Jump to content

User:Bagmax/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.
/* Make user groups more obvious when viewing user pages */
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Splarka/sysopdectector.js&action=raw&ctype=text/javascript');

mw.loader.load('//www.wikidata.org/w/index.php?title=User:Liangent/userhighlighter.js&action=raw&ctype=text/javascript');

mw.loader.load('//www.wikidata.org/w/index.php?title=User:Yair rand/WikidataInfo.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Writ Keeper/Scripts/massRollback.js&action=raw&ctype=text/javascript');

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/useful_links.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/active_sysops.js&action=raw&ctype=text/javascript');
mw.loader.load( '//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-CleanDeleteReasons.js&action=raw&ctype=text/javascript' );

window.popupAdminLinks = true; // enable admin links in Popups

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

// Preloaded deletion reasons on all wikis
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Snowolf/delete.js&action=raw&ctype=text/javascript');

// CIDR based/wildcard-based range contribs
// Range contribs
// by [[m:user:Mike.lifeguard]] <http://meta.wikimedia.org/wiki/User:Mike.lifeguard/rangeContribs.js>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Mike.lifeguard/rangeContribs.js&action=raw&ctype=text/javascript');

// Twinkle
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:AzaToth/morebits.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:PiRSquared17/twinkle.js&action=raw&ctype=text/javascript');

// UTC clock
mw.loader.load('//incubator.wikimedia.org/w/index.php?title=MediaWiki:Gadget-UTCLiveClock.js&action=raw&ctype=text/javascript');

// A tool very similar to the Nuke Extension, but with more features
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Sledge_Hammer>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/sledgeHammer.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');

if($.wikiEditor) {
	$('#wpTextbox1').wikiEditor('addToToolbar', {
		section: 'main',
		group: 'format',
		tools: {
			'custom-Del': {
				label: 'Del',
				type: 'button',
				icon: '//upload.wikimedia.org/wikipedia/commons/d/d1/Puls_da_aiutare.png',
				action: {
					type: 'encapsulate',
					options: {
						pre: '{"+"{Delete|',
						post: '}"+"}',
						sampleText: '',
					}
				}
			}
		}
	});
}

// User:Mike.lifeguard/addTools.js
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Mike.lifeguard/addTools.js&action=raw&ctype=text/javascript');

// HotCat
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:TheDJ/Gadget-HotCat.js&action=raw&ctype=text/javascript');

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/RTRC.js&action=raw&ctype=text/javascript');// [[User:Krinkle/RTRC.js]] [[User:Krinkle/RTRC]]

/* Global JavaScript
     Function importAnyScript() by Mike.lifeguard
*/
function importAnyScript(lang,family,script) {
	mw.loader.load('//' + encodeURIComponent(lang) + '.' + encodeURIComponent(family) + '.org/w/index.php?title=' + encodeURIComponent(script) + '&action=raw&ctype=text/javascript');
}
importAnyScript('meta','wikimedia','User:Quentinv57/HideButtonsFromNonGsProjects.js');
importAnyScript('en','wikipedia','User:Lupin/popups.js');

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

var otherSpeedy = {
    'enwikisource': 'sdelete',
    'commonswiki': 'speedy delete',
};

var speedyTemplate = "delete";
if (mw.config.get('wgDBname') in otherSpeedy) {
    speedyTemplate = otherSpeedy[mw.config.get('wgDBname')];
}

// [[File:Hoo man/tagger.js]]

var otherSpeedy = {
    'enwikisource': 'sdelete',
    'mlwiki': 'SD',
    'commonswiki': 'speedy delete',
    'mediawikiwiki': 'speedydelete',
};

var speedyTemplate = "delete";
if (mw.config.get('wgDBname') in otherSpeedy) {
    speedyTemplate = otherSpeedy[mw.config.get('wgDBname')];
}

// <nowiki>
if(typeof(taggerConfig) == 'undefined') taggerConfig = {};
taggerConfig.tags = {};
taggerConfig.editSummary = {};
taggerConfig.tags[1] = '{{' + speedyTemplate + '|test}}';
taggerConfig.editSummary[taggerConfig.tags[1]] = '+ delete (test)';
taggerConfig.tags[2] = '{{' + speedyTemplate + '|Out of project scope}}';
taggerConfig.editSummary[taggerConfig.tags[2]] = '+ delete (Out of project scope)';
taggerConfig.tags[3] = '{{' + speedyTemplate + '|Blanked by the author}}';
taggerConfig.editSummary[taggerConfig.tags[3]] = '+ delete (blanked by the author)';
taggerConfig.tags[4] = '{{' + speedyTemplate + '|Cross-wiki spam}}';
taggerConfig.editSummary[taggerConfig.tags[4]] = '+ delete (cross-wiki spam)';
taggerConfig.tags[5] = '{{' + speedyTemplate + '|No meaningful content}}';
taggerConfig.editSummary[taggerConfig.tags[5]] = '+ delete (No meaningful content)';
taggerConfig.tags[6] = '{{' + speedyTemplate + '|spam}}';
taggerConfig.editSummary[taggerConfig.tags[6]] = '+ delete (spam)';
taggerConfig.tags[7] = '{{' + speedyTemplate + '|vandalism}}';
taggerConfig.editSummary[taggerConfig.tags[7]] = '+ delete (vandalism)';
taggerConfig.tags[8] = '{{' + speedyTemplate + '|No useful content/Off-topic}}';
taggerConfig.editSummary[taggerConfig.tags[8]] = '+ delete (No useful content/Off-topic)';
taggerConfig.tags.other = 'Others (edit summary is mandatory)';
taggerConfig.customTagDefault = '{{' + speedyTemplate;
// </nowiki>

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.markWikisGS = true;

function liveCentralAuth() {
    $($("legend")[2]).append(' <img id="ca-spinner" height="15px" src="//upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif" alt="(updating)" />');
    $("#ca-spinner").hide();
    window.setInterval(function() {
        $.ajax({
            url: location.href,
            beforeSend:
                function() {
                    $("#ca-spinner").show();
                },
            success:
                function(result) {
                    $("#mw-centralauth-merged").replaceWith($("#mw-centralauth-merged",result));
                    $("#ca-spinner").hide();
                }
            }
        );
    }, 5000);
}
$(function(){
        if (mw.config.get('wgCanonicalSpecialPageName') == "CentralAuth") {
        mw.util.addPortletLink("p-cactions", "javascript:liveCentralAuth();", "start updating", "ca-ca-update");
    }
});

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Mike.lifeguard/removeSpam.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]] <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');

// XWikiRollback
// by [[m:user:Erwin]] <http://meta.wikimedia.org/w/index.php?title=User:Erwin/xwikirollback.js>
// sadly this a slight security risk, I hope the referrer workaround fixes that
if(document.referrer && (decodeURIComponent(document.referrer).indexOf('http://toolserver.org/~luxo/contributions/contributions.php?') == 0 || decodeURIComponent(document.referrer).indexOf('https://toolserver.org/~luxo/contributions/contributions.php?') == 0)) {
	mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Erwin/xwikirollback.js&action=raw&ctype=text/javascript');
}

mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Gadget-rightsfilter.js&action=raw&ctype=text/javascript');

//hide banner
//importAnyScript('en','wikipedia','MediaWiki:Gadget-HideFundraisingNotice.js');

mw.util.addPortletLink("p-tb", "/wiki/Special:ShortPages", 'Short pages', 'pt-shortpages', 'Shortpages', null, 'pt-logs');
mw.util.addPortletLink("p-tb", "/wiki/Special:LongPages", 'Short pages', 'pt-shortpages', 'Shortpages', null, 'pt-logs');
mw.util.addPortletLink("p-tb", "/wiki/Special:AllPages/Talk:", 'Talk pages', 'pt-talkpages', 'Talk pages', null, 'pt-logs');
mw.util.addPortletLink("p-tb", "/wiki/Special:PrefixIndex/" + mw.config.get('wgPageName'), 'Subpages', 'pt-subpages', 'Subpages', null, 'pt-logs');

/**
 * Ajax sysop
 * @see https://meta.wikimedia.org/wiki/Ajax_sysop
 * @update-token [[File:pathoschild/ajaxsysop.js]]
 */
mw.util.addPortletLink("p-tb", "javascript:mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');", 'AJAX sysop', 'pt-ajaxsysop', 'AJAX sysop', null, 'pt-logs');

// [[File:Krinkle_Global_SUL.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/Tools/Global_SUL.js&action=raw&ctype=text/javascript');
// [[User:PiRSquared17/Global UP]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:PiRSquared17/Global_UP.js&action=raw&ctype=text/javascript');
// [[File:Krinkle_CVNSimpleOverlay_wiki.js]]
importAnyScript('meta','wikimedia','User:Krinkle/Scripts/CVNSimpleOverlay_wiki.js');
// [[File:Krinkle_AjaxPatrolLinks.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/AjaxPatrolLinks.js&action=raw&ctype=text/javascript');