User:DavidL/monobook.js

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Note – after saving, you may have to bypass your browser’s cache to see the changes.

  • Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
  • Konqueror and Chrome: click Reload or press F5;
  • Opera: clear the cache in Tools → Preferences;
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

This JavaScript is executed for DavidL on every page load, when User:DavidL is using the Monobook skin.


function useScript(server, page)
{
    var uri = server + wgScript + "?title=" + encodeURIComponent(page.replace(/ /g, "_")).replace(/%2F/gi, "/").replace(/%3A/gi, ":") + "&action=raw&ctype=text/javascript";
    return mw.loader.load(uri);
}

function useStylesheet(server, page) {
    return importStylesheetURI(server + wgScript + "?action=raw&ctype=text/css&title=" + encodeURIComponent(page.replace(/ /g, "_")));
}

useScript('//fr.wikipedia.org/','Utilisateur:DavidL/monobook.js');
useStylesheet('//fr.wikipedia.org/','Utilisateur:DavidL/monobook.css');