User:Mike Dillon/monobook.js

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
// See [[User:Mike Dillon/Scripts]] for descriptions
 
// Proposed versions of importScript() and importStylesheet()
function buildRawUrl(page, ctype, options) {
    if (!options) options = {};
    var server = '';
    if (options.server) {
        server = "http://" + options.server;
    }
    var url = server + wgScriptPath
            + '/index.php?title='
            + encodeURIComponent( page.replace( / /g, '_' ) )
            + '&action=raw&ctype=' + ctype;
    var keys = [ "oldid", "smaxage", "maxage" ];
    for (var n in keys) {
        if (options[keys[n]]) {
            url += "&" + keys[n] + "=" + encodeURIComponent(options[keys[n]]);
        }
    }
    return url;
}
 
function importScript( page, options ) {
    importScriptURI(buildRawUrl(page, 'text/javascript', options));
}
 
function importStylesheet( page, options ) {
    importStylesheetURI(buildRawUrl(page, 'text/css', options));
}
 
// [[User:Mike Dillon/Scripts/params.js]]
importScript('User:Mike Dillon/Scripts/params.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/cookies.js]]
importScript('User:Mike Dillon/Scripts/cookies.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/i18n.js]]
importScript('User:Mike Dillon/Scripts/i18n.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/namespaces.js]]
importScript('User:Mike Dillon/Scripts/namespaces.js', { "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/username.js]]
importScript('User:Mike Dillon/Scripts/username.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/build-urls.js]]
importScript('User:Mike Dillon/Scripts/build-urls.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/easydom.js]]: defines functional interface for building DOM trees
//importScript('User:Mike Dillon/Scripts/easydom.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
importScript('User:Mike Dillon/Scripts/easydom-dev.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/addlilink.js]]: defines addlilink() and addToolboxLink()
importScript('User:Mike Dillon/Scripts/addlilink.js', { "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/duplicateTabs.js]]: duplicates tabs to bottom
importScript('User:Mike Dillon/Scripts/duplicateTabs.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/tabs.js]]: defines addTab(); creates custom tabs
importScript('User:Mike Dillon/Scripts/tabs.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/searchNewWindow.js]]
importScript('User:Mike Dillon/Scripts/searchNewWindow.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/toolbox.js]]: defines addToolboxLink()
importScript('User:Mike Dillon/Scripts/toolbox.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/popups.js]]: Popups
var alertArticleRegex = false;
 
//var simplePopups = false;
var popupDelay = 1.5;
//var popupAdminLinks = true;
var popupNavLinks = true;
var popupSummaryData = true;
var popupFixRedirs = true;
var popupFixDabs = true;
var popupLastModified = true;
//var popupStructure = 'original';
 
importScript('User:Mike Dillon/Scripts/popups.js', { "smaxage": 604800 });
 
// [[User:Zocky/PicturePopups.js]]: Picture Popups
importScript('User:Zocky/PicturePopups.js', {
    "smaxage": 604800,
    "oldid": 93863610
});
 
// [[User:Mike Dillon/Scripts/defaultsort.js]]
importScript('User:Mike Dillon/Scripts/defaultsort.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
 
// [[User:Mike Dillon/Scripts/recentpages.js]]
importScript('User:Mike Dillon/Scripts/recentpages.js', { "server": "en.wiktionary.org", "smaxage": 604800 });