( function ( mw, $ ) { var ajaxUploadDestCheck = mw.config.get( 'wgAjaxUploadDestCheck' ), fileExtensions = mw.config.get( 'wgFileExtensions' ); window.licenseSelectorCheck = function() { var selector = document.getElementById( "wpLicense" ); var 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 e = document.getElementById( 'wpSourceTypeurl' ); if( e ) { if( !e.checked ) { var ein = document.getElementById( 'wpUploadFileURL' ); if(ein) ein.setAttribute( 'disabled', 'disabled' ); } } // For MSIE/Mac: non-breaking spaces cause the