User:Cörey/global.js

var qtEnableUserPageOverwrite = true; window.ajaxRefresh = 5000; var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'Spam', 'label': 'Spam' }; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping', 'label': 'Housekeeping' }; 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',    ] });

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 { \                 display: none; \             } \        '); }

importScriptPage('MediaWiki:RedirectManagement.js', 'corey'); importScriptPage('MediaWiki:EasyPublish.js', 'corey'); importScriptPage('AjaxUndo/code.js', 'dev'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); $.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'); }); $('ul.tools li:first-child').before('Abuse Filter'); $('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));    } /* if ("Special:Log/chatconnect".indexOf(mw.config.get('wgPageName')) !== -1) {   $('li.mw-logline-chatconnect').each(function { var IP = $(this).text.match(/((?:\d{1,3}\.){3}\d{1,3})/)[0], //IP username = decodeURIComponent($(this).children('a.mw-userlink,a.new mw-userlink').attr('href').split(':')[1])+'\n', text = IP + ' ' + decodeURIComponent($(this).children('a.mw-userlink,a.new mw-userlink').attr('href').split(':')[1])+'\n', //Username IPLookup = '(<a href="http://myip.ms/info/whois/'+IP+'">lookup</a>',      IPContribs = ' | <a href="/wiki/Special:Contributions/'+IP+'">contribs</a>',      IPBlock = ' | <a href="/wiki/Special:Block/'+IP+'">block</a>';      IPHistory = ' | <a href="/wiki/Special:Log/chatconnect?user='+username+'">history</a>)'; $(this).append(IPLookup).append(IPContribs).append(IPBlock).append(IPHistory); $('#output-box').append(text); });  $('#button-filter').click(function  { var uniqueDetails = [], nameList = $('#output-box').val; $.each(nameList.split(/\n/), function(i, details) {        if ($.inArray(details, uniqueDetails) === -1) 	    uniqueDetails.push(details);      }); $('#output-box').val(uniqueDetails.sort.join('\n').trim); }); }
 * Advanced chatconnect log interface
 * Filter button for all unique IPs to users in chat in a text box + IP lookup, contribs and block links
 * @author Ozuzanna

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