User:Cörey/global.js

var qtEnableUserPageOverwrite = true; window.ajaxRefresh = 5000; var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'Blank Blog', 'label': 'Blank Blog' }; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping', 'label': 'Housekeeping' }; fdButtons[fdButtons.length] = { 'summary': 'Spam', 'label': 'Spam' }; importArticles({   type: 'script',    articles: [        'w:c:dev:WHAM/code.2.js',        "u:dev:FastDelete/code.js",        'w:dev:WallGreetingButton/code.js',        'w:dev:AjaxRC/code.js',        'w:dev:AjaxPatrol/code.js',        'w:dev:QuickCreateMessageWallGreeting/code.js',        'w:dev:QuickCreateUserPage/code.js',        'u:dev:ChatBlockButton/code.2.js',        'u:dev:QuickDelete/code.js',        'u:dev:AbuseLogRC.js',        'u:dev:MediaWiki:PortableCSSPad/code.js',        'u:dev:MediaWiki:ChatBlockButton/code.2.js'    ] });

if (mw.config.get('wgPageName') === 'Special:Torus') { importScriptURI('http://monchbox.wikia.com/wiki/MediaWiki:Torus.js/main.js?action=raw&ctype=text/javascript&templates=expand&t=' + (new Date).getTime); $('head').append(' \            #torus { \                 position: fixed !important; \	         margin-top: 0 !important; \                 top: 0 !important; \	         left: 0 !important; \	         width: 100% !important; \	         height: 100% !important; \             } \             #WikiHeader, \             #WikiaHeader, \             #WikiaBar, \             #globalNavigation, \             .AdminDashboardHeader { \                 display: none; \             } \        '); }

importScriptPage('MediaWiki:RedirectManagement.js', 'corey'); importScriptPage('MediaWiki:EasyPublish.js', 'corey'); importScriptPage('AjaxUndo/code.js', 'dev'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('MediaWiki:ChatConnect.js', 'internal.community'); $.getScript('https://raw.github.com/sactage/wikia-js-snippets/master/ChatOptions.js'); $("a[title^='Special:ListFiles/']").text('Uploaded Files'); $(function { $('Contributions').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Log').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Interlanguage Wikis').insertBefore('.AccountNavigation .subnav li:first');   $('Create a blog post').insertBefore('.AccountNavigation .subnav li:first'); });

$('ul.tools li:first-child').before('<a href="/wiki/Special:AbuseFilter">Abuse Filter</a></li>'); $('ul.tools li:first-child').before('<a href="/wiki/Special:ListGroupRights">Group Rights</a></li>'); /** * To use this script, install it and view:  Special:BlankPage?blankspecial=interlanguage * Borrowed from Thisismyrofl, made by Mathmagician */ if (mediaWiki.config.get('wgCanonicalSpecialPageName') === 'Blankpage' && $.getUrlVar('blankspecial') === 'interlanguage') { (function ($, mw) {		var url = mw.config.get('wgServer') + '/api.php?action=query&meta=siteinfo&siprop=interwikimap&format=json';		// get local interwiki map		$.getJSON(url, function (data) { var interlanguageWikis = [], map = data.query.interwikimap; for (var i = 0, len = map.length; i < len; i++) { if (map[i].language) { interlanguageWikis[interlanguageWikis.length] = map[i]; }			}			// display results in an HTML table $(function {				// generate html				var wiki, link, html, message;				message = ' The ' + mw.config.get('wgSiteName') + ' appears to be available in ' + interlanguageWikis.length + ' language(s).  Do you know of a version of this wiki in a language not listed here? You can make a request <a title="Community Central:Interlanguage link requests" href="http://community.wikia.com/wiki/Community_Central:Interlanguage_link_requests">here</a> for it to be <a title="Help:Interlanguage links" href="http://community.wikia.com/wiki/Help:Interlanguage_links">interlanguage linked</a>. ';				html = ' ' + message + ' ';				// insert html				document.title = 'Interlanguage wikis';				$('#firstHeading, #WikiaArticle h1').first.text('Interlanguage wikis');				$('#mw-content-text').html(html);			}); });	}(jQuery, mediaWiki)); } if (mw.config.get('wgPageName') == "Special:Torus") { importScriptPage('MediaWiki:Torus.js', 'monchbox'); }   if (wgCanonicalSpecialPageName == 'Chat') { NodeChatDiscussion.prototype.ytInfoCache = {}; NodeChatDiscussion.prototype.ytInfo = function(chat) { if(mainRoom.isInitialized && !chat.attributes.isInlineAlert) { var text = chat.attributes.text, search = /https?:\/\/(?:www\.|m\.)?youtube\.com[^ ]+v=([^&# ]*)|https?:\/\/(?:www\.)?youtu\.be\/([^&#\? ]*)/im, match = text.match(search); if (match) { var $link = $("a[href='" + match[0] + "']").last, id = match[1] ? match[1] : match[2]; if (this.ytInfoCache.hasOwnProperty(id)) { return $link.attr('title', this.ytInfoCache[id]); }                                   $.get("http://gdata.youtube.com/feeds/api/videos/" + id + "?v=2&alt=jsonc", function (data) {                                            try {                                                    data = data.data;                                                    var info = data.title + ' | ' + data.uploader + ' | ' + data.uploaded.split(/T/)[0] + ' | ' + (data.viewCount || 0) + ' views';                                                    mainRoom.viewDiscussion.ytInfoCache[id] = info;                                                    $link.attr('title', info);                                            } catch (e) {                                                    console.log('fetching youtube data failed');                                                    console.error(e);                                            } });                           }                    }            }            mainRoom.model.chats.bind('afteradd', $.proxy(mainRoom.viewDiscussion.ytInfo, mainRoom.viewDiscussion));    }

var navColour = window.getComputedStyle(document.querySelector('.navbackground')).getPropertyValue('background-color'); $(".global-navigation-item").css("background-color", navColour);