diff options
author | Func <Funcer@outlook.com> | 2023-05-07 03:51:46 +0800 |
---|---|---|
committer | Func <Funcer@outlook.com> | 2023-05-07 04:04:37 +0800 |
commit | 72ed08e8b4f603a377defeb8dc6fedd64cc08707 (patch) | |
tree | 21b04bad0903a2124a814f7f7d1601f717b511aa /resources/src/mediawiki.special.upload | |
parent | 7532a620d7a67f68226a4d3df903f3ebc9f79bff (diff) | |
download | mediawikicore-72ed08e8b4f603a377defeb8dc6fedd64cc08707.tar.gz mediawikicore-72ed08e8b4f603a377defeb8dc6fedd64cc08707.zip |
upload.js: Remove unused properties
Method that using timeout things and the response cache was removed in
the commit d555c302.
Change-Id: I57b74cca19f5104430d8dd308be7a484ffa90829
Diffstat (limited to 'resources/src/mediawiki.special.upload')
-rw-r--r-- | resources/src/mediawiki.special.upload/upload.js | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/resources/src/mediawiki.special.upload/upload.js b/resources/src/mediawiki.special.upload/upload.js index e79017bdd15e..9626d8071c07 100644 --- a/resources/src/mediawiki.special.upload/upload.js +++ b/resources/src/mediawiki.special.upload/upload.js @@ -11,31 +11,18 @@ NS_FILE = mw.config.get( 'wgNamespaceIds' ).file; window.wgUploadWarningObj = uploadWarning = { - responseCache: { '': ' ' }, - nameToCheck: '', - typing: false, - delay: 500, // ms - timeoutID: false, - - checkNow: function ( fname ) { - if ( this.timeoutID ) { - clearTimeout( this.timeoutID ); - } - this.nameToCheck = fname; - this.timeout(); - }, - timeout: function () { + checkNow: function ( nameToCheck ) { var $spinnerDestCheck, title, requestTitle; - if ( this.nameToCheck.trim() === '' ) { + if ( nameToCheck.trim() === '' ) { return; } $spinnerDestCheck = $.createSpinner().insertAfter( '#wpDestFile' ); - title = mw.Title.newFromText( this.nameToCheck, NS_FILE ); + title = mw.Title.newFromText( nameToCheck, NS_FILE ); // If title is null, user input is invalid, the API call will produce details about why, // but it needs the namespace to produce errors related to files (when starts with interwiki) if ( !title || title.getNamespaceId() !== NS_FILE ) { - requestTitle = mw.config.get( 'wgFormattedNamespaces' )[ NS_FILE ] + ':' + this.nameToCheck; + requestTitle = mw.config.get( 'wgFormattedNamespaces' )[ NS_FILE ] + ':' + nameToCheck; } else { requestTitle = title.getPrefixedText(); } @@ -57,18 +44,13 @@ } else if ( page.invalidreason ) { resultOut = page.invalidreason.html; } - uploadWarning.processResult( resultOut, uploadWarning.nameToCheck ); + uploadWarning.setWarning( resultOut ); $spinnerDestCheck.remove(); } ).catch( function () { $spinnerDestCheck.remove(); } ); }, - processResult: function ( result, fileName ) { - this.setWarning( result ); - this.responseCache[ fileName ] = result; - }, - setWarning: function ( warning ) { var $warning = $( $.parseHTML( warning ) ); mw.hook( 'wikipage.content' ).fire( $warning ); |