From 40b3ecc996d232efba51a0ee98ee91c6970fe8ba Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 6 Jul 2006 13:06:32 +0000 Subject: [PATCH] Addresses #87, Add fromArray() and toArray() methods to Item objects Item.getTags() (which toArray() uses) now returns actual tags rather than ids -- separate method getTagIDs to return ids --- chrome/chromeFiles/content/scholar/xpcom/data_access.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js index a7de969cf..85ed93ed1 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/data_access.js +++ b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -971,6 +971,12 @@ Scholar.Item.prototype.addTag = function(tag){ } Scholar.Item.prototype.getTags = function(){ + var sql = "SELECT tag FROM tags WHERE tagID IN " + + "(SELECT tagID FROM itemTags WHERE itemID=" + this.getID() + ")"; + return Scholar.DB.columnQuery(sql); +} + +Scholar.Item.prototype.getTagIDs = function(){ var sql = "SELECT tagID FROM itemTags WHERE itemID=" + this.getID(); return Scholar.DB.columnQuery(sql); }