mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
Search UI changes.
This commit is contained in:
parent
4d43de09aa
commit
8883b9615f
@ -31,6 +31,8 @@
|
||||
onclick="if (event.clickCount == 2) return OpenURL(event, event.target.parentNode.parentNode); else return doResultClick(event.target.parentNode.parentNode);">
|
||||
|
||||
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||
<treecol id="PageRankColumn" rdf:resource="http://home.netscape.com/NC-rdf#PageRank"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" />
|
||||
<treecol id="RelevanceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Relevance"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"
|
||||
style="width: 0; visibility: collapse;" />
|
||||
@ -63,6 +65,7 @@
|
||||
<treeitem uri="..." rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
||||
<treerow>
|
||||
<treecell align="left" crop="right" class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" value="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
<treecell align="center" crop="right" value="rdf:http://home.netscape.com/NC-rdf#PageRank" />
|
||||
<treecell>
|
||||
<progressmeter align="horizontal" value="rdf:http://home.netscape.com/NC-rdf#Relevance" mode="normal" />
|
||||
<titledbutton align="left" crop="right" flex="1" value="rdf:http://home.netscape.com/NC-rdf#Relevance" style="list-style-image: none;" />
|
||||
@ -79,27 +82,31 @@
|
||||
|
||||
<treehead>
|
||||
<treerow>
|
||||
<treecell id="NameCell"
|
||||
<treecell id="NameCell" align="center"
|
||||
value="&name.column.label;" observes="NameColumn"
|
||||
resource="http://home.netscape.com/NC-rdf#Name"
|
||||
onclick="return doSort('NameColumn');" />
|
||||
<treecell id="RelevanceCell"
|
||||
<treecell id="PageRankCell" align="center"
|
||||
value="&pagerank.column.label;" observes="PageRankColumn"
|
||||
resource="http://home.netscape.com/NC-rdf#PageRank"
|
||||
onclick="return doSort('PageRankColumn');" />
|
||||
<treecell id="RelevanceCell" align="center"
|
||||
value="&relevance.column.label;" observes="RelevanceColumn"
|
||||
resource="http://home.netscape.com/NC-rdf#Relevance"
|
||||
onclick="return doSort('RelevanceColumn');" />
|
||||
<treecell id="PriceCell"
|
||||
<treecell id="PriceCell" align="center"
|
||||
value="&price.column.label;" observes="PriceColumn"
|
||||
resource="http://home.netscape.com/NC-rdf#Price"
|
||||
onclick="return doSort('PriceColumn');" />
|
||||
<treecell id="AvailabilityCell"
|
||||
<treecell id="AvailabilityCell" align="center"
|
||||
value="&availability.column.label;" observes="AvailabilityColumn"
|
||||
resource="http://home.netscape.com/NC-rdf#Availability"
|
||||
onclick="return doSort('AvailabilityColumn');" />
|
||||
<treecell id="SiteCell"
|
||||
<treecell id="SiteCell" align="center"
|
||||
value="&site.column.label;" observes="SiteColumn"
|
||||
resource="http://home.netscape.com/NC-rdf#Site"
|
||||
onclick="return doSort('SiteColumn');" />
|
||||
<treecell id="EngineCell"
|
||||
<treecell id="EngineCell" align="center"
|
||||
value="&engine.column.label;" observes="EngineColumn"
|
||||
resource="http://home.netscape.com/NC-rdf#Engine"
|
||||
onclick="return doSort('EngineColumn');" />
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
<!ENTITY name.column.label "Name">
|
||||
<!ENTITY relevance.column.label "Relevance">
|
||||
<!ENTITY pagerank.column.label "Page Ranking">
|
||||
<!ENTITY price.column.label "Price">
|
||||
<!ENTITY availability.column.label "Availability">
|
||||
<!ENTITY site.column.label "Internet Site">
|
||||
|
@ -22,11 +22,10 @@
|
||||
<!ENTITY search.button.label "Search">
|
||||
<!ENTITY search.results.tab "Apply">
|
||||
<!ENTITY search.advanced.tab "Settings for ">
|
||||
<!ENTITY allengines.label "the Web">
|
||||
<!ENTITY allengines.label "All Engines">
|
||||
<!ENTITY within.label "within">
|
||||
<!ENTITY whenSearching.label "When searching ">
|
||||
<!ENTITY useTheseProviders.label "use these engines:">
|
||||
<!ENTITY engine.column.label "Engine Name">
|
||||
<!ENTITY useResults.label "Search results:">
|
||||
<!ENTITY useTheseProviders.label "Available search engines:">
|
||||
<!ENTITY engine.column.label "Search Engines">
|
||||
<!ENTITY checkbox.column.label "Use">
|
||||
<!ENTITY stop.button.label "Stop">
|
||||
<!ENTITY explain.label "Explain Text...">
|
@ -23,8 +23,6 @@
|
||||
var rootNode = null;
|
||||
var textArc = null;
|
||||
var RDF_observer = new Object;
|
||||
var settingsButton = null;
|
||||
var settingsButtonText = null;
|
||||
var bunremoveAttributedle = null;
|
||||
var pref = null;
|
||||
|
||||
@ -79,9 +77,6 @@ function rememberSearchText(targetNode)
|
||||
// 3) initialise the checked state of said engines.
|
||||
function SearchPanelStartup()
|
||||
{
|
||||
settingsButton = document.getElementById("btn.Advanced");
|
||||
settingsButtonText = settingsButton.getAttribute("value");
|
||||
|
||||
bundle = srGetStrBundle( "chrome://search/locale/search-panel.properties" );
|
||||
|
||||
var tree = document.getElementById("Tree");
|
||||
@ -125,7 +120,7 @@ function SearchPanelStartup()
|
||||
catch( e ) {
|
||||
var lastCategoryName = "";
|
||||
}
|
||||
dump("*** lastCategoryName = " + lastCategoryName + "\n");
|
||||
// dump("*** lastCategoryName = " + lastCategoryName + "\n");
|
||||
var categoryList = document.getElementById( "categoryList" );
|
||||
if( categoryList ) {
|
||||
//set to default value 'the web'
|
||||
@ -139,14 +134,6 @@ function SearchPanelStartup()
|
||||
}
|
||||
}
|
||||
|
||||
// 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";
|
||||
else
|
||||
@ -156,6 +143,38 @@ function SearchPanelStartup()
|
||||
}
|
||||
|
||||
loadEngines( lastCategoryName );
|
||||
|
||||
// if we have search results, show them, otherwise show engines
|
||||
if (haveSearchResults() == true)
|
||||
switchTab(0);
|
||||
else switchTab(1);
|
||||
}
|
||||
|
||||
function haveSearchResults()
|
||||
{
|
||||
var resultsTree = document.getElementById("Tree");
|
||||
if( !resultsTree) return(false);
|
||||
var ds = resultsTree.database;
|
||||
if (!ds) return(false);
|
||||
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
{
|
||||
var source = rdf.GetResource( "NC:LastSearchRoot", true);
|
||||
var childProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#LastText", true);
|
||||
var target = ds.GetTarget(source, childProperty, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target && target != "")
|
||||
{
|
||||
var textNode = document.getElementById("sidebar-search-text");
|
||||
if (!textNode) return(false);
|
||||
textNode.value = unescape(target);
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
function getNumEngines()
|
||||
@ -177,14 +196,6 @@ function getNumEngines()
|
||||
|
||||
function chooseCategory( aSelectElement )
|
||||
{
|
||||
// set the category name on the advanced panel
|
||||
var categoryText = aSelectElement.options[ aSelectElement.selectedIndex ].text;
|
||||
var textElement = document.getElementById( "categoryNameText" );
|
||||
textElement.setAttribute( "value", categoryText );
|
||||
//set the category name on the settings button
|
||||
settingsButton.setAttribute("value",settingsButtonText + categoryText + "...");
|
||||
//alert("set button to " + settingsButtonText + categoryText);//debug remove
|
||||
|
||||
var category = aSelectElement.options[ aSelectElement.selectedIndex ].getAttribute("id");
|
||||
var pref = Components.classes["component://netscape/preferences"].getService();
|
||||
if( pref )
|
||||
@ -288,7 +299,7 @@ function loadEngines( aCategory )
|
||||
var engineSRC = rdf.GetResource( engineURI, true );
|
||||
var hasAssertion = localStore.HasAssertion( categorySRC, checkedProperty, engineSRC, true );
|
||||
var checkbox = treeItem.firstChild.firstChild.firstChild;
|
||||
dump("*** hasAssertion = " + hasAssertion + "\n");
|
||||
// dump("*** hasAssertion = " + hasAssertion + "\n");
|
||||
if ( hasAssertion )
|
||||
{
|
||||
checkbox.checked = true;
|
||||
@ -390,10 +401,11 @@ function doStop()
|
||||
|
||||
if (sortSetFlag == false)
|
||||
{
|
||||
colNode = top.content.document.getElementById("NameColumn");
|
||||
colNode = top.content.document.getElementById("PageRankColumn");
|
||||
if (colNode)
|
||||
top.content.setInitialSort(colNode, "ascending");
|
||||
}
|
||||
switchTab(0);
|
||||
}
|
||||
|
||||
function doSearch()
|
||||
@ -491,11 +503,11 @@ function doSearch()
|
||||
engineURIs[engineURIs.length] = treeItem.getAttribute( "id" );
|
||||
}
|
||||
else {
|
||||
dump("*** multiple search engines present, 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");
|
||||
// dump("*** the current URI is = " + currItem.getAttribute("id") + "\n");
|
||||
if( currItem.getAttribute("id").indexOf("NetscapeSearch.src") != -1 ) {
|
||||
engineURIs[engineURIs.length] = currItem.getAttribute("id");
|
||||
break;
|
||||
@ -530,9 +542,9 @@ function checkSearchProgress( aSearchURL )
|
||||
var resultsTree = top.content.document.getElementById("internetresultstree");
|
||||
var enginesBox = top.content.document.getElementById("engineTabs");
|
||||
if( !resultsTree || !enginesBox )
|
||||
return false;
|
||||
return (activeSearchFlag);
|
||||
var treeref = resultsTree.getAttribute("ref");
|
||||
if( !treeref ) {
|
||||
if( aSearchURL ) {
|
||||
resultsTree.setAttribute( "ref", aSearchURL );
|
||||
treeref = aSearchURL;
|
||||
}
|
||||
@ -554,13 +566,13 @@ function checkSearchProgress( aSearchURL )
|
||||
}
|
||||
}
|
||||
if( activeSearchFlag )
|
||||
setTimeout("checkSearchProgress()", 1000);
|
||||
setTimeout("checkSearchProgress(null)", 1000);
|
||||
else {
|
||||
//window.frames["sidebar-content"].doStop();
|
||||
doStop();
|
||||
}
|
||||
|
||||
return true;
|
||||
return(activeSearchFlag);
|
||||
}
|
||||
|
||||
function FOO_doSearch()
|
||||
@ -729,4 +741,5 @@ function switchTab( aPageIndex )
|
||||
{
|
||||
var deck = document.getElementById( "advancedDeck" );
|
||||
deck.setAttribute( "index", aPageIndex );
|
||||
return(true);
|
||||
}
|
||||
|
@ -35,11 +35,8 @@
|
||||
|
||||
<html:script src="chrome://global/content/strres.js"/>
|
||||
<html:script src="chrome://search/content/search-panel.js" />
|
||||
|
||||
<deck id="advancedDeck" flex="100%" style="border:none;">
|
||||
|
||||
<!-- results panel -->
|
||||
<box class="searchpanel-outerbox" align="vertical" flex="100%">
|
||||
|
||||
<box align="vertical" flex="100%">
|
||||
<box align="horizontal" class="spaced">
|
||||
<html:input id="sidebar-search-text" flex="1" onkeyup="if (event.which == 13) { return doSearch(); }" />
|
||||
<titledbutton id="searchbutton" value="&search.button.label;" onclick="return doSearch();" class="dialog toolbar-non-iconic"/>
|
||||
@ -59,13 +56,28 @@
|
||||
</template>
|
||||
<html:select id="categoryList" template="categoryTemplate" ref="NC:SearchCategoryRoot" datasources="rdf:null"
|
||||
sortResource="http://home.netscape.com/NC-rdf#title" sortDirection="ascending"
|
||||
onmousedown="return switchTab(1);"
|
||||
onchange="return chooseCategory(this)" >
|
||||
<html:option value="NC:SearchEngineRoot" >&allengines.label;</html:option>
|
||||
</html:select>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<deck id="advancedDeck" flex="100%" style="border:none;">
|
||||
|
||||
<!-- results panel -->
|
||||
|
||||
<box flex="1">
|
||||
<box align="vertical" class="searchpanel-outerbox" flex="1">
|
||||
|
||||
<box orient="horizontal" align="center">
|
||||
<text value="&useResults.label;" class="indented-label"/>
|
||||
</box>
|
||||
<spring style="height: 2px;"/>
|
||||
|
||||
<tree id="Tree" ref="NC:LastSearchRoot"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#PageRank"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"
|
||||
sortDirection="ascending" sortActive="true"
|
||||
class="inset"
|
||||
flex="100%"
|
||||
datasources="rdf:internetsearch"
|
||||
@ -101,31 +113,21 @@
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Name" />
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#PageRank" rdf:resource2="http://home.netscape.com/NC-rdf#Name" />
|
||||
|
||||
</tree>
|
||||
</box>
|
||||
<spring style="height: 2px;"/>
|
||||
<titledbutton id="btn.Advanced" value="&search.advanced.tab;" crop="right" onclick="switchTab(1);" class="push"/>
|
||||
<spring style="height: 2px;"/>
|
||||
</box>
|
||||
|
||||
<!-- advanced panel -->
|
||||
<box align="vertical" class="searchpanel-outerbox" >
|
||||
<box align="vertical" class="searchpanel-outerbox" flex="1">
|
||||
|
||||
<box orient="horizontal" align="center">
|
||||
<text value="&whenSearching.label;" class="indented-label"/><text value="&within.label;"/>
|
||||
</box>
|
||||
<box orient="horizontal" align="center" style="font-weight: bold;" class="indented-label">
|
||||
<text id="categoryNameText"/>
|
||||
</box>
|
||||
<box orient="horizontal" align="center">
|
||||
<text value="&useTheseProviders.label;" class="indented-label"/>
|
||||
</box>
|
||||
<spring style="height: 2px;"/>
|
||||
|
||||
<tree align="horizontal" id="searchengines" flex="1" datasources="rdf:internetsearch" ref="NC:SearchEngineRoot" class="inset">
|
||||
<treecol id="CheckboxColumn" />
|
||||
<treecol id="CheckboxColumn" class="checkboxColumn" />
|
||||
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name" sortActive="true" sortDirection="ascending" />
|
||||
<template>
|
||||
<treechildren>
|
||||
@ -144,15 +146,10 @@
|
||||
<treehead>
|
||||
<treerow>
|
||||
<treecell value="&checkbox.column.label;" style="width: 23px;"/>
|
||||
<treecell observes="NameColumn" value="&engine.column.label;" resource="http://home.netscape.com/NC-rdf#Name" onclick="return doSort('NameColumn');" sortActive="true" sortDirection="ascending" flex="1"/>
|
||||
<treecell observes="NameColumn" align="center" value="&engine.column.label;" resource="http://home.netscape.com/NC-rdf#Name" onclick="return doSort('NameColumn');" sortActive="true" sortDirection="ascending" flex="1"/>
|
||||
</treerow>
|
||||
</treehead>
|
||||
</tree>
|
||||
<spring style="height: 2px;"/>
|
||||
<html:div>&explain.label;</html:div>
|
||||
<spring style="height: 2px;"/>
|
||||
<titledbutton value="&search.results.tab;" default="true" onclick="switchTab(0);" class="push"/>
|
||||
<spring style="height: 2px;"/>
|
||||
</box>
|
||||
</deck>
|
||||
</window>
|
||||
</window>
|
||||
|
@ -31,7 +31,7 @@ titledbutton.paneltitle {
|
||||
}
|
||||
|
||||
treecol.checkboxColumn {
|
||||
width: 20px ! important;
|
||||
width: 30px ! important;
|
||||
}
|
||||
|
||||
box.spaced {
|
||||
|
Loading…
x
Reference in New Issue
Block a user