Jump to content

User:0-pigeon/Gadget-pagescripts.js

From Wikipedia!

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* <pre><nowiki>
 For every page having its scripts on its scriptpage called {PAGENAME}/scripts.js */
$(function()  {
 var hw = '//test.wikipedia.org/w/index.php?title='
 var hk = '&action=raw'   '&ctype=text/javascript'
 var fscriptpagename = hw   mw.config.get('wgPageName')   '/'   'scripts.js'   hk
 var a = $('#pagescript')
 var no = $('#nopagescript')
 var otherscript = $('#otherpagescript')
  if (no) return
  if (a) {
   if (otherscript) {
    mw.loader.load(hw   otherscript   hk)
   }
   else {
    mw.loader.load(fscriptpagename)
   }
  }
});
/* </nowiki></pre> */