Template:YouTubeWithCommonsFallback: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
No edit summary |
||
Line 45: | Line 45: | ||
</div><!-- /video-outer-wrapper --> |
</div><!-- /video-outer-wrapper --> |
||
<script> |
<script> |
||
function inlineScriptWhenReady() { |
|||
var videoTemplate = {}; |
|||
/* Wrapper function so waits until jQuery ready - see MediaWiki:Common.js */ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
videoTemplate.main = function() { |
|||
$(".video-placeholder").click(function () { |
$(".video-placeholder").click(function () { |
||
$(this).replaceWith( |
$(this).replaceWith( |
||
Line 70: | Line 64: | ||
$("#showcommonsvideo a").click(function(event){ |
$("#showcommonsvideo a").click(function(event){ |
||
event.preventDefault(); |
event.preventDefault(); |
||
showCommonsVideo(); |
|||
}); |
}); |
||
if( mw.util.getParamValue( "commons" ) == "true" ){ |
if( mw.util.getParamValue( "commons" ) == "true" ){ |
||
showCommonsVideo(); |
|||
} |
} |
||
} |
} |
||
⚫ | |||
videoTemplate.runWhenReady = function() { |
|||
⚫ | |||
if ( window.$ ) { // is jquery loaded yet? |
|||
⚫ | |||
videoTemplate.main(); |
|||
⚫ | |||
} else { |
|||
⚫ | |||
window.setTimeout( videoTemplate.runWhenReady, 200 ); |
|||
} |
|||
}; |
|||
videoTemplate.runWhenReady(); |
|||
</script> |
</script> |
||
</html><noinclude><pre>{{YouTubeWithCommonsFallback |
</html><noinclude><pre>{{YouTubeWithCommonsFallback |
Revision as of 19:22, 4 January 2017
{{YouTubeWithCommonsFallback | placeholder = Wikipedia_Puzzle_Globe.jpg | youtube = 3Knv6D6Thi0 | commons = File:The_Impact_Of_Wikipedia.webm | caption = Caption | width = 640 }}