Jump to content

User:Johan Elisson/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Johan Elisson (talk | contribs) at 23:08, 12 June 2006 (tool). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* Features shamelessly stolen from:

* User:Lupo */

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() {
    /* Remove the top "tabs" from the .portlet side column (why were they ever put there?) and
    put them at the top of the content area, where they belong! (This allows me to use simple
    relative positioning to get a proper layout. I don't have to mess around with absolute
    positioning. This is necessary for my language links at the top to work properly, but it
    is cleaner anyway. */
    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();
}

if (window.addEventListener) window.addEventListener("load",reformatMyPage,false);
else if (window.attachEvent) window.attachEvent("onload",reformatMyPage);


// [[User:Lupin/popups.js]]

document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

popupDelay=1.0;

//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
  document.write('<script type="text/javascript" src="' 
    + 'http://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js' 
    + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); }