From ae277391b63a16989635af7f3bf1b036e84d7aa3 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 12 Nov 2015 02:48:41 -0500 Subject: [PATCH] Miscellaneous tweaks --- chrome/content/zotero/xpcom/attachments.js | 2 ++ chrome/content/zotero/xpcom/http.js | 4 +--- chrome/content/zotero/xpcom/sync/syncAPIClient.js | 4 ++-- chrome/content/zotero/xpcom/sync/syncEngine.js | 11 +---------- test/content/support.js | 2 +- test/tests/syncEngineTest.js | 5 +---- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index ed1a1e3ad0..52a630de8f 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -1298,6 +1298,8 @@ Zotero.Attachments = new function(){ /** + * If necessary/possible, detect the file charset and index the file + * * Since we have to load the content into the browser to get the * character set (at least until we figure out a better way to get * at the native detectors), we create the item above and update diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js index 8254505542..251ce19ec3 100644 --- a/chrome/content/zotero/xpcom/http.js +++ b/chrome/content/zotero/xpcom/http.js @@ -219,9 +219,7 @@ Zotero.HTTP = new function() { var msg = "HTTP " + method + " " + dispURL + " failed: " + "Unexpected status code " + xmlhttp.status; Zotero.debug(msg, 1); - if (options.debug) { - Zotero.debug(xmlhttp.responseText); - } + Zotero.debug(xmlhttp.responseText, 1); deferred.reject(new Zotero.HTTP.UnexpectedStatusException(xmlhttp, msg)); } }; diff --git a/chrome/content/zotero/xpcom/sync/syncAPIClient.js b/chrome/content/zotero/xpcom/sync/syncAPIClient.js index a38228e5c1..41df60b148 100644 --- a/chrome/content/zotero/xpcom/sync/syncAPIClient.js +++ b/chrome/content/zotero/xpcom/sync/syncAPIClient.js @@ -89,9 +89,9 @@ Zotero.Sync.APIClient.prototype = { getSettings: Zotero.Promise.coroutine(function* (libraryType, libraryTypeID, since) { var params = { - target: "settings", libraryType: libraryType, - libraryTypeID: libraryTypeID + libraryTypeID: libraryTypeID, + target: "settings" }; if (since) { params.since = since; diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js index aedca11492..044d3d4305 100644 --- a/chrome/content/zotero/xpcom/sync/syncEngine.js +++ b/chrome/content/zotero/xpcom/sync/syncEngine.js @@ -49,16 +49,7 @@ Zotero.Sync.Data.Engine = function (options) { this.apiClient = options.apiClient; this.libraryID = options.libraryID; this.library = Zotero.Libraries.get(options.libraryID); - switch (this.library.libraryType) { - case 'user': - case 'publications': - this.libraryTypeID = Zotero.Users.getCurrentUserID(); - break; - - case 'group': - this.libraryTypeID = Zotero.Groups.getGroupIDFromLibraryID(options.libraryID); - break; - } + this.libraryTypeID = this.library.libraryTypeID; this.setStatus = options.setStatus || function () {}; this.onError = options.onError || function (e) {}; this.stopOnError = options.stopOnError; diff --git a/test/content/support.js b/test/content/support.js index 3215e71d37..849b26455c 100644 --- a/test/content/support.js +++ b/test/content/support.js @@ -380,7 +380,7 @@ var installPDFTools = Zotero.Promise.coroutine(function* () { * @return {Promise} */ function uninstallPDFTools() { - return Zotero.Fulltext.removePDFTools(); + return Zotero.Fulltext.uninstallPDFTools(); } /** diff --git a/test/tests/syncEngineTest.js b/test/tests/syncEngineTest.js index 5150fcf87d..f67c903870 100644 --- a/test/tests/syncEngineTest.js +++ b/test/tests/syncEngineTest.js @@ -9,9 +9,7 @@ describe("Zotero.Sync.Data.Engine", function () { var responses = {}; - var setup = Zotero.Promise.coroutine(function* (options) { - options = options || {}; - + var setup = Zotero.Promise.coroutine(function* (options = {}) { server = sinon.fakeServer.create(); server.autoRespond = true; @@ -20,7 +18,6 @@ describe("Zotero.Sync.Data.Engine", function () { caller.setLogger(msg => Zotero.debug(msg)); caller.stopOnError = true; - Components.utils.import("resource://zotero/config.js"); var client = new Zotero.Sync.APIClient({ baseURL, apiVersion: options.apiVersion || ZOTERO_CONFIG.API_VERSION,