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": "" }; } qtUserPageTemplate = ''; window.AdvancedOasisUI = {RCHeader:false,lightbox:false,activity2RC:false}; window.fdButtons = []; window.fdButtons.push({summary:'Clean-up',label:'C'},{summary:'Veralteten Default-Import gelöscht',label:'D'}); window.AjaxCommentDeleteConfig = {vocab:{linkText:"AjaxDelete"},fastDelete:"Clean-up"}; PurgeButtonText = 'Purge'; anchoredRollbackBot = true; window.lastEdited = {avatar: false,size: false}; PRAoptions = {editSummary: 'Automatic page link update'} importArticles({   type: 'script',    articles: [    'u:dev:MediaWiki:AdvancedOasisUI/code.js',    'u:dev:MediaWiki:FastDelete/code.js',    'u:kocka:MediaWiki:AjaxCommentDelete/code.js',    'u:dev:MediaWiki:PurgeButton/code.js',    'u:dev:MediaWiki:AutoEditDropdown/code.js',    'u:dev:MediaWiki:AjaxDiff/code.js',    'u:dev:MediaWiki:ViewRemovedAlways/code.js',    'u:dev:MediaWiki:AnchoredRollback/code.js',    'u:dev:MediaWiki:LastEdited/code.js',    'u:dev:MediaWiki:PageRenameAuto-update/code.js',    'u:dev:MediaWiki:View_Source/code.js',    'u:dev:MediaWiki:PortableCSSPad/code.js',    'u:dev:MediaWiki:AjaxPatrol/code.js',    'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',    'u:dev:MediaWiki:RedirectManagement/code.js',    'u:dev:MediaWiki:Thread_Inspection/code.js',    'u:dev:MediaWiki:CacheCheck/code.js',    'u:dev:MediaWiki:WHAM/code.2.js',    'u:dev:MediaWiki:SearchSuggest/code.js',    'u:dev:MediaWiki:FindAndReplace/code.js', 'u:dev:MediaWiki:SkinSwitchButton/code.js', 'u:dev:MediaWiki:ListFiles/code.js', 'u:dev:MediaWiki:FileUsageAuto-update/code.js', 'u:dev:MediaWiki:CategoryRenameAuto-update/code.js', 'u:dev:MediaWiki:ColoredColors/code.js' ] });

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 + ""); } }

// http://dev.wikia.com/wiki/MediaWiki:QQX/code.js $(function {    'use strict';    if ($('#ca-lang-qqx').length) {        return;    }    var elem = mw.html,        qstring = (window.location.search) ? '&' : '?',        $qqx = elem.element('li', {id: 'ca-lang-qqx'}, new elem.Raw(                elem.element('a', { href: (window.location.href).replace(/#.*/, '') + qstring + 'uselang=qqx&debug=1', title: 'QQX', }, (window.qqxText || 'QQX')))); if (mw.config.get('skin') === 'oasis') {       $(window.WikiaBar.wikiaBarWrapperObj.find('.tools')).append($qqx);    } else {        $('#p-cactions > .pBody > ul').append($qqx);    } }); // add en $(function {    'use strict';    if ($('#ca-lang-en').length) {        return;    }    var elem = mw.html,        qstring = (window.location.search) ? '&' : '?',        $spaen = elem.element('li', {id: 'ca-lang-en'}, new elem.Raw(                elem.element('a', { href: (window.location.href).replace(/#.*/, '') + qstring + 'uselang=en', title: 'EN', }, (window.spaenText || 'EN')))); if (mw.config.get('skin') === 'oasis') {       $(window.WikiaBar.wikiaBarWrapperObj.find('.tools')).append($spaen);    } else {        $('#p-cactions > .pBody > ul').append($spaen);    } }); /* http://rhythmheaven.wikia.com/wiki/MediaWiki:Wikia.js/editCount.js */ $(function {   var loc = window.location.href;    var username = (wgTitle == "Contributions") ? loc.substring(loc.lastIndexOf("/")+1) : wgTitle;    $('.tabs-container > ul.tabs').append('EC'); }); $(function {   var loc = window.location.href;    var username = (wgTitle == "Contributions") ? loc.substring(loc.lastIndexOf("/")+1) : wgTitle;    $('.tabs-container > ul.tabs').append('LC'); }); $(function {   var loc = window.location.href;    var username = (wgTitle == "Contributions") ? loc.substring(loc.lastIndexOf("/")+1) : wgTitle;    $('.tabs-container > ul.tabs').append('UR'); }); //RC link in global nav $('Letzte Änderungen').appendTo('.global-navigation-container'); //Add Tools $('#my-tools-menu').prepend(' <a href="/wiki/MediaWiki:Recentchangestext">Recentchangestext</a></li>'); $('#my-tools-menu').prepend(' <a href="/wiki/Special:PrefixIndex">PrefixIndex</a></li>'); $('#my-tools-menu').prepend(' <a href="/wiki/Special:SpecialPages">SpecialPages</a></li>'); $('#my-tools-menu').prepend(' <a href="/wiki/Special:ListGroupRights">ListGroupRights</a></li>'); $('#my-tools-menu').prepend(' <a href="/wiki/Special:ListUsers">ListUsers</a></li>'); /* Based on http://kocka.wikia.com/wiki/MediaWiki:AjaxThreadDelete/code.js?oldid=446 by User:KockaAdmiralac */ $(function { if(wgNamespaceNumber !== wgNamespaceIds.thread && wgNamespaceNumber !== wgNamespaceIds.board_thread && wgNamespaceNumber !== wgNamespaceIds.message_wall) return;	var api = new mw.Api,	config = window.AjaxThreadDeleteConfig || {fastDelete: "true"};	$(".message-main .WikiaMenuElement").append("<a href='#' class='AjaxThreadDeleteButton'>AjaxDelete</a></li>");	$(".message-main .WikiaMenuElement .AjaxThreadDeleteButton").click(function(e) {		var superParent = $(e.currentTarget).closest(".SpeechBubble"); function deleteThread {			api.post({				action: 'delete',				pageid: superParent.data.id,				reason: ("Schnelllöschung"),				bot: true,				token: mw.user.tokens.get('editToken')			}).done(function(d)			{				if(!d.error) $("[data-id=" + superParent.data.id + "]").slideToggle;				else new BannerNotification(("Fail") + ": " + d.error.code, 'error').show;			}).fail(function(d) { new BannerNotification(("Fail"), 'error').show; }); }    if(config.fastDelete) deleteThread; }); });

(function($, mw) { var c = mw.config.get([ 'wgPageName', 'wgCanonicalSpecialPageName', 'wgTitle', 'wgAction', 'wgCanonicalNamespace', 'wgNamespaceNumber', 'wgUserGroups', 'wgSiteName', 'skin' ]), escapedPage = encodeURIComponent(c.wgPageName), href, link; /* IP lookup on contribs */ if (c.wgCanonicalSpecialPageName == "Contributions" && c.wgTitle.split('.').length == 4) { href = 'http://myip.ms/info/whois/' + page.split('/')[1],  link = ' <a style="color:white" href="'+href+'">(lookup)</a>';  $('.masthead-info').find('h2').html(link); } /* Create an edit link on Special:MovePage for easy redirecting */ if (c.wgCanonicalSpecialPageName == "Movepage") {  href = $('fieldset').find('a').attr('href') + '?action=edit',  link = ' <a href="'+href+'">(Bearbeiten)</a>';  $('#mw-movepage-table').find('a').first.after(link); } /* Unchecks redirects when moving */ if (c.wgCanonicalSpecialPageName == "Movepage") {  $('#wpLeaveRedirect').removeAttr('checked'); } /* Create move link on Special:ListFiles for users' files listed */ if (c.wgCanonicalSpecialPageName == "Listfiles" && c.wgPageName.split('/').length === 2) { $('.TablePager_col_img_name').each(function {   link = ' (<a href="/wiki/Special:MovePage/File:' + $(this).find('a').first.text + '">move</a>)';     $(this).append(link);  }); } /* Automatic broken redirect delete summary */ if (c.wgAction == "delete" && $('#wpReason').val.slice(0,23) == 'content was: \"#REDIRECT' ) $('#wpReason').val('Broken redirect'); /* Thread history return to thread */ if (c.wgPageName.split(':')[0] == "Thread" && c.wgAction == "history")  $('.SortingBar').after('<a href="/wiki/'+page+'" style="font-size:14px">Back to thread</a>'); /* Special:WhatLinksHere on redirect page */ var h2header = $('#WikiaPageHeader').find('h2'); if (h2header && h2header.text.split('Weitergeleitet von').length == 2) {  link = ' <a href="/wiki/Special:WhatLinksHere/'+h2header.children('a').attr('title')+'">(links)</a> <a href="/wiki/'+h2header.children('a').attr('title')+'?action=history">(history)</a>';  h2header.append(link); } /* Add history button to diffs */ if ($('strong:contains("Changes:")').length)  $('#WikiaPageHeader').find('p').children('a').after(' <a href="?action=history">(history)</a>'); /* Always go to IP contributions, not userpage */ if (c.wgNamespaceNumber == 2 && title.split('.').length == 4) location.replace("/wiki/Special:Contributions/"+mw.config.get('wgPageName').split(':')[1]); }) (this.jQuery, this.mediaWiki);