Template:YouTubeWithCommonsFallback: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
optional
No edit summary
Line 45: Line 45:
</div><!-- /video-outer-wrapper -->
</div><!-- /video-outer-wrapper -->
<script>
<script>
$(".video-placeholder").click(function () {
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").click(function(event){
$(".video-placeholder").click(function () {
$(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();
}
}
}



Revision as of 21:02, 11 May 2016

This video hosted by YouTube.com is subject to its Terms of Use and Privacy Policy. If you prefer, https://commons.wikimedia.org/wiki/File:The_Impact_Of_Wikipedia.webm">view on Wikimedia Commons.

{{YouTubeWithCommonsFallback
| placeholder = Wikipedia_Puzzle_Globe.jpg
| youtube     = 3Knv6D6Thi0
| commons     = File:The_Impact_Of_Wikipedia.webm
| caption     = Caption
| width       = 640
}}