From c05a06ad0796cc3fab25058dcb7f04ec59f79c8a Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Thu, 5 Nov 2009 22:22:56 +0000 Subject: [PATCH] * removed display of preview video for iframe uploads * fixed token check for iframe uploads --- .../libAddMedia/mvBaseUploadInterface.js | 4 +++- js2/mwEmbed/libAddMedia/mvFirefogg.js | 5 ++--- js2/mwEmbed/libAddMedia/remoteSearchDriver.js | 4 +++- js2/mwEmbed/mv_embed.js | 2 +- js2/remoteMwEmbed.js | 17 +++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js index 06be8ce21b..8c7e2ae4dd 100644 --- a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js +++ b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js @@ -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: diff --git a/js2/mwEmbed/libAddMedia/mvFirefogg.js b/js2/mwEmbed/libAddMedia/mvFirefogg.js index 4072474b2b..35e1500d75 100644 --- a/js2/mwEmbed/libAddMedia/mvFirefogg.js +++ b/js2/mwEmbed/libAddMedia/mvFirefogg.js @@ -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(); } }, diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index c060e367c9..4bab6f628a 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -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: diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index 16cb8f2173..c35e692a30 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -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'; diff --git a/js2/remoteMwEmbed.js b/js2/remoteMwEmbed.js index e993fc0317..e7a2612875 100644 --- a/js2/remoteMwEmbed.js +++ b/js2/remoteMwEmbed.js @@ -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 ); -- 2.20.1