commit 97c3f13112c5eca1b69951c7b1989cac4905ca5c
parent 0c24beee3ff422b31027ebf04b1f3c592eff0d51
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 29 Aug 2006 07:18:41 +0000
Closes #222, Quick search should use current view as the context
Diffstat:
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js
@@ -311,7 +311,7 @@ var ScholarPane = new function()
{
if(itemsView)
{
- searchVal = document.getElementById('tb-search').value;
+ var searchVal = document.getElementById('tb-search').value;
itemsView.searchText(searchVal);
document.getElementById('tb-search-cancel').hidden = searchVal == "";
diff --git a/chrome/chromeFiles/content/scholar/xpcom/collectionTreeView.js b/chrome/chromeFiles/content/scholar/xpcom/collectionTreeView.js
@@ -641,7 +641,17 @@ Scholar.ItemGroup.prototype.getChildItems = function()
{
if(this.searchText)
{
- return Scholar.Items.get(Scholar.Items.search(this.searchText,(this.isCollection() ? this.ref.getID() : null)));
+ var s = new Scholar.Search();
+ if (this.isCollection())
+ {
+ s.addCondition('collectionID', 'is', this.ref.getID(), true);
+ }
+ else if (this.isSearch())
+ {
+ s.addCondition('savedSearchID', 'is', this.ref['id'], true);
+ }
+ s.addCondition('fulltext', 'contains', this.searchText);
+ return Scholar.Items.get(s.search());
}
else
{
diff --git a/chrome/chromeFiles/content/scholar/xpcom/search.js b/chrome/chromeFiles/content/scholar/xpcom/search.js
@@ -127,6 +127,7 @@ Scholar.Search.prototype.addCondition = function(condition, operator, value, req
this.addCondition('joinMode', 'any');
this.addCondition('title', operator, value, false);
this.addCondition('field', operator, value, false);
+ this.addCondition('numberfield', operator, value, false);
this.addCondition('creator', operator, value, false);
this.addCondition('tag', operator, value, false);
this.addCondition('note', operator, value, false);
@@ -794,7 +795,7 @@ Scholar.SearchConditions = new function(){
if (!_initialized){
_init();
}
- Scholar.debug(_standardConditions);
+
// TODO: return copy instead
return _standardConditions;
}