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 * 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 * character set (at least until we figure out a better way to get
* at the native detectors), we create the item above and update * 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: " var msg = "HTTP " + method + " " + dispURL + " failed: "
+ "Unexpected status code " + xmlhttp.status; + "Unexpected status code " + xmlhttp.status;
Zotero.debug(msg, 1); Zotero.debug(msg, 1);
if (options.debug) { Zotero.debug(xmlhttp.responseText, 1);
Zotero.debug(xmlhttp.responseText);
}
deferred.reject(new Zotero.HTTP.UnexpectedStatusException(xmlhttp, msg)); 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) { getSettings: Zotero.Promise.coroutine(function* (libraryType, libraryTypeID, since) {
var params = { var params = {
target: "settings",
libraryType: libraryType, libraryType: libraryType,
libraryTypeID: libraryTypeID libraryTypeID: libraryTypeID,
target: "settings"
}; };
if (since) { if (since) {
params.since = since; params.since = since;

View File

@ -49,16 +49,7 @@ Zotero.Sync.Data.Engine = function (options) {
this.apiClient = options.apiClient; this.apiClient = options.apiClient;
this.libraryID = options.libraryID; this.libraryID = options.libraryID;
this.library = Zotero.Libraries.get(options.libraryID); this.library = Zotero.Libraries.get(options.libraryID);
switch (this.library.libraryType) { this.libraryTypeID = this.library.libraryTypeID;
case 'user':
case 'publications':
this.libraryTypeID = Zotero.Users.getCurrentUserID();
break;
case 'group':
this.libraryTypeID = Zotero.Groups.getGroupIDFromLibraryID(options.libraryID);
break;
}
this.setStatus = options.setStatus || function () {}; this.setStatus = options.setStatus || function () {};
this.onError = options.onError || function (e) {}; this.onError = options.onError || function (e) {};
this.stopOnError = options.stopOnError; this.stopOnError = options.stopOnError;

View File

@ -380,7 +380,7 @@ var installPDFTools = Zotero.Promise.coroutine(function* () {
* @return {Promise} * @return {Promise}
*/ */
function uninstallPDFTools() { 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 responses = {};
var setup = Zotero.Promise.coroutine(function* (options) { var setup = Zotero.Promise.coroutine(function* (options = {}) {
options = options || {};
server = sinon.fakeServer.create(); server = sinon.fakeServer.create();
server.autoRespond = true; server.autoRespond = true;
@ -20,7 +18,6 @@ describe("Zotero.Sync.Data.Engine", function () {
caller.setLogger(msg => Zotero.debug(msg)); caller.setLogger(msg => Zotero.debug(msg));
caller.stopOnError = true; caller.stopOnError = true;
Components.utils.import("resource://zotero/config.js");
var client = new Zotero.Sync.APIClient({ var client = new Zotero.Sync.APIClient({
baseURL, baseURL,
apiVersion: options.apiVersion || ZOTERO_CONFIG.API_VERSION, apiVersion: options.apiVersion || ZOTERO_CONFIG.API_VERSION,