From cdcaccb688bfa534069155f19e2f842a312979b7 Mon Sep 17 00:00:00 2001 From: "mozilla.mano@sent.com" Date: Sat, 29 Mar 2008 11:16:27 -0700 Subject: [PATCH] Bug 422977 - remove advanced search UI from library / bookmarks organizer. r=mconnor. --- browser/components/places/content/places.js | 33 +++++------ browser/components/places/content/places.xul | 4 ++ browser/components/places/jar.mn | 2 + browser/themes/gnomestripe/browser/jar.mn | 2 +- .../gnomestripe/browser/places/organizer.css | 52 ++++-------------- browser/themes/pinstripe/browser/jar.mn | 2 +- .../pinstripe/browser/places/organizer.css | 55 ++++++++++--------- browser/themes/winstripe/browser/jar.mn | 2 +- .../winstripe/browser/places/organizer.css | 40 +++----------- 9 files changed, 71 insertions(+), 121 deletions(-) diff --git a/browser/components/places/content/places.js b/browser/components/places/content/places.js index 1afd0591bf46..6efd6681d766 100755 --- a/browser/components/places/content/places.js +++ b/browser/components/places/content/places.js @@ -78,8 +78,10 @@ var PlacesOrganizer = { // Set up the search UI. PlacesSearchBox.init(); +#ifdef PLACES_QUERY_BUILDER // Set up the advanced query builder UI PlacesQueryBuilder.init(); +#endif window.addEventListener("AppCommand", this, true); #ifdef XP_MACOSX @@ -632,25 +634,15 @@ var PlacesOrganizer = { saveSearch: function PO_saveSearch() { // Get the place: uri for the query. // If the advanced query builder is showing, use that. - var queries = []; + var queries = PlacesQueryBuilder.queries; var options = this.getCurrentOptions(); - options.excludeQueries = true; - // unset expandQueries=false, which is set by the left pane - options.expandQueries = true; - var searchUI = document.getElementById("searchModifiers"); - if (!searchUI.hidden) - queries = PlacesQueryBuilder.queries; - else if (PlacesSearchBox.value && PlacesSearchBox.value.length > 0) { - // If not, use the value of the search box. - var query = PlacesUtils.history.getNewQuery(); - query.searchTerms = PlacesSearchBox.value; - queries.push(query); - } - else { - // if there is no query, do nothing. - // XXX should probably have a dialog here to explain that the user needs to search first. - return; - } + +#ifndef PLACES_QUERY_BUILDER + var query = PlacesUtils.history.getNewQuery(); + query.searchTerms = PlacesSearchBox.value; + queries.push(query); +#endif + var placeSpec = PlacesUtils.history.queriesToQueryString(queries, queries.length, options); @@ -843,9 +835,11 @@ var PlacesSearchBox = { var searchModifiers = document.getElementById("searchModifiers"); searchModifiers.hidden = false; +#ifdef PLACES_QUERY_BUILDER // if new search, open builder with pre-populated text row if (PlacesQueryBuilder.numRows == 0) document.getElementById("OrganizerCommand_search:moreCriteria").doCommand(); +#endif }, hideSearchUI: function PSB_hideSearchUI() { @@ -862,6 +856,7 @@ var PlacesQueryBuilder = { queries: [], queryOptions: null, +#ifdef PLACES_QUERY_BUILDER numRows: 0, /** @@ -904,6 +899,7 @@ var PlacesQueryBuilder = { _nextSearch: null, _queryBuilders: null, + init: function PQB_init() { // Initialize advanced search this._nextSearch = { @@ -1319,6 +1315,7 @@ var PlacesQueryBuilder = { // XXXben - find some public way of doing this! PlacesOrganizer._content.load(this.queries, this.options); }, +#endif onScopeSelected: function PQB_onScopeSelected(aButton) { var id = aButton.getAttribute("id"); diff --git a/browser/components/places/content/places.xul b/browser/components/places/content/places.xul index dcd6c9dde3d6..e36b2036cb40 100755 --- a/browser/components/places/content/places.xul +++ b/browser/components/places/content/places.xul @@ -435,6 +435,7 @@