diff --git a/chrome/chromeFiles/content/scholar/bindings/scholarsearch.xml b/chrome/chromeFiles/content/scholar/bindings/scholarsearch.xml
new file mode 100644
index 000000000..5c2b03495
--- /dev/null
+++ b/chrome/chromeFiles/content/scholar/bindings/scholarsearch.xml
@@ -0,0 +1,231 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/chrome/chromeFiles/content/scholar/collectionTreeView.js b/chrome/chromeFiles/content/scholar/collectionTreeView.js
index 6a72193da..ae9286e55 100644
--- a/chrome/chromeFiles/content/scholar/collectionTreeView.js
+++ b/chrome/chromeFiles/content/scholar/collectionTreeView.js
@@ -61,11 +61,44 @@ Scholar.CollectionTreeView.prototype.refresh = function()
var newRows = Scholar.getCollections();
for(var i = 0; i < newRows.length; i++)
- this._showItem(new Scholar.ItemGroup('collection',newRows[i]), 0, this._dataItems.length); //item ref, level, beforeRow
-
+ this._showItem(new Scholar.ItemGroup('collection',newRows[i]), 0, this._dataItems.length); //itemgroup ref, level, beforeRow
+
+ var savedSearches = Scholar.Searches.getAll();
+ for(var i = 0; i < savedSearches.length; i++)
+ {
+ this._showItem(new Scholar.ItemGroup('search',savedSearches[i]), 0, this._dataItems.length); //itemgroup ref, level, beforeRow
+ Scholar.debug(i);
+ }
+
this._refreshHashMap();
}
+/*
+ * Redisplay everything
+ */
+Scholar.CollectionTreeView.prototype.reload = function()
+{
+ var openCollections = new Array();
+
+ for(var i = 0; i < this.rowCount; i++)
+ if(this.isContainer(i) && this.isContainerOpen(i))
+ openCollections.push(this._getItemAtRow(i).ref.getID());
+
+ var oldCount = this.rowCount;
+ this._treebox.beginUpdateBatch();
+ this.refresh();
+ this._treebox.rowCountChanged(0,this.rowCount - oldCount);
+
+ for(var i = 0; i < openCollections.length; i++)
+ {
+ var row = this._collectionRowMap[openCollections[i]];
+ if(row != null)
+ this.toggleOpenState(row);
+ }
+ this._treebox.invalidate();
+ this._treebox.endUpdateBatch();
+}
+
/*
* Called by Scholar.Notifier on any changes to collections in the data layer
*/
@@ -101,25 +134,7 @@ Scholar.CollectionTreeView.prototype.notify = function(action, type, ids)
}
else if(action == 'move')
{
- var openCollections = new Array();
-
- for(var i = 0; i < this.rowCount; i++)
- if(this.isContainer(i) && this.isContainerOpen(i))
- openCollections.push(this._getItemAtRow(i).ref.getID());
-
- var oldCount = this.rowCount;
- this._treebox.beginUpdateBatch();
- this.refresh();
- this._treebox.rowCountChanged(0,this.rowCount - oldCount);
-
- for(var i = 0; i < openCollections.length; i++)
- {
- var row = this._collectionRowMap[openCollections[i]];
- if(row != null)
- this.toggleOpenState(row);
- }
- this._treebox.invalidate();
- this._treebox.endUpdateBatch();
+ this.reload();
}
else if(action == 'modify')
{
@@ -291,7 +306,11 @@ Scholar.CollectionTreeView.prototype.deleteSelection = function()
for (var i=0; i
+