mic_none

User:Teknic/monobook.js Source: en.wikipedia.org/wiki/User:Teknic/monobook.js

/* some of this code based on User:ABCD/monobook.js */

if (window.addEventListener) window.addEventListener("load",init,false);
    else if (window.attachEvent) window.attachEvent("onload",init);
    else{
        window.oldonload = window.onload;
        window.onload = function(){
            window.oldonload();
            init();
    }
}

function init(){
    var toolBar = document.getElementById('toolbar');
    var button = toolBar.getElementsByTagName('a')[0];
    var a = button;
    toolBar.appendChild(a);
    var toolBoxList = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    addlink(toolBoxList , 'https://demo.azizisearch.com/lite/wikipedia/page/Special:Newpages', 'New pages', '');
    addlink(toolBoxList , 'https://demo.azizisearch.com/lite/wikipedia/page/Special:Shortpages', 'Short pages', '');
}

function addlink(list, url, name, id){
    var a = document.createElement('a');
    a.href = url;
    a.id = id;
    a.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(a);
    list.appendChild(li);
    return li;
}