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

Revision: 73649
Author:   dale
Date:     2010-09-23 23:56:55 +0000 (Thu, 23 Sep 2010)

Log Message:
-----------
preserve _this context in smil callback

Modified Paths:
--------------
    branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js
    branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
    branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js

Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js        
2010-09-23 23:44:34 UTC (rev 73648)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js        
2010-09-23 23:56:55 UTC (rev 73649)
@@ -187,7 +187,7 @@
                                        if( smilXml == '' ){
                                                smilXml = _this.getNewSmilXML();
                                        }
-                                       _this.smilSource = _this.getDataUrl( 
smilXml );
+                                       _this.smilSource = _this.getDataUrl( 
smilXml );                                 
                                        callback( _this.smilSource )    
                                })
                                // Wait for server to return smil source

Modified: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js  
2010-09-23 23:44:34 UTC (rev 73648)
+++ branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js  
2010-09-23 23:56:55 UTC (rev 73649)
@@ -108,7 +108,7 @@
                        mw.getTitleText( this.getApiUrl(), this.getTitleKey(), 
function( smilPage ){                            
                                // Check for remote payload wrapper 
                                // XXX need to support multiple pages in single 
context                 
-                               _this.currentSequencePage =  
_this.parseSequencerPage( smilPage );
+                               _this.currentSequencePage =  
_this.parseSequencerPage( smilPage );                              
                                // Cache the latest serverSmil ( for local 
change checks ) 
                                // ( save requests automatically respond with 
warnings on other user updates )
                                if( _this.currentSequencePage.sequenceXML ){
@@ -118,8 +118,7 @@
                                        _this.serverSmilXml = '';
                                }
                                
-                               // Cache the pre / post bits
-                               
+                               // Cache the pre / post bits                    
        
                                callback( _this.serverSmilXml  );       
                        })
                },              

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js 
2010-09-23 23:44:34 UTC (rev 73648)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js 
2010-09-23 23:56:55 UTC (rev 73649)
@@ -301,16 +301,17 @@
        * @param callback 
        */
        getSmil: function( callback ){
+               var _this = this;
                if( !this.smil ) {
                        // Create the Smil engine object 
                        this.smil = new mw.Smil( this );
                        
                        // Load the smil 
                        this.smil.loadFromUrl( this.getSrc(), function(){
-                               callback( this.smil ); 
+                               callback( _this.smil ); 
                        });                     
                } else { 
-                       callback( this.smil );
+                       callback( _this.smil );
                }
        },
        

Modified: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js    2010-09-23 
23:44:34 UTC (rev 73648)
+++ branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js    2010-09-23 
23:56:55 UTC (rev 73649)
@@ -110,7 +110,7 @@
        loadFromString: function( smilXmlString ) {
                // Load the parsed string into the local "dom"
                this.$dom = $j( this.getXMLDomObject( smilXmlString ) );
-               mw.log("Smil::loadFromString: loaded smil dom: " + 
this.$dom.length + "\n" + smilXmlString );
+               mw.log("Smil::loadFromString: loaded smil dom: " + 
this.$dom.children().length + "\n" + smilXmlString );
        },
        /**
         * Update the smil dom via an xmlString
@@ -298,7 +298,7 @@
                        return 0;
                }               
                if ( this.duration == null || forceRefresh === true ) {
-                       var orgDuration = this.duration
+                       var orgDuration = this.duration;
                        this.duration = this.getBody().getDuration( 
forceRefresh );
                        // Trigger the duration change event: 
                        if( orgDuration !=  this.duration ){
@@ -404,7 +404,7 @@
                        // Escape link output as to not include scirpt execution
                        $j(link).attr('href', 
                                mw.escapeQuotesHTML( $j(link).attr('href') )
-                       )
+                       );
                });             
                
                // Make every asset url absolute and restrict domain of assets 
@@ -413,17 +413,17 @@
                        if( $j(node).attr('src') ){
                                $j(node).attr('src', 
                                        _this.getAssetUrl( $j(node).attr('src') 
)
-                               )
+                               );
                        }
                        if( $j(node).attr('data') ){
                                $j(node).attr('data', 
                                        _this.getAssetUrl(  
$j(node).attr('src') )
-                               )
+                               );
                        }
-                       // xxx don't know if we really need a form inside of 
smil. 
+                       // remove form action
                        if( $j(node).attr('action') ){
                                if( 
$j(node).attr('action').toLowerCase().indexOf('javascript') != -1 ){
-                                        $j(node).attr('action')= null;
+                                        $j(node).attr('action',  '');
                                } else {
                                        $j(node).attr('action', 
                                                _this.getAssetUrl( 
$j(node).attr('src') )



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

Reply via email to