Index: branches/new-upload/phase3/skins/common/upload.js |
— | — | @@ -11,7 +11,17 @@ |
12 | 12 | wgUploadLicenseObj.fetchPreview( selection ); |
13 | 13 | } |
14 | 14 | |
15 | | -function licenseSelectorFixup() { |
| 15 | +function wgUploadSetup() { |
| 16 | + //disable source type if not checked: |
| 17 | + var e = document.getElementById('wpSourceTypeURL'); |
| 18 | + if(e){ |
| 19 | + if(!e.checked){ |
| 20 | + var ein = document.getElementById('wpUploadFileURL'); |
| 21 | + if(ein) |
| 22 | + ein.setAttribute('disabled', 'disabled'); |
| 23 | + } |
| 24 | + } |
| 25 | + |
16 | 26 | // for MSIE/Mac; non-breaking spaces cause the <option> not to render |
17 | 27 | // but, for some reason, setting the text to itself works |
18 | 28 | var selector = document.getElementById("wpLicense"); |
— | — | @@ -103,7 +113,6 @@ |
104 | 114 | ackElt.value = '1'; |
105 | 115 | } |
106 | 116 | }, |
107 | | - |
108 | 117 | 'setInnerHTML' : function (element, text) { |
109 | 118 | // Check for no change to avoid flicker in IE 7 |
110 | 119 | if (element.innerHTML != text) { |
— | — | @@ -144,7 +153,7 @@ |
145 | 154 | if( fname.lastIndexOf('.')!=-1 ){ |
146 | 155 | var ext = fname.substr( fname.lastIndexOf('.')+1 ); |
147 | 156 | for(var i=0; i < wgFileExtensions.length; i++){ |
148 | | - if( wgFileExtensions[i] == ext ) |
| 157 | + if( strtolower( wgFileExtensions[i] ) == strtolower( ext ) ) |
149 | 158 | found = true; |
150 | 159 | } |
151 | 160 | } |
— | — | @@ -222,4 +231,4 @@ |
223 | 232 | |
224 | 233 | } |
225 | 234 | |
226 | | -addOnloadHook( licenseSelectorFixup ); |
\ No newline at end of file |
| 235 | +addOnloadHook( wgUploadSetup ); |
\ No newline at end of file |
Index: branches/new-upload/phase3/includes/DefaultSettings.php |
— | — | @@ -3425,6 +3425,11 @@ |
3426 | 3426 | $wgAjaxUploadDestCheck = true; |
3427 | 3427 | |
3428 | 3428 | /** |
| 3429 | + * Enable AJAX upload interface (need for large http uploads & to display progress on uploads for browsers that support it) |
| 3430 | + */ |
| 3431 | +$wgAjaxUploadInterface = true; |
| 3432 | + |
| 3433 | +/** |
3429 | 3434 | * Enable previewing licences via AJAX |
3430 | 3435 | */ |
3431 | 3436 | $wgAjaxLicensePreview = true; |
Index: branches/new-upload/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -723,7 +723,7 @@ |
724 | 724 | "onfocus='" . |
725 | 725 | "toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\");" . |
726 | 726 | "toggle_element_check(\"wpSourceTypeURL\",\"wpSourceTypeFile\")' " . |
727 | | - "onchange='fillDestFilename(\"wpUploadFileURL\")' size='60' disabled='disabled' />" . |
| 727 | + "onchange='fillDestFilename(\"wpUploadFileURL\")' size='60' />" . |
728 | 728 | wfMsgHtml( 'upload_source_url' ) ; |
729 | 729 | } else { |
730 | 730 | $filename_form = |
Index: branches/new-upload/phase3/includes/Skin.php |
— | — | @@ -384,10 +384,11 @@ |
385 | 385 | 'wgDigitTransformTable' => $compactDigitTransTable, |
386 | 386 | ); |
387 | 387 | |
388 | | - //if on upload page output the extension list: |
| 388 | + //if on upload page output the extension list & js_upload |
389 | 389 | if( SpecialPage::resolveAlias( $wgTitle->getDBkey() ) == "Upload" ){ |
390 | | - global $wgFileExtensions; |
391 | | - $vars['wgFileExtensions'] = $wgFileExtensions; |
| 390 | + global $wgFileExtensions, $wgAjaxUploadInterface; |
| 391 | + $vars['wgFileExtensions'] = $wgFileExtensions; |
| 392 | + $vars['wgAjaxUploadInterface'] = $wgAjaxUploadInterface; |
392 | 393 | } |
393 | 394 | |
394 | 395 | if( $wgUseAjax && $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false )){ |
Index: branches/new-upload/phase3/includes/UploadBase.php |
— | — | @@ -479,8 +479,7 @@ |
480 | 480 | * @return success |
481 | 481 | */ |
482 | 482 | function unsaveUploadedFile() { |
483 | | - $repo = RepoGroup::singleton()->getLocalRepo(); |
484 | | - print "free temp: {$this->mTempPath}\n"; |
| 483 | + $repo = RepoGroup::singleton()->getLocalRepo(); |
485 | 484 | $success = $repo->freeTemp( $this->mTempPath ); |
486 | 485 | return $success; |
487 | 486 | } |