diff --git a/chrome/content/zotero/ingester/selectitems.js b/chrome/content/zotero/ingester/selectitems.js index 4118b790b..8f639248c 100644 --- a/chrome/content/zotero/ingester/selectitems.js +++ b/chrome/content/zotero/ingester/selectitems.js @@ -47,11 +47,21 @@ Zotero_Ingester_Interface_SelectItems.init = function() { var listbox = document.getElementById("zotero-selectitems-links"); for(var i in this.io.dataIn) { // we could use a tree for this if we wanted to + var item = this.io.dataIn[i]; + + var title, checked = false; + if(item && typeof(item) == "object" && item.title !== undefined) { + title = item.title; + checked = !!item.checked; + } else { + title = item; + } + var itemNode = document.createElement("listitem"); itemNode.setAttribute("type", "checkbox"); itemNode.setAttribute("value", i); - itemNode.setAttribute("label", this.io.dataIn[i]); - itemNode.setAttribute("checked", false); + itemNode.setAttribute("label", title); + itemNode.setAttribute("checked", checked); listbox.appendChild(itemNode); } } diff --git a/chrome/content/zotero/tools/testTranslators/translatorTester.js b/chrome/content/zotero/tools/testTranslators/translatorTester.js index 9cd292ef0..01a07a349 100644 --- a/chrome/content/zotero/tools/testTranslators/translatorTester.js +++ b/chrome/content/zotero/tools/testTranslators/translatorTester.js @@ -422,7 +422,11 @@ Zotero_TranslatorTester.prototype.runTest = function(test, doc, testDoneCallback var newItems = {}; var haveItems = false; for(var i in items) { - newItems[i] = items[i]; + if(items[i] && typeof(items[i]) == "object" && items[i].title !== undefined) { + newItems[i] = items[i].title; + } else { + newItems[i] = items[i]; + } haveItems = true; // only save one item if "items":"multiple" (as opposed to an array of items) @@ -546,7 +550,11 @@ Zotero_TranslatorTester.prototype.newTest = function(doc, testReadyCallback) { var newItems = {}; for(var i in items) { - newItems[i] = items[i]; + if(items[i] && typeof(items[i]) == "object" && items[i].title !== undefined) { + newItems[i] = items[i].title; + } else { + newItems[i] = items[i]; + } break; }