User:開拓者/global.js

mw.loader.load('//meta.miraheze.org/w/index.php?title=User:Void/links.js&action=raw&ctype=text/javascript'); mw.loader.load( '//meta.miraheze.org/w/index.php?action=raw&ctype=text/javascript&title=User:Void/centralAuthLink.js' ); mw.loader.load( '//meta.miraheze.org/w/index.php?action=raw&ctype=text/javascript&title=User:Zppix/cvtToolbox.js'); mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Writ_Keeper/Scripts/massRollback.js');/*Go to Special:contributions to make it work*/ mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Writ_Keeper/Scripts/massRevdel.js');/*The same as above*/ mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Writ_Keeper/Scripts/massProtect.js');/*The same as above, it's acutally mass semi-protect.*/ mw.loader.load( '//meta.miraheze.org/w/index.php?action=raw&ctype=text/javascript&title=User:MacFan4000/globalBlockLink.js' ); mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js'); mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Kangaroopower/MRollback.js'); mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Lenore/autolink.js'); mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Joeytje50/JWB.js/load.js');/*Go to Project:AutoWikiBrowser/Script to make it work*/ mw.loader.load('//de.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=Benutzer:TMg/autoFormatter.js'); mw.loader.load( 'https://meta.miraheze.org/w/index.php?title=User:Void/massGBlock.js&action=raw&ctype=text/javascript' );

/** * Fix links like User:Example@somewiki on Special:Log and Special:Recentchanges * @author VasilievVV, 2008-2010 * @author Kalan, 2008 * @author Splarka, 2008 * @author Krinkle, 2012 * Imported from https://meta.wikimedia.org/wiki/MediaWiki:Gadget-CentralAuthInterlinkFixer.js and modified by 開拓者 for Miraheze, 2018. */ /*global mediaWiki, jQuery */ /*jshint browser:true */ (function (mw, $) {	'use strict';	function host(id) {		var url=id.replace(/(.*)wiki/,"$1.miraheze.org")		return url;	}

function fixCrosswikiLinks { $('* a.new').each(function {			var bits, wiki, user, hostName,				$el = $(this),				txt = $el.text;			if (txt.indexOf('@') !== -1 && txt.indexOf('/') === -1 && /^User\:/i.test(txt)) {				bits = txt.split('@');				user = bits.shift.replace(/^\s*User:(.+)\s*$/g, '$1');				wiki = bits.join('@');				if (wiki === 'global') {					$el.attr('href', mw.config.get('wgScript') + '?title=Special:CentralAuth&target=' + encodeURIComponent(user));				} else {					hostName = host(wiki);					$el.attr('href', '//' + hostName + '/wiki/User:' + encodeURIComponent(user));				}				if (wiki !== 'metawiki') {					$el.removeClass('new external').addClass('extiw');				}				$el.attr('title', txt);			}		}); }

if (mw.config.get('wgCanonicalSpecialPageName') === 'Log' || mw.config.get('wgCanonicalSpecialPageName') === 'Recentchanges') { mw.hook('wikipage.content').add(fixCrosswikiLinks); } }(mediaWiki, jQuery));