User:Rebbing/common.js

/* * Imports. */ importScript('User:Rebbing/script/deletion-sorting-helper.js'); importScript("User:Rebbing/script/mosify-dates.js"); importScript("User:Rebbing/script/pageswap.js");

/* * Popups filters. */ importScript('User:Rebbing/script/popups-page-watchers.js');

/* * Automatically tick the "Move subpages" option when moving pages. */ var moveSubpagesBox = document.getElementsByName("wpMovesubpages")[0]; if (moveSubpagesBox !== undefined) { moveSubpagesBox.checked = true; }

/* * Enable AFC helper. * * This would properly be done by setting false AFCH.consts.whitelistRequired, but there's no standard way to set consts * going in: afch-master.js defines AFCH and AFCH.consts. It's possible to prevent them from being redefined, but * core.js needs to be able to redefine AFCH.consts to add variables related to the current page. core.js is careful not * to overwrite AFCH.consts' already-defined properties, but it's no use, as there's no simple way to get the object * past afch-master.js intact without disabling writing. */

AFCH = {}; AFCH.checkWhitelist = function{};

/* Prevent redefinition of AFCH by afch-master.js. */ Object.defineProperty(window, "AFCH", { writable: false });

/* Prevent redefinition of checkWhitelist in core.js. */ Object.defineProperty(AFCH, "checkWhitelist", { writable: false });

/* * Helpful UI links. */ mw.util.addPortletLink("p-personal", mw.util.getUrl("Special:MyPage/Notes"), "Notes", "pt-notes", null, "Your notes", "#pt-sandbox"); mw.util.addPortletLink("p-personal", mw.util.getUrl("Special:MyPage/sandbox") + "?action=edit", "(edit)", "pt-edit-sandbox", null, "Edit my sandbox", "#pt-preferences"); mw.util.addPortletLink("p-tb", mw.util.getUrl("Special:ExpandTemplates"), "Expand templates");