From: Alex Monk Date: Wed, 27 Aug 2014 14:52:49 +0000 (+0100) Subject: Clean up mediawiki.legacy.upload a bit more X-Git-Tag: 1.31.0-rc.0~14217^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=db9d1bd39b50cd40df9cc5b156551bf76610ce9f;p=lhc%2Fweb%2Fwiklou.git Clean up mediawiki.legacy.upload a bit more We can merge it into mediawiki.special.upload later. It still sets wgUploadWarningObj, because that's used in a bunch of places: commonswiki MediaWiki:UploadForm.js commonswiki MediaWiki:UploadFormTest.js fawiki MediaWiki:UploadForm.js siwiki MediaWiki:UploadForm.js commonswiki User:CuteHappyBrute/monobook.js kowiki User:Kwj2772/UploadForm.js sqwiki User:Euriditi/UploadForm.js Bug: 31946 Change-Id: I4fc3dcd1f1bfb15aa130845e3de0474943b7e3fc --- diff --git a/skins/common/upload.js b/skins/common/upload.js index 7933cafb70..144bdf992d 100644 --- a/skins/common/upload.js +++ b/skins/common/upload.js @@ -1,355 +1,246 @@ /*jshint camelcase:false */ ( function ( mw, $ ) { -var licenseSelectorCheck, wgUploadWarningObj, wgUploadLicenseObj, fillDestFilename, - ajaxUploadDestCheck = mw.config.get( 'wgAjaxUploadDestCheck' ), - fileExtensions = mw.config.get( 'wgFileExtensions' ), - $spinnerDestCheck, $spinnerLicense; - -licenseSelectorCheck = window.licenseSelectorCheck = function () { - var selector = document.getElementById( 'wpLicense' ), - selection = selector.options[selector.selectedIndex].value; - if ( selector.selectedIndex > 0 ) { - if ( !selection ) { - // Option disabled, but browser is broken and doesn't respect this - selector.selectedIndex = 0; - } - } - // We might show a preview - wgUploadLicenseObj.fetchPreview( selection ); -}; - -function uploadSetup() { - // Disable URL box if the URL copy upload source type is not selected - var ein, - selector, ua, isMacIe, i, - optionsTable, row, td, - wpLicense, wpLicenseRow, wpLicenseTbody, - uploadSourceIds, len, onchange, - e = document.getElementById( 'wpSourceTypeurl' ); - if ( e ) { - if ( !e.checked ) { - ein = document.getElementById( 'wpUploadFileURL' ); - if ( ein ) { - ein.disabled = true; - } - } - } - - // For MSIE/Mac: non-breaking spaces cause the