diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js
index 3a4e48df2e..fbf9933699 100644
--- a/chrome/chromeFiles/content/scholar/itemTreeView.js
+++ b/chrome/chromeFiles/content/scholar/itemTreeView.js
@@ -100,8 +100,11 @@ Scholar.ItemTreeView.prototype.deleteSelection = function()
this._treebox.beginUpdateBatch();
for (var i=0; i
-
+
diff --git a/chrome/chromeFiles/content/scholar/organizeWindow.js b/chrome/chromeFiles/content/scholar/organizeWindow.js
deleted file mode 100644
index 1fb45ce511..0000000000
--- a/chrome/chromeFiles/content/scholar/organizeWindow.js
+++ /dev/null
@@ -1,108 +0,0 @@
-var foldersView;
-var itemsView;
-var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
-
-function init()
-{
- foldersView = new Scholar.TreeView(0); //pass params here?
- document.getElementById('folders-tree').view = foldersView;
- itemsView = new Scholar.ItemTreeView(0);
- document.getElementById('items-tree').view = itemsView;
-
- var addMenu = document.getElementById('tb-add').firstChild;
- var itemTypes = Scholar.ItemTypes.getTypes();
- for(var i = 0; i 0 && confirm("Are you sure you want to delete the selected items?"))
- itemsView.deleteSelection();
-}
-
-function search()
-{
- //TO DO: reload items tree with a search instead of a root folder
- alert(document.getElementById('tb-search').value);
-}
\ No newline at end of file
diff --git a/chrome/chromeFiles/content/scholar/organizeWindow.xul b/chrome/chromeFiles/content/scholar/organizeWindow.xul
deleted file mode 100644
index 03118dc204..0000000000
--- a/chrome/chromeFiles/content/scholar/organizeWindow.xul
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#ifdef XP_MACOSX
-
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js
index be88a634ad..73f1c91dd4 100644
--- a/chrome/chromeFiles/content/scholar/overlay.js
+++ b/chrome/chromeFiles/content/scholar/overlay.js
@@ -13,6 +13,7 @@ var ScholarPane = new function()
this.itemSelected = itemSelected;
this.deleteSelection = deleteSelection;
this.search = search;
+ this.toggleView = toggleView;
function init()
{
@@ -29,6 +30,8 @@ var ScholarPane = new function()
menuitem.setAttribute("oncommand","ScholarPane.newItem("+itemTypes[i]['id']+")");
addMenu.appendChild(menuitem);
}
+
+// Drag.init(document.getElementById('scholar-floater-handle'),document.getElementById('scholar-floater'), 0, 400, 0, 500, true, true);
}
function toggleScholar()
@@ -75,10 +78,17 @@ var ScholarPane = new function()
{
var item = itemsView._getItemAtRow(itemsView.selection.currentIndex);
- document.getElementById('content').loadURI('chrome://scholar/content/view.xul?id='+encodeURIComponent(item.getID()));
+ MetadataPane.viewItem(item);
+ var url = item.getField('source');
+ if(!validURL(url))
+ url = 'http://www.google.com/search?q='+encodeURIComponent('"'+item.getField("title")+'"'); //+'&btnI'
+
+ document.getElementById('content').loadURI(url);
+ document.getElementById('scholar-floater').hidden=false;
}
else
{
+ document.getElementById('scholar-floater').hidden=true;
}
@@ -92,8 +102,25 @@ var ScholarPane = new function()
function search()
{
- //TO DO: reload items tree with a search instead of a root folder
- alert(document.getElementById('tb-search').value);
+ if(itemsView)
+ itemsView.searchText(document.getElementById('tb-search').value);
+ }
+
+ function toggleView(id)
+ {
+ var button = document.getElementById('tb-'+id);
+ var elem = document.getElementById('scholar-'+id);
+
+ button.checked = !button.checked;
+ elem.hidden = !elem.hidden;
+ }
+
+ //Thanks: http://www.bigbold.com/snippets/posts/show/452
+ //TODO: move this out of overlay.js, into Scholar.js?
+ function validURL(s)
+ {
+ var regexp = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
+ return regexp.test(s);
}
}
diff --git a/chrome/chromeFiles/content/scholar/overlay.xul b/chrome/chromeFiles/content/scholar/overlay.xul
index 4b4d362bfd..a9c49c094e 100644
--- a/chrome/chromeFiles/content/scholar/overlay.xul
+++ b/chrome/chromeFiles/content/scholar/overlay.xul
@@ -1,10 +1,10 @@
-
+
@@ -19,6 +19,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -37,7 +50,7 @@
@@ -82,6 +95,10 @@
+
+
+
+
diff --git a/chrome/chromeFiles/content/scholar/view.js b/chrome/chromeFiles/content/scholar/view.js
deleted file mode 100644
index 967831a396..0000000000
--- a/chrome/chromeFiles/content/scholar/view.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var thisItem;
-
-function init()
-{
- if(thisItem)
- return;
-
- var id = getArgument("id");
- if(id)
- {
- thisItem = Scholar.Items.get(id);
- document.getElementById('view').setAttribute('src','http://www.google.com/search?q='+encodeURIComponent('"'+thisItem.getField("title")+'"')+'&btnI');
- MetadataPane.viewItem(thisItem);
- }
- else
- {
- thisItem = new Scholar.Item(getArgument('new'));
- MetadataPane.viewItem(thisItem);
- MetadataPane.toggleEdit();
- }
-}
-
-function toggle(id)
-{
- var button = document.getElementById('tb-'+id);
- var elem = document.getElementById(id);
-
- button.checked = !button.checked;
- elem.hidden = !elem.hidden;
-}
-
-//thanks to: http://evolt.org/node/14435
-function getArgument (name)
-{
- var arguments = document.location.search.slice(1).split('&');
- var r = '';
- for (var i = 0; i < arguments.length; i++)
- {
- if (arguments[i].slice(0,arguments[i].indexOf('=')) == name)
- {
- r = arguments[i].slice(arguments[i].indexOf('=')+1);
- return (r.length > 0 ? unescape(r).split(',') : '');
- }
- }
- return '';
-}
-
-addEventListener("load", function(e) { init(e); }, false);
\ No newline at end of file
diff --git a/chrome/chromeFiles/content/scholar/view.xul b/chrome/chromeFiles/content/scholar/view.xul
deleted file mode 100644
index eea85f952f..0000000000
--- a/chrome/chromeFiles/content/scholar/view.xul
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/chrome/chromeFiles/skin/default/scholar/overlay.css b/chrome/chromeFiles/skin/default/scholar/overlay.css
index 7b0f3aaff8..13ebbb1982 100644
--- a/chrome/chromeFiles/skin/default/scholar/overlay.css
+++ b/chrome/chromeFiles/skin/default/scholar/overlay.css
@@ -33,6 +33,11 @@ tree #items-tree
}
+#scholar-toolbar .toggler
+{
+ margin: 4px;
+}
+
#tb-search
{
width: 150px;
@@ -45,4 +50,42 @@ tree #items-tree
min-height: 4px;
max-height: 4px;
background: #f5f5f5 !important;
+}
+
+#scholar-floater
+{
+ position: fixed;
+ bottom: 0px;
+ right: 0px;
+ margin-bottom: 30px;
+ margin-right: 30px;
+ border: 1px solid #a5a5a5;
+ padding: 5px;
+ background: #f5f5f5;
+
+ font-size: 12px;
+ width: 400px;
+ max-width: 400px;
+}
+
+#scholar-floater vbox, #scholar-floater toolbar
+{
+ width: 400px;
+ max-width: 400px;
+ margin-top: 5px;
+ padding: none;
+}
+
+#scholar-metadata
+{
+}
+
+#scholar-metadata toolbar
+{
+ border-bottom: none;
+}
+
+#scholar-notes
+{
+ height: 100px;
}
\ No newline at end of file
diff --git a/chrome/chromeFiles/skin/default/scholar/view.css b/chrome/chromeFiles/skin/default/scholar/view.css
deleted file mode 100644
index ccfc18b0b1..0000000000
--- a/chrome/chromeFiles/skin/default/scholar/view.css
+++ /dev/null
@@ -1,41 +0,0 @@
-#view-toolbar
-{
- background: #f5f5f5;
-}
-
-#view-toolbar .toggler
-{
- margin: 4px;
-}
-
-#subs
-{
- width: 400px;
-}
-
-.floater
-{
- position: relative;
- margin-top: 10px;
- margin-right: 30px;
-
- padding: 5px;
- font-size: 12px;
- background: #f5f5f5;
- width: 400px;
-}
-
-#metadata
-{
-
-}
-
-#notes
-{
- height: 100px;
-}
-
-#metadata toolbar
-{
- border-bottom: none;
-}
\ No newline at end of file