diff --git a/browser/components/bookmarks/content/bookmarks.js b/browser/components/bookmarks/content/bookmarks.js
index dca1251d0351..d15fff70ffda 100644
--- a/browser/components/bookmarks/content/bookmarks.js
+++ b/browser/components/bookmarks/content/bookmarks.js
@@ -475,6 +475,7 @@ var BookmarksCommand = {
// requires utilityOverlay.js if opening in new window for getTopWin()
openOneBookmark: function (aURI, aTargetBrowser, aDS)
{
+ var w, browser
var url = BookmarksUtils.getProperty(aURI, NC_NS+"URL", aDS)
// Ignore "NC:" and empty urls.
if (url == "" || url.substring(0,3) == "NC:")
@@ -484,19 +485,23 @@ var BookmarksCommand = {
openTopWin(url);
break;
case "tab":
- var w = getTopWin();
+ w = getTopWin();
if (!w) {
openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url);
break;
}
- w.focus();
- var browser = w.document.getElementById("content");
- var tab = browser.addTab(url);
+ browser = w.document.getElementById("content");
+ var tab = browser.addTab(url);
browser.selectedTab = tab;
+ browser.focus();
break;
case "window":
openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url);
break;
+ case "properties":
+ openDialog("chrome://browser/content/bookmarks/bookmarksProperties.xul",
+ "", "centerscreen,chrome,resizable=no", url);
+
}
},
@@ -536,8 +541,7 @@ var BookmarksCommand = {
showProperties: function (aSelection)
{
- openDialog("chrome://browser/content/bookmarks/bookmarksProperties.xul",
- "", "centerscreen,chrome,resizable=no", aSelection.item[0].Value);
+ this.openBookmark(aSelection, "properties");
},
findBookmark: function ()
@@ -1537,7 +1541,7 @@ var BookmarksUtils = {
getBrowserTargetFromEvent: function (aEvent)
{
// note: modifier keys are ignored in menuitems (bug 126189)
- var button = aEvent.type == "command"? 0:aEvent.button;
+ var button = aEvent.type == "command" || aEvent.type == "keypress"? 0:aEvent.button;
if (button == 2)
return "";
if (aEvent.metaKey || aEvent.ctrlKey || button == 1)
@@ -1545,6 +1549,8 @@ var BookmarksUtils = {
return "window";
else
return "tab";
+ else if (aEvent.altKey)
+ return "properties"
else
return "current";
},
diff --git a/browser/components/bookmarks/content/bookmarksManager.js b/browser/components/bookmarks/content/bookmarksManager.js
index c601a452e95d..423c1c43856c 100644
--- a/browser/components/bookmarks/content/bookmarksManager.js
+++ b/browser/components/bookmarks/content/bookmarksManager.js
@@ -23,6 +23,7 @@
*/
var gSearchBox;
+
////////////////////////////////////////////////////////////////////////////////
// Initialize the command controllers, set focus, tree root,
// window title state, etc.
@@ -217,14 +218,3 @@ function onViewMenuColumnItemSelected(aEvent)
aEvent.preventBubble();
}
-
-function searchBookmarks(aInput)
-{
- var bookmarksView = document.getElementById("bookmarks-view");
- if (!aInput)
- bookmarksView.tree.setAttribute("ref", "NC:BookmarksRoot");
- else
- bookmarksView.tree.setAttribute("ref",
- "find:datasource=rdf:bookmarks&match=http://home.netscape.com/NC-rdf#Name&method=contains&text=" + escape(aInput));
- }
-
diff --git a/browser/components/bookmarks/content/bookmarksManager.xul b/browser/components/bookmarks/content/bookmarksManager.xul
index d4c16af52220..0a768cc1b91d 100644
--- a/browser/components/bookmarks/content/bookmarksManager.xul
+++ b/browser/components/bookmarks/content/bookmarksManager.xul
@@ -57,7 +57,6 @@
-
@@ -66,12 +65,10 @@
-
+
-
-
+ callback="document.getElementById('bookmarks-view').searchBookmarks(gSearchBox.value);"/>
diff --git a/browser/components/bookmarks/content/bookmarksPanel.js b/browser/components/bookmarks/content/bookmarksPanel.js
index 6bed46675f27..0c128fa7581a 100644
--- a/browser/components/bookmarks/content/bookmarksPanel.js
+++ b/browser/components/bookmarks/content/bookmarksPanel.js
@@ -36,6 +36,7 @@
*
* ***** END LICENSE BLOCK ***** */
+var gSearchBox;
////////////////////////////////////////////////////////////////////////////////
// Get the two bookmarks utility libraries running, attach controllers, focus
@@ -44,10 +45,11 @@ function Startup()
{
var bookmarksView = document.getElementById("bookmarks-view");
bookmarksView.treeBoxObject.selection.select(0);
+ gSearchBox = document.getElementById("search-box");
}
function manageBookmarks() {
- openDialog("chrome://communicator/content/bookmarks/bookmarksManager.xul", "", "chrome,dialog=no,resizable=yes");
+ openDialog("chrome://browser/content/bookmarks/bookmarksManager.xul", "", "chrome,dialog=no,resizable=yes");
}
function addBookmark() {
diff --git a/browser/components/bookmarks/content/bookmarksPanel.xul b/browser/components/bookmarks/content/bookmarksPanel.xul
index a7eac7344307..a43c4d236337 100644
--- a/browser/components/bookmarks/content/bookmarksPanel.xul
+++ b/browser/components/bookmarks/content/bookmarksPanel.xul
@@ -23,65 +23,67 @@
-->
-
+
-
-
-
+
-
-
-
-
+
-
+
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
+
+
-
+
diff --git a/browser/components/bookmarks/content/bookmarksTree.xml b/browser/components/bookmarks/content/bookmarksTree.xml
index 3ba458e8ed08..c414e32369d6 100644
--- a/browser/components/bookmarks/content/bookmarksTree.xml
+++ b/browser/components/bookmarks/content/bookmarksTree.xml
@@ -427,6 +427,7 @@ dump("error in refresh sort:"+e)
return;
if (aClickCount == 1 && this.clickCount == 2 && aEvent.button != 1)
return;
+
var row = {};
var col = {};
var obj = {};
@@ -435,11 +436,9 @@ dump("error in refresh sort:"+e)
if (row == -1 || obj.value == "twisty")
return;
var browserTarget = BookmarksUtils.getBrowserTargetFromEvent(aEvent);
- if (browserTarget != "current" && this.clickCount == aClickCount) {
- if (!this.treeBoxObject.selection.isSelected(row)) {
- this.treeBoxObject.selection.select(row)
- }
- }
+ if (this.clickCount == 1 || browserTarget != "current" &&
+ this.clickCount == aClickCount && !this.treeBoxObject.selection.isSelected(row))
+ this.treeBoxObject.selection.select(row)
var selection = this.getTreeSelection();
this._selection = selection;
@@ -447,24 +446,37 @@ dump("error in refresh sort:"+e)
if (!isFolderGroup && selection.isContainer[0]) {
if (this.clickCount == 1) {
- if (row.value >= 0) {
- this.treeBoxObject.view.toggleOpenState(row.value);
+ if (row >= 0) {
+ this.treeBoxObject.view.toggleOpenState(row);
}
}
- if (selection.protocol[0] == "file")
- BookmarksCommand.openBookmark(selection, browserTarget, this.db);
- return;
- }
-
- if (aEvent.altKey) {
- BookmarksCommand.showProperties(selection);
- return
- }
-
+ if (selection.protocol[0] != "file")
+ return;
+ }
BookmarksCommand.openBookmark(selection, browserTarget, this.db);
]]>