User:Lawiki1534virus/common.js: Difference between revisions

From Screamer Wiki
Jump to navigation Jump to search
imported>Lawiki1534virus
test
imported>Lawiki1534virus
Removing all content from page
 
Line 1: Line 1:
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(),
            loop = String(data.loop || '').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(),
                allowfullscreen: 'true',
                allow: 'fullscreen' + (loop ? '; autoplay' : '')
            })
        ).addClass('loaded');
    });
});

Latest revision as of 00:04, 12 May 2019