From db9d1bd39b50cd40df9cc5b156551bf76610ce9f Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Wed, 27 Aug 2014 15:52:49 +0100 Subject: [PATCH] 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 --- skins/common/upload.js | 535 ++++++++++++++++------------------------- 1 file changed, 213 insertions(+), 322 deletions(-) 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