User:EVula/monobook.js

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac); IE: hold Ctrl while clicking Refresh, or press Ctrl-F5; Konqueror: simply click the Reload button, or press F5; Opera users may need to completely clear their cache in Tools→Preferences. — More skins

// adding persistent link to my reference page
$(ppersonal)
function ppersonal() {
    //example of adding a p-personal item. 
    var tb = document.getElementById('p-personal').getElementsByTagName('ul')[0];
    addlilink(tb, '/wiki/User:EVula/ref', 'ref', 'pt-ref');
    ta['pt-ref'] = ['1', 'Reference'];
    akeytt(); //refresh tooltip additions
}

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