User:Shining-Armor/global.js

importScriptURI('http://vstf.wikia.com/index.php?title=User:Sactage/EasyCURangeCalc.js&action=raw&ctype=text/javascript');

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

if (mw.config.get('wgPageName') === 'Special:Torus') { $('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 { \                 display: none; \             } \        '); } window.ajaxPages = [ "Special:RecentChanges", "Special:Watchlist", "Special:Log", "Special:Contributions" ];

var qtUserPageTemplate = ""; var qtEnableUserPageOverwrite = true;

var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'Spam', 'label': 'S' }; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping', 'label': 'H' };

importArticles({   type: "script",    articles: [        "u:dev:WHAM/code.js",        "u:cpw:MediaWiki:Gadget-HotCat.js",        "u:dev:FastDelete/code.js",        "u:dev:AjaxBatchDelete/code.js",        "u:dev:AjaxRC/code.js",        "u:dev:AjaxUndo/code.js",        "u:dev:RevealAnonIP/usercode.js",        "u:dev:QuickCreateUserPage/code.js",        "u:cod:User:Sactage/scripts/Speedy-Comments.js"    ] });

// Youtube info // Written by User:Sactage 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)); }