Template:YouTubeWithCommonsFallback: Difference between revisions

Content deleted Content added
optional
No edit summary
Line 45:
</div><!-- /video-outer-wrapper -->
<script>
$(".video-placeholder").click(function inlineScriptWhenReady() {
/* Wrapper function so waits until jQuery ready - see MediaWiki:Common.js */
$(this).replaceWith(
$("<iframe></iframe>", {
class : "video-youtube",
frameborder : 0,
allowfullscreen : 1,
cc_load_policy : 1,
show_info : 0,
enablejsapi : 1,
src : "https://www.youtube-nocookie.com/embed/" + "</html>{{{youtube|3Knv6D6Thi0}}}<html>" + "?rel=0&autoplay=1&origin=wikimediafoundation.org&theme=light&modestbranding=1&color=white"
})
);
});
 
$("a#showcommonsvideo.video-placeholder").click(function (event) {
$(this).replaceWith(
event.preventDefault();
$("<iframe></iframe>", {
showCommonsVideo();
class : "video-youtube",
});
frameborder : 0,
allowfullscreen : 1,
cc_load_policy : 1,
show_info : 0,
enablejsapi : 1,
src : "https://www.youtube-nocookie.com/embed/" + "</html>{{{youtube|3Knv6D6Thi0}}}<html>" + "?rel=0&autoplay=1&origin=wikimediafoundation.org&theme=light&modestbranding=1&color=white"
})
});
});
 
$("a#showcommonsvideo").click(function(event){
if( mw.util.getParamValue( "commons" ) == "true" ){
showCommonsVideo event.preventDefault();
showCommonsVideo();
});
 
if( mw.util.getParamValue( "commons" ) == "true" ){
showCommonsVideo();
}
}