Miscellaneous tweaks
This commit is contained in:
parent
614232754a
commit
ae277391b6
6 changed files with 8 additions and 20 deletions
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -380,7 +380,7 @@ var installPDFTools = Zotero.Promise.coroutine(function* () {
|
|||
* @return {Promise}
|
||||
*/
|
||||
function uninstallPDFTools() {
|
||||
return Zotero.Fulltext.removePDFTools();
|
||||
return Zotero.Fulltext.uninstallPDFTools();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue