From 4f1d0074e16206bc2a9d0cce06fca81dbbb3b680 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Sat, 7 Nov 2009 15:25:06 +0000 Subject: [PATCH] * fixed wpSourceTypeURL rename to wpSourceTypeUrl --- .../libAddMedia/mvBaseUploadInterface.js | 33 ++++++++++--------- js2/mwEmbed/libAddMedia/mvFirefogg.js | 8 ++--- js2/mwEmbed/libTimedText/mvTextInterface.js | 7 ++-- js2/remoteMwEmbed.js | 2 +- js2/uploadPage.js | 1 - 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js index 8c7e2ae4dd..7943fbea40 100644 --- a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js +++ b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js @@ -62,24 +62,26 @@ mvBaseUploadInterface.prototype = { js_log( "init mvBaseUploadInterface:: " + this.api_url); }, setupForm:function(){ + js_log("Base::setupForm::"); var _this = this; //set up the local pointer to the edit form: - _this.editForm = _this.getEditForm(); + _this.editForm = _this.getEditForm(); if( _this.editForm ){ - + //if in api re-map the upload form to api: (we have to do this BEFORE the users selects a file) - if(_this.upload_mode == 'api'){ + if( _this.upload_mode == 'api'){ _this.doRemapFormToApi(); - } + } //set up the org_onsubmit if not set: if( typeof( _this.org_onsubmit ) == 'undefined' && _this.editForm.onsubmit ) - _this.org_onsubmit = _this.editForm.onsubmit; - + _this.org_onsubmit = _this.editForm.onsubmit; + + //set up the submit action: $j( _this.editForm ).submit( function(){ js_log('setupForm.onSubmit:'); - + //set the upload mode: _this.setWgUploadSelect(); @@ -104,6 +106,7 @@ mvBaseUploadInterface.prototype = { } //put into a try catch so we are sure to return false: try{ + debugger; //get a clean loader: _this.dispProgressOverlay(); @@ -119,8 +122,10 @@ mvBaseUploadInterface.prototype = { //don't submit the form we will do the post in ajax return false; }); - } - + } + $j('#testcat').click(function(){ + $j( _this.editForm ).submit(); + }); }, detectUploadMode:function( callback ){ var _this = this; @@ -167,7 +172,7 @@ mvBaseUploadInterface.prototype = { return false; //add the action api - $j(_this.editForm).attr('action', _this.api_url); + //$j(_this.editForm).attr('action', _this.api_url); //add api url //add api action: @@ -185,15 +190,12 @@ mvBaseUploadInterface.prototype = { $j(_this.editForm).find("[name='wpEditToken']").attr('name', 'token'); $j(_this.editForm).find("[name='wpIgnoreWarning']").attr('name', 'ignorewarnings'); $j(_this.editForm).find("[name='wpWatchthis']").attr('name', 'watch'); - - //update the status to 100% progress bar (no status in iframe submit) - $j('#up-progressbar' ).progressbar( 'value', parseInt( 100 ) ); - $j('#up-status-container').html( gM('mwe-upload-in-progress') ); + }, setWgUploadSelect: function(){ if( $j('#wpSourceTypeFile').length == 0 || $j('#wpSourceTypeFile').get(0).checked ){ this.http_copy_upload = false; - }else if( $j('#wpSourceTypeURL').get(0).checked ){ + }else if( $j('#wpSourceTypeUrl').get(0).checked ){ this.http_copy_upload = true; } }, @@ -242,7 +244,6 @@ mvBaseUploadInterface.prototype = { return false; }else if( _this.upload_mode == 'api' ){ js_log('doHttpUpload (no form submit) '); - //if the api is supported.. && source type is http do upload with http status updates var httpUpConf ={ 'url' : $j('#wpUploadFileURL').val(), diff --git a/js2/mwEmbed/libAddMedia/mvFirefogg.js b/js2/mwEmbed/libAddMedia/mvFirefogg.js index 35e1500d75..98ab67beed 100644 --- a/js2/mwEmbed/libAddMedia/mvFirefogg.js +++ b/js2/mwEmbed/libAddMedia/mvFirefogg.js @@ -182,7 +182,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface //hide all targets: var hide_target_list=''; var coma=''; - $j.each(default_firefogg_options, function(target, na){ + $j.each( default_firefogg_options, function(target, na) { if(target.substring(0, 6)=='target'){ hide_target_list+=coma + _this[target]; coma=','; @@ -190,7 +190,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface }); $j( hide_target_list ).hide(); //now that the proper set of items has been hiiden show: - $j( this.selector ).show(); + $j( _this.selector ).show(); //hide all but check-for-fogg @@ -199,7 +199,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface //if rewriting the form lets keep the text input around: if( _this.form_rewrite ) - $j(this.target_input_file_name).show(); + $j( _this.target_input_file_name ).show(); //show select file: $j( this.target_btn_select_file ).unbind( @@ -547,7 +547,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface return gM('mwe-upload-transcode-in-progress'); }, doUploadSwitch:function(){ - var _this = this; + var _this = this; js_log("firefogg: doUploadSwitch:: " + this.fogg_enabled + ' up mode:' + _this.upload_mode); //make sure firefogg is enabled otherwise do parent UploadSwich: if( !this.fogg_enabled || !this.firefogg_form_action ) diff --git a/js2/mwEmbed/libTimedText/mvTextInterface.js b/js2/mwEmbed/libTimedText/mvTextInterface.js index 8cbb9c8f28..8dfec18adb 100644 --- a/js2/mwEmbed/libTimedText/mvTextInterface.js +++ b/js2/mwEmbed/libTimedText/mvTextInterface.js @@ -1,11 +1,10 @@ loadGM({ - "mwe-select_transcript_set" : "Select layers", + "mwe-select_transcript_set" : "Select subtitles", "mwe-auto_scroll" : "auto scroll", "mwe-close" : "close", "mwe-improve_transcript" : "Improve", - "mwe-no_text_tracks_found" : "No text tracks were found", - "mwe-subtitles" : "$1 subtitles" + "mwe-no_text_tracks_found" : "No text tracks were found" }) // text interface object (for inline display captions) var mvTextInterface = function( parentEmbed ){ @@ -86,7 +85,7 @@ mvTextInterface.prototype = { 'category' : 'SUB', 'lang' : langKey, 'type' : mimeTypes[ extension ], - 'title' : gM('mwe-subtitles', langData[ langKey]), + 'title' : langData[ langKey], 'src' : wgServer + wgScript + '?title=' + subPage.title + '&action=raw' }); _this.pe.media_element.tryAddSource( textElm ); diff --git a/js2/remoteMwEmbed.js b/js2/remoteMwEmbed.js index 50d5b301cf..e5cec897c2 100644 --- a/js2/remoteMwEmbed.js +++ b/js2/remoteMwEmbed.js @@ -17,7 +17,7 @@ addOnloadHook( function(){ function doPageSpecificRewrite() { // Add media wizard if( wgAction == 'edit' || wgAction == 'submit' ) { - load_mv_embed( function() { + load_mv_embed( function() { loadExternalJs( mwEmbedHostPath + '/editPage.js' + reqAguments ); } ); } diff --git a/js2/uploadPage.js b/js2/uploadPage.js index a41b2ddc34..1676cea081 100644 --- a/js2/uploadPage.js +++ b/js2/uploadPage.js @@ -4,7 +4,6 @@ */ js2AddOnloadHook( function() { - js_log("never ran js2hook"); mwUploadHelper.init(); }); -- 2.20.1