mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-09-29 13:17:35 +00:00
Fix commons detection, use URL
URLs don't change, they aren't ever localised, etc. Hopefully this is the end of this problem. Change-Id: Ib5b41e2e64a5af65f342783cfd41f35559fbfd60
This commit is contained in:
parent
d6188af75a
commit
b921b3e7c8
|
@ -143,6 +143,14 @@
|
||||||
return this.absoluteArticlePath;
|
return this.absoluteArticlePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
ForeignApiRepo.prototype.isCommons = function () {
|
||||||
|
return /^(https?:)?\/\/commons.wikimedia.org/.test( this.server );
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents information about a foreign, shared DB repository
|
* Represents information about a foreign, shared DB repository
|
||||||
* @class mw.mmv.model.ForeignDbRepo
|
* @class mw.mmv.model.ForeignDbRepo
|
||||||
|
@ -173,6 +181,14 @@
|
||||||
return this.descBaseUrl.replace( /[^\/:]*:$/, '$1' );
|
return this.descBaseUrl.replace( /[^\/:]*:$/, '$1' );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
ForeignDbRepo.prototype.isCommons = function () {
|
||||||
|
return /^(https?:)?\/\/commons.wikimedia.org/.test( this.descBaseUrl );
|
||||||
|
};
|
||||||
|
|
||||||
mw.mmv.model.Repo = Repo;
|
mw.mmv.model.Repo = Repo;
|
||||||
mw.mmv.model.ForeignApiRepo = ForeignApiRepo;
|
mw.mmv.model.ForeignApiRepo = ForeignApiRepo;
|
||||||
mw.mmv.model.ForeignDbRepo = ForeignDbRepo;
|
mw.mmv.model.ForeignDbRepo = ForeignDbRepo;
|
||||||
|
|
Loading…
Reference in a new issue