From b921b3e7c8f54d8d783d6f2786bc7fe5abaf88db Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Thu, 19 Jun 2014 14:59:07 -0700 Subject: [PATCH] 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 --- resources/mmv/model/mmv.model.Repo.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/resources/mmv/model/mmv.model.Repo.js b/resources/mmv/model/mmv.model.Repo.js index daf033ead..90d1f7d7d 100644 --- a/resources/mmv/model/mmv.model.Repo.js +++ b/resources/mmv/model/mmv.model.Repo.js @@ -143,6 +143,14 @@ 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 * @class mw.mmv.model.ForeignDbRepo @@ -173,6 +181,14 @@ 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.ForeignApiRepo = ForeignApiRepo; mw.mmv.model.ForeignDbRepo = ForeignDbRepo;