Difference between revisions of "MediaWiki:Common.js"

From Super Mario World Speedrunning Wiki
Jump to: navigation, search
m
m
Line 3: Line 3:
 
/* put here by Dotsarecoolp */
 
/* put here by Dotsarecoolp */
 
$(document).ready(function() {
 
$(document).ready(function() {
     $(".yt-ll-data [title]").each(function() {
+
     $(".yt-ll-data[title]").each(function() {
 
         var url = $(this).attr("title");
 
         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).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)");

Revision as of 02:23, 11 May 2017

/* 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>");
        });
    });
});