Jump to content

User:Verdy p/monobook.js

From Wikipedia, the free encyclopedia
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.
/* Deprecation of Javascript functions in Mediawiki:
  importScript
  importScriptURI
  importStylesheet
  importStylesheetURI
  See: https://www.mediawiki.org/wiki/ResourceLoader/JavaScript_Deprecations
       https://www.mediawiki.org/wiki/ResourceLoader/Default_modules#mw.loader.load
*/
function importScriptWP(lang, page) {
  mediaWiki.loader.load('//' + lang + '.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=' + encodeURI(page), 'text/javascript');
  // was: mw.loader.load('https//' + lang + '.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=' + encodeURI(page));
}
function importStylesheetWP(lang, page) {
  mediaWiki.loader.load('//' + lang + '.wikipedia.org/w/index.php?action=raw&ctype=text/css&title=' + encodeURI(page), 'text/css');
  // was: importStylesheetURI('https://'+lang+'.wikipedia.org/w/index.php?action=raw&ctype=text/css&title=' + encodeURI(page));
}

importStylesheetWP('en','User:Verdy_p/common.css');
importScriptWP('en','User:Verdy_p/common.js');