commit fed9fe597da0b69cfcc564d6bcdebc1329ae8188
parent 42215d0441965099a67aba9f617061388ef62591
Author: aurimasv <aurimas.dev@gmail.com>
Date: Mon, 12 Nov 2012 03:19:29 -0600
Allow translators to pre-select items in the "multiple" select item dialog.
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git 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(typeof(item) != "string" && 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);
}
}