MediaWiki:Common.js: Difference between revisions

From Screamer Wiki
Jump to: navigation, search
No edit summary
No edit summary
Line 8: Line 8:


/* YouTube Embed /*
/* YouTube Embed /*
$ ("#iframeloader-KfeeBehindScenes").replaceWith('<iframe width="854" height="480" src="https://www.youtube.com/embed/lnnxURHT2Ak" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')
$ ("#iframeloader-KfeeBehindScenes").replaceWith('<iframe width="480" height="360" src="https://www.youtube.com/embed/lnnxURHT2Ak" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')





Revision as of 23:00, 19 August 2019

/* 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>');
$("#Attributions").replaceWith('<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.');


/* YouTube Embed /*
$ ("#iframeloader-KfeeBehindScenes").replaceWith('<iframe width="480" height="360" src="https://www.youtube.com/embed/lnnxURHT2Ak" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')




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