User:RainA/g.js

// Dev Scripts importArticles({   	type: 'script',	articles: [	'u:dev:MediaWiki:AllPagesHideRedirect/code.js',	'u:dev:MediaWiki:AlwaysShowBottomBar.js',    'u:dev:MediaWiki:AjaxEditPreview.js',    'u:dev:MediaWiki:AjaxUndo/code.js',    //'u:dev:MediaWiki:AnnouncementsIgnore.js',    'u:dev:MediaWiki:Discussions Delete All/code.js',    'u:dev:MediaWiki:DiscussionsRC.js',    'u:dev:MediaWiki:FastDelete/code.js',    'u:dev:MediaWiki:InfoboxEditorPreview.js',    'u:dev:MediaWiki:LastEdited/code.js',    'u:dev:MediaWiki:NoImageLightbox/code.js',    'u:dev:MediaWiki:PortableCSSPad/code.js',    'u:dev:MediaWiki:PortableListUsers.js',    'u:dev:MediaWiki:PurgeButton/code.js',    'u:dev:MediaWiki:QuickDiff/code.js',    'u:dev:MediaWiki:ReturnOasisCat.js',    'u:dev:MediaWiki:ShowWikiManagerOnToolbar.js',    'u:dev:MediaWiki:Sofix.js',    'u:dev:MediaWiki:StickyRailToggler.js',    'u:dev:MediaWiki:SyntaxHighlight.js', 'u:dev:MediaWiki:ThemeToggler.js', 'u:dev:MediaWiki:View_Source/code.js' ] });

// Adds edit links to Special:WhatLinksHere if (mw.config.get('wgCanonicalSpecialPageName') === 'Whatlinkshere') { $('#mw-whatlinkshere-list li').each(function {       var $this = $(this);        $this.find('.mw-whatlinkshere-tools').before( $(' ', {               'class': 'mw-whatlinkshere-edit'            }).append(                '(', $('', {                   href: mw.util.getUrl($this.find('> a').text, { action: 'edit' }),                   text: 'edit',                    title: 'Edit form'                }), ')'           ),            ' '        );    }); }

//format numbers in profile header //@author User:DarkBarbarian //formatNumbersProfileHeader function taken from https://dev.fandom.com/wiki/MediaWiki:ProfileTags.js?oldid=142816

//0 in JS (German style) function formatNumbers(num) { if (num.length > 3) { for (var i = -3; i > -num.length; i -= 4) { num = num.slice(0, i) + '.' + num.slice(i); }   }    return num; }

function formatNumbersProfileHeader { var conf = mw.config.get([           'wgCanonicalNamespace',            'wgCanonicalSpecialPageName',            'wgTitle'        ]); mw.loader.using(['mediawiki.util', 'site'], function {       // UCP, User box may take forever to load and there is no event that fires when it does load        // so we must continually check for its existence until it loads        var namespace = conf.wgCanonicalNamespace,            specialName = conf.wgCanonicalSpecialPageName,            notSubpage = (conf.wgTitle || '').indexOf('/') === -1;        if ( ((namespace === 'User') && notSubpage) || (namespace === 'Message_Wall') || ((namespace === 'User_blog') && notSubpage) || (specialName === 'Contributions') || (specialName === 'UserProfileActivity') ) {           var __init = function {                if ($('.user-identity-box').length) {                    var edits = document.querySelector('.user-identity-stats > li:nth-child(1) > a:nth-child(1) > strong:nth-child(1)'),                        posts = document.querySelector('.user-identity-stats > li:nth-child(2) > a:nth-child(1) > strong:nth-child(1)');                    edits.innerHTML = formatNumbers(edits.innerHTML);                    posts.innerHTML = formatNumbers(posts.innerHTML);                } else {                    setTimeout(__init, 500);                }            };            __init;        }    }); }

$(formatNumbersProfileHeader);

// FastDelete buttons var fdButtons = []; fdButtons[fdButtons.length] = {'summary': 'Vandalism', 'label': 'V'}; fdButtons[fdButtons.length] = {'summary': 'Spam', 'label': 'S'}; fdButtons[fdButtons.length] = {'summary': 'Cleanup', 'label': 'C↑'}; fdButtons[fdButtons.length] = {'summary': 'Violation of the ToU', 'label': 'ToU'}; fdButtons[fdButtons.length] = {'summary': 'Erfüllt nicht Mindeststandards', 'label': 'AfA'};

if (wgCanonicalSpecialPageName == "Multidelete") { importSOAPScripts(['Mediawiki:MultiDeleteImprove.js']); }

if ([14379, 65099].indexOf(mw.config.get('wgCityId')) >= 0) { var rrMyAnswers = ['Done, thanks for the report!', 'Done, thanks!' ]; importSOAPScripts([       'MediaWiki:ReportResponses.js'    ]); }

// Bypass Special:InfoboxBuilder by Nanaki if ($('.template-classification-type-text').data('type') == 'infobox') $('#ca-edit').attr('href', function(a) {   return this.href + '&useeditor=source'; }); if (window.location.pathname.indexOf('InfoboxBuilder') != -1) { var lname = window.location.pathname.split('InfoboxBuilder/')[1]; location.replace(document.URL.replace(window.location.href.split('/wiki/')[1],'Template:' + lname + '?action=edit&useeditor=source')); }

//FD $(function {	if (mw.config.get('wgWikiaEnvironment') !== "sandbox") return;	if (mw.config.get('wgCanonicalSpecialPageName') !== "ThemeDesigner") return;	if (mw.config.get('themeDesignerState') === null) location.reload; }); mw.loader.using('mediawiki.api').then(function{	if (mw.config.get('wgWikiaEnvironment') !== "sandbox") return;	if (mw.config.get('skin') === "fandomdesktop") return;	if (mw.config.get('wgCanonicalSpecialPageName') === "ThemeDesigner") return;	new mw.Api.saveOption('skin','fandomdesktop').then(function { location.reload; }); });

//PortableListUsers customizations window.PortableListUsers = { avatars: false };

//Enable personal JS for Sofix window.Sofix = { enablePersonalUse: true };

// DotSyntaxHighlighter by Rail var syntaxHighlighterSiteConfig = syntaxHighlighterSiteConfig || {}; syntaxHighlighterSiteConfig.timeout = 150;