跳转到内容

User:Chaplin/blinktalk.js

维基百科,自由的百科全书

这是本页的一个历史版本,由Chaplin留言 | 贡献2007年8月21日 (二) 13:04 新頁面,內容: // This script is under public domain, and comes with ABSOLUTELY NO WARRANTY. // You can use/modify/redistribute without any permission. // *** CUSTOMIZE SECTION...)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。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");
addOnloadHook(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();
  }
});