From 72ca609b52ebe511ccb054d499a2dd476274558f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 29 Jun 2006 05:18:55 +0000 Subject: [PATCH] Addresses #87, Add fromArray() and toArray() methods to Item objects Changed _getDescendents to take _nested_ flag, be extensible later for smart folders and other types, and include the collection name in the dataset Added Collection.toArray() Sample array: '0' ... 'id' => "13" 'type' => "item" '1' ... 'id' => "14" 'type' => "item" '2' ... 'id' => "7373" 'name' => "A Sub-project!" 'type' => "collection" 'children' ... '0' ... 'id' => "15" 'type' => "item" '1' ... 'id' => "9233" 'name' => "A Sub-sub-project!" 'type' => "collection" 'children' ... --- .../content/scholar/xpcom/data_access.js | 72 +++++++++++-------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js index a90b59a195..db807d70d3 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/data_access.js +++ b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -1791,10 +1791,7 @@ Scholar.Collection.prototype.hasItem = function(itemID){ Scholar.Collection.prototype.hasDescendent = function(type, id){ var descendents = this._getDescendents(); for (var i=0, len=descendents.length; i