Index: trunk/extensions/TimedMediaHandler/mwEmbedLoader.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php |
| 3 | +// This is a stub entry point to load.php This is need to support valid paths for the stand alone |
| 4 | +// mwEmbed module html test files. |
| 5 | + |
| 6 | +// This is useful for running stand alone test of mwEmbed components in the TimedMediaHandler |
| 7 | +// extension. ( ie MwEmbedModules/EmbedPlayer/tests/*.html files ) |
| 8 | + |
| 9 | +$_GET['modules'] = 'startup'; |
| 10 | +$_GET['only'] = 'scripts'; |
| 11 | + |
| 12 | +// NOTE this won't work so well with symbolic links |
| 13 | +$loaderPath = dirname(__FILE__) . '/../../load.php'; |
| 14 | +if( is_file( $loaderPath ) ){ |
| 15 | + chdir( dirname( $loaderPath ) ); |
| 16 | + include_once( $loaderPath ); |
| 17 | +} else { |
| 18 | + print "if( console && typeof console.log == 'function' ){ console.log('Error can't find load.php for stand alone tests' ) }"; |
| 19 | +} |
| 20 | +// Bootstrap some js code to make the "loader" work in stand alone tests: |
| 21 | +// Note this has to be wrapped in a document.write to run after other document.writes |
| 22 | +$pageStartupScript = Html::inlineScript( |
| 23 | + ResourceLoader::makeLoaderConditionalScript( |
| 24 | + Xml::encodeJsCall( 'mw.loader.go', array() ) |
| 25 | + ) |
| 26 | +); |
| 27 | +echo Xml::encodeJsCall( 'document.write', array( $pageStartupScript ) ); |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/tests/Player_Timed_Text.html |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | <head> |
6 | 6 | <title>sample mv embed</title> |
7 | 7 | |
8 | | - <script type="text/javascript" src="../../../load.php?modules=startup&only=scripts"></script> |
| 8 | + <script type="text/javascript" src="../../../mwEmbedLoader.php"></script> |
9 | 9 | |
10 | 10 | <script type="text/javascript"> |
11 | 11 | $( document ).ready(function(){ |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/tests/Player_Audio.html |
— | — | @@ -2,14 +2,12 @@ |
3 | 3 | <html> |
4 | 4 | <head> |
5 | 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
6 | | - <!-- <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script> --> |
7 | | - |
8 | | - <script type="text/javascript" src="../../../load.php?modules=startup&only=scripts"></script> |
| 6 | + <script type="text/javascript" src="../../../mwEmbedLoader.php"></script> |
9 | 7 | |
10 | 8 | <title>Audio Player sample</title> |
11 | 9 | </head> |
12 | 10 | <body> |
13 | | -<h3> Audio Player </h3> |
14 | | -<audio class="kskin" src="http://upload.wikimedia.org/wikipedia/commons/4/4c/Faurepiece.ogg" data-durationhint="164"></audio> |
| 11 | + <h3> Audio Player </h3> |
| 12 | + <audio class="kskin" src="http://upload.wikimedia.org/wikipedia/commons/4/4c/Faurepiece.ogg" data-durationhint="164"></audio> |
15 | 13 | </body> |
16 | 14 | </html> |
\ No newline at end of file |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/tests/Player_Themable.html |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | <script type="text/javascript" src="../../../ResourceLoader.php?debug=true&class=mwEmbed"></script> |
10 | 10 | --> |
11 | 11 | |
12 | | - <script type="text/javascript" src="../../../load.php?modules=startup&only=scripts"></script> |
| 12 | + <script type="text/javascript" src="../../../mwEmbedLoader.php"></script> |
13 | 13 | </head> |
14 | 14 | <script type="text/javascript"> |
15 | 15 | mediaWiki.loader.go(); |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/tests/Player_Sources.html |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | <head> |
5 | 5 | <title>Player sources</title> |
6 | 6 | |
7 | | -<script type="text/javascript" src="../../../load.php?modules=startup&only=scripts"></script> |
| 7 | +<script type="text/javascript" src="../../../mwEmbedLoader.php"></script> |
8 | 8 | </head> |
9 | 9 | <body> |
10 | 10 | |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/tests/Player_Seek.html |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <html> |
3 | 3 | <head> |
4 | 4 | |
5 | | -<script type="text/javascript" src="../../../load.php?modules=startup&only=scripts"></script> |
| 5 | +<script type="text/javascript" src="../../../mwEmbedLoader.php"></script> |
6 | 6 | </head> |
7 | 7 | <body> |
8 | 8 | <h2>mwEmbed / archive.org server side seek</h2> |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/tests/Player_ServerSeek.html |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <html> |
3 | 3 | <head> |
4 | | - <script type="text/javascript" src="../../../load.php?modules=startup&only=scripts"></script> |
| 4 | + <script type="text/javascript" src="../../../mwEmbedLoader.php"></script> |
5 | 5 | </head> |
6 | 6 | <body> |
7 | 7 | <h2>mwEmbed / archive.org server side seek</h2> |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | /** |
3 | 3 | * EmbedPlayer loader |
4 | 4 | */ |
5 | | - |
6 | 5 | ( function( mw, $ ) { |
7 | 6 | |
8 | 7 | /** |
— | — | @@ -11,20 +10,11 @@ |
12 | 11 | * work after the 'IntefacesReady' event |
13 | 12 | */ |
14 | 13 | $( mw ).bind( 'SetupInterface', function( event, callback ){ |
15 | | - // Allow modules to extend EmbedPlayerRewritePlayerTags rewrites as well: |
16 | | - var doModuleTagRewrites = function(){ |
17 | | - $( mw ).triggerQueueCallback( 'EmbedPlayerRewritePlayerTags', callback ); |
18 | | - }; |
19 | | - |
20 | 14 | // Check if we have tags to rewrite: |
21 | 15 | if( $( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).length ) { |
22 | | - var rewriteElementCount = 0; |
23 | | - |
24 | | - // Rewrite the embedPlayer EmbedPlayer.RewriteTags : |
| 16 | + // Rewrite the embedPlayer EmbedPlayer.RewriteTags and run callback once ready: |
25 | 17 | $( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ) |
26 | | - .embedPlayer( doModuleTagRewrites ); |
27 | | - } else { |
28 | | - doModuleTagRewrites(); |
| 18 | + .embedPlayer( callback ); |
29 | 19 | } |
30 | 20 | }); |
31 | 21 | |
— | — | @@ -40,6 +30,7 @@ |
41 | 31 | var playerSelect = this; |
42 | 32 | } |
43 | 33 | mw.log( 'jQuery.fn.embedPlayer :: ' + playerSelect ); |
| 34 | + |
44 | 35 | // Hide videonojs class |
45 | 36 | $( '.videonojs' ).hide(); |
46 | 37 | |
— | — | @@ -62,7 +53,6 @@ |
63 | 54 | if( document.createElement('video').canPlayType && !$.browser.safari) { |
64 | 55 | $.merge( dependencySet, ['mw.EmbedPlayerNative'] ) |
65 | 56 | } |
66 | | - |
67 | 57 | |
68 | 58 | // Check if the iFrame player api is enabled and we have a parent iframe url: |
69 | 59 | // TODO we might want to move the iframe api to a separate module |
— | — | @@ -108,6 +98,7 @@ |
109 | 99 | }); |
110 | 100 | // Remove any duplicates in the dependencySet: |
111 | 101 | dependencySet = $.unique( dependencySet ); |
| 102 | + |
112 | 103 | // Do the request and process the playerElements with updated dependency set |
113 | 104 | mediaWiki.loader.using( dependencySet, function(){ |
114 | 105 | mw.processEmbedPlayers( playerSelect, readyCallback ); |