User:Lawiki1534virus/common.js: Difference between revisions
Jump to navigation
Jump to search
imported>Lawiki1534virus Removing all content from page |
imported>Lawiki1534virus test |
||
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'); | |||
}); | |||
}); |
Revision as of 23:58, 11 May 2019
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');
});
});