跳转到内容

User:Chaplin/blinktalk.js

维基百科,自由的百科全书
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
// This script is under public domain, and comes with ABSOLUTELY NO WARRANTY.
// You can use/modify/redistribute without any permission.

// *** CUSTOMIZE SECTION
blinktalk_style = "color:red;font-weight:bold";
blinktalk_cycle = 700; // (ms) no blink if null
// ***
// You must add .usermessage { display:none } style to your custom css

if(!window.$$) importScript("http://linky.wikipedia.jp/javascripts/prototype.js");
$(function() {
  var blinker = function() {
    var mt = $('pt-mytalk-inner');
    mt.style.visibility = (mt.style.visibility != "hidden" ? "hidden" : "visible");
    setTimeout(blinker, blinktalk_cycle);
  };
  if($$('#bodyContent div.usermessage').length) {
    var e = $('pt-mytalk').firstChild;
    e.href += "?diff=cur";
    e.innerHTML = '<span style="' + blinktalk_style + '" id="pt-mytalk-inner">' + e.innerHTML + '<\/span>';
    if(blinktalk_cycle) blinker();
  }
});