Difference between revisions of "MediaWiki:Group-moderator.js"
(👺) |
m (Fix "addPortletLink" sometimes returning undefined because of being called before the DOM is loaded (Tark pls)) |
||
Line 2: | Line 2: | ||
// Begin Purge link | // Begin Purge link | ||
− | if ( mw.config.get( "wgIsArticle" ) ) { | + | var purgeLink = { |
− | + | init: function() { | |
− | + | if (mw.config.get("wgIsArticle")) { | |
− | + | mw.util.addPortletLink("p-views", | |
− | + | mw.util.wikiScript() + "?" + $.param({ title: mw.config.get("wgPageName"), action: "purge" }), | |
− | + | "Purge", | |
− | + | "ca-purge", | |
− | } | + | "Purge the server cache of this page" |
+ | ); | ||
+ | } | ||
+ | } | ||
+ | }; | ||
+ | $(purgeLink.init); | ||
// End Purge link | // End Purge link |
Revision as of 21:26, 1 September 2023
/* Any JavaScript here will be loaded for moderators only */ // Begin Purge link var purgeLink = { init: function() { if (mw.config.get("wgIsArticle")) { mw.util.addPortletLink("p-views", mw.util.wikiScript() + "?" + $.param({ title: mw.config.get("wgPageName"), action: "purge" }), "Purge", "ca-purge", "Purge the server cache of this page" ); } } }; $(purgeLink.init); // End Purge link