User:GerritH/global.js

// Buttons if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png", "speedTip": "Weiterleitung", "tagOpen": "#REDIRECT ", "tagClose": "" }; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://upload.wikimedia.org/wikipedia/commons/0/05/Button_Anf%C3%BChrung.png", "speedTip": "Anführungszeichen", "tagOpen": "„", "tagClose": "“" }; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png", "speedTip": "Adoption", "tagOpen": "" }; } window.AjaxCommentDeleteConfig = {vocab:{linkText:"AjaxDelete"},fastDelete:"Clean-up"};

window.AdvancedOasisUI = {RCHeader:false,lightbox:false,activity2RC:false};

anchoredRollbackBot = true;

window.lastEdited = {avatar: false,size: false};

PRAoptions = {editSummary: 'Automatic page link update'}

// check http://dev.wikia.com/wiki/Special:RecentChanges for changes importArticles({   type: 'script',    articles: [    'u:kocka:AjaxCommentDelete/code.js',    'u:dev:AdvancedOasisUI/code.js',    'u:dev:AnchoredRollback/code.js',    'u:dev:LastEdited/code.js',    'u:dev:PageRenameAuto-update/code.js',    'u:dev:AjaxDiff/code.js',    'u:dev:ViewRemovedAlways/code.js',    'u:dev:View_Source/code.js',    'u:dev:RevealAnonIP/code.js',    'u:dev:PortableCSSPad/code.js',    'u:dev:ExpandGlobalNavDropdownsOnHover/code.js',    'u:dev:AjaxPatrol/code.js',    'u:dev:QuickToolsv2/code.js',    'u:dev:RecentChangesMultiple/code.2.js',    'u:dev:AjaxBatchDelete/code.2.js',    'u:dev:RedirectManagement/code.js',    'u:dev:AntiSoundcloud/code.js',    'u:dev:AllPagesHideRedirect/code.js',    'u:dev:Thread_Inspection/code.js',    'u:dev:CacheCheck/code.js',    'u:dev:QuickDiff/code.js',    'u:dev:QuickDelete/code.js',    'u:dev:WHAM/code.2.js',    'u:dev:SearchSuggest/code.js', 'u:dev:FindAndReplace/code.js', 'u:dev:SkinSwitchButton/code.js', 'u:dev:BackToTopButton/code.js', 'u:dev:GiveChatModPrompt/code.js', 'u:dev:ListFiles/code.js', 'u:dev:FileUsageAuto-update/code.js', 'u:dev:CategoryRenameAuto-update/code.js', 'u:dev:ColoredColors/code.js', 'u:dev:GlobalChatJS.js', 'u:dev:QQX/code.js', 'u:community:Interwiki.js', 'u:community:User:AmonFatalis/monobook.js' ] });

qtUserPageTemplate = '';

importScriptURI( 'http://internal.vstf.wikia.com/index.php?title=MediaWiki:CU.js&action=raw&ctype=text/javascript' ); if (wgCanonicalSpecialPageName === 'Contributions') { importStylesheetURI('http://internal.vstf.wikia.com/index.php?title=MediaWiki:NiceButtons.css&action=raw&ctype=text/css'); var usernamej2 = $('input[name="target"]').val, usernamej = usernamej2.replace(/_/g,'+'); if(usernamej.match(/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/)) { $('#contentSub >a:first').before("" + usernamej + ""); } } // Add RC link in global nav $('RecentChanges').appendTo('#globalNavigation');

//Add links to toolbar $('Global.css' +  'Global.js' +   'Zusätzliches JS' +   '<a href="/Special:Mypage/wikia.css">Mypage/wikia.css</a></li>' +   '<a href="/Special:Mypage/chat.js">Mypage/chat.js</a></li>' +   '<a href="/wiki/MediaWiki:Recentchangestext?action=history">MediaWiki:Recentchangestext?</a></li>' +   '<a href="/wiki/Special:Watchlist/raw">Watchlist/raw</a></li>' +   '<a href="/wiki/Special:SpecialPages">SpecialPages</a></li>' +   '<a href="/wiki/Special:DoubleRedirects">DoubleRedirects</a></li>' +   '<a href="/wiki/Special:WikiFeatures">WikiFeatures</a></li>' +   '<a href="/wiki/MediaWiki:ImportJS">MediaWiki:ImportJS</a></li>' +   '<a href="/wiki/Special:JSPages">JSPages</a></li>' + '<a href="/wiki/Special:CheckUserLog">CheckUserLog</a></li>' + '<a href="/wiki/Special:Log/chatconnect">Log/chatconnect</a></li>' + '<a href="/wiki/Special:AllPages">AllPages</a></li>' + '<a href="/wiki/Special:PrefixIndex">PrefixIndex</a></li>' + '<a href="/wiki/Special:UnusedFiles">UnusedFiles</a></li>' + '<a href="/wiki/Special:ListGroupRights">ListGroupRights</a></li>' + '<a href="/wiki/Special:ListUsers">ListUsers</a></li>' + '<li><a href="/wiki/Special:ListAdmins">ListAdmins</a></li>')   .insertBefore('.WikiaBarWrapper .tools-menu li:first'); $(function { if( skin == 'oasis' ) { $('<li style="position: absolute; right: -85px; top: 3px; border:none;"><a style="background-color: #00647a; color: #fff; font-weight: bold; font-size: 13px; padding: 1px 4px; border-radius: 4px" href="/wiki/Special:CSS">CSS</a></li>').appendTo('#WikiaBarWrapper .toolbar > .tools'); $('<li style="position: absolute; right: -125px; top: 3px; border:none;"><a style="background-color: #007a64; color: #fff; font-weight: bold; font-size: 13px; padding: 1px 4px; border-radius: 4px" href="/wiki/MediaWiki:Wiki-navigation?action=edit">Nav</a></li>').appendTo('#WikiaBarWrapper .toolbar > .tools'); } });

/** * Ajax Fast Delete * @author Grunny * @version 2.1 * @notes Original FastDelete code was written by Splarka, and later modified by uberfuzzy and Grunny. */ window.fdButtons = []; window.fdButtons.push({summary:'Clean-up',label:'C'},{summary:'Veralteten Default-Import gelöscht',label:'D'}); ( function( $ ) {	"use strict";	// Don't load twice...	if ( typeof window.wkAjaxFastDelete !== 'undefined' ) {		return false;	}	window.wkAjaxFastDelete = {		version: '2.2',

init: function {

if ( wgNamespaceNumber === -1 || !window.fdButtons ) { return; }			var deleteButtons = ''; switch( skin ) { case 'uncyclopedia': case 'wowwiki': case 'monobook': if( !$( '#ca-delete' ).length ) { return; }					for( var i = 0; i < fdButtons.length; i++ ) { deleteButtons += '<li><a style="cursor: pointer;" title="Ajax delete: ' + fdButtons[i].summary + '" data-summary="' + fdButtons[i].summary + '" data-id="fastdelete">' + fdButtons[i].label + '</a></li>'; }					$( '#p-cactions > .pBody > ul' ).append( deleteButtons ); break;

case 'oasis': case 'wikia': if( !$( '.wds-list #ca-delete' ).length ) { return; }					for( var i = 0; i < fdButtons.length; i++ ) { deleteButtons += '<a class="wds-is-squished wds-button" title="one-click delete: ' + fdButtons[i].summary + '" data-summary="' + fdButtons[i].summary + '" data-id="fastdelete">' + fdButtons[i].label + '</a> '; }					switch( wgNamespaceNumber ) { case 2: case 3: if( $( '#UserProfileMasthead' ).length ) { $( 'div.UserProfileActionButton' ).append( deleteButtons ); } else { $( '#WikiaUserPagesHeader > ul.wikia-avatar' ).after( deleteButtons ); }							break; case 500: case 502: $( '#WikiaUserPagesHeader > h1' ).after( deleteButtons ); break; default: $( '.page-header__contribution-buttons' ).prepend( deleteButtons ); break; }					break; }			if( $( 'a[data-id="fastdelete"]' ).length ) { $( 'a[data-id="fastdelete"]' ).click( function {					wkAjaxFastDelete.ajaxDeleteAPage( $( this ).attr( 'data-summary' ) );				} ); }		},		ajaxDeleteAPage: function ( deleteReason ) { var url = wgServer + wgScriptPath + '/api.php?action=query&prop=info&intoken=delete&titles=' + encodeURIComponent( wgPageName ) + '&format=json'; $.getJSON( url, function( data ) {				var	editToken = data.query.pages[wgArticleId].deletetoken,					url = wgServer + wgScriptPath + '/api.php?action=delete&title=' + encodeURIComponent( wgPageName ) + '&reason=' + encodeURIComponent( deleteReason ) + '&format=json&token=' + encodeURIComponent( editToken );				$.post( url, function { document.location.reload; } );			} );		}	};	$(document).ready( wkAjaxFastDelete.init ); }( jQuery ) );

/* Creates an actual "Purge" button, based on http://dev.wikia.com/wiki/MediaWiki:PurgeButton/code.js?oldid=56312 */ ( function ( $, mw ) {   'use strict';    var nsNr = mw.config.get( 'wgNamespaceNumber' );    if ( nsNr < 0 || window.PurgeButtonsLoaded || document.getElementById( 'control_purge' ) ) {        return;    }    window.PurgeButtonsLoaded = true;    $( addPurgeButton );    function purgePage  {        var page = encodeURIComponent( mw.config.get( 'wgPageName' ) );        $.get( '/index.php?title=' + page + '&action=purge', function  { location.reload( true ); } );       $('html,body').css( { display: 'block', overflow: 'hidden' } );       $( '<div style="background: url(\'/skins/common/images/ajax.gif\') no-repeat fixed center center #efefef;height: 100%;left: 0;opacity: 0.25;position: absolute;top: 0;width: 100%;z-index: 1000000000;"> ' ).appendTo( document.body )        .css( 'height', $( window ).height );    }    function addOasisPurgeButton  {        switch (nsNr) {            case 2:            case 3:                $( '.UserProfileActionButton .wikia-menu-button ul' ).append( '<li><a class="custom-purge-button" href="javascript:void(0)" title="Purge page"></a></li>' );               break;            default:                $('.page-header__contribution-buttons').append( '<a class="custom-purge-button wds-button wds-is-squished wds-is-secondary" href="javascript:void(0)" title="Purge page"></a>' );       }    }    function addPurgeButton  {        switch( mw.config.get( 'skin' ) ) {            case 'monobook':                $('#p-cactions > .pBody > ul').append('<li id="ca-purge"><a class="custom-purge-button" href="javascript:void(0)" title="Purge page"></a></li>');                break;            case 'oasis':            case 'wikia':                addOasisPurgeButton;                break;        }        $( '.custom-purge-button' ).text( 'Purge' ).click( purgePage );    }    } ( jQuery, mediaWiki ) );