User:ThePokegeek5000/global.js

///////////////////////////////////////////////////////////////////////// /***********************************************************************/ /************************* Table of Contents ***************************/ /***********************************************************************/ ///////////////////////////////////////////////////////////////////////// /*   Section 1: Table of Contents Section 2: Functions Section 2.1: Kill Syntax Highlight | By KockaAdmiralac Section 2.2: Multiple Upload | Someone on Gamepedia Section 3: Import Customization Section 4: Imports

///////////////////////////////////////////////////////////////////////// /***********************************************************************/ /***************************** Functions *******************************/ /***********************************************************************/ /////////////////////////////////////////////////////////////////////////

/* Kill Syntax Highlight | By KockaAdmiralac */ var syntaxConfig = mw.config.get([   'wgAction',    'wgCityId',    'wgPageName' ]); var killSyntaxHighlight = function(a) { if ((syntaxConfig.wgAction === 'edit' || syntaxConfig.wgAction === 'submit') && a.some(function(page) { return syntaxConfig.wgPageName.indexOf(page) === 0; })) {       var interval = setInterval(function {            if ($('#wpTextbox0').length) {                $('#wpTextbox0').remove;                $('#wpTextbox1').removeClass('highlighted');                clearInterval(interval);            }        }, 1000); }   console.log("KillSyntaxHighlight("+a+"); ran"); }

switch (syntaxConfig.wgCityId) { // surviv.io   case '1547755': killSyntaxHighlight(['User:ThePokegeek5000/AppJS']); break; // moomoo.io   case '1542998': killSyntaxHighlight(['User:ThePokegeek5000/bundlejs']); break; default: killSyntaxHighlight(['User:ThePokegeek5000/AppJS']); break; }

/* Multiple Upload | Someone on Gamepedia */ //https://help.gamepedia.com/index.php?title=MediaWiki:Gadget-multiupload.js&action=raw&ctype=text/javascript but not demanding licensing mw.loader.using(['site']).then(function {	i18n = {		multiupload:"Upload multiple files:",		yes:"Yes",		no:"No",		sourcefiles:"Source files:",		uploadfiles:"Upload files",		nofiles:"Please select some files first.",		nolicense:"Please select a valid license first.",		summary:"Summary",		license:"License",		uploading:"Uploading files...",		uploaded:"Uploaded:",		failed:"Failed:",		done:"Done."	};	if (mw.config.get("wgCanonicalSpecialPageName")!=="Upload") return;		$("#wpUploadFile").parent.parent.addClass("regularFileSelect");	$("tr.regularFileSelect").before(' '+i18n.multiupload+'   '+i18n.yes+'   '+i18n.no+'  ');	$("tr.regularFileSelect").after(''+i18n.sourcefiles+'   '); $("input[name='wpUpload']").addClass("regularFileSelect"); $("#wpDestFile").parent.parent.addClass("regularFileSelect"); $("#wpIgnoreWarning").parent.parent.addClass("regularFileSelect"); $("span.mw-htmlform-submit-buttons").append(''); $("input[name='multipleFiles']").change(function{		if (this.value===i18n.yes) {			$(".regularFileSelect").hide;			$(".multipleFileSelect").show;		}		else {			$(".regularFileSelect").show;			$(".multipleFileSelect").hide;		}	}); $("#multiFileSubmit").click(function {		files = $("#multiupload")[0].files;		if (files.length === 0) {			alert(i18n.nofiles);			return false;		}/*		if ($("#wpLicense option:selected").val === "") {			alert(i18n.nolicense);			return false;		}*/		summary = $("#wpUploadDescription").val;		if (summary !== "") summary = "== "+i18n.summary+" ==\n"+summary;		license = "== "+i18n.license+" ==\n"+$("#wpLicense option:selected").prop("title");		text = summary + "\n" + license;		watch = "preferences";		if ($("#wpWatchthis").is(":checked")) watch = "watch";		else watch = "nochange";		curFile = 0;		$("#firstHeading").text(i18n.uploading);		$("#mw-content-text").html(" "+i18n.uploaded+"  "+i18n.failed+"  ");		function gNF {			if(curFile>files.length) {				$("#mw-content-text").append(" "+i18n.done+" ");				return;			}	       if(files[curFile] === undefined) {                curFile++; gNF; return; }			$.ajax({url:'/api.php',data:{action:'query',meta:'tokens',format:'json'},dataType:'json'}).done(function(data) {				fd = new FormData;				fd.append("action","upload");				fd.append("token",data.query.tokens.csrftoken);				fd.append("filename",files[curFile].name);				fd.append("file",files[curFile]);				fd.append("text",text);				fd.append("watchlist",watch);				fd.append("ignorewarnings",1);				fd.append("format","json");				$.ajax({ url:'/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; }); });

///////////////////////////////////////////////////////////////////////// /***********************************************************************/ /************************ Import Customization *************************/ /***********************************************************************/ /////////////////////////////////////////////////////////////////////////

/* AjaxBatchDelete */ batchDeleteDelay = 250; /**/

/* AjaxBatchUndelete */

/* AjaxUndo */

/* AnchoredRollback */

/* AutoCreateUserPages */ window.AutoCreateUserPagesConfig = { content:{ 2:'',       3:'\n\n', //1202:''//Wall Greetings Removed },   summary:'Creating UserPages (Automatic)', };

/* BlogLink */

/* CodeQuickLinks */ window.customCodeQuickLinks= { replaceAllDefaultLinks:true, linkSet:{ userFiles:[ {name:"Global.js",				href:"/wiki/w:Special:MyPage/global.js"}, {name:"Global.css", 			href:"/wiki/w:Special:MyPage/global.css"}, {name:"Common.js",				href:"/wiki/Special:MyPage/common.js"}, {name:"Common.css", 			href:"/wiki/Special:MyPage/common.css"}, {name:"FandomDesktop.js",		href:"/wiki/Special:MyPage/fandomdesktop.js"}, {name:"FandomDesktop.css", 	href:"/wiki/Special:MyPage/fandomdesktop.css"}, {name:"",	href:""}, {name:"Wikimarks",				href:"/wiki/Special:MyPage/Wikimarks"}, {name:"Sandbox",				href:"/wiki/Special:MyPage/Sandbox"}, {name:"To Do List", 			href:"/wiki/Special:MyPage/To Do List"}, ],       siteFiles:[ {name:"JSPages",				href:"/wiki/Special:JSPages"}, {name:"ImportJS",				href:"/wiki/MediaWiki:ImportJS"}, {name:"Common.js",				href:"/wiki/MediaWiki:common.js"}, {name:"Common.css", 			href:"/wiki/MediaWiki:common.css"}, {name:"FandomDesktop.js",		href:"/wiki/MediaWiki:fandomdesktop.js"}, {name:"FandomDesktop.css",		href:"/wiki/MediaWiki:fandomdesktop.css"}, {name:"",	href:""}, {name:"Themes.css", 			href:"/wiki/MediaWiki:Themes.css"}, {name:"Staff.css",				href:"/wiki/MediaWiki:Staff.css"}, {name:"Custom-user-tags",		href:"/wiki/MediaWiki:Custom-user-tags.json"}, ],   } };/**/

/* DisableInfoboxBuilder */

/* EditConflictAlert */ var EditConflictAlertInterval = 10000;/**/

/* FileLogs */

/* MarkBlocked */

/* MassCategoration */ massCategorizationDelay = 500;/**/

/* MassEdit */ window.massEditConfig = { editInterval:1000 };/**/

/* MassNullEdit */ nullEditDelay = 250;/**/

/* MassProtect */ massProtectDelay = 500;/**/

/* MassRename */ massRenameDelay = 500; massRenameSummary = "Mass Edit (Automatic)";/**/

/* MassRenameRevert */

/* MastheadGender */

/* MinimalTemplateClassification */

/* NullEditButton */

/* PortableCSSPad */

/* PreferenceLinks */

/* ProtectionIcons */

/* QuickDiff */

/* Rollback */

/* SandboxTab */

/* SeeMoreActivityButton */

/* ShowUserGroups */

/* ToggleDebugMode */

/* UserAccountAge */

/* View Source */

/* WHAM */ WHAMDelay = 500;/**/

/* Wikimarks */

///////////////////////////////////////////////////////////////////////// /***********************************************************************/ /******************************* Imports *******************************/ /***********************************************************************/ ///////////////////////////////////////////////////////////////////////// //"Big Sad" ones are ones that don't exist anymore, keeping the text there because who knows why importArticles({   type:'script',    articles:[        //'u:dev:MediaWiki:AjaxBatchDelete/code.js',        //'u:dev:MediaWiki:AjaxBatchUndelete.js',        'u:dev:MediaWiki:AjaxUndo/code.js',        'u:dev:MediaWiki:AnchoredRollback/code.js',        'u:dev:MediaWiki:AutoCreateUserPages.js',        'u:dev:MediaWiki:BlogLink/code.js',        'u:dev:MediaWiki:CodeQuickLinks/code.js',        'u:dev:MediaWiki:DisableInfoboxBuilder.js',        'u:dev:MediaWiki:EditConflictAlert/code.js',        'u:dev:MediaWiki:FileLogs.js',        'u:dev:MediaWiki:MarkBlocked.js',        //'u:dev:MediaWiki:MassCategorization/code.js',        'u:dev:MediaWiki:MassEdit/code.js',        'u:dev:MediaWiki:MassNullEdit/code.js',        //'u:dev:MediaWiki:MassProtect/code.js',        //'u:dev:MediaWiki:MassRename/code.js',        'u:dev:MediaWiki:MassRenameRevert/code.js',        'u:dev:MediaWiki:MastheadGender/code.js', 'u:dev:MediaWiki:MinimalTemplateClassification.js', 'u:dev:MediaWiki:NullEditButton/code.js', 'u:dev:MediaWiki:PortableCSSPad/code.js', 'u:dev:MediaWiki:PreferenceLinks.js', 'u:dev:MediaWiki:ProtectionIcons.js', 'u:dev:MediaWiki:QuickDiff/code.js', 'u:dev:MediaWiki:Rollback/code.js', 'u:dev:MediaWiki:SandboxTab/code.js', 'u:dev:MediaWiki:SeeMoreActivityButton/code.js', 'u:dev:MediaWiki:ShowUserGroups.js', 'u:dev:MediaWiki:ToggleDebugMode/code.js', 'u:dev:MediaWiki:UserAccountAge/code2.js', 'u:dev:MediaWiki:View Source/code.js', 'u:dev:MediaWiki:WHAM/code.2.js', //'u:dev:MediaWiki:Wikimarks/code.js', //Big Sad - Stuff I wish still existed //'u:dev:MediaWiki:FindAndReplace/code.js',//Because Built In Single-Line > Extension Multi-Line Apparently //'u:dev:MediaWiki:GlobalEditcount/code.js',//No Reliable Way to Build on UCP //'u:dev:MediaWiki:RevealAnonIP/usercode.js',//Big Sad //'u:dev:MediaWiki:WallGreetingButton/code.js',//Wall Greetings Removed //'u:kocka:User:KockaAdmiralac/DecodeHex.javascript',//Not Functioning Properly //'u:thegoldenpatrik1:User:TheGoldenPatrik1/FollowingLink.javascript',//Unmaintained for UCP //'u:thepokegeek5000:User:ThePokegeek5000/DecodeHex.javascript',//Fork of Kocka one, also not functioning ], });/**/