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

Revision: 73581
Author:   dale
Date:     2010-09-22 23:14:16 +0000 (Wed, 22 Sep 2010)

Log Message:
-----------
some minor fixes and style updates
fixed setting smil in and out times from text user input 

Modified Paths:
--------------
    branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerKeyBindings.js
    branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
    branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
    branches/MwEmbedStandAlone/remotes/mediaWiki.js

Modified: 
branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerKeyBindings.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerKeyBindings.js     
2010-09-22 22:53:54 UTC (rev 73580)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerKeyBindings.js     
2010-09-22 23:14:16 UTC (rev 73581)
@@ -33,9 +33,11 @@
        },
        onFocus: function( ){                           
                this.inputFocus = true;         
+               mw.log("text focus");
        },
        onBlur: function(){
                this.inputFocus = false;
+               mw.log("text blur");
        },      
        setupKeyBindigs: function(){
                var _this = this;

Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js  
2010-09-22 22:53:54 UTC (rev 73580)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js  
2010-09-22 23:14:16 UTC (rev 73581)
@@ -120,10 +120,16 @@
                },              
                wrapSequencerWikiText : function( xmlString ){
                        var _this = this;
-                       if( !_this.currentSequencePage || 
!_this.currentSequencePage.pageStart ){
+                       if( !_this.currentSequencePage ){
+                               _this.currentSequencePage= {};
+                       }
+                       if( !_this.currentSequencePage.pageStart ){             
        
                                 _this.currentSequencePage.pageStart ="\nTo 
edit or view this sequence " + 
                                        
'[{{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:MwEmbed.js}} enable the 
sequencer] for this page'; 
                        }
+                       if(!_this.currentSequencePage.pageEnd ){
+                               _this.currentSequencePage.pageEnd ='';
+                       }
                        return _this.currentSequencePage.pageStart + 
                                "\n\n<!-- " + SEQUENCER_PAYLOADKEY + "\n" + 
                                xmlString +

Modified: 
branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js     
2010-09-22 22:53:54 UTC (rev 73580)
+++ branches/MwEmbedStandAlone/modules/Sequencer/tools/mw.SequencerTools.js     
2010-09-22 23:14:16 UTC (rev 73581)
@@ -120,7 +120,7 @@
                'time' : {
                        update : function( _this, smilElement, attributeName, 
value){
                                // Validate time
-                               var seconds = 
_this.sequencer.getSmil().parseTime( value );
+                               var seconds = 
_this.sequencer.getSmil().parseTime( value );                             
                                $j( smilElement ).attr( attributeName, 
mw.seconds2npt( seconds ) );
                                // Update the clip duration :
                                _this.sequencer.getEmbedPlayer().getDuration( 
true );
@@ -859,6 +859,9 @@
                                                updateDurationThumb()
                                        )
                                }
+                               
+                               // Register the edit state for undo / redo 
+                               _this.sequencer.getActionsEdit().registerEdit();
                        },
                        // Return the trimTimeline edit widget
                        'draw': function( _this, target, smilElement ){
@@ -885,28 +888,37 @@
                                        return parseInt( ( time / 
fullClipDuration ) * sliderScale );
                                }
                                
-                               
+                               // Special flag to prevent slider updates from 
propgating if the change was based on user input
+                               var onInputChangeFlag = false;
                                var onInputChange = function( sliderIndex, 
timeValue ){ 
-                                       // Update the slider
+                                       onInputChangeFlag = true;
                                        if( fullClipDuration ){
+                                               // Update the slider
+                                               var sliderTime = ( sliderIndex 
== 0 )? timeToSlider( timeValue ) : 
+                                                       timeToSlider( timeValue 
+ smil.parseTime( $j('#' + _this.getEditToolInputId( 'trim', 'clipBegin') 
).val() ) );
+                                               
                                                $j('#'+_this.sequencer.id + 
'_trimTimeline' )
-                                                       .slider( 
-                                                                       
"values", 
-                                                                       
sliderIndex, 
-                                                                       
timeToSlider( timeValue )
-                                                       );                      
                
+                                                       .slider(
+                                                               "values", 
+                                                               sliderIndex, 
+                                                               sliderTime
+                                                       );                      
                                                        
                                        }
+                                       // restore the onInputChangeFlag
+                                       onInputChangeFlag = false;
+                                       
                                        // Directly update the smil xml from 
the user Input
-                                       if( sliderIndex == 0 ){
+                                       if( sliderIndex == 0 ){                 
                        
                                                // Update clipBegin 
                                                
_this.editableTypes['time'].update( _this, smilElement, 'clipBegin',  timeValue 
);
                                        } else {                                
        
                                                // Update dur
                                                
_this.editableTypes['time'].update( _this, smilElement, 'dur',   timeValue );
                                        }
+                                       mw.log(' should update inx:' + 
sliderIndex + ' set to: ' + timeValue);
                                        
                                        // Register the change
-                                       
_this.editWidgets.trimTimeline.onChange( _this, smilElement );
+                                       
_this.editWidgets.trimTimeline.onChange( _this, smilElement );                  
                
                                }
                                
                                // Add a trim binding:                          
 
@@ -918,8 +930,7 @@
                                
                                 $j('#' + _this.getEditToolInputId( 'trim', 
'dur') ) 
                                .change( function(){                    
-                                       var timeValue = smil.parseTime(  
$j(this).val() ) + 
-                                       smil.parseTime( $j('#' + 
_this.getEditToolInputId( 'trim', 'clipBegin') ).val() );
+                                       var timeValue = smil.parseTime(  
$j(this).val() );                                              
                                        onInputChange( 1, timeValue );
                                });
                                 
@@ -961,20 +972,16 @@
                                                                );
                                                        },
                                                        change: function( 
event, ui ) {
-                                                               var 
attributeValue = 0, sliderIndex  = 0;
-                                                               
-                                                               // Update 
clipBegin 
-                                                               
_this.editableTypes['time'].update( _this, smilElement, 'clipBegin',  
sliderToTime( ui.values[ 0 ] ) );
-                                                               
-                                                               // Update dur
-                                                               
_this.editableTypes['time'].update( _this, smilElement, 'dur',   sliderToTime( 
ui.values[ 1 ]- ui.values[0] ) );
-                                                                               
                                                                                
-                                                               // update the 
widget display
-                                                               
_this.editWidgets.trimTimeline.onChange( _this, smilElement );
-                                                               
-                                                               // Register the 
edit state for undo / redo 
-                                                               
_this.sequencer.getActionsEdit().registerEdit();
-                                                               
+                                                               if( ! 
onInputChangeFlag ){
+                                                                       // 
Update clipBegin 
+                                                                       
_this.editableTypes['time'].update( _this, smilElement, 'clipBegin',  
sliderToTime( ui.values[ 0 ] ) );
+                                                                       
+                                                                       // 
Update dur
+                                                                       
_this.editableTypes['time'].update( _this, smilElement, 'dur',   sliderToTime( 
ui.values[ 1 ]- ui.values[0] ) );
+                                                                               
                                                                                
        
+                                                                       // 
update the widget display
+                                                                       
_this.editWidgets.trimTimeline.onChange( _this, smilElement );                  
        
+                                                               }               
                                                
                                                        }
                                                })
                                        );

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js      
2010-09-22 22:53:54 UTC (rev 73580)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js      
2010-09-22 23:14:16 UTC (rev 73581)
@@ -589,8 +589,13 @@
                        'id' : this.smil.getSmilElementPlayerID( smilImg ), 
                        'src' : this.smil.getAssetUrl( $j( smilImg ).attr( 
'src' ) )
                } )
-               // default width 100%
-               .css('width', '100%')
+               // default width 100% upper left
+               .css({
+                       'position' : 'absolute',
+                       'top' : '0px',
+                       'left' : '0px',
+                       'width': '100%'
+               })
                        
                return $image;  
        },

Modified: branches/MwEmbedStandAlone/remotes/mediaWiki.js
===================================================================
--- branches/MwEmbedStandAlone/remotes/mediaWiki.js     2010-09-22 22:53:54 UTC 
(rev 73580)
+++ branches/MwEmbedStandAlone/remotes/mediaWiki.js     2010-09-22 23:14:16 UTC 
(rev 73581)
@@ -4,7 +4,7 @@
  */
 var urlparts = getRemoteEmbedPath();
 var mwEmbedHostPath = urlparts[0];
-var mwRemoteVersion = 'r150';
+var mwRemoteVersion = 'r151';
 var mwUseScriptLoader = true;
 
 // Log the mwRemote version makes it easy to debug cache issues



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

Reply via email to