User:Dominic1743/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:Nuke/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:RedirectManagement/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PageRenameAuto-update/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PowerDelete/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:RevealAnonIP/usercode.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MassUserRights/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:RollbackSpamUserContribs/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxRename/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:RollbackSpamUserContribs/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxRename/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PageRenameAuto-update/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MassRenameRevert/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MultipleFileDelete/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:Deadvideo/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:WHAM/code.2.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxUndo/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxDelete/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxEdit.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxUndo/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MultiUpload/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxRedirect/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MassEdit/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:NullEditButton/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CleanWantedFiles/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:Linksweeper/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MassCategorization/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PreloadFileDescription.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PreferenceLinks.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PageEditInfo/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxBatchDelete.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:FileUsageAuto-update/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxCommentDelete/code.js',    ] }); window.fdButtons = [ {       summary: 'Unused/Broken Redirect', label: 'Red' },   {        summary: 'Vandalism', label: 'Van' },   {        summary: 'Not Needed', label: 'Not' },   {        summary: 'Unused/Broken Video', label: 'Vid' },   {        summary: 'Unused Photo', label: 'Photo' } ]; importArticles({   type: 'script',    articles: [        // ...        'u:dev:MediaWiki:FastDelete/code.js',        // ...    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxCommentDelete/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:FileLogs.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:FindAndReplace/code.js',    ] }); importArticles({   type: "script",    articles: [        "u:dev:ListFiles/code.js" // ListFiles from Dev Wiki    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:Standard Edit Summary/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:StickySummary.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxBatchUndelete.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:WhatLinksHere/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxDiff/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxRC/code.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CommentPreview/code.js',    ] }); /* mw.loader.using('mediawiki.api', function {	//Exit if normal rollback links are present	if ($('.mw-rollback-link').length || window.RollbackWikiDisable) return;	var conf = mw.config.get([ 'wgAction', 'wgCanonicalSpecialPageName', 'wgContentLanguage', 'wgPageName', 'wgUserLanguage' ]),	i18n = {		en: {			rollback: "rollback",			description: "&quot;Rollback&quot; reverts edit(s) to this page of the last contributor in one click",			summary: "Reverted edits by $1 (talk) to last version by $2",			summaryShort: "Reverted edits by $1",			editConflict: "Unable to rollback (edit conflict)",			contentFail: "Unable to rollback (failed to get page content)",			singleEditor: "Unable to rollback (no different editor found)",			revisionFail: "Unable to rollback (failed to get revisions)",			editFail: "Unable to rollback (failed to publish edit)",			success: "Rollback successful"		},		ru: {			rollback: "rollback",			description: "&quot;Rollback&quot; reverts edit(s) to this page of the last contributor in one click",			summary: "Откат правок без статуса откатчика (скрипт)",			summaryShort: "Reverted edits by $1", editConflict: "Произошёл конфликт правок", contentFail: "Произошла ошибка", singleEditor: "Произошла ошибка", revisionFail: "Произошла ошибка", editFail: "Произошла ошибка", success: "Откат совершен" },		fr: { rollback: "révoquer", description: "&quot;Rollback&quot; révoque la/les modification(s) du dernier contributeur de cette page en un clic", summary: "Révoqué les modifications par $1 (talk) à la dernière version par $2 (script)", summaryShort: "Révoqué les modifications par $1 (script)", editConflict: "Impossible de révoquer (conflit de modifications)", contentFail: "Impossible de révoquer (échec de l'obtention du contenu de la page)", singleEditor: "Impossible de révoquer (aucun éditeur différent trouvé)", revisionFail: "Impossible de révoquer (échec de l'obtention des révisions)", editFail: "Impossible de révoquer (échec de la publication de la modification)", success: "Révocation(s) réussie(s) !" }	};	i18n = i18n[conf.wgContentLanguage] || i18n[conf.wgContentLanguage.split('-')[0]] || i18n[conf.wgUserLanguage] || i18n[conf.wgUserLanguage.split('-')[0]] || i18n.en; //History if (conf.wgAction == "history" && $('#pagehistory li').length > 1) $('#pagehistory li:first .mw-history-undo a').before(' ' + i18n.rollback + ' | '); //Contributions else if (conf.wgCanonicalSpecialPageName == "Contributions") { $('#mw-content-text ul').find('li').each(function {			if ($(this).find('.mw-uctop').length)				$(this).append(' [' + i18n.rollback + '] ');		}); }	//Diffs else if (($.getUrlVar('diff') || $.getUrlVar('oldid')) && $('#differences-nextlink').length === 0) $('.mw-usertoollinks:last').after('   [' + i18n.rollback + '] '); else return; conf.API = new mw.Api; conf.token = mw.user.tokens.values.editToken; mw.util.addCSS('.mw-custom-rollback-link a { cursor: pointer; }'); $('.mw-custom-rollback-link a').click(function {		getRevisionIdAndContent($(this).data('id'),$(this).data('user').replace(/_/g, " "));		$(this).parent.remove;	}); function getRevisionIdAndContent(title,target) { conf.API.get({		action: 'query',		prop: 'revisions',		titles: title,		rvprop: 'user|ids',		rvlimit: 500,		cb: new Date.getTime		}) .done(function(d) {			if (!d.error) {				var revisions;				for (var i in d.query.pages) {					revisions = d.query.pages[i].revisions;				}				//Don't rollback if the page has been edited by somebody else				if (target != revisions[0].user) {					outputError(i18n.editConflict);					return;				}				var lastUser,				revId;				for (var i in revisions) {					if (revisions[i].user != target) {						lastUser = revisions[i].user; //remember last author						revId = revisions[i].revid; //get revision to revert to						break;					}				}				if (lastUser) {					conf.API.get({ action: 'query', prop: 'revisions', rvprop: 'content', revids: revId, cb: new Date.getTime })					.done(function(d) { if (!d.error) { var content = ""; //can be no content on page for (var i in d.query.pages) { if (d.query.pages[i].revisions) content = d.query.pages[i].revisions[0]["*"]; }							performRollback(title,content,target,lastUser); }						else outputError(i18n.contentFail + ': ' + d.error.code); })					.fail(function { outputError(i18n.contentFail); });				}				else					outputError(i18n.singleEditor);			}			else				outputError(i18n.revisionFail + ': ' + d.error.code);		}) .fail(function {			outputError(i18n.revisionFail);		}); }	function performRollback(page,text,user,user2) { var summary = i18n.summary.replace(/\$1/g,user).replace(/\$2/g,user2); if (summary.length > 150) summary = i18n.summaryShort.replace('$1',user); conf.API.post({		action: 'edit',		title: page,		text: text,		summary: summary,		minor: true,		token: conf.token		}) .done(function(d) {			if (!d.error) {				new BannerNotification(i18n.success,'confirm').show;							}			else				outputError(i18n.editFail + ': ' + d.error.code);		}) .fail(function {			outputError(i18n.editFail);		}); }	function outputError(text) { new BannerNotification(text,'error').show; } }); importArticles({ type: 'script', articles: [ 'u:dev:MediaWiki:FixWantedFiles/code.js', ] }); importArticles({ type: 'script', articles: [ 'u:dev:MediaWiki:WLHEditLinks/code.js', ] }); importArticles({ type: 'script', articles: [ 'u:dev:MediaWiki:Message/code.js', ] });
 * Rollback
 * @description Perform rollbacks without needing to be in the usergroup
 * @author Ozank