Index: branches/new-upload/phase3/js2/uploadPage.js |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | //set up the upoload form bindings once all dom manipluation is done |
10 | 10 | var mwUploadHelper = { |
11 | 11 | init:function(){ |
| 12 | + var _this = this; |
12 | 13 | if( wgEnableFirefogg ){ |
13 | 14 | //setup the upload handler to firefogg (supports our upload proccess) (should work with the http uploads too) |
14 | 15 | $j('#wpUploadFile').firefogg({ |
— | — | @@ -35,30 +36,35 @@ |
36 | 37 | } |
37 | 38 | |
38 | 39 | //check if we have http enabled & setup enable/disable toggle: |
39 | | - if($j('#wpUploadFileURL').length != 0){ |
40 | | - var toggleUpType = function( set ){ |
41 | | - $j('#wpSourceTypeFile').get(0).checked = set; |
42 | | - $j('#wpUploadFile').get(0).disabled = !set; |
43 | | - |
44 | | - $j('#wpSourceTypeURL').get(0).checked = !set; |
45 | | - $j('#wpUploadFileURL').get(0).disabled = set; |
46 | | - } |
| 40 | + if($j('#wpUploadFileURL').length != 0){ |
47 | 41 | //set the initial toggleUpType |
48 | | - toggleUpType(true); |
| 42 | + _this.toggleUpType(true); |
49 | 43 | |
50 | 44 | $j("input[name='wpSourceType']").click(function(){ |
51 | | - toggleUpType( this.id == 'wpSourceTypeFile' ); |
52 | | - }); |
53 | | - } |
| 45 | + _this.toggleUpType( this.id == 'wpSourceTypeFile' ); |
| 46 | + }); |
| 47 | + } |
54 | 48 | $j('#wpUploadFile,#wpUploadFileURL').focus(function(){ |
55 | | - toggleUpType( this.id == 'wpUploadFile' ); |
| 49 | + _this.toggleUpType( this.id == 'wpUploadFile' ); |
56 | 50 | }).change(function(){ //also setup the onChange event binding: |
57 | 51 | if ( wgUploadAutoFill ) { |
58 | 52 | mwUploadHelper.doDestinationFill( this ); |
59 | 53 | } |
60 | | - }); |
61 | | - }, |
| 54 | + }); |
| 55 | + }, |
62 | 56 | /** |
| 57 | + * toggleUpType sets the upload radio buttons |
| 58 | + * |
| 59 | + * boolean set |
| 60 | + */ |
| 61 | + toggleUpType:function( set ){ |
| 62 | + $j('#wpSourceTypeFile').attr('checked', set); |
| 63 | + $j('#wpUploadFile').attr('disabled', !set); |
| 64 | + |
| 65 | + $j('#wpSourceTypeURL').attr('checked', !set); |
| 66 | + $j('#wpUploadFileURL').attr('disabled', set); |
| 67 | + }, |
| 68 | + /** |
63 | 69 | * doDestCheck checks the destination |
64 | 70 | * @@todo we should be able to configure its "targets" via parent config |
65 | 71 | */ |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js |
— | — | @@ -145,15 +145,18 @@ |
146 | 146 | _this.doUploadSwitch(); |
147 | 147 | } |
148 | 148 | }, |
149 | | - doUploadSwitch:function(){ |
150 | | - js_log('mvUPload:doUploadSwitch()'); |
| 149 | + doUploadSwitch:function(){ |
151 | 150 | var _this = this; |
| 151 | + js_log('mvUPload:doUploadSwitch():' + _this.upload_mode); |
152 | 152 | //issue a normal post request |
153 | | - if( _this.upload_mode == 'post' || $j('#wpSourceTypeFile').get(0).checked ){ |
154 | | - js_log('do normal submit form'); |
155 | | - //update the status to loading img: |
156 | | - _this.updateProgressWin(_this.getProgressTitle(), mv_get_loading_img( 'left:40%;top:20%')); |
| 153 | + if( _this.upload_mode == 'post' || //we don't support the upload api |
| 154 | + (_this.upload_mode=='api' && $j('#wpSourceTypeFile').length ==0) // web form uplaod |
| 155 | + ){ |
| 156 | + js_log('do ormal submit form'); |
| 157 | + //update the status to 100% progress bar: |
| 158 | + $j( '#up-progressbar' ).progressbar('value', parseInt( 100 ) ); |
157 | 159 | |
| 160 | + $j('#up-status-container').html( gM('upload-in-progress') ); |
158 | 161 | //do normal post upload no status indicators (also since its a file I think we have to submit the form) |
159 | 162 | _this.form_post_override = true; |
160 | 163 | |
— | — | @@ -441,7 +444,7 @@ |
442 | 445 | }, |
443 | 446 | updateProgress:function( perc ){ |
444 | 447 | //js_log('update progress: ' + perc); |
445 | | - $j('#up-progressbar').progressbar('value', parseInt( perc * 100 ) ); |
| 448 | + $j( '#up-progressbar' ).progressbar('value', parseInt( perc * 100 ) ); |
446 | 449 | $j( '#up-pstatus' ).html( parseInt( perc * 100 ) + '% - ' ); |
447 | 450 | }, |
448 | 451 | /*update to jQuery.ui progress display type */ |
— | — | @@ -476,8 +479,10 @@ |
477 | 480 | //set initial content: |
478 | 481 | '<div id="up-pbar-container" style="border:solid thin gray;width:90%;height:15px;" >' + |
479 | 482 | '<div id="up-progressbar" style="height:15px;"></div>' + |
| 483 | + '<div id="up-status-container">'+ |
480 | 484 | '<span id="up-pstatus">0% - </span> ' + |
481 | | - '<span id="up-status-state">' + gM('uploaded-status') + '</span> ' + |
| 485 | + '<span id="up-status-state">' + gM('uploaded-status') + '</span> ' + |
| 486 | + '</div>'+ |
482 | 487 | '</div>' |
483 | 488 | ) |
484 | 489 | //setup progress bar: |
Index: branches/new-upload/phase3/js2/mwEmbed/skins/mvpcf/styles.css |
— | — | @@ -197,7 +197,7 @@ |
198 | 198 | height: 29px; |
199 | 199 | overflow: visible; |
200 | 200 | font-size: 10.4px; |
201 | | - width: 88px; |
| 201 | + width: 95px; |
202 | 202 | float: right; |
203 | 203 | display: inline; |
204 | 204 | border:none; |