User:8/vector.js

From Test Wiki
Jump to navigation Jump to search

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"));