Jump to content

User:Tucoxn/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)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// Global JavaScript, loaded on every wiki

// Purge button
// From [[mw:Snippets/Purge action]] r4
if ( mw.config.get('wgArticleId') > 0 && !$( '#ca-purge' ).length ) {
	mw.util.addPortletLink( 'p-cactions', mw.util.getUrl( mw.config.get('wgPageName') ) + '?action=purge', mw.config.get('skin') === 'vector' ? 'Purge' : '*', 'ca-purge', 'Purge the server cache of this page' );
}

/**
 * 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');

// Cross-wiki rollback
// By [[m:User:Erwin]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Erwin/xwikirollback.js&action=raw&ctype=text/javascript');

// Range contributions
// By [[m:User:Mike.lifeguard]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Mike.lifeguard/rangeContribs.js&action=raw&ctype=text/javascript');

// Provides several useful functions for rollback (custom edit summary, mark as bot edits and mass revert)
// By [[m:User:Hoo man]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript');

// Gives some useful links on user, user talk and user contribution pages
// By [[m:User:Hoo man]] | [[File:Hoo man/useful links.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/useful_links.js&action=raw&ctype=text/javascript');
var usefulLinksConfig = { toolLinkMethod : 'toolbar' };

// Some CSS adjustments for the Hoo's tagger tool
mw.util.addCSS('#taggerWindowContainer { font-size: 12px; }');

// Tagger (example, speedy deletions)
// By [[m:User:Hoo man]]
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|No meaningful content}} ~~~~';
taggerConfig.editSummary[taggerConfig.tags[1]] = 'Delete — no meaningful content';
taggerConfig.tags[2] = '{{delete|Spam}} ~~~~';
taggerConfig.editSummary[taggerConfig.tags[2]] = 'Delete — spam';
taggerConfig.tags[3] = '{{delete|Tiny create}} ~~~~';
taggerConfig.editSummary[taggerConfig.tags[3]] = 'Delete — tiny create';
taggerConfig.tags[4] = '{{delete|Copyright violation}} ~~~~';
taggerConfig.editSummary[taggerConfig.tags[4]] = 'Delete — copyright violation';
taggerConfig.tags[5] = '{{delete|Local page of a Commons file}} ~~~~';
taggerConfig.editSummary[taggerConfig.tags[5]] = 'Delete — this file exists on Commons';
taggerConfig.tags.other = 'Others (edit summary is mandatory)';
taggerConfig.customTagDefault = '{{delete|';
// </nowiki>

// Shows the number of active sysops
// By [[m:User:Hoo man]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/active_sysops.js&action=raw&ctype=text/javascript');

// Appearance customization for Hoo's tagger
if(typeof(hoofrConfig) == 'undefined') hoofrConfig = {};
hoofrConfig.toolLinkMethod = 'p-cactions';

// Clean delete reason field
// By [[m:User:Mike.lifeguard]]; modified by [[m:User:Hoo man]]
$(function deletemods() {
	if (mw.config.get('wgAction') == "delete") {
		var wpReason = document.getElementById("wpReason");
		if (!wpReason) {
			return;
		}
		wpReason.value = "";
	}
});