MediaWiki:Common.js: Difference between revisions
imported>Lawiki1534virus  Iframe test for BitChute  | 
				 Created page with "→Any JavaScript here will be loaded for all users on every page load.:  $("#iframeloader-GoodIntentions").replaceWith('<iframe src=https://www.bitchute.com/embed/UNBNbGMM1B..."  | 
				||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */  | /* Any JavaScript here will be loaded for all users on every page load. */  | ||
/  | $("#iframeloader-GoodIntentions").replaceWith('<iframe src=https://www.bitchute.com/embed/UNBNbGMM1B1q/ WIDTH=480 HEIGHT=360>');  | ||
$("#iframeloader-ABabyToy").replaceWith('<iframe src=https://www.bitchute.com/embed/7ONLxUCacy4c/ WIDTH=480 HEIGHT=360>');  | |||
$("#iframeloader-JingleBellsReversed").replaceWith('<iframe src=https://www.bitchute.com/embed/gyxTQDvlDDay/ WIDTH=480 HEIGHT=360>');  | |||
$("#iframeloader-ChrisTheJackOLantern").replaceWith('<iframe src=https://www.bitchute.com/embed/BzK2JS21Ng5l/ WIDTH=480 HEIGHT=360>');  | |||
function   | /* BitChute Player (adapted from YouTube player .js) */  | ||
mw.hook('wikipage.content').add(function($content) {  | |||
     $content.find('.bitchuteplayer:not(.loaded)').each(function() {  | |||
        var $this = $(this),  | |||
            data = $this.data(),  | |||
            uri = new mw.Uri('https://www.bitchute.com/embed/'),  | |||
            id = String(data.id || '').trim();  | |||
        if (id === '') {  | |||
            console.warn('[BitChute Player] Video ID is not defined.');  | |||
            return;  | |||
         '  |         }  | ||
        uri.path += id;  | |||
        $this.html(  | |||
            $('<iframe>', {  | |||
                width: String(data.width || '').trim(),  | |||
                height: String(data.height || '').trim(),  | |||
                src: uri.toString(),  | |||
            })  | |||
         ).addClass('loaded');  | |||
     });  | |||
});  | });  | ||