User:TheWWRNerdGuy/global.js

// Go Ctrl+F (importArticles) to get actual explanations of the extensions rather than what I've changed. This stuff needs to be first because of load priorities and they won't work if after the imports.

window.AjaxUndoPrompt = true; /*The main reason I would use undo over Rollback is to give a reason. Doing this means I have to write a reason each time I'm using AjaxUndo.*/

window.toDoList = { page: 'User:TheWWRNerdGuy' }; /*1Vzz1 (ToDoList) Means that when I press to do, I get the straight source code of my profile. Much more useful than intended and I absolutely love it.*/

window.massRenameSummary = ' '

$.when($.ready, mw.loader.using(["mediawiki.api", "mediawiki.jqueryMsg"])).then(function{	return new mw.Api.loadMessagesIfMissing(["global-navigation-search-placeholder-inactive", "global-navigation-search-placeholder-in-wiki", "recentchanges","mediastatistics-header-video", "images"]); }).then(function{

//prevent double loading if( $(document.body).hasClass("oasis-is-revived") ) { return; }

var oasisRevivedClass = $(document.body).addClass("oasis-is-revived"); });

window.dev = $.extend(true, window.dev, {   i18n: {        overrides: {            Rollback: {                'summary': 'Reverted edits by $1 to last revision by $2',                // 'summary': ' ',                'summaryShort': 'k'            }        }    } });

window.customUserAccountAge = { showFullDate: true };

// window.Sofix = { //    enablePersonalUse: true // }	'use strict'; var config = mw.config.get([		'wgCanonicalSpecialPageName',		'UMFBypassLicenseCheck',		'wgScriptPath',		'wgContentLanguage'	]); var msg;
 * (function($, mw) {

if (config.wgCanonicalSpecialPageName !== 'Upload') return;

function init { $('#wpUploadFile').parent.parent.addClass('regularFileSelect'); $('tr.regularFileSelect').before(			' ' +				'' + msg('multiupload').escape + ' ' +				'' +					' ' +						' ' + msg('yes').escape +					'  ' +					' ' +						' ' + msg('no').escape +					' ' +				' ' +			' '		); $('tr.regularFileSelect').after(			'' +				'' + msg('sourcefiles').escape + ' ' +				' ' +			' '		); $('input[name="wpUpload"]').addClass('regularFileSelect'); $('#wpDestFile').parent.parent.addClass('regularFileSelect'); $('#wpIgnoreWarning').parent.parent.addClass('regularFileSelect'); $('input[name="wpUpload"]').after(''); $('input[name="multipleFiles"]').change(function{			if (this.value === msg('yes').plain) {				$('.regularFileSelect').hide;				$('.multipleFileSelect').show;			} else {				$('.regularFileSelect').show;				$('.multipleFileSelect').hide;			}		}); $('#multiFileSubmit').click(function {			var files = $('#multiupload')[0].files;			if (files.length === 0) {				alert(msg('nofiles').plain);				return false;			}			var comment = $('#wpUploadDescription').val;			var license = ($('#wpLicense option:selected').val === ) ?  : '\n== ' + mw.msg('license-header') + ' ==\n' + $('#wpLicense option:selected').prop('title');			var text = (comment !== '' ? '== ' + mw.msg('filedesc') + ' ==\n' + comment : '') + license;			var watch = 'preferences';			if ($('#wpWatchthis').is(':checked')) watch = 'watch';			else watch = 'nochange';			var curFile = 0;			$('#firstHeading').text(msg('uploading').plain);			$('#mw-content-text').html(' ' + msg('uploaded').escape + '  ' + msg('failed').escape + '  ');			function gNF {				if(curFile>files.length) {					$('#mw-content-text').append(' ' + msg('done').escape + ' ');					return;				}				if(files[curFile] === undefined) {					curFile++;					gNF;					return;				}				var fd = new FormData;				fd.append("action","upload");				fd.append("token",mw.user.tokens.get('csrfToken'));				fd.append("filename",files[curFile].name);				fd.append("file",files[curFile]);				fd.append("comment",comment);				fd.append("text",text);				fd.append("watchlist",watch);				fd.append("ignorewarnings",1); fd.append("format","json"); $.ajax({					url: config.wgScriptPath + '/api.php',					method: 'POST',					data: fd,					cache: false,					contentType: false,					processData: false,					type: 'POST'				}).done(function(d){					if (d.error == undefined) {						$('#mw-content-text > ul').append(''+d.upload.filename+'</li>');					}					else {						$('#multiUploadFailed ul').append('<li>' + files[curFile].name + '</li>');						$('#multiUploadFailed').show;					}					curFile++;					gNF;				}).fail(function(d) {					$('#multiUploadFailed ul').append('<li>' + files[curFile].name + '</li>');					$('#multiUploadFailed').show;					curFile++;					gNF;				}); }			gNF; });	}	mw.loader.using(['mediawiki.api', 'jquery']).then(function { return new mw.Api.loadMessagesIfMissing([			'filedesc',			'license-header'		], {amlang: config.wgContentLanguage}); }).then(function { mw.hook('dev.i18n').add(function (i18n) {			i18n.loadMessages('UploadMultipleFiles').done(function (i18no) { msg = i18no.msg; init; });		});		importArticles({			type: 'script',			articles: 'u:dev:MediaWiki:I18n-js/code.js'		}); }); })(window.jQuery, window.mediaWiki);

/* (function {    if (window.NavCodeLinksLoaded) {        return;    }    window.NavCodeLinksLoaded = true;    $('.wds-global-navigation__user-menu .wds-list, .wiki-tools .wds-dropdown__content .wds-list').append( ['css', 'js'].map(function(ext) {           return $('<li>', { append: $('', {                   'href': mw.util.getUrl('MediaWiki:Fandomdesktop.' + ext),                    text: 'Fandomdesktop ' + ext.toUpperCase                }) });       })    ); });
 * NavCodeLinks
 * Adds Wiki's CSS and JS link to navigation dropdown
 * @author Monochromatic Bunny
 * Modified to link FandomDesktop

importArticles({   type: 'script',    articles: [        /*        Extensions installed        Adding something which describes each one and whatever values I've changed.        For each thingy in here just get https://dev.fandom.com/wiki/ and copy-paste the name to get to its official page.        Some extensions I will give acronyms to. Assume, unless otherwise stated, that I personally use the extension, am happy with it, and I would only have it used by myself.        Note: Where an extension requires a lot of explanation or has its config settings changed, I will write a Note: String, where String is a random ID. Ctrl+F String to find a full explanation.        Acronyms used:        // PUO         –        Breaks Fandom's Customisation policy. Stands for Personal Use Only, as you're allowed to mess up your personal JS however you want.        // SWO         –        Can only be used site-wide // SW         –        I would recommend using this site-wide with ImportJS // VC         –        Values changed where they need to be. Will give it a Note: String. // SWVC       –        I would recommend this be used site-wide with certain customisations. Those will be commented where they need to be. // B          –        Only bots (or users who REALLY know what they are doing) should use this // NS         –        Not sure about permitting this one's existence // NU         –        I haven't really used this so I don't have an explanation/I've never seen it in action // TBC        –        I need to expand upon this. Probably mostly with SWVC. // BU         –        Buggy/doesn't work as intended, but not completely broken. Terms used: // Edity people    –      People with special editing rights. Locally, these are Admin and Content Mod. */

// To add extensions to ImportJS, copy the line and remove these parts: ', u:, MediaWiki:

/* Rollback/Spam prevention stuff Basically just there to stop spam/useless contributions*/ 'u:dev:MediaWiki:Rollback/code.js', 'u:dev:MediaWiki:AnchoredRollback/code.js', 'u:dev:MediaWiki:MassRollback.js', 'u:dev:MediaWiki:Nuke/code.js', 'u:dev:MediaWiki:AddBlockUserTag/code.js', /* Explanations of each: Rollback                            –        Does the Fandom default rollback that Fandom has, but instead of Tag:Rollback, it has (script) in the edit summary, which has a link to the script's page on DevWiki. Only works if you don't already have the permission. AnchoredRollback       SW           –        Means that when you press Rollback, it will just happen and you will just see the Rollback button disappear. NS because it takes away the weight of a rollback, but required for MassRollback. MassRollback           SW           –        Adds a Rollback All button on a user's contributions. Only works with Rollback and AnchoredRollback, and seemingly only usable by edity people. Nuke                   NU/SW        –        Deletes all pages created by a user. Can only be used by edity people implicitly. AddBlockUserTag        NU/SW        –        Adds a Block button to a user's masthead. Can only be used by blocky users implicitly. */

/* Page Controls Stuff that appears in the dropdown menu next to the edit button*/ /*       'u:dev:MediaWiki:PageRenameAuto-update/code.js', 'u:dev:MediaWiki:FileUsageAuto-update/code.js', */       'u:dev:MediaWiki:View_Source/code.js', 'u:dev:MediaWiki:WhatLinksHere/code.js', 'u:dev:MediaWiki:NullEditButton/code.js', 'u:dev:MediaWiki:PurgeButton.js', /* Explanations of each: CategoryRenameAuto-update       B        –        For a category, renames it and then applies the rename to every link to it and all pages within it. Utterly floods RecentChanges. PageRenameAuto-update           B        –        Basically ↑ but for pages. Only available to the usual edity suspects. I'd assume the others are, too. FileUsageAuto-update            B        –        Basically ↑ but for Files. Need to use the queue button. View_Source WhatLinksHere                            –        Allows you to access the special page from Page Controls NullEditButton                           –        Clears cache and does other stuff perhaps */

/* My Tools Stuff that appears in the My Tools menu at the bottom of the screen 'u:dev:MediaWiki:MassEdit/code.js', 'u:dev:MediaWiki:MassCategorization/code.js', Obsolete because AWB and pywikibot */       'u:dev:MediaWiki:MassRename/code.js', 'u:dev:MediaWiki:AjaxBatchDelete.js', 'u:dev:MediaWiki:AjaxBatchUndelete.js',/* 'u:dev:MediaWiki:MassRenameRevert/code.js',*/ /**/       /* Explanations of each: MassEdit                                   –       Does a lot. Only usable by edity people. 4 modes: Find and replace content, Add new content, Message users, Generate page listing. MassCategorization                         –       Can add, remove and replace categories where you give it the pages to. You can also add every page in a certain category to the list. Duplicate detector in Add is buggy. MassRename                     NU          –       Allows you to rename a lot of pages in quick succession. Format is Current_Name New_Name for each line. Limited use for non-edity people. MassRenameRevert               NU/NS       –       Opens tabs to revert renaming of every checked rename. Hampered by Popup blockers. AjaxBatchDelete                NU          –       Deletes all pages. Format is same as MassEdit. Only usable by edity people implicitly. AjaxBatchUndelete              NU/NS       –       ↑ but the opposite. Not sure because only edity people, who should be trusted, can delete stuff. Note: All of these besides MassRenameRevert would be flagged as B, but it's more aesthetic to just put this as a note down here */

/* Help Stuff that I find to be generally quite helpful (sometimes theoretically), mostly just small QOL things*/ 'u:dev:MediaWiki:CopyTitle.js', 'u:dev:MediaWiki:DupeArgs.js', 'u:dev:MediaWiki:EditConflictAlert/code.js', 'u:dev:MediaWiki:DecodeURI/code.js', // 'u:dev:MediaWiki:MassProtect/code.js', 'u:dev:MediaWiki:FastFileDelete.js', 'u:dev:MediaWiki:CategoryQuickRemove.js', 'u:dev:MediaWiki:AddArticleToCategory/code.js', // 'u:dev:MediaWiki:AjaxRename/code.js', 'u:dev:MediaWiki:AjaxUndo/code.js', // 'u:dev:MediaWiki:QuickTitle/code.js', // 'u:dev:MediaWiki:MassBlock/code.js', 'u:dev:MediaWiki:ToDoList.js', // 'u:dev:MediaWiki:UploadMultipleFiles.js', /* Explanations of each: CopyTitle                          –       Adds two buttons to the top of the page. Top copies title, bottom copies namespace and title. DupeArgs               NU          –       In My Tools, adds a thing for resolving templates using duplicate arguments. EditConflictAlert                  –       Notifies you when the page you are editing gets edited by somebody else. MassProtect            NU          –       Allows you to protect many pages at once. Seems to be the same format as MassEdit etc. Perhaps SW/B? FastFileDelete         NU/SW       –       Adds a 'delete' button to Special:UnusedFiles/Videos and the lightbox (the one that shows when you click an image). Edity people only. CategoryQuickRemove    SW          –       Adds an X next to categories, allowing you to delete them without editing. AddArticleToCategory   SW          –       Adds an Add to Category link in each category page AjaxRename             NU          –       Broken? AjaxUndo               VC          –       Allows you to undo an edit without moving page, like anchored rollback but as an undo. Note SVsrn. QuickTitle                         –       Allows you to edit the  by just clicking on the title. Annoying crossover with CopyTitle but whatever. ToDoList               PUO/VC      –       Hijacked. On the bottom bit where My Tools also is. Note 1Vzz1. */

//Visual stuff 'u:dev:MediaWiki:MarkBlocked.js', 'u:dev:MediaWiki:ProtectionIcons.js', //Fun 'u:dev:MediaWiki:FirstEditDate.js', 'u:dev:MediaWiki:ShowUserGroups.js', 'u:dev:MediaWiki:MastheadGender/code.js', 'u:dev:MediaWiki:RevealAnonIP/usercode.js', 'u:dev:MediaWiki:UserRightsRecord/code.js', 'u:dev:MediaWiki:UserAccountAge/code2.js', 'u:dev:MediaWiki:UserAndIPTools.js', 'u:dev:MediaWiki:ShowWROnToolbar.js', //Pretty cool 'u:dev:MediaWiki:EditLeaderboard.js', 'u:dev:MediaWiki:AnalyticsShortcut.js', 'u:dev:MediaWiki:StickySummary.js', 'u:dev:MediaWiki:AddUserRightsTag/code.js', // 'u:dev:MediaWiki:MassUserRights/code.js', 'u:dev:MediaWiki:CatNav/code.js', 'u:dev:MediaWiki:ImportJSPage/code.js', 'u:dev:MediaWiki:MassNullEdit/code.js', // ?       'u:dev:MediaWiki:GlobalJSLinks.js', 'u:dev:MediaWiki:Bang.js', 'u:dev:MediaWiki:Sofix.js', 'u:dev:MediaWiki:DisableCode/code.js', // DisableCode                    NS          –       Allows me to disable JS for reasons unknown

// New 'u:dev:MediaWiki:PowerDelete.js', // 'u:dev:MediaWiki:WHAM/code.2.js',

/* Common.js but not personal use UserBadge*/ /* Sitewide DisableBotMessageWalls Standard_Edit_Summary */   ] });

/* Additional notes https://www.random.org/strings/?num=1&len=5&digits=on&upperalpha=on&loweralpha=on&unique=on&format=html&rnd=new MediaWiki:Group-sysop.js