User:Sanmartin/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:Sanmartin/monobook.css. |
function languageAtTop () {
/* Take the #p-lang (if there is one) out of the .portlet sidebar and put it
physically into the main column. */
var contents = document.getElementById('column-content');
var langlinks = document.getElementById('p-lang');
if (langlinks != null) {
langlinks.parentNode.removeChild (langlinks);
contents.insertBefore(langlinks, contents.firstChild);
}
}
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 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);