From 04ca04b3979bb3be3600d7740115a314e1831a5a Mon Sep 17 00:00:00 2001 From: "ben%netscape.com" Date: Thu, 9 Mar 2000 07:53:22 +0000 Subject: [PATCH] fixes for search panel appearance, 28103 r=german, a=jevering --- .../search/resources/search-panel.js | 49 ++++++++++++++----- .../search/resources/search-panel.xul | 22 +++++---- xpfe/components/search/resources/search.css | 41 +++++++++++++++- 3 files changed, 90 insertions(+), 22 deletions(-) diff --git a/xpfe/components/search/resources/search-panel.js b/xpfe/components/search/resources/search-panel.js index 79d31ad80bb2..a837cfcf1e78 100644 --- a/xpfe/components/search/resources/search-panel.js +++ b/xpfe/components/search/resources/search-panel.js @@ -23,10 +23,11 @@ var rootNode = null; var textArc = null; var RDF_observer = new Object; -var settingsButton = null; -var settingsButtonText = null; -var bundle = null; -var pref = null; +var settingsButton = null; +var settingsButtonText = null; +var bunremoveAttributedle = null; +var pref = null; +var mClickCount = null; // get the click count pref try { @@ -138,13 +139,14 @@ function SearchPanelStartup() categoryList.selectedIndex = i; } } - + // set the category name on the advanced panel var categoryText = categoryList.options[ categoryList.selectedIndex ].text; var textElement = document.getElementById( "categoryNameText" ); textElement.setAttribute( "value", categoryText ); //set the category name on the settings button settingsButton.value = settingsButtonText + categoryText + "..."; + if( lastCategoryName == "" ) lastCategoryName = "NC:SearchEngineRoot"; @@ -397,6 +399,28 @@ function doStop() function doSearch() { + //get click count pref for later + //and set tree attribute to cause proper results appearance (like links) to happen + //when user set pref to single click + try { + if( pref ) { + var prefvalue = pref.GetBoolPref( "browser.search.use_double_clicks" ); + mClickCount = prefvalue ? 2 : 1; + } + else + mClickCount = 1; + } + catch(e) { + mClickCount = 1; + } + var tree = document.getElementById("Tree"); + if (mClickCount == 1) + tree.setAttribute("singleclick","true"); + else + tree.removeAttribute("singleclick"); + + //end insert for single click appearance + // hide search button var searchButtonNode = document.getElementById("searchbutton"); var stopButtonNode = document.getElementById("stopbutton"); @@ -468,14 +492,14 @@ function doSearch() engineURIs[engineURIs.length] = treeItem.getAttribute( "id" ); } else { - dump("*** multiple engines present, none selected, selecting the netscape search engine\n"); + dump("*** multiple search engines present, selecting the netscape search engine\n"); for( var i = 0; i < treeChildrenNode.childNodes.length; i++ ) { var currItem = treeChildrenNode.childNodes[i]; dump("*** the current URI is = " + currItem.getAttribute("id") + "\n"); - if( currItem.getAttribute("id").indexOf("NetscapeSearchMain") != -1 ) { + if( currItem.getAttribute("id").indexOf("Open_Directory") != -1 ) { - engineURIs[engineURIs.length] = currItem.getAttribute("id"); + engineURIs[engineURIs.length] = treeItem.getAttribute("id"); break; } } @@ -537,7 +561,8 @@ function checkSearchProgress( aSearchURL ) //window.frames["sidebar-content"].doStop(); doStop(); } - return true; + + return true; } function FOO_doSearch() @@ -551,7 +576,8 @@ function FOO_doSearch() function openURL(event, treeitem, root) { - try { + /* mClickCount variable now made global and retrieved at start of doSearch() */ + /* try { if( pref ) { var prefvalue = pref.GetBoolPref( "browser.search.use_double_clicks" ); mClickCount = prefvalue ? 2 : 1; @@ -561,7 +587,7 @@ function openURL(event, treeitem, root) } catch(e) { mClickCount = 1; - } + } */ if ((event.button != 1) || (event.clickCount != mClickCount)) return(false); @@ -703,4 +729,3 @@ function switchTab( aPageIndex ) var deck = document.getElementById( "advancedDeck" ); deck.setAttribute( "index", aPageIndex ); } - diff --git a/xpfe/components/search/resources/search-panel.xul b/xpfe/components/search/resources/search-panel.xul index 565a5d685b35..d58268d2cc57 100644 --- a/xpfe/components/search/resources/search-panel.xul +++ b/xpfe/components/search/resources/search-panel.xul @@ -39,11 +39,12 @@ - + + - - &within.label; @@ -89,9 +90,12 @@ - + + @@ -108,16 +112,16 @@ - + - + - + - + @@ -152,4 +156,4 @@ - + \ No newline at end of file diff --git a/xpfe/components/search/resources/search.css b/xpfe/components/search/resources/search.css index 7ed47d6312b1..743f285762f5 100755 --- a/xpfe/components/search/resources/search.css +++ b/xpfe/components/search/resources/search.css @@ -88,4 +88,43 @@ treeitem > treerow.searchresult > treecell > titledbutton:active { /*undo regular search tree selection look*/ treeitem[selected="true"] > treerow.searchresult { background-color: transparent; -} \ No newline at end of file +} + + + +.searchpanel-outerbox { + padding: 8px 4px 4px 4px; +} + +.indented-label { + padding-left: 8px; +} + +titledbutton.panelbtn { + margin-left: 1em; + margin-right: 1em; +} + +tree[singleclick="true"] treeitem > treerow > treecell > titledbutton { + cursor: pointer; +} + +tree[singleclick="true"] treeitem > treerow > treecell { + color: black; + text-decoration: none; +} + +tree[singleclick="true"] treeitem > treerow > treecell:hover { + color: blue; + text-decoration: underline; +} + +tree[singleclick="true"] treeitem > treerow > treecell:active { + color: red; + text-decoration: underline; +} + +/*undo regular search tree selection look*/ +tree[singleclick="true"] treeitem[selected="true"] > treerow { + background-color: transparent; +}