Template:YouTubeWithCommonsFallback: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
No edit summary |
||
Line 45:
</div><!-- /video-outer-wrapper -->
<script>
var videoTemplate = {};
$('.video-youtube').remove();▼
$('.video-placeholder').css('display', 'none');▼
$('.video-commons').css('display', 'block');▼
};▼
videoTemplate.main = function() {
$(".video-placeholder").click(function () {
$(this).replaceWith(
Line 64 ⟶ 70:
$("#showcommonsvideo a").click(function(event){
event.preventDefault();
videoTemplate.showCommonsVideo();
});
if( mw.util.getParamValue( "commons" ) == "true" ){
videoTemplate.showCommonsVideo();
}
};
videoTemplate.runWhenReady = function() {
▲function showCommonsVideo() {
if ( window.$ ) { // is jquery loaded yet?
▲ $('.video-youtube').remove();
videoTemplate.main();
▲ $('.video-placeholder').css('display', 'none');
} else {
▲ $('.video-commons').css('display', 'block');
window.setTimeout( videoTemplate.runWhenReady, 200 );
▲}
}
};
videoTemplate.runWhenReady();
</script>
</html><noinclude><pre>{{YouTubeWithCommonsFallback
|
Revision as of 19:21, 4 January 2017
{{YouTubeWithCommonsFallback | placeholder = Wikipedia_Puzzle_Globe.jpg | youtube = 3Knv6D6Thi0 | commons = File:The_Impact_Of_Wikipedia.webm | caption = Caption | width = 640 }}