http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73356

Revision: 73356
Author:   dale
Date:     2010-09-20 04:59:32 +0000 (Mon, 20 Sep 2010)

Log Message:
-----------
* added track duration and associated duration change bind trigger.
* fixed new sequence save bug

Modified Paths:
--------------
    branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php
    branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerPlayer.js
    branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
    branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js

Modified: branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php     
2010-09-20 04:13:21 UTC (rev 73355)
+++ branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php     
2010-09-20 04:59:32 UTC (rev 73356)
@@ -15,7 +15,7 @@
 
        'mwe-sequencer-visual-editor'=> "Visual sequence editor",
        'mwe-sequencer-text-editor-warn'=> 'Text XML editor ( not recommended ) 
',
-       'mwe-sequencer-restore-text-edit' => '[$1 Restore text editor] ( It\'s 
<i>highly</i> recommended that you use the visual editor',
+       'mwe-sequencer-restore-text-edit' => '[$1 Restore text editor] ( It\'s 
<i>highly</i> recommended that you use the visual editor )',
 
        'mwe-sequencer-loading-timeline' => 'Loading timeline ...',
        'mwe-sequencer-loading-player' => 'Loading player ...',

Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerPlayer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerPlayer.js  
2010-09-20 04:13:21 UTC (rev 73355)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerPlayer.js  
2010-09-20 04:59:32 UTC (rev 73356)
@@ -95,7 +95,7 @@
                if( this.sequencer.options.videoAspect ){
                        var aspect = this.sequencer.options.videoAspect.split( 
':' );                                                                          
         
                        var apectRatio = ( aspect[1] / aspect[0] );
-                       size.height = parseInt( size.width * ( aspect[1] / 
aspect[0] ) )- 50;
+                       size.height = parseInt( size.width * ( aspect[1] / 
aspect[0] ) )- 55;
                } else {
                        size.height = $playerContainer.height() ;
                }

Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js  
2010-09-20 04:13:21 UTC (rev 73355)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js  
2010-09-20 04:59:32 UTC (rev 73356)
@@ -40,6 +40,9 @@
                //Template cache of wikitext for templates loaded in this 
session
                templateTextCache: [],
                
+               // Current sequence page
+               currentSequencePage: {},
+               
                /**
                 * init the sequencer
                 */
@@ -117,7 +120,7 @@
                },              
                wrapSequencerWikiText : function( xmlString ){
                        var _this = this;
-                       if( !_this.currentSequencePage.pageStart ){
+                       if( !_this.currentSequencePage || 
!_this.currentSequencePage.pageStart ){
                                 _this.currentSequencePage.pageStart ="\nTo 
edit or view this sequence " + 
                                        
'[{{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:MwEmbed.js}} enable the 
sequencer] for this page'; 
                        }

Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js        
2010-09-20 04:13:21 UTC (rev 73355)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js        
2010-09-20 04:59:32 UTC (rev 73356)
@@ -138,15 +138,24 @@
                        )
                        $clipTrackName = $j( '#' + 
this.getTrackNameInterfaceId( trackIndex ) );
                }
-               // Update the TrackNameInterface duration on every draw::
-               /*$clipTrackName.find('.trackDuration').text( 
-                       mw.seconds2npt( 
-                               
this.sequencer.getSmil().getBody().getClipDuration( smilSequenceTrack )
-                       )
-               )*/
                
+               var updateTrackDuration = function(){
+                       // Update the TrackNameInterface duration on every 
draw::
+                       $clipTrackName.find('.trackDuration')
+                       .fadeOut('slow', function(){                            
+                               $j(this).text( 
+                                       mw.seconds2npt( 
+                                               
_this.sequencer.getSmil().getBody().getClipDuration( $j( smilSequenceTrack )  )
+                                       )
+                               ).fadeIn( 'slow') 
+                       })
+               }
+               // Bind the update event to every time the duration is 
re-calculated
+               $j( this.sequencer.getEmbedPlayer() ).bind( 'durationchange', 
updateTrackDuration )
+               updateTrackDuration();
                
                
+               
                // Add Sequence track container if not present 
                var $clipTrackSet = $j( '#' + this.getTrackSetId( trackIndex ))
                mw.log( "SequenceTimeline::drawSequenceTrack: id: " +   
$clipTrackSet.length );
@@ -357,6 +366,9 @@
        },
        // calls the edit interface passing in the selected clip:
        editClip: function( selectedClip ){
+               // commit any input changes 
+               $j( document.activeElement ).change();
+               
                var smil = this.sequencer.getSmil();
                // get the smil element for the edit tool:
                var smilElement = smil.$dom.find( '#' + $j( selectedClip 
).data('smilId') );    

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js    2010-09-20 
04:13:21 UTC (rev 73355)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js    2010-09-20 
04:59:32 UTC (rev 73356)
@@ -296,9 +296,14 @@
                // return 0 while we don't have the $dom loaded
                if (!this.$dom) {
                        return 0;
-               }
+               }               
                if ( this.duration == null || forceRefresh === true ) {
+                       var orgDuration = this.duration
                        this.duration = this.getBody().getDuration( 
forceRefresh );
+                       // Trigger the duration change event: 
+                       if( orgDuration !=  this.duration ){
+                               $j( this.getEmbedPlayer() 
).trigger('durationchange');  
+                       }
                }
                return this.duration;
        },



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to