From c9f15927048998ad4810d62cc432f11f99e88df0 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 2 Sep 2008 19:30:14 +0000 Subject: [PATCH] fix strict mode error and add JSDoc to selectitems.js --- chrome/content/zotero/ingester/selectitems.js | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/chrome/content/zotero/ingester/selectitems.js b/chrome/content/zotero/ingester/selectitems.js index 6674123f49..d6dbd20a9b 100644 --- a/chrome/content/zotero/ingester/selectitems.js +++ b/chrome/content/zotero/ingester/selectitems.js @@ -20,14 +20,9 @@ ***** END LICENSE BLOCK ***** */ -////////////////////////////////////////////////////////////////////////////// -// -// Zotero_Ingester_Interface_SelectItems -// -////////////////////////////////////////////////////////////////////////////// - -// Class to interface with the browser when ingesting data - +/** + * @namespace Singleton to interface with the browser when ingesting data + */ var Zotero_Ingester_Interface_SelectItems = function() {} ////////////////////////////////////////////////////////////////////////////// @@ -36,9 +31,9 @@ var Zotero_Ingester_Interface_SelectItems = function() {} // ////////////////////////////////////////////////////////////////////////////// -/* - * Initialize some variables and prepare event listeners for when chrome is done - * loading +/** + * Presents items to select in the select box. Assumes window.arguments[0].dataIn is an object with + * URLs as keys and descriptions as values */ Zotero_Ingester_Interface_SelectItems.init = function() { // Set font size from pref @@ -48,7 +43,7 @@ Zotero_Ingester_Interface_SelectItems.init = function() { this.io = window.arguments[0]; var listbox = document.getElementById("zotero-selectitems-links"); - for(i in this.io.dataIn) { // we could use a tree for this if we wanted to + for(var i in this.io.dataIn) { // we could use a tree for this if we wanted to var itemNode = document.createElement("listitem"); itemNode.setAttribute("type", "checkbox"); itemNode.setAttribute("value", i); @@ -58,6 +53,10 @@ Zotero_Ingester_Interface_SelectItems.init = function() { } } +/** + * Selects or deselects all items + * @param {Boolean} deselect If true, deselect all items instead of selecting all items + */ Zotero_Ingester_Interface_SelectItems.selectAll = function(deselect) { var listbox = document.getElementById("zotero-selectitems-links"); for (var i=0; i