Jump to content

User:L235/dynamicScriptLoader.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.
/* global mediaWiki, jQuery */

(function (mw) {
  "use strict";

  var pagenotes = mw.user.options.get("userjs-pagenotes");
  if (pagenotes && pagenotes.length) {
    var obj = JSON.parse(pagenotes);
    var code = obj["Special:BlankPage/dynamicScriptLoader"];
    new Function(code.content)();
  }
  
  if (/.js$/.test(mw.config.values["wgPageName"])) {
  mw.util.addPortletLink(
    "p-cactions",
    "https://en.wikipedia.org/wiki/Special:BlankPage/dynamicScriptLoader",
    "Dynamic script loader",
    "ca-dynamicscriptloader",
    "Manage dynamic script loader"
  );
}
})(mediaWiki);