r54541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54540‎ | r54541 | r54542 >
Date:22:25, 6 August 2009
Author:dale
Status:deferred
Tags:
Comment:
* made wgMaxUploadSize check work with js2/firefogg uploading interface.
Modified paths:
  • /trunk/phase3/includes/upload/UploadFromChunks.php (modified) (history)
  • /trunk/phase3/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html (modified) (history)
  • /trunk/phase3/js2/mwEmbed/jquery/jquery.ui-1.7.1/ui/ui.dialog.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromChunks.php
@@ -229,17 +229,15 @@
230230 }
231231 return $status;
232232 } else {
233 - //check to make sure we have not expanded beyond $wgMaxUploadSize
234 - if( ( filesize( $this->mTempAppendPath ) + filesize( $this->mTempPath ) ) > $wgMaxUploadSize )
235 - $status = Status::newFatal( 'largefileserver' );
236 -
237233 if( is_file( $this->getRealPath( $this->mTempAppendPath ) ) ){
238234 $status = $this->appendToUploadFile( $this->mTempAppendPath, $this->mTempPath );
239235 } else {
240236 $status = Status::newFatal( 'filenotfound', $this->mTempAppendPath );
241237 }
 238+ //check to make sure we have not expanded beyond $wgMaxUploadSize
 239+ if( filesize( $this->getRealPath( $this->mTempAppendPath ) ) > $wgMaxUploadSize )
 240+ $status = Status::newFatal( 'largefileserver' );
242241
243 -
244242 return $status;
245243 }
246244 }
Index: trunk/phase3/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html
@@ -1,7 +1,7 @@
22 <!DOCTYPE HTML>
33 <html><head>
44 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5 - <title>Firefogg - Make Ogg Video in your Browser</title>
 5+ <title>Firefogg - Make Ogg Video in your Browser</title>
66 <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>
77 <style type="text/css" media="all">body {
88 margin: 0;
Index: trunk/phase3/js2/mwEmbed/jquery/jquery.ui-1.7.1/ui/ui.dialog.js
@@ -15,16 +15,16 @@
1616 (function($) {
1717
1818 var setDataSwitch = {
19 - dragStart: "start.draggable",
20 - drag: "drag.draggable",
21 - dragStop: "stop.draggable",
22 - maxHeight: "maxHeight.resizable",
23 - minHeight: "minHeight.resizable",
24 - maxWidth: "maxWidth.resizable",
25 - minWidth: "minWidth.resizable",
26 - resizeStart: "start.resizable",
27 - resize: "drag.resizable",
28 - resizeStop: "stop.resizable"
 19+ dragStart : "start.draggable",
 20+ drag : "drag.draggable",
 21+ dragStop : "stop.draggable",
 22+ maxHeight : "maxHeight.resizable",
 23+ minHeight : "minHeight.resizable",
 24+ maxWidth : "maxWidth.resizable",
 25+ minWidth : "minWidth.resizable",
 26+ resizeStart : "start.resizable",
 27+ resize : "drag.resizable",
 28+ resizeStop : "stop.resizable"
2929 },
3030
3131 uiDialogClasses =
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
@@ -380,6 +380,7 @@
381381 '4' : 'minlength1',
382382 '5' : 'illegalfilename'
383383 };
 384+
384385 //@@todo: need to write conditionals that mirror SpecialUpload for handling these error types:
385386 var error_onlykey = {
386387 '1': 'BEFORE_PROCESSING',
@@ -393,12 +394,21 @@
394395 '13': 'INTERNAL_ERROR',
395396 '14': 'MIN_LENGHT_PARTNAME'
396397 }
 398+
397399 //do a remote call to get the error msg:
398400 if(!error_code || error_code == 'unknown-error'){
399401 if(typeof JSON != 'undefined'){
400402 js_log('Error: apiRes: ' + JSON.stringify( apiRes) );
401403 }
402 - js_log('should update win::');
 404+ if( apiRes.upload.error == 'internal-error'){
 405+ errorKey = apiRes.upload.details[0];
 406+ gMsgLoadRemote(errorKey, function(){
 407+ _this.updateProgressWin( gM( 'uploaderror' ), gM( errorKey ), bObj );
 408+
 409+ });
 410+ return false;
 411+ }
 412+
403413 _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + '<br>' + error_msg, bObj );
404414 return false;
405415 }else{
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js
@@ -50,7 +50,7 @@
5151
5252 "mv_welcome_to_sequencer" : "<h3>Welcome to the sequencer demo</h3> very <b>limited</b> functionality right now. Not much documentation yet either",
5353
54 - "no_selected_resource" : "<h3>No Resource selected</h3> Select a Clip to enable editing",
 54+ "no_selected_resource" : "<h3>No Resource Selected</h3> Select a Clip to enable editing",
5555 "error_edit_multiple" : "<h3>Multiple Resources Selected</h3> Select a single clip to edit it",
5656
5757 "mv_editor_options" : "Editor options",
@@ -566,7 +566,7 @@
567567 '<a id="mv_menu_item_'+tab_id+'" href="#' + tab_id + '_ic">'+gM('menu_' + tab_id ) + '</a>' +
568568 '</li>';
569569
570 - tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:272px;" >';
 570+ tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:268px;" >';
571571 tabc += (menu_item.html) ? menu_item.html : '<h3>' + gM('menu_'+tab_id) + '</h3>';
572572 tabc +='</div>';
573573 inx++;
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -380,7 +380,10 @@
381381 );
382382 _this.setInOutBindings();
383383 }
384 - $j('#'+this.control_ct).append( _this.getInsertDescHtml() );
 384+ //if in a sequence we have no need for insertDesc
 385+ if( !_this.p_seqObj){
 386+ $j('#'+this.control_ct).append( _this.getInsertDescHtml() );
 387+ }
385388 //update control actions
386389 this.updateInsertControlActions();
387390 },

Status & tagging log