User:ThePokegeek5000/global.js

/* Multiple Upload - 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; }); });

///////////////////////////////////////////////////////////////////////// /***********************************************************************/ /************************* Table of Contents ***************************/ /***********************************************************************/ ///////////////////////////////////////////////////////////////////////// /*   Section 1:Table of Contents Section 2:Functions Section 2.1:Hotkeys Section 2.2:Kill Syntax Highlight | By KockaAdmiralac Section 2.3:Kill Syntax Highlight | By KockaAdmiralac and TheGoldenPatrik1 Beta Section 3:Import Customization A Lot Of Import Customization; 1 for Every Import Section 4:Imports

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

/* Hotkeys * //which do but aren't supposed to trigger when you decide to use searchbar or article comments. var keys = {}; var input = false; $(document).on('keydown', function (e) {	keys[e.which] = true;	//Load if you press K and another key	if (keys[75] && !input) {   	// load AjaxEdit if you hit E    	if (keys[69] && !input) {    		$('#ca-ajax-edit').click;    	}    	// load FindAndReplace if AjaxEdit is loaded and you hit F    	mw.hook('AjaxEdit.session').add(function  { if (keys[70] && !input) { $('#ajax-edit__buttons-replace').click; }   	});	} }).on('keyup', function (e) {	keys[e.which] = false; }); $('input, textarea').on('keydown', function {   input = true; }).on('keyup', function {    input = false; });

/* 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; }

/* Kill Syntax Highlight | By KockaAdmiralac and TheGoldenPatrik1 Beta * (function {    var config = mw.config.get([ 'wgAction', 'wgCityId', 'wgPageName' ]);   if (config.wgAction !== 'edit' && config.wgAction !== 'submit') {        return;    }    var highlight = true;    var $text0 = $('#wpTextbox0');    var $text1 = $('#wpTextbox1');    function click  {        if (highlight) {            $text0.hide;            $text1.removeClass('highlighted');            $('#toggle-syntax-highlight').text('Add Syntax Highlight');            highlight = false;        } else {            $text0.show;            $text1.addClass('highlighted');            $('#toggle-syntax-highlight').text('Remove Syntax Highlight');            highlight = true;        }    }    $('#WikiaBar .toolbar .tools').append( $('<li>').append(           $('', {'text':'Remove Syntax Highlight', 'click':click, 'id':'toggle-syntax-highlight'})        ) );   function killSyntaxHighlight (a) {        if (a.some(function (page) {            return config.wgPageName.indexOf(page) === 0;        })) {            setTimeout(click, 1000);        }        console.log("KillSyntaxHighlight("+a+"); ran");    }    switch (config.wgCityId) {        // surviv.io        case '1547755':            killSyntaxHighlight(['User:ThePokegeek5000/AppJS']);            break;        // moomoo.io        case '1542998':            killSyntaxHighlight(['User:ThePokegeek5000/bundlejs']);            break;        default:            console.log("KillSyntaxHighlight; was not called");            break;

} });/**/

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

/* Community User:TYA AutoEditDropdown */

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

/* AjaxBatchUndelete */

/* AjaxEdit */ window.AjaxEdit = { minor:mw.user.options.get('minordefault') === '1', reloadContent:false, restart:false, watchlist:'preferences', hideRail:true, height:'500px', replaceGlobal:true, replaceCase:true, replaceRegex:false, summaries:false, summaryNotice:false, reload:false, button:true, buttons:[ {label:'nowiki', open:' ', middle:'', close:' '}, {label:'code nowiki', open:' '}, ], }

/* AjaxThreadDelete */ window.AjaxThreadDeleteConfig = { fastDelete:false, reason:'Cleanup' };

/* AjaxUndo */

/* BlogLink */

/* ChainQuotes */

/* ChatHacks */ window.ChatHacksNoStar = false; //window.ChatHacksIconMod = 'full URL to image';//Custom Icon by Chat Mod //window.ChatHacksIconStaff = 'full URL to image';//Custom Icon by Staff window.ChatHacksPingSound = false;//Replace f with a full Audio URL when a custom sound is wanted

/* CleanWantedFiles */

/* CodeQuickLinks */ window.customCodeQuickLinks= { replaceAllDefaultLinks:true, linkSet:{ userFiles:[ {name:"Global.js", href:"//community.fandom.com/wiki/Special:MyPage/global.js"}, {name:"Global.css", href:"//community.fandom.com/wiki/Special:MyPage/universal.css"}, {name:"Common.js", href:"/wiki/Special:MyPage/common.js"}, {name:"Common.css", href:"/wiki/Special:MyPage/common.css"}, {name:"Wikia.js", href:"/wiki/Special:MyPage/wikia.js"}, {name:"Wikia.css", href:"/wiki/Special:MyPage/wikia.css"}, {name:"Chat.js", href:"/wiki/Special:MyPage/chat.js"}, {name:"Chat.css", href:"/wiki/Special:MyPage/chat.css"}, {name:"", href:""}, {name:"Universal.css", href:"//community.fandom.com/wiki/Special:MyPage/global.css"}, {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:"Wikia.js", href:"/wiki/MediaWiki:wikia.js"}, {name:"Wikia.css", href:"/wiki/MediaWiki:wikia.css"}, {name:"Chat.js", href:"/wiki/MediaWiki:chat.js"}, {name:"Chat.css", href:"/wiki/MediaWiki:chat.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"}, {name:"ProfileTags (Old)", href:"/wiki/MediaWiki:ProfileTags"}, ],   } };/**/

/* ContribsButtons */

/* DisableInfoboxBuilder */

/* DiscussionsFeed */

/* EditBio */

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

/* FastOldImageDelete */

/* FileLogs */

/* FindAndReplace */ var cvGlobalMatching = 'checked'; // Global matching, Default Checked. var cvCaseSensitive = 'checked'; // Case sensitive, Default UnChecked. var cvEnableRegex = 'unchecked'; // Regular expression, Default UnChecked. /**/

/* GlobalEditcount */ window.GlobalEditcountPlain = false;/**/

/* Linksweeper */ linkSweepConfirmation = true; LinkSweeperDelay = 1000;/**/

/* LinkToDiscussionsProfileIfTheyDontHaveLivePosts */

/* Mark Blocked */

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

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

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

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

/* MassRedirect */ massRedirectDelay = 500;/**/

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

/* MassRenameRevert */

/* MastheadGender */

/* MinimalTemplateClassification */

/* NullEditButton */

/* PersistentParameters */ window.persistentParameterList = ['useskin'];

/* PortableCSSPad */

/* PortableListUsers */ window.PortableListUsers={ editcount:'1', landing:'sysop', storage:false, time:'timeago', };

/* PreferenceLinks */

/* ProtectionIcons */

/* QuickDiff */

/* RailWAM */

/* RevealAnonIP */

/* Rollback */

/* SandboxTab */

/* SeeMoreActivityButton */

/* ShowUserGroups */

/* ToggleDebugMode */

/* UserAccountAge */

/* ViewRemoved */

/* View Source */

/* WallGreetingButton */ WallGreetingButtonProtect = true;/**/

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

/* WLHEditLinks */

/* Wikimarks */

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

/* Kocka User:KockaAdmiralac/DecodeHex */

/* TheGoldenPatrik1 User:TheGoldenPatrik1/FollowingLink.javascript */

///////////////////////////////////////////////////////////////////////// /***********************************************************************/ /******************************* Imports *******************************/ /***********************************************************************/ ///////////////////////////////////////////////////////////////////////// importArticles({   type:'script',    articles:[        //'u:community:User:TyA/AutoEditDropdown.js',        //'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',        //'u:dev:MediaWiki:AjaxBatchUndelete.js',        'u:dev:MediaWiki:AjaxEdit.js',        'u:dev:MediaWiki:AjaxThreadDelete/code.js',        'u:dev:MediaWiki:AjaxUndo/code.js',        'u:dev:MediaWiki:AnchoredRollback/code.js',        'u:dev:MediaWiki:BlogLink/code.js',        'u:dev:MediaWiki:ChainQuotes.js',        'u:dev:MediaWiki:ChatHacks.js',        'u:dev:MediaWiki:CleanWantedFiles/code.js',        'u:dev:MediaWiki:CodeQuickLinks/code.js',        'u:dev:MediaWiki:ContribsButtons.js',        'u:dev:MediaWiki:DisableInfoboxBuilder.js',        'u:dev:MediaWiki:DiscussionsFeed.js',        'u:dev:MediaWiki:EditBio/code.js', 'u:dev:MediaWiki:EditConflictAlert/code.js', 'u:dev:MediaWiki:FastOldImageDelete.js', 'u:dev:MediaWiki:FileLogs.js', 'u:dev:MediaWiki:FindAndReplace/code.js', 'u:dev:MediaWiki:GlobalEditcount/code.js', 'u:dev:MediaWiki:Linksweeper/code.js', 'u:dev:MediaWiki:LinkToDiscussionsProfileIfTheyDontHaveLivePosts/code.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:MassRedirect/code.1.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:PersistentParameters/code.js',//Testing '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:RailWAM/code.js', 'u:dev:MediaWiki:RevealAnonIP/usercode.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:ViewRemoved/code.js', 'u:dev:MediaWiki:View Source/code.js', 'u:dev:MediaWiki:WallGreetingButton/code.js', 'u:dev:MediaWiki:WHAM/code.2.js', 'u:dev:MediaWiki:WLHEditLinks/code.js', //'u:dev:MediaWiki:Wikimarks/code.js', 'u:kocka:User:KockaAdmiralac/AutoCreateUserPages.javascript', //'u:kocka:User:KockaAdmiralac/DecodeHex.javascript', 'u:thegoldenpatrik1:User:TheGoldenPatrik1/FollowingLink.javascript', //'u:thepokegeek5000:User:ThePokegeek5000/DecodeHex.javascript', ], });/**/