MediaWiki:Common.js

/**** Any JavaScript here will be loaded for all users on every page load. ****/

/* User Tags */

window.UserTagsJS = { modules: {}, tags: { bureaucrat: { u:'Bureaucrat', order: 0 }, sysop: { u:'Administrator', order: 1 }, rollback: { u:'Rollback', order: 2 }, threadmoderator: { u:'Forum Moderator', order: 3 }, chatmoderator: { u:'Chat Moderator', order: 4 }, yogscast: { u:'Yogscast', order: 5 }, yogmod: { u:'Yogscast Forum Moderator', order:6 }, verified: { u:'Verified', order: 7 }, coder: { u:'Coder', order: 8 }, artist: { u:'Artist', order: 9 }, retired: { u:'Retired', order: 10 }, inactive: { u:'Inactive', order: 11 } } };

UserTagsJS.modules.inactive = 30; UserTagsJS.modules.newuser = true; UserTagsJS.modules.autoconfirmed = true; UserTagsJS.modules.mwGroups = ['bureaucrat', 'rollback', 'threadmoderator', 'chatmoderator', 'patroller', 'sysop', 'bannedfromchat', 'bot', 'bot-global']; UserTagsJS.modules.custom = { 'ActuallyCranks' : ['verified', 'yogmod'], 'Ctrl+Alt+Llama' : ['verified'], 'Cynicalwolf' : ['verified', 'yogmod'], 'DaveChaos' : ['yogscast', 'verified'], 'Ferazhin' : ['yogscast', 'verified'], 'Ghostofsparkles': ['yogscast', 'verified'], 'Hazzat' : ['verified'], 'IAmMaide' : ['verified'], 'IBringTheFunk': ['yogscast', 'verified'], 'Icildor' : ['verified', 'yogmod'], 'Jaderos' : ['verified', 'yogmod'], 'Kaeyidream': ['verified'], 'LittleNom' : ['verified'], 'Lomadia': ['yogscast', 'verified'], 'Matt FyreUK' : ['verified', 'yogscast'], 'Mighty claw' : ['verified', 'yogmod'], 'MintyMinute': ['yogscast', 'verified', 'yogmod'], 'NanoSounds': ['yogscast', 'verified'], 'Napkat' : ['verified', 'yogmod'], 'Radderss' : ['verified'], 'Ravsy': ['yogscast', 'verified'], 'RealTeutron': ['yogscast', 'verified', 'artist'], 'SamStrippin': ['yogscast', 'verified'], 'Smerry95' : ['verified', 'yogscast'], 'SoTotallyToby': ['yogscast', 'verified'], 'Thijsmie' : ['verified'], 'Turpster': ['yogscast', 'verified'], 'Veteranharry' : ['verified', 'yogscast'], 'Yogscast-Tom': ['yogscast', 'verified'], 'Yogszach': ['verified', 'yogmod'],

'AbiHaines': ['retired'], 'Adamo Magus': ['retired'], 'Aethelhelm': ['retired'], 'Cyber-Funk' : ['retired'], 'DarknightWolf' : ['retired'], 'Dragonofelder' : ['inactive'], 'Elfdemon101' : ['retired'], 'Gamerboy555' : ['retired'], 'Guardian of the Garde' : ['artist'], 'MisterGryphon' : ['retired'], 'Nixeu' : ['retired'], 'SnowyNix': ['retired'], 'Space Jam' : ['retired'], 'SwampinBlazes': ['artist'], 'Thepenguin9': ['retired', 'coder'], 'ThinWhiteMale' : ['coder', 'artist'], 'TkaiaWolf': ['retired'], 'Totallyneena' : ['retired'], 'Wolfii' : ['retired'], 'Xasparaz' : ['artist', 'retired'] };

UserTagsJS.modules.metafilter = { };

importArticle({type:'script', article:'w:c:dev:UserTags/code.js'});

/* Auto-Refresh */ window.ajaxPages = ["Special:RecentChanges","Special:Watchlist","Special:WikiActivity","Special:Log","Special:Contributions"]; window.AjaxRCRefreshText = 'Auto-refresh'; window.AjaxRCRefreshHoverText = 'Automatically refresh the page'; importScriptPage('AjaxRC/code.js', 'dev');

// A range of dev.wikia.com imports. For more details // see their respective pages. importArticles({   type: "script",    articles: [        "w:c:dev:RevealAnonIP/code.js",        "w:c:dev:Countdown/code.js",        'w:c:dev:Message/code.js',        "w:c:dev:UserTags/code.js",        "w:c:dev:DisplayClock/code.js",        "w:c:dev:BackToTopButton/code.js"    ] }, {    type: "style",    articles: [        "MediaWiki:AdminHighlighting.css",         "MediaWiki:Poll.css"    ] });

// Twitch and YouTube Gaming Livestreams V2 // // Shows when Yogscast members are broadcasting on Twitch // For more details contact User:Noreplyz

$(function { if($("#twitch-online").length > 0) {

// Yogscast twitch names var names = ["Yogscast", "PyrionFlax", "Strippin", "sips_", "HatFilms", "TheFyreUK", "Dave_Chaos", "Rythian", "ZoeyProasheck", "WilliamStrife", "YogsLomadia", "Turps", "InTheLittleWood", "HybridPanda", "Sjin", "Ridgedog", "BebopVox", "SoTotallyToby"];

for (var i = 0; i < names.length; i++) { var name = names[i]; $.getJSON("https://api.twitch.tv/kraken/streams/" + names[i] + "/?callback=?", function (json) {           var channelString = json._links.channel;            var channelGameString = json.stream.game;            channelString = channelString.replace("https://api.twitch.tv/kraken/channels/", "");            if (json.stream === null) {                     // Twitch changed settings...            } else {                    if (channelGameString.indexOf(":") != -1) {                        channelGameString = channelGameString.slice(0,channelGameString.indexOf(":"));                    }                    if (channelGameString == null) {                        channelGameString = "Online";                    }                    $("#twitch-online").append( "" + channelString + " "+ channelGameString +"  "); $(".sidebar-livestreams").css("display", "block"); }       });    }    // Yogscast YouTube    var ytstreams = ["l6rGXhLfey4", "elmzjRaHfe8", "sYdGOBTBLBo"];    var ytnames = ["Hat Films", "Sjin", "Zoey"];    $.getJSON("https://www.googleapis.com/youtube/v3/videos?part=snippet&id=l6rGXhLfey4%2C+elmzjRaHfe8%2C+sYdGOBTBLBo&fields=items&key=AIzaSyAJsrNQ3KEXbjdcIYR2sds0V0W0R68GItk", function (json) { for (var i = 0; i < 3; i++) { var titleString = json.items[i].snippet.title; var channelID = json.items[i].snippet.channelId; if (json.items[i].snippet.liveBroadcastContent == "none") { //$("#ytgaming-online").append( ""+ytnames[i] + " "+ titleString +"  "); } else { $("#twitch-online").append( ""+ytnames[i] + " <span class=\"twitch-desc\">"+ titleString +" </a> "); $(".sidebar-livestreams").css("display", "block"); }       }    });

} });