www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 084f5a72df24912820724e8fe46b39b837deb554
parent 205bab7b89886eeaa77431d67f8aa1f06ec1a8ca
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 21 Dec 2016 05:52:55 -0500

Make API server configurable with extensions.zotero.api.url

Needless to say, use of this pref is unsupported.

Closes #901

Diffstat:
Mchrome/content/zotero/xpcom/sync/syncRunner.js | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/sync/syncRunner.js b/chrome/content/zotero/xpcom/sync/syncRunner.js @@ -41,7 +41,15 @@ Zotero.Sync.Runner_Module = function (options = {}) { Zotero.defineProperty(this, 'syncInProgress', { get: () => _syncInProgress }); Zotero.defineProperty(this, 'lastSyncStatus', { get: () => _lastSyncStatus }); - this.baseURL = options.baseURL || ZOTERO_CONFIG.API_URL; + Zotero.defineProperty(this, 'baseURL', { + get: () => { + let url = options.baseURL || Zotero.Prefs.get("api.url") || ZOTERO_CONFIG.API_URL; + if (!url.endsWith('/')) { + url += '/'; + } + return url; + } + }); this.apiVersion = options.apiVersion || ZOTERO_CONFIG.API_VERSION; // Allows tests to set apiKey in options or as property, overriding login manager