Jump to content

User:Nihiltres/vector.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nihiltres (talk | contribs) at 19:54, 9 March 2010 (Point to brand-new nothingthree.js instead of holding the code locally). 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.
//Functions are defined at [[User:Nihiltres/nothingthree.js]], as created or collected by Nihiltres.
importScript("User:Nihiltres/nothingthree.js");

//ENABLE STUFF FOR USE HERE
addOnloadHook(function() {
    if (!nothingthree.util.isMobile() ) { //in the usual case…
        //First, fix some links, using linkFix
        nothingthree.util.linkFix('pt-preferences', 'Preferences');
        nothingthree.util.linkFix('pt-watchlist', 'Watchlist');
        nothingthree.util.linkFix('pt-mytalk', 'Talk');
        nothingthree.util.linkFix('pt-mycontris', 'Contributions');
        //Second, add the tabs as desired
        nothingthree.tabAdd.log();
        nothingthree.tabAdd.sandbox();
        nothingthree.tabAdd.purge();
        //Some miscellaneous additions…
        nothingthree.watchMediawikiSpaceEdits();
        nothingthree.tabMove.protection();
        nothingthree.tabMove.deletion();
        nothingthree.sidebar.toggleTab();
        nothingthree.sidebar.remember();
        nothingthree.tops.toggleTab();
        nothingthree.tabMove.watch();
    }
    else { //if it's a mobile browser as defined by nothingthree.util.isMobile() …
        //Mobile-specific CSS! (Mobile-specific JS is handled here.)
        importStylesheet('User:' + wgUserName + '/vector-ipod.css');
        //the next bit *would be* importScript('User:' + wgUserName + '/vector-ipod.css'); …
        nothingthree.util.linkFix('pt-preferences', 'Preferences');
        nothingthree.util.linkFix('pt-watchlist', 'Watchlist');
        nothingthree.util.linkFix('pt-mytalk', 'Talk');
        nothingthree.util.linkFix('pt-mycontris', 'Contributions');
        //Second, add the tabs as desired
        nothingthree.tabAdd.log();
        nothingthree.tabAdd.sandbox();
        nothingthree.tabAdd.purge();
        //Some miscellaneous additions… 
        nothingthree.watchMediawikiSpaceEdits();
        nothingthree.tabMove.protection();
        nothingthree.tabMove.deletion();
        nothingthree.sidebar.collapse();
        nothingthree.sidebar.toggleTab();
    }
});