MediaWiki:Gadget-Cat-a-lot.js: Difference between revisions

From Kanthaus wiki
Add Cat-a-lot gadget code
 
Add namespace "-1" (special pages) to allow tagging from `Special:AllPages`
Line 3: Line 3:
  * https://commons.wikimedia.org/w/index.php?title=Help:Gadget-Cat-a-lot&withJS=MediaWiki:ActivateGadget.js&gadgetname=Cat-a-lot
  * https://commons.wikimedia.org/w/index.php?title=Help:Gadget-Cat-a-lot&withJS=MediaWiki:ActivateGadget.js&gadgetname=Cat-a-lot
**/
**/
if (mw.config.get('wgNamespaceNumber') === 14) {
if (mw.config.get('wgNamespaceNumber') === 14 || -1) {
window.catALotPrefs = { editpages: true, subcatcount: 100 };
window.catALotPrefs = { editpages: true, subcatcount: 100 };
mw.loader.using(['jquery.ui', 'mediawiki.util']).done(function () {
mw.loader.using(['jquery.ui', 'mediawiki.util']).done(function () {

Revision as of 15:36, 19 November 2024

/**
 * Cat-a-lot - changes category of multiple files
 * https://commons.wikimedia.org/w/index.php?title=Help:Gadget-Cat-a-lot&withJS=MediaWiki:ActivateGadget.js&gadgetname=Cat-a-lot
**/
if (mw.config.get('wgNamespaceNumber') === 14 || -1) {
	window.catALotPrefs = { editpages: true, subcatcount: 100 };
	mw.loader.using(['jquery.ui', 'mediawiki.util']).done(function () {
		mw.util.addCSS("#cat_a_lot_settings { display:none !important;}"); // Preferences depend on some Commons gadgets, not available locally
		mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-Cat-a-lot.js&action=raw&ctype=text/javascript');
		mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-Cat-a-lot.css&action=raw&ctype=text/css', 'text/css');
	});
}