r72016 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72015‎ | r72016 | r72017 >
Date:09:08, 31 August 2010
Author:dale
Status:deferred
Tags:
Comment:
* added support for kaltura pause overlay
* minor sequencer fixes and tweeks ( fixed publish status updates, fixed remoteSearchDriver config, removed extra debug in sequence server )
Modified paths:
  • /branches/MwEmbedStandAlone/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsEdit.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/css/mw.style.Sequencer.css (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerAddMedia.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/remotes/images (added) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/remotes/images/kaltura_logo_transparent_large.png (added) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.style.SequencerRemote.css (added) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/tests/SwarmTransport_CommonsApi.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/tests/SwarmTransprot_Url.html (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SwarmTransport/loader.js
@@ -15,23 +15,23 @@
1616 /**
1717 * If SwarmTransport should be enabled by default as video transport mechanism
1818 */
19 - 'SwarmTransport.enable': true,
 19+ 'SwarmTransport.Enable': true,
2020
2121 /**
2222 * If the swarm transport plugin should be recommended if the user does not have it installed.
2323 */
24 - 'SwarmTransport.recommend' : false,
 24+ 'SwarmTransport.Recommend' : false,
2525
2626 /**
2727 * Lookup service url
2828 */
29 - 'SwarmTransport.torrentLookupUrl' : 'http://url2torrent.net/get/'
 29+ 'SwarmTransport.TorrentLookupUrl' : 'http://url2torrent.net/get/'
3030 });
3131
3232 // Add the mw.SwarmTransport to the embedPlayer loader:
3333 $j( mw ).bind( 'LoaderEmbedPlayerUpdateRequest', function( event, playerElement, classRequest ) {
3434 // If the swarm transport is enabled add mw.SwarmTransport to the request.
35 - if( mw.getConfig( 'SwarmTransport.enable' ) ) {
 35+ if( mw.getConfig( 'SwarmTransport.Enable' ) ) {
3636 if( $j.inArray( 'mw.SwarmTransport', classRequest ) == -1 ) {
3737 classRequest.push( [ 'mw.SwarmTransport' ]);
3838 }
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/tests/SwarmTransprot_Url.html
@@ -12,9 +12,9 @@
1313 <script type="text/javascript">
1414
1515 // Set configuration:
16 - mw.setConfig( 'SwarmTransport.enable', true );
 16+ mw.setConfig( 'SwarmTransport.Enable', true );
1717
18 - mw.setConfig( 'SwarmTransport.recommend', true );
 18+ mw.setConfig( 'SwarmTransport.Recommend', true );
1919
2020 </script>
2121 </head>
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/tests/SwarmTransport_CommonsApi.html
@@ -12,9 +12,9 @@
1313 <script type="text/javascript">
1414
1515 // Set configuration:
16 - mw.setConfig( 'SwarmTransport.enable', true );
 16+ mw.setConfig( 'SwarmTransport.Enable', true );
1717
18 - mw.setConfig( 'SwarmTransport.recommend', true );
 18+ mw.setConfig( 'SwarmTransport.Recommend', true );
1919
2020 </script>
2121 </head>
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js
@@ -32,7 +32,7 @@
3333 // Check if we have a "recommend" binding and provide an xpi install link
3434 mw.log('SwarmTransport::bind:addControlBindingsEvent');
3535 $j( embedPlayer ).bind( 'addControlBindingsEvent', function(){
36 - if( mw.getConfig( 'SwarmTransport.recommend' ) &&
 36+ if( mw.getConfig( 'SwarmTransport.Recommend' ) &&
3737 typeof window['swarmTransport'] == 'undefined' &&
3838 $j.browser.mozilla )
3939 {
@@ -75,10 +75,10 @@
7676 'url' : mw.absoluteUrl( source.getSrc() )
7777 }
7878
79 - mw.log( 'SwarmTransport:: lookup torrent url: ' + mw.getConfig( 'SwarmTransport.torrentLookupUrl' ) + "\n" + mw.absoluteUrl( source.getSrc() ));
 79+ mw.log( 'SwarmTransport:: lookup torrent url: ' + mw.getConfig( 'SwarmTransport.TorrentLookupUrl' ) + "\n" + mw.absoluteUrl( source.getSrc() ));
8080 // Setup function to run in context based on callback result
8181 $j.getJSON(
82 - mw.getConfig( 'SwarmTransport.torrentLookupUrl' ) + '?jsonp=?',
 82+ mw.getConfig( 'SwarmTransport.TorrentLookupUrl' ) + '?jsonp=?',
8383 torrentLookupRequest,
8484 function( data ){
8585 // Check if the torrent is ready:
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -2049,7 +2049,7 @@
20502050 'runBaseControlDone' : true
20512051 }
20522052
2053 - // run the ended trigger ( allow the ended object to prevent default actions )
 2053+ // Run the ended trigger ( allow the ended object to prevent default actions )
20542054 $j( this ).trigger( 'ended', onDoneActionObject );
20552055
20562056 if( onDoneActionObject.runBaseControlDone ){
@@ -2750,11 +2750,13 @@
27512751 * There is no general way to pause the video
27522752 * must be overwritten by embed object to support this functionality.
27532753 */
2754 - pause: function() {
2755 - var _this = this;
2756 - // mw.log('mwEmbed:do pause');
2757 - // (playing) do pause
2758 - this.paused = true;
 2754+ pause: function( event ) {
 2755+ var _this = this;
 2756+ if( this.paused === false ){
 2757+ this.paused = true;
 2758+ $j( this ).trigger('pause');
 2759+ }
 2760+ mw.log('mwEmbed:embedPlayer::pause() ');
27592761
27602762 // update the ctrl "paused state"
27612763 this.$interface.find('.play-btn span' )
@@ -2767,7 +2769,7 @@
27682770 .click( function() {
27692771 _this.play();
27702772 } )
2771 - .attr( 'title', gM( 'mwe-embedplayer-play_clip' ) );
 2773+ .attr( 'title', gM( 'mwe-embedplayer-play_clip' ) );
27722774 },
27732775
27742776 /**
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js
@@ -495,16 +495,15 @@
496496 * Handle the native paused event
497497 */
498498 onPaused: function(){
499 - mw.log("native:paused:trigger");
500 - this.pause();
501 - $j( this ).trigger( 'pause' );
 499+ mw.log("native:paused");
 500+ this.pause();
502501 },
503502
504503 /**
505504 * Handle the native play event
506505 */
507506 onPlay: function(){
508 - mw.log("native::play::trigger");
 507+ mw.log("native::play");
509508 if( !this.isPlaying () ){
510509 this.play();
511510 }
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js
@@ -35,7 +35,7 @@
3636 'panzoom' : {
3737 'editWidgets' : ['panzoom'],
3838 'editableAttributes' : [ 'panZoom' ],
39 - 'contentTypes': ['video', 'img'],
 39+ 'contentTypes': [ 'img'], // xxx todo add video support
4040 'animate' : 'true'
4141 },
4242 'transitions' : {
@@ -153,6 +153,12 @@
154154 'onChange': function( _this, target, smilClip ){
155155 var panZoomVal = $j('#' +_this.getEditToolInputId( 'panzoom', 'panZoom')).val();
156156 mw.log("panzoom change:" + panZoomVal );
 157+ // Update on the current smil clip display:
 158+ _this.sequencer.getSmil()
 159+ .getLayout()
 160+ .panZoomLayout(
 161+ smilClip
 162+ );
157163 },
158164 'draw': function( _this, target, smilClip ){
159165 var orginalHelperCss = {
@@ -223,19 +229,27 @@
224230 var updatePanZoomFromUiValue = function( layout ){
225231 var pz = startPanZoomVal.split(',');
226232 // Set the new percent offset to x/2
227 - if( layout.left )
228 - pz[0] = ( parseInt( pz[0] ) + ( layout.left / 2 ) ) + '%';
 233+ if( layout.left ){
 234+ pz[0] = ( parseInt( pz[0] ) - ( layout.left ) ) + '%';
 235+ }
229236
230 - if( layout.top )
231 - pz[1] = ( parseInt( pz[1] ) + ( layout.top / 2 ) )+ '%';
 237+ if( layout.top ){
 238+ pz[1] = ( parseInt( pz[1] ) - ( layout.top ) )+ '%';
 239+ }
232240
233 - if( layout.width )
234 - pz[2] = ( parseInt( pz[2] ) + ( layout.width / 2 ) ) + '%'
 241+ if( layout.width ) {
 242+ pz[2] = ( parseInt( pz[2] ) - ( layout.width / 2) ) + '%'
235243
236 - if( layout.height )
237 - pz[2] = ( parseInt( pz[2] ) + ( layout.width / 2 ) ) + '%'
238 -
239 - var smilPanZoomValue = pz.join(', ');
 244+ // right now only keep aspect is supported do size hack::
 245+ pz[3] = parseInt( pz[2] ) * _this.sequencer.getSmil().getLayout().getTargetAspectRatio();
 246+ // only have 2 significant digits
 247+ pz[3] = ( Math.round( pz[3]* 100 ) / 100 ) + '%';
 248+ }
 249+ // Trim all the values
 250+ for(var i=0; i < pz.length; i++){
 251+ pz[i] = $j.trim( pz[i] );
 252+ }
 253+ var smilPanZoomValue = pz.join(', ');
240254
241255 // Update the smil DOM:
242256 $j( smilClip ).attr( 'panZoom', smilPanZoomValue );
@@ -461,7 +475,8 @@
462476 $toolsContainer = $j('<div />')
463477 .addClass( 'editToolsContainer' )
464478 .css( {
465 - 'height': '80%'
 479+ 'height': '80%',
 480+ 'overflow': 'auto'
466481 })
467482 .append(
468483 $j('<ul />')
@@ -499,7 +514,7 @@
500515 // Append the tooltab container
501516 $toolsContainer.append(
502517 $j('<div />')
503 - .css({'height' : '100%', 'overflow': 'auto'})
 518+ .css({'height' : '100%' })
504519 .attr('id', 'tooltab_' + toolId )
505520 .append(
506521 $j('<h3 />').text( gM('mwe-sequencer-tools-' + toolId + '-desc') )
Index: branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js
@@ -5,6 +5,10 @@
66 * Supports basic "sequencer" functionality as a javascript rewrite system.
77 */
88
 9+// Wrap in mw to not pollute global namespace
 10+( function( mw ) {
 11+
 12+
913 mw.addMessageKeys( [
1014 "mwe-sequencer-no-sequence-create",
1115 "mwe-sequencer-create-sequence",
@@ -20,7 +24,9 @@
2125 "mwe-sequencer-loading-publish-render",
2226
2327 "mwe-sequencer-not-published",
24 - "mwe-sequencer-published-out-of-date"
 28+ "mwe-sequencer-published-out-of-date",
 29+ "mwe-sequencer-you-can-edit-this-video",
 30+ "mwe-sequencer-using-kaltura-video-editor"
2531 ]);
2632
2733 /* exported functions */
@@ -43,6 +49,140 @@
4450 return url;
4551 },
4652
 53+// Add player pause binding if config is set::
 54+$j( mw ).bind( 'newEmbedPlayerEvent', function( event, embedPlayerId ) {
 55+ if( mw.getConfig( 'Sequencer.KalturaPlayerEditOverlay' )){
 56+ var embedPlayer = $j( '#' + embedPlayerId ).get(0);
 57+
 58+ $j( embedPlayer ).bind( 'pause', function() {
 59+ // For now don't overlay smil players ( used in editor )
 60+ // xxx in the future we should have an editor class
 61+ if( embedPlayer.supports['overlays'] && embedPlayer.instanceOf.toLowerCase() != 'smil' ){
 62+ mw.remoteSequencerAddEditOverlay( embedPlayerId )
 63+ // xxx should use getter setter
 64+ embedPlayer.controlBuilder.displayOptionsMenuFlag = true;
 65+ }
 66+ return true;
 67+ })
 68+ $j( embedPlayer ).bind( 'onend', function( onDoneAction ){
 69+ // pause event should fire
 70+ //mw.remoteSequencerAddEditOverlay( embedPlayerId )
 71+
 72+ // show the credits screen after 3 seconds
 73+ setTimeout(function(){
 74+ $j( embedPlayer ).siblings( '.kalturaEditOverlay' ).fadeOut( 'fast' );
 75+ embedPlayer.$interface.find('.k-menu').fadeIn('fast');
 76+ },3000)
 77+
 78+ // On end runs before interface bindings (give the dom 10ms to build out the menu )
 79+ setTimeout(function(){
 80+ $j( embedPlayer ).siblings( '.k-menu' ).hide();
 81+ },10)
 82+ });
 83+ $j( embedPlayer ).bind( 'play', function(){
 84+ $j( embedPlayer ).siblings( '.kalturaEditOverlay' ).fadeOut( 'fast' );
 85+ embedPlayer.controlBuilder.displayOptionsMenuFlag = false;
 86+ return true ;
 87+ });
 88+ }
 89+});
 90+mw.remoteSequencerAddEditOverlay = function( embedPlayerId ){
 91+ var embedPlayer = $j( '#' + embedPlayerId ).get(0);
 92+ if(! $j( '#' + embedPlayerId ).siblings( '.kalturaEditOverlay' ).length ){
 93+ var editLink = '#';
 94+ if( mw.isLocalDomain( mw.getApiProviderURL( embedPlayer.apiProvider ) )
 95+ &&
 96+ embedPlayer.apiTitleKey )
 97+ {
 98+ var seqTitle = embedPlayer.apiTitleKey
 99+ .replace( 'Sequence-', 'Sequence:')
 100+ // strip the extension
 101+ seqTitle = seqTitle.substr(0, seqTitle.length -4 );
 102+ // not ideal details page builder but 'should work' ::
 103+ editLink = mw.getApiProviderURL( embedPlayer.apiProvider ).replace( 'api.php', 'index.php' );
 104+ editLink = mw.replaceUrlParams( editLink,
 105+ {
 106+ 'title' : seqTitle,
 107+ 'action' : 'edit'
 108+ }
 109+ );
 110+ }
 111+ var kalturaLinkAttr = {
 112+ 'href': 'http://kaltura.com',
 113+ 'target' : '_new',
 114+ 'title' : gM('mwe-embedplayer-kaltura-platform-title')
 115+ };
 116+ $j( '#' + embedPlayerId ).before(
 117+ $j( '<div />' )
 118+ .addClass( 'kalturaEditOverlay' )
 119+ .css({
 120+ 'position' : 'absolute',
 121+ 'width' : '100%',
 122+ 'top' : '0px',
 123+ 'bottom' : '22px',
 124+ 'background' : 'none repeat scroll 0 0 #FFF',
 125+ 'color' : 'black',
 126+ 'opacity': 0.9,
 127+ 'z-index': 999
 128+ })
 129+ .append(
 130+ $j('<div />')
 131+ .css({
 132+ 'position' : 'absolute',
 133+
 134+ 'width' : '200px',
 135+ 'margin-left' : '-100px',
 136+
 137+ 'height' : '100px',
 138+ 'margin-top' : '-50px',
 139+
 140+ 'top' : '50%',
 141+ 'left' : '50%',
 142+ 'text-align' : 'center'
 143+ })
 144+ .append(
 145+ gM('mwe-sequencer-you-can-edit-this-video',
 146+ $j('<a />')
 147+ .attr({
 148+ 'href': editLink,
 149+ 'target': '_new'
 150+ })
 151+ .click(function(){
 152+ // load the editor in-place if on the same domain as the sequence
 153+ if( editLink == '#' ){
 154+ if( ! window.mwSequencerRemote ){
 155+ window.mwSequencerRemote = new mw.MediaWikiRemoteSequencer({
 156+ 'title' : embedPlayer.apiTitleKey
 157+ });
 158+ }
 159+ window.mwSequencerRemote.showEditor();
 160+ return false;
 161+ }
 162+ return true;
 163+ })
 164+ ),
 165+ $j( '<br />' )
 166+ ,
 167+ gM( 'mwe-sequencer-using-kaltura-video-editor',
 168+ $j('<a />')
 169+ .attr( kalturaLinkAttr )
 170+ )
 171+ ,
 172+ $j('<a />')
 173+ .attr( kalturaLinkAttr )
 174+ .append(
 175+ $j('<div />')
 176+ .addClass('mwe-kalturaLogoLarge')
 177+ )
 178+ )
 179+ )
 180+ .hide() // hide .kalturaEditOverlay by default
 181+ );
 182+ }
 183+
 184+ $j( '#' + embedPlayerId ).siblings( '.kalturaEditOverlay' )
 185+ .fadeIn('fast');
 186+}
47187 mw.MediaWikiRemoteSequencer = function( options ) {
48188 return this.init( options );
49189 };
@@ -150,7 +290,7 @@
151291 },
152292
153293
154 - getSequenceFileKey: function( wgPageName ){
 294+ getSequenceFileKey: function(){
155295 return 'File:' + wgPageName.replace( 'Sequence:', 'Sequence-') + '.ogv';
156296 },
157297
@@ -161,7 +301,7 @@
162302 // Check if the sequence has been flattened and is up to date:
163303 var request = {
164304 'action': 'query',
165 - 'titles': _this.getSequenceFileKey( wgPageName ),
 305+ 'titles': _this.getSequenceFileKey(),
166306 'prop': 'imageinfo|revisions',
167307 'iiprop': 'url|metadata',
168308 'iiurlwidth': '400',
@@ -291,8 +431,16 @@
292432 })
293433 },
294434 getSequenceEmbedCode: function(){
295 - return 'embed code here';
 435+ var editLink = wgServer + wgArticlePath.replace('$1', wgTitle );
 436+ editLink = mw.replaceUrlParams( editLink, {'action' : 'edit' });
 437+
 438+ return '[[' + this.getSequenceFileKey() + "|thumb|400px|right|\n\n" +
 439+ "Sequence " + this.getTitle() + " \n\n" +
 440+ "<br/>Edit this sequence with the [" +
 441+ mw.getRemoteSequencerLink ( editLink ) +
 442+ ' kaltura editor] ]]';
296443 },
 444+
297445 showEditor: function(){
298446 var _this = this;
299447
@@ -327,8 +475,10 @@
328476 return {
329477 // The title for this sequence:
330478 title : _this.getTitle(),
331 - // If the sequence is new
 479+
 480+ // If the sequence is new
332481 newSequence : ( wgArticleId == 0 ),
 482+
333483 // Server config:
334484 server: {
335485 'type' : 'mediaWiki',
@@ -376,4 +526,6 @@
377527 // set page to loading
378528 // display sequence editor in "body" with -> full-screen link
379529 }; //Setup the remote configuration
380 -
\ No newline at end of file
 530+
 531+
 532+} )( window.mw );
\ No newline at end of file
Index: branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.style.SequencerRemote.css
@@ -0,0 +1,7 @@
 2+.mwe-kalturaLogoLarge{
 3+ width: 50px;
 4+ height: 50px;
 5+ background: url( 'images/kaltura_logo_transparent_large.png');
 6+ margin : auto;
 7+ cursor : pointer;
 8+}
Index: branches/MwEmbedStandAlone/modules/Sequencer/remotes/images/kaltura_logo_transparent_large.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/MwEmbedStandAlone/modules/Sequencer/remotes/images/kaltura_logo_transparent_large.png
___________________________________________________________________
Added: svn:mime-type
19 + application/octet-stream
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
@@ -197,11 +197,10 @@
198198 'titles' : _this.titleKey,
199199 'rvprop' : 'user|comment|timestamp'
200200 };
201 - mw.getJSON( _this.getApiUrl(), request, function( data ) {
202 - debugger;
203 - if( data.query && data.pages ){
204 - for( page_id in data.pages ){
205 - var page = data.pages[page_id];
 201+ mw.getJSON( _this.getApiUrl(), request, function( data ) {
 202+ if( data.query && data.query.pages ){
 203+ for( page_id in data.query.pages ){
 204+ var page = data.query.pages[page_id];
206205 if( page.revisions && page.revisions[0] && page.revisions[0].comment ){
207206 callback( page.revisions[0].comment );
208207 return;
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
@@ -434,9 +434,9 @@
435435 _this.sequencer.getActionsEdit().registerEdit();
436436
437437 // Select the current clip
438 - var $timelineClip = $clipTrackSet.find('#' + this.getTimelineClipId( smilClip ) )
 438+ var $timelineClip = $clipTrackSet.find('#' + _this.getTimelineClipId( smilClip ) )
439439 if( $timelineClip.length == 0 ){
440 - mw.log("Error: insertSmilClipEdit: could not find clip: " + this.getTimelineClipId( smilClip ) );
 440+ mw.log("Error: insertSmilClipEdit: could not find clip: " + _this.getTimelineClipId( smilClip ) );
441441 }
442442 _this.getTimelineContainer().find( '.selectedClip' ).removeClass( 'selectedClip' );
443443 $timelineClip.addClass( 'selectedClip' );
Index: branches/MwEmbedStandAlone/modules/Sequencer/loader.js
@@ -5,9 +5,15 @@
66 // Wrap in mw to not pollute global namespace
77 ( function( mw ) {
88
 9+ // Loader configuration options ( all runtime options are stored in mw.SequencerConfig.js )
 10+ mw.setDefaultConfig({
 11+ 'Sequencer.KalturaPlayerEditOverlay' : true
 12+ });
 13+
 14+
915 mw.addResourcePaths( {
1016 "mw.Sequencer" : "mw.Sequencer.js",
11 - "mw.style.Sequencer" : "mw.style.Sequencer.css",
 17+ "mw.style.Sequencer" : "mw.style.Sequencer.css",
1218
1319 "mw.SequencerConfig" : "mw.SequencerConfig.js",
1420
@@ -30,6 +36,8 @@
3137 "$j.fn.layout" : "ui.layout/ui.layout-1.2.0.js",
3238
3339 "mw.MediaWikiRemoteSequencer" : "remotes/mw.MediaWikiRemoteSequencer.js",
 40+ "mw.style.SequencerRemote" : "remotes/mw.style.SequencerRemote.css",
 41+
3442 "mw.style.Sequencer" : "css/mw.style.Sequencer.css"
3543
3644 } );
@@ -91,5 +99,16 @@
92100 ];
93101 });
94102
 103+ // If doing player overlays include remote for player hooks
 104+ $j( mw ).bind( 'LoaderEmbedPlayerUpdateRequest', function( event, playerElement, classRequest ) {
 105+ if( mw.getConfig( 'Sequencer.KalturaPlayerEditOverlay' )){
 106+ if( $j.inArray( 'mw.MediaWikiRemoteSequencer', classRequest ) == -1 ) {
 107+ classRequest.push('mw.MediaWikiRemoteSequencer');
 108+ classRequest.push('mw.style.SequencerRemote');
 109+ }
 110+ }
 111+ })
 112+
 113+
95114 } )( window.mw );
96115
\ No newline at end of file
Index: branches/MwEmbedStandAlone/modules/Sequencer/css/mw.style.Sequencer.css
@@ -1,5 +1,4 @@
22
3 -
43 .mwe-sequencer .timelineTrackContainer{
54 position: absolute;
65 border: solid thin #999;
Index: branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php
@@ -8,8 +8,11 @@
99
1010 $messages = array();
1111 $messages['en'] = array(
12 - 'mwe-sequencer-loading-sequencer' => 'Loading sequencer ...',
13 -
 12+ 'mwe-sequencer-loading-sequencer' => 'Loading sequencer ...',
 13+
 14+ 'mwe-sequencer-you-can-edit-this-video' => 'You can [$1 edit this video]',
 15+ 'mwe-sequencer-using-kaltura-video-editor' => 'Using the [$1 Kaltura] video editor',
 16+
1417 'mwe-sequencer-visual-editor'=> "Visual sequence editor",
1518 'mwe-sequencer-text-editor-warn'=> 'Text XML editor ( not recommended ) ',
1619 'mwe-sequencer-restore-text-edit' => '[$1 Restore text editor] ( note this <i>highly</i> recommended that you use the visual editor )',
@@ -58,7 +61,7 @@
5962 'mwe-sequencer-create-sequence' => 'Create sequence',
6063 'mwe-sequencer-edit-sequence' => 'Edit sequence',
6164
62 - 'mwe-sequencer-embed-sequence' => 'Embed Sequence into article',
 65+ 'mwe-sequencer-embed-sequence' => 'Embed Sequence into an article',
6366 'mwe-sequencer-embed-sequence-desc' => 'Copy the following code into an article to embed this sequence',
6467
6568 'mwe-sequencer-menu-sequence' => 'Sequence',
Index: branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsEdit.js
@@ -26,6 +26,7 @@
2727 getNumberOfUndos: function(){
2828 return mw.getConfig( 'Sequencer.NumberOfUndos' );
2929 },
 30+
3031 selectAll: function(){
3132 // Select all the items in the timeline
3233 $target = this.sequencer.getTimeline().getTimelineContainer();
@@ -92,9 +93,11 @@
9394 // index out of range set to 0
9495 this.editIndex = 0;
9596 mw.log("Error: SequenceActionsEdit:: undo Already at oldest index:" + this.editIndex);
 97+ // make sure to disable the menu item:
 98+ this.sequencer.getMenu().disableMenuItem( 'edit', 'undo' );
9699 }
97100 // if at oldest undo disable undo option
98 - if( ( this.editIndex - 1 ) < 0 ){
 101+ if( ( this.editIndex - 1 ) <= 0 ){
99102 this.sequencer.getMenu().disableMenuItem( 'edit', 'undo' );
100103 }
101104 },
Index: branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js
@@ -225,7 +225,7 @@
226226 };
227227
228228 $dialog.empty().append(
229 - gM('mwe-sequencer-save-summary' ),
 229+ gM('mwe-sequencer-save-summary' ),
230230 $j('<input />')
231231 .css({ 'width': 400 })
232232 .attr({
@@ -286,12 +286,13 @@
287287 $dialog.dialog( 'option', 'buttons', buttons);
288288 }
289289 });
290 -
291 -
292 -
293290 },
294291 doPublish: function( $dialog ){
295292 var _this = this;
 293+ // disable drag and resize
 294+ $dialog.dialog("option", "draggable", false )
 295+ $dialog.dialog( "option", "resizable", false );
 296+
296297 // Get a Firefogg object to check if firefogg is installed
297298 var myFogg = new mw.Firefogg( {
298299 'only_fogg':true
@@ -326,7 +327,12 @@
327328 $j('<span />').attr('id', 'firefoggPercentDone')
328329 .css('float', 'right')
329330 .text("%"),
330 - $j('<div />').attr( 'id', 'firefoggProgressbar')
 331+ $j('<div />')
 332+ .attr( 'id', 'firefoggProgressbar')
 333+ .css({
 334+ 'width': '100%',
 335+ 'height' : '20px'
 336+ })
331337
332338 );
333339 // Embed the player and continue application flow
@@ -345,10 +351,11 @@
346352 progressPrecent +
347353 '%'
348354 )
349 - mw.log( "set progrees to: " + Math.round( progress * 100 ) );
350355 $j("#firefoggProgressbar").progressbar({
351356 "value" : Math.round( progress * 100 )
352357 });
 358+ // xxx WTF? no idea why progressbar above is not working
 359+ $j("#firefoggProgressbar .ui-progressbar-value").css('width', Math.round( progress * 10000 ) / 100 + '%');
353360 },
354361 'doneRenderCallback': function( fogg ){
355362 _this.uploadRenderedVideo( $dialog, fogg );
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerAddMedia.js
@@ -22,7 +22,7 @@
2323 var _this = this;
2424 if( ! _this.remoteSearchDriver ){
2525 // Get any sequencer configured options
26 - var addMediaOptions = _this.sequencer.getOption('AddMedia');
 26+ var addMediaOptions = _this.sequencer.getOption('addMedia');
2727 addMediaOptions = $j.extend( {
2828 'target_container' : _this.sequencer.getEditToolTarget(),
2929 'target_search_input' : _this.sequencer.getMenuTarget().find('input.searchMedia'),
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
@@ -427,8 +427,13 @@
428428 $j.each( $j( this.smil.getEmbedPlayer() ).find('.smilRootLayout'), function(inx, pageNode){
429429 // Check if the node is in the smil dom
430430 if( _this.smil.$dom.find( '#' + _this.smil.getSmilDomId( pageNode ) ).length == 0 ){
431 - // remove from pageDom
432 - $j( pageNode ).remove();
 431+ // check for parent layout helper:
 432+ if( $j( pageNode ).parent('.refTransformWrap').length ){
 433+ $j( pageNode ).parent('.refTransformWrap').remove();
 434+ } else {
 435+ // Remove the pageNode
 436+ $j( pageNode ).remove();
 437+ }
433438 }
434439 });
435440 },
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
@@ -35,6 +35,10 @@
3636 }
3737 },
3838
 39+ getTargetAspectRatio:function(){
 40+ return this.smil.embedPlayer.getHeight() / this.smil.embedPlayer.getWidth();
 41+ },
 42+
3943 /*
4044 * Get layout
4145 */
@@ -82,7 +86,7 @@
8387 drawElement: function( smilElement ) {
8488 var _this = this;
8589 // Check for quick "show" path:
86 - var $targetElement = this.$rootLayout.find( '#' + this.smil.getPageDomId( smilElement ) )
 90+ var $targetElement = $j( '#' + this.smil.getPageDomId( smilElement ) );
8791 if( $targetElement.length ){
8892 $targetElement.show();
8993 return ;
@@ -98,22 +102,13 @@
99103 if( !$regionTarget ){
100104 return ;
101105 }
102 -
103 - // Check that the element is already in the dom
104 - var $targetElement = $regionTarget.find( '#' + this.smil.getPageDomId( smilElement ) );
105 - if( $targetElement.length == 0 ){
106 - mw.log(" drawElement:: " + this.smil.getPageDomId( smilElement ) );
107 - // Append the Smil to the target region
108 - $regionTarget.append(
109 - _this.getSmilElementHtml( smilElement )
110 - )
111 - } else {
112 - // Make sure the element is visible ( may be faster to just call
113 - // show directly)
114 - if( $targetElement.is(':hidden') ) {
115 - $targetElement.show();
116 - }
117 - }
 106+
 107+ // Append the Smil element to the target region
 108+ _this.addSmilElementHtml($regionTarget, smilElement )
 109+ mw.log( "addSmilElementHtml Added " +
 110+ this.smil.getPageDomId( smilElement ) +
 111+ ' to target: ' +
 112+ $j( '#' + this.smil.getPageDomId( smilElement ) ).length );
118113 },
119114
120115 drawElementThumb: function( $target, $node, relativeTime, callback){
@@ -274,44 +269,48 @@
275270 },
276271
277272 /**
278 - * Get the transformed smil element in html format
 273+ * Add the transformed smil element to the $regionTarget
279274 *
280275 * @param
281276 */
282 - getSmilElementHtml: function( smilElement ) {
283 - var smilType = this.smil.getRefType( smilElement )
284 -
 277+ addSmilElementHtml: function( $regionTarget, smilElement ) {
 278+ var _this = this;
 279+ var smilType = this.smil.getRefType( smilElement )
285280 switch( smilType ){
286281 // Not part of strict smil, but saves time being able have an "html"
287282 // display mode
288283 case 'cdata_html':
289 - return this.getSmilCDATAHtml( smilElement );
 284+ $regionTarget.append( this.getSmilCDATAHtml( smilElement ) );
 285+ return ;
290286 break;
291287 case 'video':
292 - return this.getSmilVideoHtml( smilElement );
 288+ $regionTarget.append( this.getSmilVideoHtml( smilElement ) );
 289+ return ;
293290 break;
294291 case 'img':
295 - return this.getSmilImgHtml( smilElement );
 292+ $regionTarget.append( this.getSmilImgHtml( smilElement ) );
 293+ // Update the asset layout ( only img supports layout atm )
 294+ _this.doSmilElementLayout( smilElement );
 295+ return ;
296296 break;
297297 case 'audio':
298 - return this.getSmilAudioHtml( smilElement );
 298+ $regionTarget.append( this.getSmilAudioHtml( smilElement ) );
 299+ return ;
299300 break;
300 - // Smil Text: http://www.w3.org/TR/SMIL/smil-text.html ( obviously
301 - // we support a subset )
 301+ // Smil Text: http://www.w3.org/TR/SMIL/smil-text.html
 302+ // We support a subset
302303 case 'smiltext':
303 - return this.getSmilTextHtml( smilElement );
 304+ $regionTarget.append( this.getSmilTextHtml( smilElement ) ) ;
 305+ return ;
304306 break;
305307 }
 308+
306309 mw.log( "Error: Could not find smil layout transform for element type: " +
307 - smilType + ' of type ' + $j( smilElement ).attr( 'type' ) );
308 -
309 - return $j('<span />')
310 - .attr( 'id' , this.smil.getPageDomId( smilElement ) )
311 - .css( {
312 - 'position' : 'absolute',
313 - 'zindex' : 9999 // xxx need to clean up z-index system
314 - })
315 - .text( 'Error: unknown type:' + smilType );
 310+ smilType + ' of type ' + $j( smilElement ).attr( 'type' ) );
 311+ $regionTarget.append( $j('<span />')
 312+ .attr( 'id' , this.smil.getPageDomId( smilElement ) )
 313+ .text( 'Error: unknown type:' + smilType )
 314+ )
316315 },
317316
318317 /**
@@ -466,18 +465,26 @@
467466 .attr( {
468467 'id' : this.smil.getPageDomId( smilImg ),
469468 'src' : this.smil.getAssetUrl( $j( smilImg ).attr( 'src' ) )
470 - } );
471 -
472 - _this.getNaturalSize( $image.get(0), function( naturalSize) {
473 - _this.doAssetLayout( smilImg , naturalSize);
474 - })
 469+ } )
 470+ // default width 100%
 471+ .css('width', '100%')
 472+
475473 return $image;
476474 },
 475+ doSmilElementLayout: function( smilElement ){
 476+ var _this = this;
 477+
 478+ var img = $j( '#' + this.smil.getPageDomId( smilElement ) ).get(0);
 479+ _this.getNaturalSize( img, function( naturalSize) {
 480+ _this.doAssetLayout( smilElement , naturalSize);
 481+ });
 482+ },
477483 // xxx should really use a callback instead of failing if the media is not
478484 // loaded
479485 getNaturalSize: function( img , callback){
480486 // note this just works for images atm
481487 if( !img ){
 488+ mw.log("Error getNaturalSize for null image ");
482489 callback( false );
483490 }
484491 if( img.naturalWidth ){
@@ -498,7 +505,7 @@
499506 * Layout an asset
500507 */
501508 doAssetLayout: function( smilElement, naturalSize ){
502 -
 509+ var _this = this;
503510 // We default smil layout to meetBest
504511 var fitMode = $j( smilElement).attr('fit');
505512 if( !fitMode ){
@@ -518,7 +525,7 @@
519526 mw.log("Layout mode: " + fitMode + ' not yet supported');
520527 }
521528
522 - // Check for panZoom attribute
 529+ // Check for panZoom attribute ( if animation is set it will override this value )
523530 if( $j( smilElement).attr('panZoom') ){
524531 _this.panZoomLayout( smilElement );
525532 }
@@ -530,28 +537,48 @@
531538 var _this = this;
532539
533540 // xxx Should read smil "imgElement" fill type
534 - var imageCss = {};
535 -
 541+ var imageCss = _this.getDominateAspectTransform( natrualSize, targetSize, 100 );
 542+
 543+ // update the layout of the element
 544+ $j( element ).css( imageCss );
 545+ },
 546+
 547+ getDominateAspectTransform: function(natrualSize, targetSize, transformPercent ){
 548+ var _this = this;
 549+ var transformCss = {}
 550+ if( ! targetSize ){
 551+ targetSize = {
 552+ 'width' : this.smil.embedPlayer.getWidth(),
 553+ 'height' : this.smil.embedPlayer.getHeight()
 554+ };
 555+ }
536556 // Fit the image per the provided targetWidth closure
537 - if( natrualSize.width > targetSize.width ){
538 - imageCss.width = '100%';
539 - imageCss.height = ( 100 * ( natrualSize.height / natrualSize.width ) ) + '%';
 557+ if( natrualSize.width / natrualSize.height > targetSize.width / targetSize.height ){
 558+ transformCss.width = transformPercent + '%';
 559+ transformCss.height = ( transformPercent * (
 560+ ( natrualSize.height / natrualSize.width ) /
 561+ _this.getTargetAspectRatio()
 562+ )
 563+ ) + '%';
540564 }
541565
542566 // Fit vertically
543 - if(! imageCss.height || imageCss.height > targetSize.height ){
544 - imageCss.height = '100%';
545 - imageCss.width = ( 100 * ( natrualSize.width / natrualSize.height ) ) + '%';
 567+ if(! transformCss.height || natrualSize.width / natrualSize.height < targetSize.width / targetSize.height ){
 568+ transformCss.height = transformPercent + '%';
 569+ transformCss.width = ( transformPercent *
 570+ ( natrualSize.width / natrualSize.height ) /
 571+ _this.getTargetAspectRatio()
 572+ ) + '%';
546573 }
547 - // update the layout of the element
548 - $j( element ).css( imageCss );
 574+ return transformCss;
549575 },
 576+
550577 /**
551578 * layout function
552579 */
553580 panZoomLayout: function( smilElement ){
554 - var _this = this;
555 - var panZoom = this.parsePanZoom( $j( smilElement).attr('panZoom') );
 581+ var _this = this;
 582+ var panZoom = $j( smilElement).attr('panZoom').split(',');
556583 var img = $j( '#' + this.smil.getPageDomId( smilElement ) ).get(0);
557584
558585 _this.getNaturalSize( img, function( natrualSize ){
@@ -567,11 +594,11 @@
568595 // no transform is needed
569596 return ;
570597 }
571 - // Get percent values
572 - var percentValues = _this.smil.getAnimate().getPercentFromPanZoomValues( panZoomValues, natrualSize );
573 -
 598+ // Get percent values
 599+ var percentValues = _this.smil.getAnimate().getPercentFromPanZoomValues( panZoom, natrualSize );
 600+
574601 // Update the layout via the animation engine updateElementLayout method
575 - _this.smil.getAnimate().updateElementLayout( smilElement, panZoomValues );
 602+ _this.smil.getAnimate().updateElementLayout( smilElement, percentValues );
576603 });
577604 },
578605 /**
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
@@ -380,6 +380,7 @@
381381 * http://www.w3.org/TR/SMIL/smil-extended-media-object.html#q32
382382 */
383383 transformPanZoom: function( smilImgElement, animateElement, animateTime ){
 384+ var _this = this;
384385 var begin = this.smil.parseTime( $j( animateElement ).attr( 'begin') );
385386 var duration = this.smil.parseTime( $j( animateElement ).attr( 'dur') );
386387
@@ -397,32 +398,32 @@
398399 // Let Top Width Height
399400 // translate values into % values
400401 // NOTE this is dependent on the media being "loaded" and having natural width and height
401 -
402 - var percentValues = this.getPercentFromPanZoomValues( targetValue,
403 - this.smil.getLayout().getNaturalSize( smilImgElement )
404 - );
405 -
406 - // Now we have "hard" layout info try and render it.
407 - this.updateElementLayout( smilImgElement, percentValues );
 402+ this.smil.getLayout().getNaturalSize(smilImgElement, function( naturalSize ){
 403+ var percentValues = _this.getPercentFromPanZoomValues( targetValue, naturalSize );
 404+ // Now we have "hard" layout info try and render it.
 405+ _this.updateElementLayout( smilImgElement, percentValues );
 406+ });
408407 },
409408 // transforms pan zoom target value into layout percentages
410409 getPercentFromPanZoomValues: function(targetValue, naturalSize){
411 - var namedValueOrder = ['left', 'top', 'width', 'height' ];
 410+ var namedValueOrder = [ 'left', 'top', 'width', 'height' ];
412411 var percentValues = {};
413412 for( var i =0 ;i < targetValue.length ; i++ ){
414413 if( targetValue[i].indexOf('%') == -1 ) {
415414 switch( namedValueOrder[i] ){
416415 case 'left':
417416 case 'width':
418 - percentValues[ namedValueOrder[i] ] = parseFloat( targetValue[i] ) / naturalSize.width;
 417+ percentValues[ namedValueOrder[i] ] =
 418+ ( parseFloat( targetValue[i] ) / naturalSize.width ) * 100
419419 break;
420420 case 'height':
421421 case 'top':
422 - percentValues[ namedValueOrder[i] ] = parseFloat( targetValue[i] ) / naturalSize.height
 422+ percentValues[ namedValueOrder[i] ] =
 423+ ( parseFloat( targetValue[i] ) / naturalSize.height ) * 100
423424 break;
424425 }
425426 } else {
426 - percentValues[ namedValueOrder[i] ] = parseFloat( targetValue[i] ) / 100;
 427+ percentValues[ namedValueOrder[i] ] = parseFloat( targetValue[i] );
427428 }
428429 }
429430 return percentValues;
@@ -430,38 +431,22 @@
431432
432433 // xxx need to refactor move to "smilLayout"
433434 updateElementLayout: function( smilElement, percentValues ){
 435+ var _this = this;
 436+ mw.log("updateElementLayout::" + ' ' + percentValues.left + ' ' + percentValues.top + ' ' + percentValues.width + ' ' + percentValues.height );
434437
435 - //mw.log("updateElementLayout::" + percentValues.top + ' ' + percentValues.left + ' ' + percentValues.width + ' ' + percentValues.height );
436 -
437438 // get a pointer to the html target:
438 - var $target = $j( '#' + this.smil.getPageDomId( smilElement ));
439 -
440 - var htmlAsset = $j( '#' + this.smil.getPageDomId( smilElement ) ).get(0);
441 -
442 - // xxx best way may be to use canvas and a fitting system.
443 -
444 - // Setup target height width based target region size
445 - var fullWidth = $target.parents('.smilRegion').width() ;
446 - var fullHeight = $target.parents('.smilRegion').height() ;
447 - var targetWidth = fullWidth;
448 - var targetHeight = targetWidth * (
449 - ( parseInt( percentValues['height'] ) * htmlAsset.naturalHeight )
450 - /
451 - ( parseInt( percentValues['width'] ) * htmlAsset.naturalWidth )
452 - )
453 - // Check if it exceeds the height constraint:
454 - var sourceScale = ( targetHeight < fullHeight )
455 - ? (1 / parseInt( percentValues['width'] ) )
456 - : (1 / parseInt( percentValues['height'] ) )
457 -
458 -
459 - // Wrap the target and absolute the image layout ( if not already )
460 - if( $target.parent('.refTransformWrap').length === 0 ){
 439+ var $target = $j( '#' + this.smil.getPageDomId( smilElement ));
 440+ var htmlElement = $j( '#' + this.smil.getPageDomId( smilElement ) ).get(0);
 441+
 442+ // Wrap the target with its natura size ( if not already )
 443+ if( $target.parent('.refTransformWrap').length == 0 ){
461444 $target
462445 .wrap(
463446 $j( '<div />' )
464447 .css( {
465 - 'position' : 'relative',
 448+ 'top' : '0px',
 449+ 'left' : '0px',
 450+ 'position' : 'absolute',
466451 'overflow' : 'hidden',
467452 'width' : '100%',
468453 'height' : '100%'
@@ -469,14 +454,17 @@
470455 .addClass('refTransformWrap')
471456 )
472457 }
473 - // Run the css transform
474 - $target.css( {
475 - 'position' : 'absolute',
476 - 'width' : sourceScale *100 + '%',
477 - 'height' : sourceScale *100 + '%',
478 - 'top' : (-1 * parseInt( percentValues['top'] ) )*100 + '%',
479 - 'left' : (-1 * parseInt( percentValues['left'] ) )*100 + '%',
480 - } );
 458+
 459+ _this.smil.getLayout().getNaturalSize( htmlElement, function( natrualSize ){
 460+ // XXX note we have locked aspect so we can use 'width' here:
 461+ var sizeCss = _this.smil.getLayout().getDominateAspectTransform( natrualSize, null, percentValues.width );
 462+ // Run the css transform
 463+ $target.css( {
 464+ 'position' : 'absolute',
 465+ 'left' : percentValues.left,
 466+ 'top' : percentValues.top
 467+ }).css( sizeCss );
 468+ });
481469 },
482470
483471 /**
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/loader.js
@@ -7,12 +7,10 @@
88 mw.setDefaultConfig( {
99 // The framerate for the smil player
1010 'SmilPlayer.framerate': 30
11 - } );
12 -
 11+ } );
1312
1413 mw.addResourcePaths( {
15 - "mw.SmilHooks" : "mw.SmilHooks.js",
16 -
 14+ "mw.SmilHooks" : "mw.SmilHooks.js",
1715 "mw.Smil" : "mw.Smil.js",
1816 "mw.SmilLayout" : "mw.SmilLayout.js",
1917 "mw.style.SmilLayout" : "mw.style.SmilLayout.css",
@@ -55,11 +53,11 @@
5654 return true;
5755 }
5856 var loadSmil = false;
59 - $j( element ).find( 'source' ).each( function(inx, sourceElement){
 57+ $j( element ).find( 'source' ).each( function( inx, sourceElement ){
6058 if( mw.CheckElementForSMIL( sourceElement ) ){
6159 loadSmil = true;
6260 return true;
63 - }
 61+ }
6462 });
6563 return loadSmil;
6664 };
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -134,17 +134,22 @@
135135 var body = document.getElementById( 'bodyContent' );
136136 body.innerHTML = "<div class=\"loadingSpinner sequenceLoader\"></div>" + body.innerHTML;
137137 }
138 - loadMwEmbed( [ 'mw.MediaWikiRemoteSequencer' ], function(){
139 - $j('#editform,.mw-newarticletext').hide();
140 - $j('.sequenceLoader').hide();
141 -
142 - var remote = new mw.MediaWikiRemoteSequencer({
143 - 'action': wgAction,
144 - 'title' : wgTitle,
145 - 'target' : '#bodyContent'
146 - });
147 - remote.drawUI();
148 - } );
 138+ if( window.mwSequencerRemote ){
 139+ window.mwSequencerRemote.drawUI();
 140+ } else {
 141+ loadMwEmbed( [ 'mw.MediaWikiRemoteSequencer', 'mw.style.SequencerRemote' ], function(){
 142+ $j('#editform,.mw-newarticletext').hide();
 143+ $j('.sequenceLoader').hide();
 144+
 145+ window.mwSequencerRemote = new mw.MediaWikiRemoteSequencer({
 146+ 'action': wgAction,
 147+ 'title' : wgTitle,
 148+ 'target' : '#bodyContent'
 149+ });
 150+ window.mwSequencerRemote.drawUI();
 151+ } );
 152+ }
 153+
149154 }
150155 return ;
151156 }
@@ -175,9 +180,9 @@
176181 // Special api proxy page
177182 if ( wgPageName == 'MediaWiki:ApiProxy' ) {
178183 var wgEnableIframeApiProxy = true;
179 - loadMwEmbed( [ 'mw.ApiProxy' ], function() {
 184+ loadMwEmbed( [ 'mw.ApiProxy' ], function(){
180185 mw.load( mwEmbedHostPath + '/modules/ApiProxy/ApiProxyPage.js?' + mwGetReqArgs() );
181 - } );
 186+ });
182187 return ;
183188 }
184189
@@ -338,8 +343,8 @@
339344 // Check if file is from commons and therefore should explicitly set apiProvider to commons:
340345 var apiProviderAttr = ( src.indexOf( 'wikipedia\/commons' ) != -1 )?'apiProvider="commons" ': '';
341346
342 - // If in a gallery box we will be displaying the video larger in a lightbox
343 - if( $j( '#' + vidId ).parents( '.gallerybox' ).length ){
 347+ // If in a gallery box or filehistory we will be displaying the video larger in a lightbox
 348+ if( $j( '#' + vidId ).parents( '.gallerybox,.filehistory' ).length ){
344349 // Update the width to 400 and keep scale
345350 pwidth = 400;
346351 if( pheight != 0 ) {
@@ -372,7 +377,7 @@
373378 }
374379
375380 // If the video is part of a "gallery box" use light-box linker instead
376 - if( $j( '#' + vidId ).parents( '.gallerybox' ).length ){
 381+ if( $j( '#' + vidId ).parents( '.gallerybox,.filehistory' ).length ){
377382 $j( '#' + vidId ).after(
378383 $j( '<div />')
379384 .css( {
@@ -392,7 +397,7 @@
393398
394399 // A play button:
395400 $j( '<div />' )
396 - .css( {
 401+ .css({
397402 'position' : 'absolute',
398403 'top' : ( parseInt( $pimg.attr( 'height' ) ) /2 ) -25,
399404 'maring-left' : 'auto',
Index: branches/MwEmbedStandAlone/loader.js
@@ -96,7 +96,7 @@
9797
9898 // Set the default loader group strategy
9999 'loader.groupStrategy' : 'module'
100 -
 100+
101101 } );
102102
103103 /**

Status & tagging log