User:Aldnonymous/global.js

From Meta, a Wikimedia project coordination wiki

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)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// GS delete reasons
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Aldnonymous/GS_Delete.js&action=raw&ctype=text/javascript');

/**
 * Forces left-to-right layout and editing on RTL wikis.
 * @see https://meta.wikimedia.org/wiki/Force_ltr
 * @update-token [[File:pathoschild/forceltr.js]]
 */
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.forceltr.js');

/**
 * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
 * @see https://meta.wikimedia.org/wiki/TemplateScript
 * @update-token [[File:pathoschild/templatescript.js]]
 */
// <nowiki>
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
	pathoschild.TemplateScript.add([
		{ name: 'welcome', template: '{{subst:welcome}} ~~~~', position: 'after', editSummary: 'welcome!', forNamespaces: 'user talk' }
	]);
});
// </nowiki>

// Shows the number of active (one log entry in the last 7 days, or as configured) sysops, uses data from the toolserver
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Active_sysops>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/active_sysops.js‎&action=raw&ctype=text/javascript');
if(typeof(activeSysopsConfig) == 'undefined') activeSysopsConfig = {};
activeSysopsConfig.markWikisActiveSysops = true;
activeSysopsConfig.markWikisActiveSysopsLessThan = 10;

// This tool can tag pages with a few clicks (which is much faster than editing the whole page per Hand).
// by [[m:user:Hoo man]] <https://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Tagger>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/tagger.js&action=raw&ctype=text/javascript');

//<nowiki>
if(typeof(taggerConfig) == 'undefined') taggerConfig = {};
taggerConfig.tags = [];
taggerConfig.editSummary = [];
taggerConfig.tags[1] = '{{delete|test}}';
taggerConfig.editSummary[taggerConfig.tags[1]] = '+delete, test';
taggerConfig.tags[2] = '{{delete|spam}}';
taggerConfig.editSummary[taggerConfig.tags[2]] = '+delete, spam';
taggerConfig.tags[3] = '{{delete|vandalism}}';
taggerConfig.editSummary[taggerConfig.tags[3]] = '+delete, vandal';
taggerConfig.tags[4] = '{{delete|no meaningful content}}';
taggerConfig.editSummary[taggerConfig.tags[4]] = '+delete, no meaningful content';
taggerConfig.tags[5] = '{{delete|blanked by the author}}';
taggerConfig.editSummary[taggerConfig.tags[5]] = '+delete, blanked by author';
taggerConfig.tags[6] = '{{delete|wrong language}}';
taggerConfig.editSummary[taggerConfig.tags[6]] = '+delete, wrong language';
taggerConfig.tags[7] = '{{delete|out of project scope}}';
taggerConfig.editSummary[taggerConfig.tags[7]] = '+delete, out of project scope';
taggerConfig.tags.other = 'This is used for the option you have to select to be able to insert a custom template';
//</nowiki>

/*******************
** Meta-only
*******************/
switch(mw.config.get('wgDBname')) {
	case 'metawiki':
		// SBHandler parameters
		// <nowiki>
		window.SBHandlerAddComment   = ':{{Added}} — ~~'+'~~';
		window.SBHandlerRemComment   = ':{{Removed}} — ~~'+'~~';
		window.SBHandlerRevComment   = ':{{Reverted}} — ~~'+'~~';
		window.SBHandlerDecComment   = ':{{Declined}} — ~~'+'~~';
		window.SBHandlerCloseComment = ':{{Closing}} — ~~'+'~~';
		// </nowiki>
}