User:Ursuul/global.js

mw.loader.using('mediawiki.util').then(function {

/**    * SkinPropagation. Thank you Jesús for this script :)    * Copyright (C) 2010  Jesús Martínez Novo (User:Ciencia Al Poder)     *      * This program is free software; you can redistribute it and/or modify     *   it under the terms of the GNU General Public License as published by     *   the Free Software Foundation; either version 2 of the License, or     *   (at your option) any later version     */    window.SkinPropagation = {        skin: ,        init: function {            if (window.location.href.indexOf('useskin=') == -1) return;            var url = SkinPropagation.parseURL(window.location.href);            if (url.query.useskin) {                SkinPropagation.skin = (url.query.propagateskin || url.query.useskin);            }            if (SkinPropagation.skin != ) {                $(document.body).bind('click.skinpropagation', SkinPropagation.clicEvent);                $('form').bind('submit.skinpropagation', SkinPropagation.submitEvent); }       },        parseURL: function(url) { var ret = {base:,qs:,query:{},hash:''}; var loc = url.indexOf('#'); if (loc != -1) { ret.hash = url.substr(loc+1); url = url.substr(0,loc); }           loc = url.indexOf('?'); if (loc != -1) { ret.qs = url.substr(loc+1); url = url.substr(0,loc); var paras = ret.qs.split('&'); for (var i = 0; i < paras.length; i++) { var p = paras[i].split('='); if (p.length == 2) { ret.query[p[0]] = p[1]; }               }            }            ret.base = url; return ret; },       getURL: function(url) { var nurl = url.base + '?'; for (var p in url.query) { nurl += p + '=' + url.query[p] + '&'; }           nurl = nurl.substr(0,nurl.length-1); if (url.hash != '') { nurl += '#'+ url.hash; }           return nurl; },       clicEvent: function(e) { if (e.target.tagName.toLowerCase != 'a') return; if (e.target.href.indexOf(window.wgServer) != 0) return; var url = SkinPropagation.parseURL(e.target.href); var thisloc = SkinPropagation.parseURL(window.location.href); if (url.base == thisloc.base && url.qs == thisloc.qs && url.hash != '') { return; }           if (url.query.useskin && url.query.useskin != SkinPropagation.skin) { url.query.propagateskin = SkinPropagation.skin; } else { url.query.useskin = SkinPropagation.skin; }           e.target.href = SkinPropagation.getURL(url); },       submitEvent: function(e) { if (this.action.indexOf(window.wgServer) != 0) return; if (this.method == 'post') { var url = SkinPropagation.parseURL(this.action); url.query.useskin = SkinPropagation.skin; this.action = SkinPropagation.getURL(url); } else { $(this).append(''); }       },        stop: function { $(document.body).unbind('click.skinpropagation'); $('form').unbind('submit.skinpropagation'); }   };    $(SkinPropagation.init);

////////////////////////////////////////////////   /************ Functions — ************/ ////////////////////////////////////////////////   /* Variable(s) */ var config = mw.config.get([       'wgCityId',        'wgContentLanguage',        'wgFormattedNamespaces'    ]); var u = config.wgFormattedNamespaces[2]; var user, talk; switch (config.wgContentLanguage) { case 'es': user = '', talk = ''; break; case 'fr': user = '', talk = ''; break; case 'ru': user = '', talk = ''; break; case 'zh': case 'zh-tw': case 'zh-hk': user = '', talk = ''; break; default: user = '', talk = ''; }   /* Reorder SUG * function ShowUserGroups_sorter(a, b) { var PredeterminedOrder = { 'staff':                      -120, 'util':                       -119, 'restricted-login':           -118, 'restricted-login-auto':      -117, 'restricted-login-exempt':    -116, 'devboxpanel':                -115, 'translator':                 -114, 'content-reviewer':           -113, 'lookupuser':                 -112, 'lookupcontribs':             -111, 'wiki-manager':               -100, 'content-team-member':         -90, 'helper':                      -80, 'vstf':                        -70, 'global-discussions-moderator': -60, 'voldev':                      -50, 'content-volunteer':           -40, 'vanguard':                    -30, 'council':                     -20, 'authenticated':               -10, 'fandom-editor':                 0, 'bot-global':                   10, 'bot':                         110, 'codeadmin':                   120, 'checkuser':                   130, 'bureaucrat':                  140, 'sysop':                       150, 'content-moderator':           160, 'threadmoderator':             170, 'chatmoderator':               180, 'rollback':                    190, 'autoconfirmed':               200, 'emailconfirmed':              210 };       var sortA = typeof PredeterminedOrder[a] === 'number' ? PredeterminedOrder[a] : 100;       var sortB = typeof PredeterminedOrder[b] === 'number' ? PredeterminedOrder[b] : 100;       return sortA - sortB; }   ////////////////////////////////////////////////    /*************** Import Configs ***************/ ////////////////////////////////////////////////   /* General */ window.anchoredRollbackBot    = true; window.SeeMoreActivityButtonRC = true; window.nullEditDelay          = 250; window.batchDeleteDelay       = 250; window.massCategorizationDelay = 250; window.WHAMDelay              = 250; window.massProtectDelay       = 250; window.massRenameDelay        = 250; window.massRenameSummary      = 'Automatic Process'; window.mobileText             = 'Switch to Mercury'; window.cvCaseSensitive        = 'checked'; window.BotManagement = { add:   'Prevent myself spamming RecentChanges', remove: 'Done', expire: '1 week' };   window.configMessage = { interval: 750, placement: { element: 'tools', type:   'prepend' }   };    window.MassEditConfig = { editInterval: 750, placement: { element: 'tools', type:   'prepend' }   };    window.AutoCreateUserPagesConfig = { content: { 2:    user, 3:    talk, 1202: talk },       summary: 'Creating Profile (automatic)' };   window.announcementsIgnore = { option: 'opt-in-all', exceptWikiIds: [ 1547755, // Surviv 1458540, // Totally Accurate Battle Simulator //1136286, // Overlord 2378239, // ArmyWings 2318656, // rhinos-rpverse 2011605, // Hypixel Skyblock 1892334, // Faraway Paladin 1762165, // LGBTA 1358984, // Kimetsu no Yaiba 993749, // Animal Jam Clans 791363, // UK CC            621556,  // SU            338386,  // Attack on Titan 294811, // Ghibli 250551, // Arrowverse 5474,   // Doraemon 5278,   // JoJo 2575,   // YouTube 1903,   // Acepedia 1766,   // Jurassic Park 1706    // TES ]   };    /* FastCreate */ window.FCButtons = ; /* Code Quick Links */ window.customCodeQuickLinks = { replaceAllDefaultLinks: true, showIcon: true, linkSet: { siteFiles: [{ name: 'JSPages', href: mw.util.getUrl('Special:JSPages') }, {               name: 'ImportJS', href: mw.util.getUrl('MediaWiki:ImportJS') }, {               name: 'Themes.css', href: mw.util.getUrl('MediaWiki:Themes.css') }, {               name: 'Common.js', href: mw.util.getUrl('MediaWiki:Common.js') }, {               name: 'Common.css', href: mw.util.getUrl('MediaWiki:Common.css') }, {               name: 'FandomDesktop.js', href: mw.util.getUrl('MediaWiki:Fandomdesktop.js') }, {               name: 'FandomDesktop.css', href: mw.util.getUrl('MediaWiki:Fandomdesktop.css') }, {               name: 'Wikia.js', href: mw.util.getUrl('MediaWiki:Wikia.js') }, {               name: 'Wikia.css', href: mw.util.getUrl('MediaWiki:Wikia.css') }],           userFiles: [{ name: 'Global.js', href: '//community.fandom.com/wiki/Special:MyPage/global.js' }, {               name: 'ImportCSS', href: '//community.fandom.com/wiki/Special:MyPage/global.css' }, {               name: 'Global.css', href: '//community.fandom.com/wiki/Special:MyPage/g.css' }, {               name: 'Common.js', href: mw.util.getUrl('Special:MyPage/common.js') }, {               name: 'Common.css', href: mw.util.getUrl('Special:MyPage/common.css') }, {               name: 'Subpages', href: mw.util.getUrl('Special:PrefixIndex/User:Ursuul/') }, {               name: 'Sandbox', href: mw.util.getUrl('Special:Mypage/sandbox') }, {               name: 'Properties', href: '//community.fandom.com/wiki/User:Ursuul/properties.css?action=edit' }, {               name: 'S:AI', href: mw.util.getUrl('Special:AllInfoboxes') }]       }    };    /* AutoCreateUserPages exemption */ if (Number(mw.config.get('wgCityId')) === 93798) { localStorage.setItem('AutoCreateUserPagesLoaded', 'true'); }   ////////////////////////////////////////////////    /******************* Imports ******************/ ////////////////////////////////////////////////   importArticles({        type: 'script',        articles: [            //'u:community:User:Ursuul/AnalyticsToolbar.js',//eh            'u:dev:MediaWiki:AjaxBatchDelete.js',            'u:dev:MediaWiki:AjaxBatchUndelete.js',            'u:dev:MediaWiki:AjaxUndo/code.js',            'u:dev:MediaWiki:AnalyticsShortcut.js',            'u:dev:MediaWiki:AnchoredRollback/code.js',            'u:dev:MediaWiki:AnnouncementsIgnore.js',            'u:dev:MediaWiki:AutoCreateUserPages.js',            'u:dev:MediaWiki:BlogLink/code.js',            'u:dev:MediaWiki:BotManagement.js',            'u:dev:MediaWiki:CacheCheck/code.js',            //'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',//unknown            //'u:dev:MediaWiki:CleanWantedFiles/code.js',//unknown            'u:dev:MediaWiki:CodeQuickLinks/code.js',            //'u:dev:MediaWiki:ContribsButtons.js',//gotta install CSS for it            'u:dev:MediaWiki:DisableInfoboxBuilder.js', //'u:dev:MediaWiki:DiscussionsViewer.js',//unknown //'u:dev:MediaWiki:DisplayTimer/code.js',//don't like much in UCX //'u:dev:MediaWiki:EditConflictAlert/code.js',//unknown 'u:dev:MediaWiki:FastCreate.js', //'u:dev:MediaWiki:FileUsageAuto-update/code.js',//unknown //'u:dev:MediaWiki:FindAndReplace/code.js',//unknown 'u:dev:MediaWiki:LastEdited/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:MassRename/code.js', //'u:dev:MediaWiki:MinimalTemplateClassification.js',//awaiting 'u:dev:MediaWiki:MinimalTestModeAlert.js', //'u:dev:MediaWiki:MobileEditor.js',//awaiting //'u:dev:MediaWiki:MultipleFileDelete/code.js',//do not remove über script 'u:dev:MediaWiki:MultiUpload/code.js', 'u:dev:MediaWiki:NullEditButton/code.js', 'u:dev:MediaWiki:PageCreator/code2.js', 'u:dev:MediaWiki:PageEditInfo/code.js', 'u:dev:MediaWiki:PortableCSSPad/code.js', 'u:dev:MediaWiki:PortableListUsers.js', 'u:dev:MediaWiki:ProtectionIcons.js', 'u:dev:MediaWiki:PurgeButton/code.js', //'u:dev:MediaWiki:RCStats.js',//unknown 'u:dev:MediaWiki:RedirectManagement/code.js', //'u:dev:MediaWiki:ReferencePopups/code.js',//awaiting 'u:dev:MediaWiki:SeeMoreActivityButton/code.js', 'u:dev:MediaWiki:ThemeToggler.js', 'u:dev:MediaWiki:WhatLinksHere/code.js', 'u:dev:MediaWiki:ShowUserGroups.js' ]   }); });