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:
Mark Holmquist 2014-06-19 14:59:07 -07:00
parent d6188af75a
commit b921b3e7c8

View file

@ -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;