Miscellaneous tweaks

This commit is contained in:
Dan Stillman 2015-11-12 02:48:41 -05:00
parent 614232754a
commit ae277391b6
6 changed files with 8 additions and 20 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -380,7 +380,7 @@ var installPDFTools = Zotero.Promise.coroutine(function* () {
* @return {Promise}
*/
function uninstallPDFTools() {
return Zotero.Fulltext.removePDFTools();
return Zotero.Fulltext.uninstallPDFTools();
}
/**

View file

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