* fixed wpSourceTypeURL rename to wpSourceTypeUrl
authorMichael Dale <dale@users.mediawiki.org>
Sat, 7 Nov 2009 15:25:06 +0000 (15:25 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Sat, 7 Nov 2009 15:25:06 +0000 (15:25 +0000)
js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
js2/mwEmbed/libAddMedia/mvFirefogg.js
js2/mwEmbed/libTimedText/mvTextInterface.js
js2/remoteMwEmbed.js
js2/uploadPage.js

index 8c7e2ae..7943fbe 100644 (file)
@@ -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(),
index 35e1500..98ab67b 100644 (file)
@@ -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 )
index 8cbb9c8..8dfec18 100644 (file)
@@ -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 );
index 50d5b30..e5cec89 100644 (file)
@@ -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 );
                } );
        }
index a41b2dd..1676cea 100644 (file)
@@ -4,7 +4,6 @@
  */
 
 js2AddOnloadHook( function() {
-       js_log("never ran js2hook");
        mwUploadHelper.init();
 });