Template:YouTubeWithCommonsFallback: Difference between revisions
Content deleted Content added
Created page with "<html> <style> .video-outer-wrapper { max-width: </html>{{{width|640}}}<html>px; } .video-wrapper { position: relative; padding-bottom: 56.25%; padding-top: 30..." |
No edit summary |
||
(13 intermediate revisions by 3 users not shown) | |||
Line 40:
</div><!-- /video-wrapper -->
<div class="video-caption" style="text-align:center;">
<p></html>This video hosted by YouTube.com is subject to its
</div>
</div><!-- /video-outer-wrapper -->
<script>
var videoTemplate = {};
$(".video-placeholder").click(function () {▼
$(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){▼
event.preventDefault();▼
showCommonsVideo();▼
});▼
if( mw.util.getParamValue( "commons" ) == "true" ){▼
showCommonsVideo();▼
▲function showCommonsVideo() {
$('.video-youtube').remove();
$('.video-placeholder').css('display', 'none');
$('.video-commons').css('display', 'block');
};
videoTemplate.main = function() {
▲ $(".video-placeholder").click(function () {
▲ $(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"
})
▲ });
▲ event.preventDefault();
▲ videoTemplate.showCommonsVideo();
});
▲ if( mw.util.getParamValue( "commons" ) == "true" ){
▲ videoTemplate.showCommonsVideo();
}
videoTemplate.runWhenReady = function() {
if ( window.$ ) { // is jquery loaded yet?
videoTemplate.main();
} else {
window.setTimeout( videoTemplate.runWhenReady, 200 );
}
videoTemplate.runWhenReady();
</script>
</html><noinclude><pre>{{YouTubeWithCommonsFallback
Line 78 ⟶ 92:
| commons = File:The_Impact_Of_Wikipedia.webm
| width = 640
}}</pre
[[Category:Utility templates]]</noinclude>
|