MediaWiki:Common.js

From Super Mario World Speedrunning Wiki
Revision as of 02:23, 11 May 2017 by IsoFrieze (talk | contribs)
Jump to: navigation, search
/* Any JavaScript here will be loaded for all users on every page load. */

/* put here by Dotsarecoolp */
$(document).ready(function() {
    $(".yt-ll-data[title]").each(function() {
        var url = $(this).attr("title");
        $(this).css("background-image","url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><polygon points='0,0 100,50 0,100' style='fill:white;' /></svg>\"),url(https://img.youtube.com/vi/" + url + "/0.jpg)");
        $(this).click(function() {
            $(this).html("<iframe width='100%' height='100%' src='https://www.youtube.com/embed/" + url + "' frameborder='0'></iframe>");
        });
    });
});