From 8c214026b723a8a47485fed4986dd4231672e297 Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Sat, 16 Feb 2002 01:23:44 +0000 Subject: [PATCH] Fix bug # 125801: find rdf service. r=bryner sr=ben --- xpfe/components/bookmarks/resources/findBookmark.js | 13 +++++++++++++ .../components/bookmarks/resources/findBookmark.xul | 1 + .../resources/locale/en-US/bookmark.properties | 1 + .../resources/locale/en-US/findBookmark.dtd | 1 + 4 files changed, 16 insertions(+) diff --git a/xpfe/components/bookmarks/resources/findBookmark.js b/xpfe/components/bookmarks/resources/findBookmark.js index 2799a34444d3..d01318c5c4b5 100644 --- a/xpfe/components/bookmarks/resources/findBookmark.js +++ b/xpfe/components/bookmarks/resources/findBookmark.js @@ -36,6 +36,9 @@ * * ***** END LICENSE BLOCK ***** */ +const BMARKS_CONTRACTID = "@mozilla.org/browser/bookmarks-service;1"; +const nsIBookmarksService = Components.interfaces.nsIBookmarksService; + var gOKButton; var gSearchField; function Startup() @@ -65,6 +68,16 @@ function find() bmWindow.document.getElementById("bookmarks-view").outliner.setAttribute("ref", searchURI); bmWindow.focus(); + + if (document.getElementById("saveQuery").checked == true) + { + var bundle = document.getElementById("bookmarksBundle"); + var findTitle = bundle.stringBundle.formatStringFromName( + "ShortFindTitle", [gSearchField.value], 1); + var bmks = Components.classes[BMARKS_CONTRACTID].getService(nsIBookmarksService); + bmks.AddBookmark(searchURI, findTitle, bmks.BOOKMARK_FIND_TYPE, null); + } + return true; } diff --git a/xpfe/components/bookmarks/resources/findBookmark.xul b/xpfe/components/bookmarks/resources/findBookmark.xul index 94923d7ec3d8..b4d3b302cc72 100644 --- a/xpfe/components/bookmarks/resources/findBookmark.xul +++ b/xpfe/components/bookmarks/resources/findBookmark.xul @@ -64,5 +64,6 @@ + diff --git a/xpfe/components/bookmarks/resources/locale/en-US/bookmark.properties b/xpfe/components/bookmarks/resources/locale/en-US/bookmark.properties index 508e0d1a4963..9eb8b556b490 100755 --- a/xpfe/components/bookmarks/resources/locale/en-US/bookmark.properties +++ b/xpfe/components/bookmarks/resources/locale/en-US/bookmark.properties @@ -65,6 +65,7 @@ pleaseSelectANotification = Please enter at least one notification method. SortMenuItem = Sorted by %NAME% +ShortFindTitle = Find: '%S' FindTitle = Find: %S %S '%S' in %S ImportedIEFavorites = Imported IE Favorites diff --git a/xpfe/components/bookmarks/resources/locale/en-US/findBookmark.dtd b/xpfe/components/bookmarks/resources/locale/en-US/findBookmark.dtd index d8c3fb72a547..78a539506530 100644 --- a/xpfe/components/bookmarks/resources/locale/en-US/findBookmark.dtd +++ b/xpfe/components/bookmarks/resources/locale/en-US/findBookmark.dtd @@ -9,6 +9,7 @@ +