User:Choocolatiah/common.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:DisplayTimer/code.js',    ] });

/* Adapted from YouTubePlayer & DraggableYouTubePlayer for video previews. */ mw.hook('wikipage.content').add(function($content) {   $content.find('.episodepreview-video').each(function { var $this = $(this), data = $this.data, uri = new mw.Uri('https://www.youtube.com/embed/'), id = (data.id || '').trim, loop = ('' + data.loop).trim; if (data.loaded || id === '') { return; }       uri.path += id; uri.query = { autoplay: window.YoutubePlayerDisableAutoplay ? '0' :               String(data.autoplay || '').trim, loop: loop, playlist: loop === '1' ? id : '', start: String(data.start || '').trim, list: String(data.list || '').trim };

$this.html(           $(' ', { width: String(data.width || '').trim, height: String(data.height || '').trim, src: uri.toString, allowfullscreen: 'true', allow: 'fullscreen' + (loop ? '; autoplay' : '') }));       data.loaded = true; }); });