User:Angela/monobook.js
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 bottomTabs() {
/* Duplicate the top "tabs" at the end of the content area. */
var tabs = document.getElementById('p-cactions').cloneNode(true);
/* Give all the named items new ids to avoid id clashes with the existing top "tabs". */
tabs.id = 'mytabs';
var listitems = tabs.getElementsByTagName('LI');
for (i=0;i<listitems.length;i++) {
if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id;
}
document.getElementById('column-content').appendChild(tabs);
}
function topTabsToRightPlace() {
var contents = document.getElementById('column-content');
var tabs = document.getElementById('p-cactions');
tabs.parentNode.removeChild (tabs);
contents.insertBefore(tabs, contents.firstChild);
}
function reformatMyPage() {
bottomTabs();
topTabsToRightPlace(); /* First the top "tabs"... */
languageAtTop(); /* ... and then the language links */
/* The order is important here: first move the tabs, then the language links, otherwise they
will end up in the wrong order (tabs above language links). */
}
if (window.addEventListener) window.addEventListener("load",reformatMyPage,false);
else if (window.attachEvent) window.attachEvent("onload",reformatMyPage);
function addlink(name, url) {
var na = document.createElement('a');
na.setAttribute('href', ''+ url);
var txt = document.createTextNode(name);
na.appendChild(txt);
var nli = document.createElement('li');
nli.setAttribute('class', 'p-newlinks');
nli.appendChild(na);
return nli;
}
function morelinks() {
var ndivportlet = document.createElement('div');
var ndivpbody = document.createElement('div');
var colone = document.getElementById('column-one');
ndivportlet.setAttribute('class', 'portlet');
ndivportlet.setAttribute('id', 'p-newlinks');
ndivpbody.setAttribute('class', 'pBody');
var nul = document.createElement('ul');
nul.setAttribute('id', 'p-newlinks');
nul.appendChild(addlink('Admins', 'http://simple.wikipedia.org/wiki/Wikipedia:Administrators'));
nul.appendChild(addlink('Delete', 'http://simple.wikipedia.org/wiki/Wikipedia:Proposed deletions'));
nul.appendChild(addlink('Vandals', 'http://simple.wikipedia.org/wiki/Wikipedia:Vandalism in progress'));
nul.appendChild(addlink('Talk', 'http://simple.wikipedia.org/wiki/Wikipedia:Simple talk'));
nul.appendChild(addlink('en', 'http://en.wikipedia.org/wiki/Special:Recentchanges'));
nul.appendChild(addlink('Meta', 'http://meta.wikipedia.org/wiki/Special:Recentchanges'));
nul.appendChild(addlink('WMF', 'http://wikimediafoundation.org/wiki/Special:Recentchanges'));
nul.appendChild(addlink('Wikia', 'http://www.wikia.com/wiki/index.php/Special:Recentchanges'));
var title=document.createElement('h5');
title.appendChild(document.createTextNode('Shortcuts'));
ndivportlet.appendChild(title);
ndivpbody.appendChild(nul);
ndivportlet.appendChild(ndivpbody);
colone.appendChild(ndivportlet);
}
function do_onload() {
morelinks();
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false);
else if (window.attachEvent)
window.attachEvent("onload", do_onload);