Jump to content

User:Tegel/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.
// [[File:Hoo man/tagger.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/tagger.js&action=raw&ctype=text/javascript');

if(typeof(taggerConfig) == 'undefined') taggerConfig = {};
taggerConfig.noDeleteOnly = false;

//<nowiki>
if(typeof(taggerConfig) == 'undefined') taggerConfig = {};
taggerConfig.tags = [];
taggerConfig.editSummary = [];
taggerConfig.tags[1] = '{{delete|test/off-topic}}';
taggerConfig.editSummary[taggerConfig.tags[1]] = '+ delete, test - off-topic';
taggerConfig.tags[2] = '{{delete|Vandalism/Cross-wiki vandalism}}';
taggerConfig.editSummary[taggerConfig.tags[2]] = '+ delete, cross-wiki vandalism';
taggerConfig.tags[3] = '{{delete|Blanked by the author}}';
taggerConfig.editSummary[taggerConfig.tags[3]] = '+ delete, blanked by the author';
taggerConfig.tags[4] = '{{delete|Spam/Cross-wiki spam}}';
taggerConfig.editSummary[taggerConfig.tags[4]] = '+ delete, spam';
taggerConfig.tags[5] = '{{speedy|test, off-topic}}';
taggerConfig.editSummary[taggerConfig.tags[5]] = '+ delete, test, off-topic';
taggerConfig.tags[6] = '{{speedy|off-topic, spam}}';
taggerConfig.editSummary[taggerConfig.tags[6]] = '+ delete, off-topic, spam';
taggerConfig.tags[7] = '{{delete|No useful information/vandalism}}';
taggerConfig.editSummary[taggerConfig.tags[7]] = '+ delete';
taggerConfig.tags.other = 'This is used for the option you have to select to be able to insert a custom template';
//</nowiki>


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

 
/*
* Will pop-up a confirmation dialog when rollback link is clicked from Watchlist.
* Hit the "cancel" button if you had clicked Rollback accidentally and the edit will not be reverted.
* To install add importScript('User:Zvn/confirmwatchlistrollback.js'); to your monobook.js.
*/
 
function confirmWatchlistRollback()
{
	var wgCanonicalSpecialPageName = mw.config.get('wgCanonicalSpecialPageName');
	if(wgCanonicalSpecialPageName=='Watchlist' || wgCanonicalSpecialPageName=='Recentchanges')
	{
		var rollbackNodes;			
		if(!document.getElementsByClassName)
		{
			rollbackNodes=getElementsByClassName(document.getElementById("bodyContent"),"span","mw-rollback-link");
		}
		else
		{
			rollbackNodes=document.getElementsByClassName('mw-rollback-link');
		}
 
		var rollbackclicked=function (e)
							{
								if(!e)
								{
									e=window.event;
								}
								if(!confirm("Are you sure you want to rollback this edit?"))
								{
									if(e.stopPropagation)
									{
										e.stopPropagation();
										e.preventDefault();
									}
									else
									{
										e.cancelBubble=true;
										e.returnValue=false;
									}
								}
 
							};
 
        var childNodes;
		for (var i=0;i<rollbackNodes.length;i++)
		{
            childNodes = rollbackNodes[i].childNodes;
            if (childNodes && childNodes[1]) {
                childNodes[1].onclick=rollbackclicked;
            }
		}
    }
 
}
 
$(confirmWatchlistRollback);

/* Global JavaScript
     Function importAnyScript() by Mike.lifeguard
*/
function importAnyScript(lang,family,script) {
    //use importScriptURI with the full-qualified source, else importScript(); runs in the context of the remote wiki, finding nothing.
	mw.loader.getScript('https://'
		+ encodeURIComponent(lang) + '.'
		+ encodeURIComponent(family) + '.org/w/index.php?title='
		+ encodeURIComponent(script) + '&action=raw&ctype=text/javascript');
}

importAnyScript('meta','wikimedia','User:Quentinv57/HideButtonsFromNonGsProjects.js');

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


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

/************* StewardLinks *** by [[m:User:Erwin]] **********/
mw.loader.getScript('//meta.wikimedia.org/w/index.php?title=User:Erwin/stewardlinks.js&action=raw&ctype=text/javascript');


//Preloads common deletion reasons for crosswiki use
// [[File:Snowolf_GS_delete.js]]
//mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Snowolf/GS_delete.js&action=raw&ctype=text/javascript');
 
//Preloads common deletion reasons for crosswiki use
// [[File:Snowolf_GS_delete.js]]
// mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Snowolf/Stew_delete.js&action=raw&ctype=text/javascript');
 
/**
 * StewardScript extends the user interface for Wikimedia stewards' convenience.
 * @see https://meta.wikimedia.org/wiki/StewardScript
 */
//$.getScript('//tools.wmflabs.org/meta/scripts/pathoschild.stewardscript.js');