* removed display of preview video for iframe uploads
authorMichael Dale <dale@users.mediawiki.org>
Thu, 5 Nov 2009 22:22:56 +0000 (22:22 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Thu, 5 Nov 2009 22:22:56 +0000 (22:22 +0000)
* fixed token check for iframe uploads

js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
js2/mwEmbed/libAddMedia/mvFirefogg.js
js2/mwEmbed/libAddMedia/remoteSearchDriver.js
js2/mwEmbed/mv_embed.js
js2/remoteMwEmbed.js

index 06be8ce..8c7e2ae 100644 (file)
@@ -202,7 +202,9 @@ mvBaseUploadInterface.prototype = {
                js_log('mvUPload:doUploadSwitch():' + _this.upload_mode);
                //issue a normal post request
                if( _this.upload_mode == 'api' && ! _this.http_copy_upload ){
-                                                                       
+                       //get the token from the page: 
+                       _this.etoken = $j("#wpEditToken").val();
+                       
                        //@@TODO check for sendAsBinnary to support firefox/html5 progress on upload
 
                        //set the form target to iframe target: 
index 4072474..35e1500 100644 (file)
@@ -313,10 +313,9 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
        },
        //do firefogg specific additions: 
        dispProgressOverlay:function(){
-               this.pe_dispProgressOverlay();          
-       
+               this.pe_dispProgressOverlay();                  
                //if we are uploading video (not in passthrough mode show preview button)
-               if( ! this.encoder_settings['passthrough']  && ! this.http_copy_upload ){ 
+               if( this.fogg_enabled && ! this.encoder_settings['passthrough']  && ! this.http_copy_upload ){ 
                        this.doPreviewControl();        
                }
        },
index c060e36..4bab6f6 100644 (file)
@@ -264,7 +264,9 @@ remoteSearchDriver.prototype = {
                //modify the content provider config based on options:          
                for(var i in this.content_providers){           
                        if(     _this.enabled_cps == 'all' && !this.disp_item  ){       
-                               this.disp_item = i; 
+                               this.disp_item = i;
+                               //end the for loop (no need to idorate if enabled_cps == 'all'
+                               break;
                        }else{
                                if( $j.inArray(i, _this.enabled_cps) != -1 ){
                                        //if no default display set to first enabled cp: 
index 16cb8f2..c35e692 100644 (file)
@@ -220,7 +220,7 @@ if( !mv_embed_path ) {
        $.conf = {
                'skin_name' : 'mvpcf',
                'jui_skin' : 'redmond',
-               'video_size' : '400x300'                
+               'video_size' : '400x300'        
        }
        // the version of mwEmbed
        $.version = '1.0r21';
index e993fc0..e7a2612 100644 (file)
@@ -23,7 +23,7 @@ function doPageSpecificRewrite() {
        }
 
        // Firefogg integration
-       if( wgPageName == "Special:Upload" ){
+       if( wgPageName == "Special:Upload" ){           
                load_mv_embed( function() {
                        loadExternalJs( mwEmbedHostPath + '/uploadPage.js' + reqAguments );
                } );
@@ -128,20 +128,17 @@ function getRemoteEmbedPath() {
        }
 }
 
-function load_mv_embed( callback ) {
-       if(console.log)
-               console.log( 'load_mv_embed');
+function load_mv_embed( callback ) {   
        // Inject mv_embed if needed
-       if( typeof mvEmbed == 'undefined' ) {
-               importScriptURI( mwEmbedHostPath + '/mwEmbed/mv_embed.js' + reqAguments );
-               check_for_mv_embed( callback );
-       } else {
-               check_for_mv_embed( callback );
+       if( typeof $mw == 'undefined' ) {
+               var mvurl = mwEmbedHostPath + '/mwEmbed/mv_embed.js' + reqAguments ;
+               importScriptURI( mvurl );               
        }
+       check_for_mv_embed( callback );
 }
 
 function check_for_mv_embed( callback ) {
-       if( typeof MV_EMBED_VERSION == 'undefined' ) {
+       if( typeof $mw == 'undefined' ) {
                setTimeout( function(){
                        check_for_mv_embed( callback );
                }, 25 );