From 08a570a38aa27cce86e18117171d4046f8a4ee66 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 16 Jun 2006 15:18:01 +0000 Subject: [PATCH] Item.numNotes() --- chrome/chromeFiles/content/scholar/xpcom/data_access.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js index 7e884e7646..93023bc48f 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/data_access.js +++ b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -713,6 +713,14 @@ Scholar.Item.prototype.removeNote = function(noteID){ return Scholar.DB.query(sql); } +/** +* Returns number of notes in item +**/ +Scholar.Item.prototype.numNotes = function(){ + var sql = "SELECT COUNT(*) FROM itemNotes WHERE itemID=" + this.getID(); + return parseInt(Scholar.DB.valueQuery(sql)); +} + /** * Get the text of an item note **/