User:DarkBarbarian/global.js

//Profil- & Begrüßungsvorlagen importScriptPage('MediaWiki:Profilvorlagen.js', 'de.barbar');

//ChatQuotes importScriptPage('User:Wildream/ChatQuote/code.js', 'ru.c');

//Notificationes importScriptPage('MediaWiki:ChatNotifications/code.js', 'dev');

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

//Importierte Codes importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxRename/code.js',        'u:dev:MediaWiki:AdminDashboard JS-Button/code.js',        'u:dev:MediaWiki:AjaxDiff/code.js',        'u:dev:MediaWiki:AjaxEmoticons/code.js',        'u:dev:MediaWiki:AjaxRC/code.js',        'u:dev:MediaWiki:AjaxUndo/code.js',        'u:dev:MediaWiki:ChatHacks.js',        'u:dev:MediaWiki:FastDelete/code.js',        'u:dev:MediaWiki:LastEdited/code.js',        'u:dev:MediaWiki:MessageBlocker/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:Status/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/advanced.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:WorkingMoreUsersCount.js', 'u:dev:MediaWiki:EditConflictAlert/code.js' ] });

//Schnelles Löschen 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'    } ); //Auto-Aktualisierung ajaxPages = ['Special:RecentChanges','Special:WikiActivity','Spezial:Letzte_Änderungen','Spezial:WikiActivity']; ajaxRefresh = 45000; AjaxRCRefreshText = 'Auto-Aktualisierung'; AjaxRCRefreshHoverText = 'Automatische Aktualisierung der gesamten Seite'; //"Neu laden"-Button PurgeButtonText = 'Neu laden';

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

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

//PN-Benachrichtigungen var PrivateMessageAlert = { beepSound: 'http://images3.wikia.nocookie.net/pucky/de/images/6/65/Pling.ogg', message: '$1 schickte eine Nachricht!', notifications: false, alertWhileFocused: false };

importScriptPage('MediaWiki:PrivateMessageAlert/code.js', 'dev');

//Profillink entfernt $('.wds-global-navigation__user-menu .wds-list > li:first').remove;

/*Hotkeys für Vorlagenklassifizierung*/ if (mw.config.get('wgCanonicalNamespace') == 'Template' && mw.config.get('wgAction')=='view') { require(['mw', 'wikia.nirvana'], function(mw, nirvana) {    var types = {         160: 'infobox', // ^         49: 'quote', // 1         50: 'navbox', // 2         51: 'notice', // 3         52: 'context-link', // 4         53: 'infoicon', // 5         54: 'scrollbox', // 6         55: 'references', // 7         56: 'media', // 8         57: 'data', // 9         48: 'design', // 0         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;             }         }); }); }); }

/* Lets the join chat button open in a new tab + let the /chat.css and /chat.js pages work. Originally taken from Monchoman. */ function OpenChatWindow { window.chatwindow = window.open('/Special:Chat'); window.chatwindow.onload = function { //addOnloadHook, importScript, and importStylesheet window.chatwindow.$('body').prepend(' \nfunction importScript(b){var a=wgScript+"?title="+encodeURIComponent(b.replace(/ /g,"_")).replace(/%2F/ig,"/").replace(/%3A/ig,":")+"&action=raw&ctype=text/javascript";return importScriptURI(a)}\nfunction importScriptURI(a){var b=document.createElement("script");b.setAttribute("src",a);b.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(b);return b}\nfunction importScriptPage(b,d){var a="/index.php?title="+encodeURIComponent(b.replace(/ /g,"_")).replace("%2F","/").replace("%3A",":")+"&action=raw&ctype=text/javascript";if(typeof d=="string"){if(d.indexOf("://")==-1){a="http://"+d+".wikia.com"+a}else{a=d+a}}return importScriptURI(a)}\nfunction importStylesheet(a){return importStylesheetURI(wgScript+"?action=raw&ctype=text/css&title="+encodeURIComponent(a.replace(/ /g,"_")))}\nfunction importStylesheetURI(b,d){var a=document.createElement("link");a.type="text/css";a.rel="stylesheet";a.href=b;if(d){a.media=d}document.getElementsByTagName("head")[0].appendChild(a);return a}\nfunction importStylesheetPage(b,d){var a="/index.php?title="+encodeURIComponent(b.replace(/ /g,"_")).replace("%2F","/").replace("%3A",":")+"&action=raw&ctype=text/css";if(typeof d=="string"){if(d.indexOf("://")==-1){a="http://"+d+".wikia.com"+a}else{a=d+a}}return importStylesheetURI(a)}\n//This isn\'t the same as the regular addOnloadHook, because the regular one runs from a script tag in the body that I don\'t feel like appending. It\'s easier to just make it $(function), which is essentially equivalent\nfunction addOnloadHook(func) {$(func);}\n ');       //global.js        window.chatwindow.importScriptURI('http://community.wikia.com/index.php?title=User:' + wgUserName + '/global.js&action=raw&ctype=text/javascript');        //chat.js        window.chatwindow.importScriptURI(wgServer + '/index.php?title=User:' + wgUserName + '/chat.js&action=raw&ctype=text/javascript');        //global.css        window.chatwindow.importStylesheetURI('http://community.wikia.com/index.php?title=User:' + wgUserName + '/global.css&action=raw&ctype=text/css');        //chat.css        window.chatwindow.importStylesheetURI(wgServer + '/index.php?title=User:' + wgUserName + '/chat.css&action=raw&ctype=text/css');

}; }

//Buttons im Account-Menü $('.wds-global-navigation__user-menu .wds-list > li:first').before('global.js');

//Infobox-Builder umgehen if (window.location.pathname.indexOf('Spezial:InfoboxBuilder') != -1) { var name = window.location.pathname.split('Spezial:InfoboxBuilder/')[1]; location.replace(document.URL.replace(window.location.href.split('/wiki/')[1],'Vorlage:'+name+'?action=edit&useeditor=source')); } if (window.location.pathname.indexOf('Special:InfoboxBuilder') != -1) { var name = window.location.pathname.split('Special:InfoboxBuilder/')[1]; location.replace(document.URL.replace(window.location.href.split('/wiki/')[1],'Template:'+name+'?action=edit&useeditor=source')); }

//Direktlink zu den RecentChanges (Vorlage: 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 verlinkt zum Profil */ $('.wds-global-navigation__dropdown-toggle .wds-avatar').wrap($('', { href: mw.util.wikiGetlink('User:' + mw.config.get('wgUserName')) }));