User:DarkBarbarian/global.js

//Standard_Edit_Summary window.dev = window.dev || {}; window.dev.editSummaries = { css: '#stdSummaries {width: 265px;}', select: [ '(Wählen)', 'Inhalt', [ 'typo', 'Korrektur', 'Ergänzung' ],       'Aufräumen', [ 'cleanup', 'Löschantrag', 'Duplikat' ],       'Vandalismus/Spam', [ 'Reverting vandalism', 'Reverting spam', 'Spam entfernt', 'Vandalismus zurückgesetzt' ],       'ILL', [ '+de', '+en', '+de +en', '+ru', '+it', '+es', '+fi', '+fr', '+pt-br', '+uk', '+ko', '+ja', ],   ] };

//FastDelete window.fdButtons = []; window.fdButtons.push({       summary: 'Nicht mehr benötigt',        label: 'NmB'    }, {        summary: 'Kein erkennbarer Mehrwert',        label: 'KeM'    }, {        summary: 'Bereits vorhanden',        label: 'Bv'    }, {        summary: 'Spam',        label: 'S'    } ); //AjaxRC ajaxPages = ['Special:RecentChanges','Special:WikiActivity','Spezial:Letzte_Änderungen','Spezial:WikiActivity']; ajaxRefresh = 45000; AjaxRCRefreshText = 'Auto-Aktualisierung'; AjaxRCRefreshHoverText = 'Automatische Aktualisierung der gesamten Seite';

//AjaxDiff AjaxDiff = { expiry: "3 days", reason: "vandalism" };

//WHAM WHAMBotMe = true; WHAMBotReason = "cleanup"; WHAMDelay = 100; WHAMDeleteReason = "cleanup";

//PurgeButton PurgeButtonText = 'Purge';

//AjaxBlock window.AjaxBlock = { expiryTimes: { '2 hours': '2 Stunden', '1 day': '1 Tag', '3 days': '3 Tage', '1 week': '1 Woche', '2 weeks': '2 Wochen', '1 month': '1 Monat', '3 months': '3 Monate', '6 months': '6 Monate', '1 year': '1 Jahr', 'never': 'Unbeschränkt' },   blockReasons: { 'Vandalismus': 'Vandalismus', 'Spam': 'Spam', 'Entfernen von Inhalt': 'Blanking', 'Sperrumgehung': 'Sperrumgehung' },   check: { talk: true, autoBlock: true, override: false } };

//Template classification hotkeys (additon to VanguardTools) if (mw.config.get('wgCanonicalNamespace') == 'Template' && mw.config.get('wgAction')=='view') { require(['mw', 'wikia.nirvana'], function(mw, nirvana) {    var types = {         160: 'infobox', // ^         63: 'navigation', // ?         192: 'nonarticle' // ´     };     document.addEventListener('keyup', function(event) { var type = types[event.which || event.keyCode]; nirvana.sendRequest({            controller: 'TemplateClassificationApi',             method: 'classifyTemplate',             data: {                 pageId: mw.config.get('wgArticleId'),                 type: type,                 editToken: mw.user.tokens.values.editToken             },             callback: function {                 document.getElementsByClassName('template-classification-type-label')[0].innerHTML = type;                 var notification = new BannerNotification('Successfully changed template type to: ' + type, 'confirm');                 notification.show;             }         }); }); }); }

//global.js button in account menu $('.wds-global-navigation__user-menu .wds-list > li:first').before('global.js');

//link to RecentChangesMultiple (inspired by: http://dev.wikia.com/wiki/MediaWiki:PortableCSSPad/code.js) $(function ($) {		var WikiaBar = window.WikiaBar,			$link = $('RCMultiple'),			$listItem = $('').append($link);

if (WikiaBar) { WikiaBar.wikiaBarWrapperObj.off('click', WikiaBar.clickTrackingHandler); WikiaBar.wikiaBarCollapseWrapperObj.off('click', WikiaBar.clickTrackingHandler); WikiaBar.wikiaBarWrapperObj.find('.tools').append($listItem); } });

//User avatar links to profile $('.wds-dropdown.wds-global-navigation__user-menu.wds-has-shadow.wds-global-navigation__user-logged-in .wds-avatar').wrap($('', { href: mw.util.wikiGetlink('User:' + mw.config.get('wgUserName')) }));

//Highlight whitespace characters in diffs when they're the only thing in the change //Winner of most conspicuous missing feature for five consecutive years if (window.location.href.indexOf('diff=') !== -1) { $('.diffchange-inline').each(function {       if (!(new RegExp('\\S+').test($(this).text))) {            $(this).css('background-color', 'red');        }    }); }

//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'                }), ')'           ),            ' '        );    }); }

//GlobalChatJS window.wgWikiaChatWindowFeatures = '';

//LastEdited window.lastEdited = { diffModal: false };

//add link to draft on top of infobox draft box if (wgCanonicalNamespace === "Template") { $(function linkToDraft {       //determine name of draft in wiki's language        var draftName;        switch(wgContentLanguage) {            case "en":                draftName = "Draft";                break;            case "de":                draftName = "Entwurf";                break;            default:                draftName = "Entwurf";        }        //if it's already the draft page, abort        var re = new RegExp("/" + draftName + "$");        if (re.test(wgTitle)) return;        //add the link        var link = wgServer + wgScriptPath + "/wiki/" + wgPageName + "/" + draftName;        $(".WikiaRail .templatedraft-module").before("Entwurf");    }); }

//BackToFile $(function backToFile {   var urlString = window.location.href;    if (urlString.indexOf("?wpDestFile") === -1 || wgCanonicalSpecialPageName !== "Upload") return;    var url = new URL(urlString);    var link = wgServer + wgScriptPath +  "/wiki/File:" +  url.searchParams.get("wpDestFile");    $("div#uploadtext").before("<< Zurück zur Datei"); });

//QuickCreateUserPage window.qtEnableUserPageOverwrite = true;

//Imported Codes importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxRename/code.js',        'u:dev:MediaWiki:AjaxDiff/code.js',        'u:dev:MediaWiki:AjaxRC/code.js',        'u:dev:MediaWiki:AjaxUndo/code.js',        'u:dev:MediaWiki:FastDelete/code.js',        'u:dev:MediaWiki:QuickDiff/code.js',        'u:dev:MediaWiki:LastEdited/code.js',        'u:dev:MediaWiki:PortableCSSPad/code.js',        'u:dev:MediaWiki:PurgeButton/code.js',        'u:dev:MediaWiki:RecentChangesMultiple/code.2.js',        'u:dev:MediaWiki:RevealAnonIP/code.js',        'u:dev:MediaWiki:Rollback/code.js',        'u:dev:MediaWiki:Standard_Edit_Summary/code.js',        'u:dev:MediaWiki:View_Source/code.js',        'u:dev:MediaWiki:ViewRemoved/code.js',        'u:dev:MediaWiki:WallGreetingButton/code.js',        'u:dev:MediaWiki:QuickComments/code.js',        'u:dev:MediaWiki:WHAM/code.2.js',        'u:dev:MediaWiki:Wikimarks/code.js', 'u:dev:MediaWiki:MassBlock/code.js', 'u:dev:MediaWiki:FindAndReplace/code.js', 'u:dev:MediaWiki:UserCheck/code.js', 'u:dev:MediaWiki:ContribsLink/code.js', 'u:dev:MediaWiki:SearchSuggest/code.js', 'u:dev:MediaWiki:QuickToolsv2/code.js', 'u:dev:MediaWiki:EditConflictAlert/code.js', 'u:dev:MediaWiki:AjaxPatrol/code.js', 'u:dev:MediaWiki:DiscussionsFeed.js', 'u:dev:MediaWiki:FileUsageAuto-update/code.js', 'u:dev:MediaWiki:MultiUpload/code.js', 'u:dev:MediaWiki:VSTFReport.js', 'u:dev:MediaWiki:VanguardTools.js', 'u:dev:MediaWiki:ProtectionIcons.js', 'u:dev:MediaWiki:AjaxBlock/code.js', 'u:dev:MediaWiki:GlobalChatJS.js', 'u:dev:MediaWiki:QuickCreateUserPage/code.js', 'u:dev:MediaWiki:LinkToDiscussionsProfileIfTheyDontHaveLivePosts/code.js', 'u:dev:MediaWiki:SavedDrafts.js', 'u:dev:MediaWiki:AjaxRedirect/code.js', 'u:dev:MediaWiki:PortableListUsers.js' ] });

//remove profile button in account menu //$('.wds-global-navigation__user-menu .wds-list > li > a[data-tracking-label="account.profile"]').remove;