r79857 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79856‎ | r79857 | r79858 >
Date:06:03, 8 January 2011
Author:dale
Status:deferred
Tags:
Comment:
improved clickable timeline in sequencer
ported over kaltura resource loader updates ( moved module config into php based configuration )
example files now reference resource loader ( instead of mwEmbed.js )
Modified paths:
  • /branches/MwEmbedStandAlone/LocalSettings.php (added) (history)
  • /branches/MwEmbedStandAlone/ResourceLoader.php (modified) (history)
  • /branches/MwEmbedStandAlone/includes/DefaultSettings.php (added) (history)
  • /branches/MwEmbedStandAlone/includes/NamedResourceLoader.php (modified) (history)
  • /branches/MwEmbedStandAlone/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/tests/Add_Media_Wizard.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/tests/Firefogg_GUI.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/ApiProxy/tests/testApiProxy.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Audio.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Native_Bindings.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Sources.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Themable.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Playlist/tests/Player_MediaRss.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/tests/Sequence_Editor.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/tests/VideoRender.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/tools/jPicker/jpicker-1.1.5.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/tests/PanZoom.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/tests/PngOverVideoSmil.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/tests/RayNaginTour-OriginalThree.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBegin.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoCrossFade.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoRender.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoTransition.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/tests/SwarmTransport_CommonsApi.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/tests/SwarmTransprot_Url.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/TimedText/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/TimedText/tests/Player_Timed_Text.html (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbedFrame.php (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)
  • /branches/MwEmbedStandAlone/skins/common/images/_player_big_play_button.png (added) (history)
  • /branches/MwEmbedStandAlone/skins/common/mw.style.mwCommon.css (modified) (history)
  • /branches/MwEmbedStandAlone/tests/mwEmbed_Demo.html (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/mwEmbedFrame.php
@@ -9,6 +9,8 @@
1010 * <iframe src="mwEmbedFrame.php?src={SRC URL}&poster={POSTER URL}&width={WIDTH}etc"> </iframe>
1111 */
1212
 13+// Include configuration: ( will include LocalSettings.php )
 14+require( dirname( __FILE__ ) . '/includes/DefaultSettings.php' );
1315
1416 // Setup the mwEmbedFrame
1517 $myMwEmbedFrame = new mwEmbedFrame();
Index: branches/MwEmbedStandAlone/loader.js
@@ -24,53 +24,13 @@
2525 'mw.Api'
2626 ];
2727
28 -
2928 /**
30 -* The default set of enabled modules
31 -* ( Modules can also be enabled via mediaWiki extensions )
32 -*
33 -* Each enabledModules array value should be a name
34 -* of a folder in mwEmbed/modules
35 -*
36 -* Modules must define a loader.js file in the root
37 -* of the module folder.
38 -*
39 -* A loader file should only include:
40 -* * Class paths of the module classes
41 -* * Style sheets of the module
42 -* * Loader function(s) that load module classes
43 -* * Any code you want run on all pages like checking the DOM
44 -* for a tag that invokes your loader.
45 -*
46 -* When using the scriptLoader the enabledModules loader code
47 -* is transcluded into base mwEmbed class include.
48 -*/
49 -var mwEnabledModuleList = [
50 - 'AddMedia',
51 - 'ClipEdit',
52 - 'EmbedPlayer',
53 - 'ApiProxy',
54 - 'Sequencer',
55 - 'TimedText',
56 - 'SmilPlayer',
57 - 'Playlist',
58 - 'SwarmTransport',
59 - 'SyntaxHighlighter',
60 - 'MiroSubs',
61 - 'PlayerThemer',
62 - 'MediaWikiSupport'
63 -];
64 -
65 -/**
6629 * mwEmbed default config values.
6730 */
6831 mw.setDefaultConfig ( {
6932 // Default coreComponents:
7033 'coreComponents' : mwCoreComponentList,
7134
72 - // Default enabled modules:
73 - 'enabledModules' : mwEnabledModuleList,
74 -
7535 // Default jquery ui skin name
7636 'jQueryUISkin' : 'redmond',
7737
@@ -152,6 +112,7 @@
153113 "mw.style.ui_le-frog" : "skins/jquery.ui.themes/le-frog/jquery-ui-1.7.2.css",
154114 "mw.style.ui_start" : "skins/jquery.ui.themes/start/jquery-ui-1.7.2.css",
155115 "mw.style.ui_sunny" : "skins/jquery.ui.themes/sunny/jquery-ui-1.7.2.css",
 116+ "mw.style.ui_kdark" : "skins/jquery.ui.themes/kaltura-dark/jquery-ui-1.7.2.css",
156117
157118 "mw.style.mwCommon" : "skins/common/mw.style.mwCommon.css",
158119
Index: branches/MwEmbedStandAlone/skins/common/mw.style.mwCommon.css
@@ -185,14 +185,14 @@
186186 * ( without additional assets in the embedPlayer skins folder )
187187 */
188188 .play-btn-large {
189 - width : 70px;
190 - height : 53px;
191 - background : url(images/player_big_play_button.png?1);
 189+ width: 70px;
 190+ height: 53px;
 191+ background : url('images/player_big_play_button.png?1');
192192 position : absolute;
193193 cursor : pointer;
194194 border : none !important;
195195 z-index : 1;
196196 }
197197 .play-btn-large:hover {
198 - background : url(images/player_big_play_button_hover.png?1);
 198+ background : url('images/player_big_play_button_hover.png?1');
199199 }
\ No newline at end of file
Index: branches/MwEmbedStandAlone/skins/common/images/_player_big_play_button.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/MwEmbedStandAlone/skins/common/images/_player_big_play_button.png
___________________________________________________________________
Added: svn:mime-type
200200 + application/octet-stream
Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -1686,6 +1686,7 @@
16871687
16881688 // Check for direct include of the mwEmbed.js
16891689 if ( src.indexOf( 'mwEmbed.js' ) !== -1 ) {
 1690+ alert( 'Direct Refrece to mwEmbed is no longer suported, please update to ResourceLoader.php?class=window.jQuery,mwEmbed& instead');
16901691 mwpath = src.substr( 0, src.indexOf( 'mwEmbed.js' ) );
16911692 }
16921693
Index: branches/MwEmbedStandAlone/LocalSettings.php
@@ -0,0 +1,9 @@
 2+<?php
 3+/**
 4+ * This file store all of mwEmbed local configuration ( in a default svn check out this file is empty )
 5+ *
 6+ * See includes/DefaultSettings.php for a configuration options
 7+ */
 8+
 9+
 10+?>
\ No newline at end of file
Index: branches/MwEmbedStandAlone/tests/mwEmbed_Demo.html
@@ -18,7 +18,7 @@
1919 <script type="text/javascript" src="../libraries/jquery/jquery.ui/ui/ui.draggable.js"></script>
2020
2121
22 - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 22+ <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
2323 <!--
2424 <script type="text/javascript" src="http://html5.kaltura.org/js" > </script>
2525
Index: branches/MwEmbedStandAlone/ResourceLoader.php
@@ -5,8 +5,6 @@
66 */
77
88 //Setup the script local script cache directory
9 -// ( has to be hard coded rather than config based for fast non-mediawiki config hits )
10 -$wgScriptCacheDirectory = realpath( dirname( __FILE__ ) ) . '/includes/cache';
119
1210 // Check if being used in mediaWiki ( ResourceLoader.php is NOT an entry point )
1311 if( is_file ( dirname( __FILE__ ) .'../mwResourceLoader.php' )
@@ -16,10 +14,8 @@
1715
1816 // Check if we are an entry point or being used as part of MEDIAWIKI:
1917 if ( !defined( 'MEDIAWIKI' ) && !defined( 'SCRIPTLOADER_MEDIAWIKI') ) {
20 - // Allow an installation an optional PHP customization/overrides file
21 - if ( is_file ( dirname( __FILE__ ) .'/../localSettings.php' ) ) {
22 - require_once dirname( __FILE__ ) .'/../localSettings.php';
23 - }
 18+ // Include settings ( will include LocalSettings.php in the root mwEmbed folder
 19+ require_once( dirname( __FILE__ ) . '/includes/DefaultSettings.php' );
2420
2521 // Load stand alone Resource Loader config
2622 // ( if running as a remote, mediaWiki variables / functions are already included as part of mediaWiki )
@@ -1215,8 +1211,9 @@
12161212 $this->filename = "{$wgScriptCacheDirectory}/{$hash1}/{$hash2}/{$hash}.js";
12171213
12181214 // Check for defined files::
1219 - if( is_file( $this->filename ) )
1220 - return $this->filename;
 1215+ if( is_file( $this->filename ) ){
 1216+ return $this->filename;
 1217+ }
12211218
12221219 // Check for non-config based gzip version already there?
12231220 if( is_file( $this->filename . '.gz') ){
Index: branches/MwEmbedStandAlone/includes/NamedResourceLoader.php
@@ -35,7 +35,7 @@
3636 * Get the javascript resource paths from javascript files
3737 */
3838 public static function loadResourcePaths(){
39 - global $wgMwEmbedDirectory, $wgExtensionJavascriptModules, $wgUseMwEmbedLoaderModuleList,
 39+ global $wgMwEmbedDirectory, $wgExtensionJavascriptModules, $wgMwEmbedEnabledModules,
4040 $wgResourceLoaderNamedPaths, $wgExtensionMessagesFiles, $IP;
4141
4242 // Only run once
@@ -73,13 +73,9 @@
7474 );
7575
7676 // Check if we should load module list from mwEmbed loader.js
77 - if( $wgUseMwEmbedLoaderModuleList ) {
 77+ if( $wgMwEmbedEnabledModules ) {
7878 // Get the list of enabled modules into $moduleList
79 - preg_replace_callback(
80 - '/mwEnabledModuleList\s*\=\s*\[(.*)\]/siU',
81 - 'NamedResourceLoader::preg_buildModuleList',
82 - $fileContent
83 - );
 79+ self::validateModuleList( $wgMwEmbedEnabledModules );
8480 }
8581
8682 // Change to the root mediawiki directory ( loader.js paths are relative to root mediawiki directory )
@@ -222,14 +218,10 @@
223219
224220 /**
225221 * Build the list of modules from the mwEnabledModuleList replace callback
226 - * @param String $jsvar Coma delimited list of modules
 222+ * @param String $moduleSet array of modules to be validated
227223 */
228 - private static function preg_buildModuleList( $jsvar ){
 224+ private static function validateModuleList( $moduleSet ){
229225 global $IP, $wgMwEmbedDirectory;
230 - if(! isset( $jsvar[1] )){
231 - return false;
232 - }
233 - $moduleSet = explode(',', $jsvar[1] );
234226
235227 $mwEmbedAbsolutePath = ( $wgMwEmbedDirectory == '' )? $IP: $IP .'/' .$wgMwEmbedDirectory;
236228
@@ -244,10 +236,9 @@
245237 array_push( self::$moduleList, $moduleName );
246238 } else {
247239 // Not valid module ( missing loader.js )
248 - throw new MWException( "Missing module: $moduleName \n" );
 240+ throw new MWException( "Module: $moduleName missing loader.js \n" );
249241 }
250242 }
251 -
252243 }
253244
254245 /**
Index: branches/MwEmbedStandAlone/includes/DefaultSettings.php
@@ -0,0 +1,65 @@
 2+<?php
 3+/**
 4+ * This file stores default settings for Kaltura html5 client library "mwEmbed".
 5+ *
 6+ * DO NOT MODIFY THIS FILE. Instead modify LocalSettings.php in the parent mwEmbd directory.
 7+ *
 8+ */
 9+
 10+// The default cache directory
 11+$wgScriptCacheDirectory = realpath( dirname( __FILE__ ) ) . '/cache';
 12+
 13+// The absolute or relative path to mwEmbed install folder.
 14+// by default its the entry point minus the entry point name:
 15+$wgMwEmbedPathUrl = str_replace(
 16+ // List entry points:
 17+ array( 'mwEmbedFrame.php', 'ResourceLoader.php', 'mwEmbedLoader.php'),
 18+ '',
 19+ $_SERVER['SCRIPT_NAME']
 20+);
 21+
 22+// Url to the resource loader php script:
 23+$wgResourceLoaderUrl = 'http://www.kaltura.org/apis/html5lib/mwEmbed/ResourceLoader.php';
 24+
 25+// The list of enabled modules
 26+$wgMwEmbedEnabledModules = array();
 27+
 28+// By default we enable every module in the "modules" folder
 29+$d = dir( realpath( dirname( __FILE__ ) ) . '/../modules' );
 30+while (false !== ($entry = $d->read())) {
 31+ if( substr( $entry, 0, 1 ) != '.' ){
 32+ $wgMwEmbedEnabledModules[] = $entry;
 33+ }
 34+}
 35+
 36+/*********************************************************
 37+ * Default Kaltura Configuration:
 38+ * TODO move kaltura configuration to KalturaSupport module ( part of ResourceLoader update )
 39+ ********************************************************/
 40+
 41+// The default Kaltura service url:
 42+$wgKalturaServiceUrl = 'http://www.kaltura.com';
 43+
 44+// Default Kaltura CDN url:
 45+$wgKalturaCDNUrl = 'http://cdn.kaltura.com';
 46+
 47+// Default Kaltura service url:
 48+$wgKalturaServiceBase = '/api_v3/index.php?';
 49+
 50+// Default expire time for ui conf api queries in seconds
 51+$wgKalturaUiConfCacheTime = 600;
 52+
 53+
 54+
 55+
 56+/*********************************************************
 57+ * Include local settings override:
 58+ ********************************************************/
 59+$wgLocalSettingsFile = realpath( dirname( __FILE__ ) ) . '/../LocalSettings.php';
 60+
 61+if( is_file( $wgLocalSettingsFile ) ){
 62+ require_once( $wgLocalSettingsFile );
 63+}
 64+
 65+
 66+?>
Index: branches/MwEmbedStandAlone/modules/Playlist/tests/Player_MediaRss.html
@@ -2,13 +2,13 @@
33 <head>
44 <title> MediaRss player </title>
55
6 -<script type="text/javascript" src="../../../mwEmbed.js?debug=true>"></script>
 6+<script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true>"></script>
77
88 <!--
99 <script type="text/javascript" src="http://html5.kaltura.org/js"></script>
1010 <script type="text/javascript" src="../../../mwEmbedLoader.js"></script>
1111 <script type="text/javascript" src="../mwEmbed/mwEmbedLoader.js"></script>
12 -<script type="text/javascript" src="../mwEmbed/mwEmbed.js?debug=true>"></script>
 12+<script type="text/javascript" src="../mwEmbed/ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true>"></script>
1313 <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script>
1414 -->
1515
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
@@ -338,7 +338,7 @@
339339 // Add the parent startOffset
340340 $node.data( 'startOffset', startOffset );
341341
342 - callback( $node )
 342+ callback( $node );
343343 }
344344 // Return the node Duration for tracking startOffset
345345 return this.getClipDuration( $node );
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/PngOverVideoSmil.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <title>Simple PNG Animation Over Video Example</title>
6 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/RayNaginTour-OriginalThree.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <title>Video CrossFade Example</title>
6 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoCrossFade.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <title>Video CrossFade Example</title>
6 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoTransition.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <title>Video Transistion Example</title>
6 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/PanZoom.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <title>Pan Zoom Example</title>
6 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoClipBegin.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <title>Video ClipBegin Example</title>
6 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/VideoRender.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <title>Video CrossFade Example</title>
6 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/tests/SwarmTransprot_Url.html
@@ -3,10 +3,10 @@
44 <html>
55 <head>
66 <title>Sample swarm transport</title>
7 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 7+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
88 <!--
99 <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed"></script>
10 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 10+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
1111 -->
1212
1313 <script type="text/javascript">
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/tests/SwarmTransport_CommonsApi.html
@@ -3,10 +3,10 @@
44 <html>
55 <head>
66 <title>Sample swarm transport</title>
7 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 7+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
88 <!--
99 <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed"></script>
10 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 10+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
1111 -->
1212
1313 <script type="text/javascript">
Index: branches/MwEmbedStandAlone/modules/TimedText/loader.js
@@ -67,7 +67,7 @@
6868 // On new embed player check if we need to add timedText
6969 $j( mw ).bind( 'newEmbedPlayerEvent', function( event, embedPlayer ){
7070 if( mw.isTimedTextSupported( embedPlayer) ){
71 - if( ! embedPlayer.timedText ) {
 71+ if( ! embedPlayer.timedText && mw.TimedText ) {
7272 embedPlayer.timedText = new mw.TimedText( embedPlayer );
7373 }
7474 }
@@ -84,7 +84,12 @@
8585 }
8686 // Check for timed text sources or api/ roe url
8787 if (
88 - ( embedPlayer.roe || embedPlayer.apititlekey || embedPlayer.apiTitleKey )
 88+ ( $j( embedPlayer ).attr( embedPlayer.roe )
 89+ ||
 90+ $j( embedPlayer ).attr('apititlekey')
 91+ ||
 92+ $j( embedPlayer ).attr('apiTitleKey' )
 93+ )
8994 ||
9095 ( embedPlayer.mediaElement && embedPlayer.mediaElement.textSourceExists() )
9196 ||
Index: branches/MwEmbedStandAlone/modules/TimedText/tests/Player_Timed_Text.html
@@ -3,7 +3,7 @@
44 <html>
55 <head>
66 <title>sample mv embed</title>
7 - <!-- <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script> -->
 7+ <!-- <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script> -->
88 <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script>
99 <script type="text/javascript">
1010 $j( document ).ready(function(){
Index: branches/MwEmbedStandAlone/modules/AddMedia/tests/Firefogg_GUI.html
@@ -30,7 +30,7 @@
3131
3232 document.write( '<script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed,mw.style.mwCommon,$j.cookie&uselang=' + langKey + '&debug=true"><\/script>' );
3333 </script>
34 - <!-- <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script> -->
 34+ <!-- <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script> -->
3535 <style type="text/css" media="all">
3636 body {
3737 margin: 0;
Index: branches/MwEmbedStandAlone/modules/AddMedia/tests/Add_Media_Wizard.html
@@ -12,7 +12,7 @@
1313 }
1414 </style>
1515 <!-- <script src="../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
16 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 16+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
1717
1818 <script type="text/javascript">
1919 mw.ready( function(){
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -906,6 +906,9 @@
907907
908908 this.$resultsContainer = $j('<div />').attr({
909909 id : "rsd_results_container"
 910+ }).css({
 911+ 'position' : 'relative',
 912+ 'bottom' : '30px'
910913 });
911914
912915 $mainContainer.append( this.$filtersContainer );
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Audio.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 - <!-- <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script> -->
 6+ <!-- <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script> -->
77 <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script>
88 <title>Audio Player sample</title>
99 </head>
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Themable.html
@@ -8,7 +8,7 @@
99 <script type="text/javascript" src="../../../ResourceLoader.php?debug=true&class=mwEmbed"></script>
1010 -->
1111
12 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 12+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
1313
1414 </head>
1515 <script type="text/javascript">
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Native_Bindings.html
@@ -41,7 +41,7 @@
4242
4343
4444
45 -<!-- <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script> -->
 45+<!-- <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script> -->
4646 <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
4747 <script type="text/javascript">
4848 /*
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Sources.html
@@ -3,7 +3,7 @@
44 <head>
55 <title>Player sources</title>
66
7 -<script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 7+<script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
88 </head>
99 <body>
1010
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -2068,8 +2068,8 @@
20692069 this.controls = true;
20702070 }
20712071 if( !this.useNativePlayerControls() && !this.isPersistentNativePlayer() && !_this.controlBuilder.checkOverlayControls() ){
2072 - // give the interface more space for the controls:
2073 - this.$interface.css('height', this.height + _this.controlBuilder.height )
 2072+ // Update the video size per available control space.
 2073+ $j(this).css('height', this.height - _this.controlBuilder.height );
20742074 }
20752075
20762076 // Update Thumbnail for the "player"
@@ -2491,6 +2491,8 @@
24922492 unescape( this.apiTitleKey ).replace( /^(File:|Image:)/ , '' ) ) +
24932493 '?' + mw.getConfig( 'Mw.AppendWithJS' ) +
24942494 '&embedplayer=yes';
 2495+ } else if ( typeof(mw.IA) != 'undefined') {
 2496+ var iframeUrl = mw.IA.embedUrl();
24952497 } else {
24962498 // old style embed:
24972499 var iframeUrl = mw.getMwEmbedPath() + 'mwEmbedFrame.php?';
Index: branches/MwEmbedStandAlone/modules/Sequencer/loader.js
@@ -102,6 +102,7 @@
103103 '$j.fn.layout',
104104
105105 // UI components used in the sequencer interface:
 106+ '$j.ui',
106107 '$j.widget',
107108 '$j.ui.mouse',
108109 '$j.ui.position',
Index: branches/MwEmbedStandAlone/modules/Sequencer/tools/jPicker/jpicker-1.1.5.js
@@ -1,4 +1,4 @@
2 -/*
 2+/*
33 * jPicker 1.1.5
44 *
55 * jQuery Plugin for Photoshop style color picker
@@ -905,17 +905,17 @@
906906 expandable: true,
907907 input: $($this)
908908 }
909 - });
910 - if($($this).val()=='')
911 - {
912 - settings.color.active = new Color({ hex: null });
913 - settings.color.current = new Color({ hex: null });
914 - }
915 - else if (ColorMethods.validateHex($($this).val()))
916 - {
917 - settings.color.active = new Color({ hex: $($this).val(), a: settings.color.active.val('a') });
918 - settings.color.current = new Color({ hex: $($this).val(), a: settings.color.active.val('a') });
 909+ });
 910+ if($($this).val()=='')
 911+ {
 912+ settings.color.active = new Color({ hex: null });
 913+ settings.color.current = new Color({ hex: null });
919914 }
 915+ else if (ColorMethods.validateHex($($this).val()))
 916+ {
 917+ settings.color.active = new Color({ hex: $($this).val(), a: settings.color.active.val('a') });
 918+ settings.color.current = new Color({ hex: $($this).val(), a: settings.color.active.val('a') });
 919+ }
920920 }
921921 if (settings.window.expandable)
922922 $($this).after('<span class="jPicker"><span class="Icon"><span class="Color">&nbsp;</span><span class="Alpha">&nbsp;</span><span class="Image" title="Click To Open Color Picker">&nbsp;</span><span class="Container">&nbsp;</span></span></span>');
@@ -1554,11 +1554,11 @@
15551555 initialize =
15561556 function()
15571557 {
1558 - var win = settings.window,
1559 - popup = win.expandable ? $($this).next().find('.Container:first') : null;
1560 - container = win.expandable ? $('<div/>') : $($this);
1561 - container.addClass('jPicker Container');
1562 - if (win.expandable) container.hide();
 1558+ var win = settings.window,
 1559+ popup = win.expandable ? $($this).next().find('.Container:first') : null;
 1560+ container = win.expandable ? $('<div/>') : $($this);
 1561+ container.addClass('jPicker Container');
 1562+ if (win.expandable) container.hide();
15631563 container.get(0).onselectstart=function(){return false;};
15641564 // inject html source code - we are using a single table for this control - I know tables are considered bad, but it takes care of equal height columns and
15651565 // this control really is tabular data, so I believe it is the right move
@@ -1982,4 +1982,4 @@
19831983 }
19841984 };
19851985
1986 -})(jQuery, '1.1.5');
\ No newline at end of file
 1986+})(jQuery, '1.1.5');
Index: branches/MwEmbedStandAlone/modules/Sequencer/tests/Sequence_Editor.html
@@ -3,7 +3,7 @@
44 <html>
55 <head>
66 <title>SMIL Sequence Editor example</title>
7 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 7+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
88 <script type="text/javascript">
99 mw.ready( function(){
1010 mw.load( 'Sequencer', function(){
Index: branches/MwEmbedStandAlone/modules/Sequencer/tests/VideoRender.html
@@ -2,7 +2,7 @@
33 <html>
44 <head>
55 <title>Video CrossFade Example</title>
6 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
@@ -18,13 +18,21 @@
1919 timelineThumbLayout: {
2020 'height': 90,
2121 'width' : 120,
22 - 'spacing': 14
 22+ // The width of the thumbnail + spacing
 23+ 'totalWidth': 134
2324 },
2425
2526 // The timeline layout mode
2627 // Can be "clip" ( like iMovie ) or "time" ( like finalCut )
2728 timelineMode: 'clip',
2829
 30+ // The smil track to use as the timeline when in clip mode
 31+ // ( when in "time" mode we have a uniform pixle to time mapping )
 32+ clipModeTrackIndex: 0,
 33+
 34+ // The base left side offset for the clickable timeline
 35+ clickableTimelineBaseOffset :10,
 36+
2937 // Store the max track length
3038 maxTrackLength: 0,
3139
@@ -55,6 +63,7 @@
5664 )
5765 .css( 'height', this.getTimelineContainerHeight() )
5866 );
 67+
5968 // Apply layout control to track name / clipTrackSet division
6069 this.trackLayout = this.getTimelineContainer().find( '.timelineTrackContainer')
6170 .layout( {
@@ -104,7 +113,7 @@
105114 };
106115 // Bind the update event to every time the duration is re-calculated
107116 $j( this.sequencer.getEmbedPlayer() ).bind( 'durationchange', updateClickableTimeline );
108 - updateClickableTimeline();
 117+ updateClickableTimeline();
109118 },
110119
111120 /**
@@ -123,7 +132,8 @@
124133 var _this = this;
125134 // For now just a save button:
126135 var $trackTools = $j('<div />')
127 - .addClass('trackNamesTools');
 136+ .addClass('trackNamesTools')
 137+ .css( 'height', '18px');
128138
129139 $j.each(this.trackNamesTools, function(toolId, tool){
130140 $trackTools.append(
@@ -135,7 +145,7 @@
136146 .css({
137147 'padding-top': 0,
138148 'padding-bottom': 0,
139 - 'height' : 16
 149+ 'height' : '16px'
140150 })
141151 .click(function(){
142152 tool.action( _this )
@@ -146,12 +156,46 @@
147157 return $trackTools;
148158 },
149159
150 - updateTimelinePlayMarker: function( playTime ){
151 - var $timelinePlayMarker = _this.getClickableTimeline().find( '.timelinePlayMarker' );
 160+ time2TimelineOffset: function( playTime ){
 161+ var _this = this;
 162+ if( this.timelineMode == 'clip' ){
 163+ var smil = this.sequencer.getSmil();
 164+ var smilSequenceTracks = this.sequencer.getSmil().getBody().getSeqElements();
 165+ var clipInx = 0;
 166+ var pixleOffset = 0;
 167+ smil.getBody().getRefElementsRecurse( smilSequenceTracks[ _this.clipModeTrackIndex ], 0, function( smilElement ){
 168+ var smilClipDur = smil.getBody().getClipDuration( smilElement );
 169+ var startOffset = $j( smilElement ).data('startOffset');
 170+ if( playTime > startOffset && playTime < (startOffset + smilClipDur) ){
 171+ // get the base pixle offset:
 172+ pixleOffset = _this.clickableTimelineBaseOffset + ( _this.timelineThumbLayout.totalWidth * clipInx ) ;
 173+ // add relative time offset:
 174+ pixleOffset += ( ( playTime - startOffset ) / smilClipDur ) * _this.timelineThumbLayout.totalWidth;
 175+ }
 176+ clipInx++;
 177+ });
 178+ return pixleOffset;
 179+ }
152180 },
153181
154182 timelineOffset2Time: function( pixleOffset ){
155 - pixleOffset - 10 / ( _this.timelineThumbLayout.width + 14 )
 183+ var _this = this;
 184+ if( this.timelineMode == 'clip' ){
 185+ var smil = this.sequencer.getSmil();
 186+ // find which clip we are in:
 187+ var clipInx = Math.floor( pixleOffset / _this.timelineThumbLayout.totalWidth );
 188+ var clipTimePercent = ( pixleOffset % _this.timelineThumbLayout.totalWidth ) / _this.timelineThumbLayout.totalWidth;
 189+ // Find the relative clip time:
 190+
 191+ // Get at the smil element:
 192+ var smilId = $j( '#' + this.getTrackSetId( _this.clipModeTrackIndex ))
 193+ .find('li').eq(clipInx)
 194+ .data( 'smilId' );
 195+ var smilElement = smil.$dom.find( '#' + smilId );
 196+
 197+ return $j(smilElement).data('startOffset') +
 198+ ( smil.getBody().getClipDuration( smilElement ) * clipTimePercent );
 199+ }
156200 },
157201
158202 setupClickableTimeline: function( timelineWidth ){
@@ -167,18 +211,38 @@
168212 var timelineOffset = event.pageX - $clickTimeline.offset().left;
169213 // Get the mouse offset get which clip we are associated with
170214 mw.log("clicked: " + timelineOffset );
171 - _this.updateTimelinePlayMarker(
172 - timelineOffset2Time( timelineOffset )
173 - )
 215+ var clickedTime =_this.timelineOffset2Time( timelineOffset );
 216+
 217+ // Seek to the click time for the embed player:
 218+ _this.sequencer.getEmbedPlayer().setCurrentTime( clickedTime, function(){
 219+ mw.log( 'SequencerTimeline::clickableTimeline:: seek done:' + clickedTime );
 220+ });
 221+
 222+ // Update the play marker
 223+ _this.getClickableTimeline().find( '.timelinePlayMarker' )
 224+ .css('left', timelineOffset );
174225 });
175226
 227+ var embedPlayer = _this.sequencer.getEmbedPlayer();
 228+ var cTime = 0;
 229+ // Setup play binding ( to update timelinePlayMarker )
 230+ $j( embedPlayer ).bind( 'monitorEvent', function(){
 231+ // Check if we have to do an update:
 232+ if( cTime != embedPlayer.currentTime ){
 233+ // Update the play marker
 234+ _this.getClickableTimeline().find( '.timelinePlayMarker' )
 235+ .css('left', _this.time2TimelineOffset( embedPlayer.currentTime ) );
 236+ }
 237+ cTime = embedPlayer.currentTime;
 238+ });
 239+
176240 // Add TimelinePlayMarker
177241 $clickTimeline.append(
178242 $j('<div />')
179243 .addClass('timelinePlayMarker')
180244 .css({
181245 'height': this.getTimelineContainerHeight(),
182 - 'left' : 10,
 246+ 'left' : this.clickableTimelineBaseOffset,
183247 'position' : 'absolute',
184248 'width' : 2,
185249 'z-index' : 2
@@ -212,13 +276,13 @@
213277 // Output a time for each clip ( right now just assume first track ( 0 )
214278 var clipInx = 0;
215279 var startOffset = 0;
216 - smil.getBody().getRefElementsRecurse( smilSequenceTracks[0], startOffset, function( smilElement ){
 280+ smil.getBody().getRefElementsRecurse( smilSequenceTracks[ _this.clipModeTrackIndex ], startOffset, function( smilElement ){
217281 mw.log(" offset:" + startOffset + ' clipDur: ' + smil.getBody().getClipDuration( smilElement ) + ' so:' + $j( smilElement ).data( 'startOffset' ) );
218282 $j('<span />')
219283 .css({
220284 'position': 'absolute',
221285 'border-left' : 'solid thin #999',
222 - 'left' : 10 + ( _this.timelineThumbLayout.width + 14 ) * clipInx
 286+ 'left' : 10 + ( _this.timelineThumbLayout.totalWidth ) * clipInx
223287 })
224288 .text(
225289 mw.seconds2npt(
@@ -238,7 +302,7 @@
239303 getTimelineContainerHeight: function(){
240304 var _this = this;
241305 // Start with vertical space for one more track + timeline
242 - var timelineHeight = 80;
 306+ var timelineHeight = 75;
243307 var smilSequenceTracks = this.sequencer.getSmil().getBody().getSeqElements();
244308 $j.each(smilSequenceTracks, function( trackIndex, smilSequenceTrack ){
245309 timelineHeight+= _this.getSequenceTrackHeight( smilSequenceTrack );
@@ -529,7 +593,7 @@
530594 }
531595 // TOOD make this use the trackIndex
532596 var trackClipCount = this.getTimelineContainer().find( '.clipTrackSet' ).children().length;
533 - return ( (this.timelineThumbLayout.width + 16) * (trackClipCount + extraClips ) );
 597+ return ( (this.timelineThumbLayout.totalWidth ) * (trackClipCount + extraClips ) );
534598 },
535599
536600 /**
Index: branches/MwEmbedStandAlone/modules/ApiProxy/tests/testApiProxy.html
@@ -3,7 +3,7 @@
44 <head>
55 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
66 <title>Api Proxy Test</title>
7 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 7+ <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script>
88 <!-- <script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed"></script> -->
99 <script type="text/javascript" >
1010 //HARD coded local test:
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -705,7 +705,7 @@
706706 var jQueryRequested = false;
707707 $j.getScript(mwEmbedHostPath + '/libraries/jquery/jquery-1.4.2.js?' + mwGetReqArgs(), function(){
708708 // load mwEmbed js
709 - $j.getScript( mwEmbedHostPath + '/mwEmbed.js?' + mwGetReqArgs(), function(){
 709+ $j.getScript( mwEmbedHostPath + '/ResourceLoader.php?class=window.jQuery,mwEmbed&&' + mwGetReqArgs(), function(){
710710 // Load the class set as part of mwReady callback
711711 mw.load( classSet, function(){
712712 callback();

Status & tagging log