User:8/vector.js

From Test Wiki
Revision as of 17:50, 21 November 2023 by Tsukushi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
(function(ele, txt, time, condition){

    var s = " (" + mw.config.values.wgUserEditCount + ")";
    var hook = document.getElementById("pt-mycontris");
    if(!hook)
        return "unexpected dom abort mission";
    hook.childNodes[0].innerHTML += s;

    if(!condition) return;
    ele.innerHTML = "";
    (function(ele, txt, time){
        txt = txt.split("");
        var len = txt.length, rate = time/len;
        for(var i=0; i<len; i++) setTimeout(function(){ele.innerHTML += txt.shift();}, i*rate);
    })(ele, txt, time);

})(document.getElementById("edit_count"), "2018.5.1 / ab9", 400, document.getElementById("8c23b4144bd58c689e192c6ab912a3b75c76f6849977518b8bedefd5e347d67f"));