User:Trollocool/global.js

/* chat hacks */ importScriptPage('MediaWiki:TrollocoolChatHacks.js', 'de.trollocool');

importArticles({   type: 'script',    articles: [        'u:dev:PurgeButton/code.js',        'w:dev:MediaWiki:WallGreetingButton/code.js'    ] });

if($.getUrlVar('veaction') == 'edit') location.replace(document.URL.replace('veaction','action'));

/*Verhinderung vom Infobox Builder | Code by Kopcap94*/

(function( $, mw ) {   if ( mw.config.get( 'wgNamespaceNumber' ) !== 10 && !$( '.noarticletext' ).lenght ) return;    var default_infobox =         ' \n' +        '    \n' +        '         \n' +        '    \n' +        '    \n' +        '    \n' +        '         \n' +        '         \n' +        '    \n' +        ' ',        i18n = {            en: 'Create infobox',            ru: 'Создать инфобокс',            de: 'Infobox erstellen'        },        name = ( typeof i18n[ mw.config.get('wgUserLanguage') ] !== 'undefined' ) ?                i18n[ mw.config.get('wgUserLanguage') ] :                i18n.en ;    $( ' ', { id: 'createTemplate', style: 'margin-top: 2px;', text: name }).appendTo( '#WikiaPageHeader' );   $( '#createTemplate' ).on( 'click', function { if ( !confirm( 'Just protecting. Going to create template, right?' ) ) return; $( this ).html(''); $.post('/api.php', {           action: 'edit',            title: mw.config.get( 'wgPageName' ),            summary: 'Creating new PI',            text: default_infobox,            token: mw.user.tokens.get('editToken'),            format: 'json'        }, function( data ) {            var articleID = data.edit.pageid;            $.post( '/wikia.php?controller=TemplateClassificationApi&method=classifyTemplate&format=json', { type: 'infobox', pageId: articleID, editToken: mw.user.tokens.get('editToken') }, function { var link = location.toString, type = ( link.indexOf( '?' ) > -1 ) ? '&' : '?';               location = link + type + 'action=edit&useeditor=source'; });       });    }); })( this.jQuery, this.mediaWiki );

$('.AccountNavigation .subnav li:first') .before( 'Infoboxen', 'Wikia CSS', 'Mein CSS', 'Global JS</li>');