diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index ae2975f975..d92d15c1fa 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -330,7 +330,7 @@ var Zotero_File_Interface = new function() { */ function _importDone(obj, worked) { // add items to import collection - _importCollection.addItems(obj.newItems); + _importCollection.addItems([item.id for each(item in obj.newItems)]); Zotero.DB.commitTransaction(); diff --git a/chrome/content/zotero/xpcom/connector/translate_item.js b/chrome/content/zotero/xpcom/connector/translate_item.js index c3ad2a9b71..3842d8e148 100644 --- a/chrome/content/zotero/xpcom/connector/translate_item.js +++ b/chrome/content/zotero/xpcom/connector/translate_item.js @@ -26,7 +26,6 @@ Zotero.Translate.ItemSaver = function(libraryID, attachmentMode, forceTagType) { this.newItems = []; - this._itemsToSaveToServer = []; this._timeoutID = null; } @@ -35,37 +34,46 @@ Zotero.Translate.ItemSaver.ATTACHMENT_MODE_DOWNLOAD = 1; Zotero.Translate.ItemSaver.ATTACHMENT_MODE_FILE = 2; Zotero.Translate.ItemSaver.prototype = { - "saveItem":function(item) { + /** + * Saves items to Standalone or the server + */ + "saveItems":function(items, callback) { // don't save documents as documents, since we can't pass them around - for(var i in item.attachments) { - if(item.attachments[i].document) { - item.attachments[i].url = item.attachments[i].document.location.href; - delete item.attachments[i].document; + var nItems = items.length; + for(var i=0; i= 2) { * Generate a random string of length 'len' (defaults to 8) **/ function randomString(len, chars) { - if (!chars) { - chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; - } - if (!len) { - len = 8; - } - var randomstring = ''; - for (var i=0; i