dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Replace Linker::link() with LinkRenderer in includes directory"
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki
/
mediawiki.ForeignUpload.js
diff --git
a/resources/src/mediawiki/mediawiki.ForeignUpload.js
b/resources/src/mediawiki/mediawiki.ForeignUpload.js
index
1a0b59a
..
08fc01d
100644
(file)
--- a/
resources/src/mediawiki/mediawiki.ForeignUpload.js
+++ b/
resources/src/mediawiki/mediawiki.ForeignUpload.js
@@
-1,8
+1,5
@@
( function ( mw, OO, $ ) {
/**
( function ( mw, OO, $ ) {
/**
- * @class mw.ForeignUpload
- * @extends mw.Upload
- *
* Used to represent an upload in progress on the frontend.
*
* Subclassed to upload to a foreign API, with no other goodies. Use
* Used to represent an upload in progress on the frontend.
*
* Subclassed to upload to a foreign API, with no other goodies. Use
@@
-12,6
+9,9
@@
* an object, we assume you want the default, and treat it as apiconfig
* instead.
*
* an object, we assume you want the default, and treat it as apiconfig
* instead.
*
+ * @class mw.ForeignUpload
+ * @extends mw.Upload
+ *
* @constructor
* @param {string} [target] Used to set up the target
* wiki. If not remote, this class behaves identically to mw.Upload (unless further subclassed)
* @constructor
* @param {string} [target] Used to set up the target
* wiki. If not remote, this class behaves identically to mw.Upload (unless further subclassed)
@@
-43,7
+43,9
@@
// However, if the target is a remote wiki, we must check the API
// to confirm that the target is one that this site is configured to
// support.
// However, if the target is a remote wiki, we must check the API
// to confirm that the target is one that this site is configured to
// support.
- if ( this.target === 'local' ) {
+ if ( validTargets.length === 0 ) {
+ this.apiPromise = $.Deferred().reject( 'upload-dialog-disabled' );
+ } else if ( this.target === 'local' ) {
// If local uploads were requested, but they are disabled, fail.
if ( !mw.config.get( 'wgEnableUploads' ) ) {
this.apiPromise = $.Deferred().reject( 'uploaddisabledtext' );
// If local uploads were requested, but they are disabled, fail.
if ( !mw.config.get( 'wgEnableUploads' ) ) {
this.apiPromise = $.Deferred().reject( 'uploaddisabledtext' );
@@
-85,12
+87,6
@@
// actual API call methods to wait for the apiPromise to resolve
// before continuing.
mw.Upload.call( this, null );
// actual API call methods to wait for the apiPromise to resolve
// before continuing.
mw.Upload.call( this, null );
-
- if ( this.target !== 'local' ) {
- // Keep these untranslated. We don't know the content language of the foreign wiki, best to
- // stick to English in the text.
- this.setComment( 'Cross-wiki upload from ' + location.host );
- }
}
OO.inheritClass( ForeignUpload, mw.Upload );
}
OO.inheritClass( ForeignUpload, mw.Upload );
@@
-119,6
+115,8
@@
/**
* Override from mw.Upload to make sure the API info is found and allowed
/**
* Override from mw.Upload to make sure the API info is found and allowed
+ *
+ * @inheritdoc
*/
ForeignUpload.prototype.upload = function () {
var upload = this;
*/
ForeignUpload.prototype.upload = function () {
var upload = this;
@@
-130,6
+128,8
@@
/**
* Override from mw.Upload to make sure the API info is found and allowed
/**
* Override from mw.Upload to make sure the API info is found and allowed
+ *
+ * @inheritdoc
*/
ForeignUpload.prototype.uploadToStash = function () {
var upload = this;
*/
ForeignUpload.prototype.uploadToStash = function () {
var upload = this;