User:DragonBallZ050/global.js

window.AutoCreateUserPagesConfig = { content: { 2: ,       3: ,        1202: ''    },    summary: 'Automatic' }; importArticles({   type: 'script',    articles: [        'u:kocka:User:KockaAdmiralac/AutoCreateUserPages.javascript',        'u:kocka:User:KockaAdmiralac/LinkModifications.javascript',        'u:dev:MediaWiki:AjaxBatchDelete.js',        'u:dev:MediaWiki:AjaxPatrol/code.js',        'u:dev:MediaWiki:AnalyticsShortcut.js',        'u:dev:MediaWiki:AnchoredRollback/code.js',        'u:dev:MediaWiki:AvatarLink.js',        'u:dev:MediaWiki:CancelButton.js',        'u:dev:MediaWiki:CategoryQuickRemove.js',        'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',        'u:dev:MediaWiki:CodeSelectAll.js',        'u:dev:MediaWiki:ConsistentModules/code.js',        'u:dev:MediaWiki:ConsistentNotifications.js',        'u:dev:MediaWiki:ContribsLink/code.js',        'u:dev:MediaWiki:CopyCodeButton.js',        'u:dev:MediaWiki:DeleteTalkpage.js',        'u:dev:MediaWiki:DisableAccessKeys.js',        'u:dev:MediaWiki:DisableInfoboxBuilder.js', 'u:dev:MediaWiki:Discussions_Delete_All/code.js', 'u:dev:MediaWiki:DiscussionsViewer.js', 'u:dev:MediaWiki:EditBio/code.js', 'u:dev:MediaWiki:EditConflictAlert/code.js', 'u:dev:MediaWiki:FandomizedChat/code.2.js', 'u:dev:MediaWiki:FandomizedWikiFeatures/adaptable.js', 'u:dev:MediaWiki:FastCreate.js', 'u:dev:MediaWiki:FastFileDelete.js', 'u:dev:MediaWiki:FastOldImageDelete/code.js', 'u:dev:MediaWiki:FavoriteWikisPersistTab/code.js', 'u:dev:MediaWiki:FileLogs.js', 'u:dev:MediaWiki:FindAndReplace/code.js', 'u:dev:MediaWiki:HideExtraTestModeBanner.js', 'u:dev:MediaWiki:JavascriptEditor.js', 'u:dev:MediaWiki:ListFiles/code.js', 'u:dev:MediaWiki:MassEdit/code.js', 'u:dev:MediaWiki:MassNullEdit/code.js', 'u:dev:MediaWiki:MassPatrol/code.js', 'u:dev:MediaWiki:MessageWallImprovements.js', 'u:dev:MediaWiki:MinimalBanners.js', 'u:dev:MediaWiki:MinimalJSPages.js', 'u:dev:MediaWiki:MinimalTemplateClassification.js', 'u:dev:MediaWiki:MinimalTestModeAlert.js', 'u:dev:MediaWiki:MobileEditor.js', 'u:dev:MediaWiki:ModernLightbox.js', 'u:dev:MediaWiki:MoveSubcategoriesToTheTop.js', 'u:dev:MediaWiki:PrivateMessageAlert/code.js', 'u:dev:MediaWiki:PurgeButton/code.js', 'u:dev:MediaWiki:QQX/code.js', 'u:dev:MediaWiki:QuickAccessToCSSAndJS/code.js', 'u:dev:MediaWiki:QuickDelete/code.js', 'u:dev:MediaWiki:QuickDiff/code.js', 'u:dev:MediaWiki:RailWAM/code.js', 'u:dev:MediaWiki:RedirectManagement/code.js', 'u:dev:MediaWiki:RemoveTracking.js', 'u:dev:MediaWiki:ReplyBottom/code.js', 'u:dev:MediaWiki:RevealAnonIP/code.js', 'u:dev:MediaWiki:SeeMoreActivityButton/code.js', 'u:dev:MediaWiki:ShowOnlyMyClearCacheMessage.js', 'u:dev:MediaWiki:SmoothGlobalNav/code.js', 'u:dev:MediaWiki:Thread Inspection/code.js', 'u:dev:MediaWiki:TopEditors/code.js', 'u:dev:MediaWiki:UsefulDropdown/code.js', 'u:dev:MediaWiki:UserActivityTab/code.js', 'u:dev:MediaWiki:UserCheck/code.js', 'u:dev:MediaWiki:UserRightsRecord/code.js', 'u:dev:MediaWiki:UserUnusedFiles/code.js', 'u:dev:MediaWiki:ViewRemoved/code.js', 'u:dev:MediaWiki:VSTFReport.js', 'u:dev:MediaWiki:VSTF_Report_Menu/code.js', 'u:dev:MediaWiki:WHAM/code.2.js', 'u:dev:MediaWiki:WLHEditLinks/code.js', ] }); /*This is borrowed from the Dev Wiki (!bang), just customizing a little */ $('.wds-global-navigation__search-input').on('keyup', function{ var txt = $(this).val, m = txt.match(/^\!([a-z]+) /), namespaces; if (m) { namespaces = { t: "Template", mw: "MediaWiki", s: "Special", f: "File", u: "User", p: "Project", c: "Category", me: "Message Wall", mlg: "Message Wall Greeting" };		if (namespaces.hasOwnProperty(m[1])) { $(this).val(namespaces[m[1]] + ":" + txt.substr(m[1].length + 2)); }	} }); /* ability to perform a rollback without being in the usergroup, author Ozank */ mw.loader.using('mediawiki.api', function { //Exit if normal rollback links are present if ($('.mw-rollback-link').length) return; var conf = mw.config.get([		'wgAction',		'wgCanonicalSpecialPageName',		'wgContentLanguage',		'wgPageName',		'wgUserLanguage',		'skin'	]), 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 | block) to last version by $2 (script)", summaryShort: "Reverted edits by $1 (talk) to last version by $2 (script)", 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" }	};	i18n = i18n[conf.wgUserLanguage] || i18n[conf.wgUserLanguage.split('-')[0]] || i18n[conf.wgContentLanguage] || i18n[conf.wgContentLanguage.split('-')[0]] || i18n.en; conf.API = new mw.Api; conf.token = mw.user.tokens.values.editToken; //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; 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;	}); window.AjaxBlock = { blockReasons: { 'Vandalism': 'Vandalism', 'Spam': 'Spam', 'Repeated policy violations': 'Repeated violations', 'Sockpuppetry/Ban Evasion': 'Sockpuppetry', 'Moved to a new account': 'Moved account', 'Removing content/blanking pages': 'Page blanking', 'Inserting false information or nonsense': 'Gibberish', 'Intimidating behaviour/harassment/trolling': 'Troll/Harassment', 'Unacceptable username, avatar, or global masthead': 'Name/avatar', 'Under the legal age': 'COPPA', 'Failing to comply with the File Policy': 'File Policy', 'Posting/Discussing leaked content': 'Leaks' },   check: { creation: true, talk: true, autoBlock: true, override: true } };	function getRevisionIdAndContent(title,target) { conf.API.get({		action: 'query',		prop: 'revisions',		titles: title,		rvprop: 'user|ids',		rvlimit: 500000,		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;				}				var lastUser,				revId;				for (var j in revisions) {					if (revisions[j].user != target) {						lastUser = revisions[j].user; //remember last author						revId = revisions[j].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); 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) { switch (conf.skin) { case 'oasis': case 'wikia': new BannerNotification(text,'error').show; break; default: alert(text); break; }		} }); /* FindAndReplace configs */ window.cvCaseSensitive = 'checked';

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:GlobalEditcount/code.js',    ] });