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:AjaxUndo/code.js',        'u:dev:MediaWiki:PortableCSSPad/code.js',        'u:dev:MediaWiki:ChatBlockButton/code.2.js',        'u:dev:MediaWiki:ViewRemoved/code.js',        'u:corey:MediaWiki:RedirectManagement.js',        'u:corey:MediaWiki:EasyPublish.js',        'u:internal.community:MediaWiki:ChatConnect.js',        'u:dev:MediaWiki:AjaxBatchDelete/code.js'    ] });

$.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('Abuse Filter</a></li>'); $('ul.tools li:first-child').before('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 here</a> for it to be 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);