FANDOM


Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Chrome - Windows: Hold the Ctrl key and press the F5 key. OS X: Hold both the ⌘ Cmd and ⇧ Shift keys and press the R key.
  • Safari - Hold down the ⇧ Shift key and click the Reload toolbar button.
  • Firefox - Windows: Hold the Ctrl key, and press F5. OS X: Hold the ⌘ Cmd and ⇧ Shift keys, and then press R.
  • Internet Explorer - Hold the Ctrl key, and press F5 (or click the Refresh button).
/**** Any JavaScript here will be loaded for all users on every page load. ****/
 
/* Auto-Refresh */
window.ajaxPages = ["Special:RecentChanges","Special:Watchlist","Special:WikiActivity","Special:Log","Special:Contributions"];
window.AjaxRCRefreshText = 'Auto-refresh';
window.AjaxRCRefreshHoverText = 'Automatically refresh the page';
 
/* ####################################
    Dev and MediaWiki imports
   #################################### */
 
importArticles({
    type: "style",
    articles: [
        'MediaWiki:AdminHighlighting.css',
        'MediaWiki:Poll.css'
    ]
});
 
/* ################################
    On-load stuff
   ################################ */
 
$(function() {
 
    /* ####################################
        Jingle Jam Livestreams
       #################################### */
 
        var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,
            function(c) {
                var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
                return v.toString(16);
            });
            console.log(uuid);
            $.getJSON( "https://humble.pubnub.com/subscribe/6b5eeae3-796b-11df-8b2d-ef048cc31d2e/humbleyogscast_jinglejam_2017/0/15121702890522216?uuid="+uuid+"&pnsdk=PubNub-JS-Web%2F3.14.1", function( data ) {
                total = data[0][0]['stats']['rawtotal'];
                total = "$" + total.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
                console.log(total);
                $("#donations-total").text(total);
                number = data[0][0]['stats']['numberofcontributions']['total']
                number = number.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
                $("#donations-number").text(number);
            })
 
 
    /* ####################################
        Livestream V2
       #################################### */
 
    if ($("#twitch-online").length > 0) {
 
        // Yogscast twitch names
        var names = [
            "Yogscast",
            "PyrionFlax",
            "sips_",
            "HatFilms",
            "TheFyreUK",
            "Rythian",
            "ZoeyProasheck",
            "WilliamStrife",
            "YogsLomadia",
            "Turps",
            "InTheLittleWood",
            "Sjin",
            "BebopVox",
            "SoTotallyToby",
            "Nilesy",
            "CaffCast",
            "HeyChrissa"
        ];
 
        for (var i = 0; i < names.length; i++) {
            var name = names[i];
            $.ajax({
                type: 'GET',
                url: 'https://api.twitch.tv/kraken/streams/' + name,
                headers: {
                    'Client-ID': 'jpseb9skikaxrtxvj7hwpxbqb4ulcge'
                },
                success: function(json) {
                    if (json.stream === null) {
                        // No current stream
                    } else {
                        var channelString = mw.html.escape(json._links.channel);
                        var channelGameString = mw.html.escape(json.stream.game);
                        channelString = channelString.replace("https://api.twitch.tv/kraken/channels/", "");
                        $("#twitch-online").append("<div class=\"live-user\"><a href=\"https://twitch.tv/" + channelString + "\"><img src=\"https://vignette.wikia.nocookie.net/yogscast/images/e/e4/Twitch-square.png/revision/latest/scale-to-width-down/26\"><div class=\"live-text\">" + channelString + "</div><span class=\"twitch-desc\">" + channelGameString + "</span></a></div>");
                        $(".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 = mw.html.escape(json.items[i].snippet.title);
                var channelID = mw.html.escape(json.items[i].snippet.channelId);
                if (json.items[i].snippet.liveBroadcastContent == "none") {
                    //$("#ytgaming-online").append( "<div class=\"live-user\"><a href=\"https://gaming.youtube.com/watch?v="+ytstreams[i]+"\"><img src=\"ytgaming-square.png\"><div class=\"live-text\">"+ytnames[i] + "</div><span class=\"twitch-desc\">"+ titleString +"</span></a></div>");
                } else {
                    $("#twitch-online").append("<div class=\"live-user\"><a href=\"https://gaming.youtube.com/watch?v=" + ytstreams[i] + "\"><img src=\"https://vignette.wikia.nocookie.net/yogscast/images/4/42/Ytgaming-square.png/revision/latest/scale-to-width-down/26\"><div class=\"live-text\">" + ytnames[i] + "</div><span class=\"twitch-desc\">" + titleString + "</span></a></div>");
                    $(".sidebar-livestreams").css("display", "block");
                }
            }
        });
 
    }
});