* made wgMaxUploadSize check work with js2/firefogg uploading interface.
authorMichael Dale <dale@users.mediawiki.org>
Thu, 6 Aug 2009 22:25:47 +0000 (22:25 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Thu, 6 Aug 2009 22:25:47 +0000 (22:25 +0000)
includes/upload/UploadFromChunks.php
js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html
js2/mwEmbed/jquery/jquery.ui-1.7.1/ui/ui.dialog.js
js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
js2/mwEmbed/libClipEdit/mvClipEdit.js
js2/mwEmbed/libSequencer/mvSequencer.js

index 5121a95..ce22b65 100644 (file)
@@ -229,16 +229,14 @@ class UploadFromChunks extends UploadBase {
                        }
                        return $status;
                } else {
-                       //check to make sure we have not expanded beyond $wgMaxUploadSize
-                       if( ( filesize( $this->mTempAppendPath ) + filesize( $this->mTempPath ) ) >  $wgMaxUploadSize )
-                               $status = Status::newFatal( 'largefileserver' );
-
                        if( is_file( $this->getRealPath( $this->mTempAppendPath ) ) ){
                                $status = $this->appendToUploadFile( $this->mTempAppendPath, $this->mTempPath );
                        } else {
                                $status = Status::newFatal( 'filenotfound', $this->mTempAppendPath );
                        }
-
+                       //check to make sure we have not expanded beyond $wgMaxUploadSize
+                       if( filesize(  $this->getRealPath( $this->mTempAppendPath ) ) >  $wgMaxUploadSize )
+                               $status = Status::newFatal( 'largefileserver' );
 
                        return $status;
                }
index 97746f5..4c91bec 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML>
 <html><head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-    <title>Firefogg - Make Ogg Video in your Browser</title>      
+    <title>Firefogg - Make Ogg Video in your Browser</title>
        <script type="text/javascript" src="../jsScriptLoader.php?&class=mv_embed,window.jQuery,mvBaseUploadInterface,mvFirefogg,mvAdvFirefogg,$j.ui,$j.ui.progressbar,$j.ui.dialog,$j.cookie,$j.ui.accordion,$j.ui.slider,$j.ui.datepicker"></script>
 <style type="text/css" media="all">body {
   margin: 0;
index e59d519..9f4f5e5 100644 (file)
 (function($) {
 
 var setDataSwitch = {
-               dragStart: "start.draggable",
-               drag: "drag.draggable",
-               dragStop: "stop.draggable",
-               maxHeight: "maxHeight.resizable",
-               minHeight: "minHeight.resizable",
-               maxWidth: "maxWidth.resizable",
-               minWidth: "minWidth.resizable",
-               resizeStart: "start.resizable",
-               resize: "drag.resizable",
-               resizeStop: "stop.resizable"
+               dragStart       : "start.draggable",
+               drag            : "drag.draggable",
+               dragStop        : "stop.draggable",
+               maxHeight       : "maxHeight.resizable",
+               minHeight       : "minHeight.resizable",
+               maxWidth        : "maxWidth.resizable",
+               minWidth        : "minWidth.resizable",
+               resizeStart     : "start.resizable",
+               resize          : "drag.resizable",
+               resizeStop      : "stop.resizable"
        },
        
        uiDialogClasses =
index 64089c7..26d2541 100644 (file)
@@ -380,6 +380,7 @@ mvBaseUploadInterface.prototype = {
                                '4' : 'minlength1',
                                '5' : 'illegalfilename'                         
                        };
+                       
                        //@@todo: need to write conditionals that mirror SpecialUpload for handling these error types:  
                        var error_onlykey = {
                                '1': 'BEFORE_PROCESSING',
@@ -393,12 +394,21 @@ mvBaseUploadInterface.prototype = {
                                '13': 'INTERNAL_ERROR',
                                '14': 'MIN_LENGHT_PARTNAME'
                        }                       
+                       
                        //do a remote call to get the error msg:                
                        if(!error_code || error_code == 'unknown-error'){
                                if(typeof JSON != 'undefined'){
                                        js_log('Error: apiRes: ' + JSON.stringify( apiRes) );
                                }
-                               js_log('should update win::');
+                               if( apiRes.upload.error == 'internal-error'){                                   
+                                       errorKey = apiRes.upload.details[0];
+                                       gMsgLoadRemote(errorKey, function(){    
+                                               _this.updateProgressWin( gM( 'uploaderror' ), gM( errorKey ), bObj );
+                                               
+                                       });
+                                       return false;                                           
+                               }
+                               
                                _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + '<br>' + error_msg, bObj );
                                return false;
                        }else{
index 5023add..83a7461 100644 (file)
@@ -380,7 +380,10 @@ mvClipEdit.prototype = {
                        );
                        _this.setInOutBindings();                       
                }
-               $j('#'+this.control_ct).append( _this.getInsertDescHtml() );
+               //if in a sequence we have no need for insertDesc
+               if( !_this.p_seqObj){
+                       $j('#'+this.control_ct).append( _this.getInsertDescHtml() );
+               }
                //update control actions                                                                                
                this.updateInsertControlActions();                                                                              
        },
index 815d8a6..384b960 100644 (file)
@@ -50,7 +50,7 @@ loadGM({
                
        "mv_welcome_to_sequencer" : "<h3>Welcome to the sequencer demo</h3> very <b>limited</b> functionality right now. Not much documentation yet either",
        
-       "no_selected_resource" : "<h3>No Resource selected</h3> Select a Clip to enable editing",
+       "no_selected_resource" : "<h3>No Resource Selected</h3> Select a Clip to enable editing",
        "error_edit_multiple" : "<h3>Multiple Resources Selected</h3> Select a single clip to edit it", 
        
        "mv_editor_options" : "Editor options",
@@ -566,7 +566,7 @@ mvSequencer.prototype = {
                                '<a id="mv_menu_item_'+tab_id+'" href="#' + tab_id + '_ic">'+gM('menu_' + tab_id ) + '</a>' +
                        '</li>';                                                
                        
-                       tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:272px;" >';                                                                                                    
+                       tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:268px;" >';                                                                                                    
                                tabc += (menu_item.html) ? menu_item.html : '<h3>' + gM('menu_'+tab_id) + '</h3>';
                        tabc +='</div>';                                
                        inx++;