search appearance tweaks, single click hookup, default search engine hookup (b=26887, 29591, 28103) r=german@netscape.com, waterson@netscape.com (pref hookup) a=jar@netscape.com
This commit is contained in:
Родитель
f5bd8da021
Коммит
5b76c26e70
|
@ -104,6 +104,7 @@ pref("browser.show_about_as_stupid_modal_window", false);
|
|||
pref("browser.search.defaulturl", "http://search.netscape.com/cgi-bin/search?search=");
|
||||
pref("browser.search.opensidebarsearchpanel", true);
|
||||
pref("browser.search.powermode", 0);
|
||||
pref("browser.search.use_double_clicks", false);
|
||||
|
||||
localDefPref("browser.bookmark_location", "");
|
||||
localDefPref("browser.addressbook_location", "");
|
||||
|
|
|
@ -87,6 +87,24 @@
|
|||
&openSidebarSearchPanel.label;
|
||||
</html:label>
|
||||
</html:div>
|
||||
<html:div>
|
||||
&sidebarClickMode.label;
|
||||
</html:div>
|
||||
<html:div>
|
||||
<html:input name="clickCount" type="radio" id="browserSearchSidebarClickCount0"
|
||||
pref="true" preftype="bool" prefindex="false" prefstring="browser.search.use_double_clicks"/>
|
||||
<html:label for="browserSearchSidebarClickCount0" accesskey="t" tabindex="2">
|
||||
&useSingleClicks.label;
|
||||
</html:label>
|
||||
</html:div>
|
||||
<html:div>
|
||||
<html:input name="clickCount" type="radio" id="browserSearchSidebarClickCount1"
|
||||
pref="true" preftype="bool" prefindex="true" prefstring="browser.search.use_double_clicks"/>
|
||||
<html:label for="browserSearchSidebarClickCount1" accesskey="t" tabindex="2">
|
||||
&useDoubleClicks.label;
|
||||
</html:label>
|
||||
</html:div>
|
||||
|
||||
</titledbox>
|
||||
|
||||
</box>
|
||||
|
|
|
@ -15,3 +15,8 @@
|
|||
<!-- LOCALIZATION NOTE (defaultengine.label): Keep parenthesis so it sorts to the first position in the list -->
|
||||
<!ENTITY defaultengine.label "Netscape Search">
|
||||
<!ENTITY searchResults.label "Search Results">
|
||||
<!ENTITY sidebarClickMode.label "Search result loading:">
|
||||
<!ENTITY useSingleClicks.label "Use single click to load search results from sidebar">
|
||||
<!ENTITY useDoubleClicks.label "Use double click to load search results from sidebar">
|
||||
|
||||
|
||||
|
|
|
@ -8,42 +8,23 @@
|
|||
<window class="dialog" align="vertical" onload="onLoadInternetResults()"
|
||||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
>
|
||||
|
||||
<html:script src="chrome://search/content/internetresults.js" />
|
||||
<html:script src="chrome://search/content/shared.js" />
|
||||
|
||||
<toolbox>
|
||||
<toolbar flex="100%" style="background-color: white;">
|
||||
<titledbutton src="http://search.netscape.com/img/search.gif" class="plain"/>
|
||||
<box id="multi-results-header" align="horizontal">
|
||||
<text value="&results.header.label;"/>
|
||||
<spring flex="100%"/>
|
||||
<html:table border="0" cellpadding="0" cellspacing="5" width="585">
|
||||
<html:tr>
|
||||
<html:td width="465" bgcolor="#99cccc" height="17" align="middle" valign="middle">
|
||||
<html:font face="sans-serif, arial, helvetica" size="2">
|
||||
<html:a href="http://home.netscape.com/misc/nav_redir/netsearch.html" target="_top" style="margin-left: 5px; margin-right: 5px;">Search</html:a>
|
||||
|
|
||||
<html:a href="http://home.netscape.com/misc/nav_redir/webmail.html" target="_top" style="margin-left: 5px; margin-right: 5px;">Webmail</html:a>
|
||||
|
|
||||
<html:a href="http://home.netscape.com/misc/nav_redir/personalize.html" target="_top" style="margin-left: 5px; margin-right: 5px;">My Netscape</html:a>
|
||||
|
|
||||
<html:a href="http://home.netscape.com/misc/nav_redir/aim.html" target="_top" style="margin-left: 5px; margin-right: 5px;">Buddy Chat</html:a>
|
||||
|
|
||||
<html:a href="http://home.netscape.com/misc/nav_redir/help.html" target="_top" style="margin-left: 5px; margin-right: 5px;">Help</html:a>
|
||||
|
|
||||
<html:a href="http://home.netscape.com/misc/nav_redir/download.html" target="_top" style="margin-left: 5px; margin-right: 5px;">Download</html:a>
|
||||
</html:font>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<box id="engineTabs" ref="NC:SearchResultsSitesRoot" datasources="rdf:internetsearch" style="height: 64;" align="horizontal">
|
||||
</box>
|
||||
<box id="engineTabs" ref="NC:SearchResultsSitesRoot" datasources="rdf:internetsearch" style="height: 64;" orient="horizontal" vertical-align="baseline">
|
||||
<template>
|
||||
<titledbutton uri="..." onclick="doEngineClick(this)" class="iconic push" align="left" crop="right" src="rdf:http://home.netscape.com/NC-rdf#StatusIcon" value="rdf:http://home.netscape.com/NC-rdf#Name" loading="rdf:http://home.netscape.com/NC-rdf#loading" />
|
||||
</template>
|
||||
<titledbutton id="allEngines" onclick="doEngineClick(this)" class="iconic push" value="&allresults.title.label;" align="left" />
|
||||
<titledbutton id="allEngines" onclick="doEngineClick(this)" class="push" value="&allresults.title.label;" align="left" />
|
||||
<spring style="width: 1em;"/>
|
||||
<text value="&viewbyprovider.label;"/>
|
||||
<spring style="width: .25em;"/>
|
||||
</box>
|
||||
|
||||
<tree id="internetresultstree" ref="" flex="100%" datasources="rdf:internetsearch"
|
||||
|
@ -51,7 +32,7 @@
|
|||
|
||||
<treecol id="NameColumn" rdf:resource="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"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" width="30px"
|
||||
style="width: 0; visibility: collapse;" />
|
||||
<treecol id="PriceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Price"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Availability"
|
||||
|
@ -81,9 +62,8 @@
|
|||
<treechildren>
|
||||
<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="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
<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;" />
|
||||
</treecell>
|
||||
<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Price" />
|
||||
|
|
|
@ -4,3 +4,5 @@ en-US:find.dtd
|
|||
en-US:findresults.dtd
|
||||
en-US:internet.dtd
|
||||
en-US:internetresults.dtd
|
||||
en-US:search-panel.properties
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<!ENTITY price.column.label "Price">
|
||||
<!ENTITY availability.column.label "Availability">
|
||||
<!ENTITY site.column.label "Internet Site">
|
||||
<!ENTITY engine.column.label "Search Engine">
|
||||
|
||||
<!ENTITY allresults.title.label "All Results">
|
||||
<!ENTITY results.header.label "Search Results">
|
||||
<!ENTITY engine.column.label "Search Provider">
|
||||
<!ENTITY viewbyprovider.label "View by provider:">
|
||||
<!ENTITY allresults.title.label "All providers combined">
|
||||
|
|
|
@ -20,12 +20,13 @@
|
|||
-->
|
||||
|
||||
<!ENTITY search.button.label "Search">
|
||||
<!ENTITY search.results.tab "Results">
|
||||
<!ENTITY search.advanced.tab "Advanced">
|
||||
<!ENTITY allengines.label "All Categories">
|
||||
<!ENTITY search.results.tab "Apply">
|
||||
<!ENTITY search.advanced.tab "Settings for ">
|
||||
<!ENTITY allengines.label "All categories combined">
|
||||
<!ENTITY within.label "within">
|
||||
<!ENTITY whenSearching.label "When Searching">
|
||||
<!ENTITY useTheseProviders.label "use these providers">
|
||||
<!ENTITY engine.column.label "Engine">
|
||||
<!ENTITY checkbox.column.label "">
|
||||
<!ENTITY whenSearching.label "When searching ">
|
||||
<!ENTITY useTheseProviders.label "use these providers:">
|
||||
<!ENTITY engine.column.label "Provider Name">
|
||||
<!ENTITY checkbox.column.label "Use">
|
||||
<!ENTITY stop.button.label "Stop">
|
||||
<!ENTITY explain.label "Explain Text...">
|
|
@ -59,6 +59,7 @@ CHROME_L10N = \
|
|||
.\locale\en-US\internetresults.dtd \
|
||||
.\locale\en-US\search.dtd \
|
||||
.\locale\en-US\search-panel.dtd \
|
||||
.\locale\en-US\search-panel.properties \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
|
|
@ -23,6 +23,19 @@
|
|||
var rootNode = null;
|
||||
var textArc = null;
|
||||
var RDF_observer = new Object;
|
||||
var settingsButton = null;
|
||||
var settingsButtonText = null;
|
||||
var bundle = null;
|
||||
var pref = null;
|
||||
|
||||
// get the click count pref
|
||||
try {
|
||||
pref = Components.classes["component://netscape/preferences"].getService();
|
||||
if( pref )
|
||||
pref = pref.QueryInterface( Components.interfaces.nsIPref );
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
|
||||
RDF_observer =
|
||||
{
|
||||
|
@ -48,8 +61,6 @@ RDF_observer =
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function rememberSearchText(targetNode)
|
||||
{
|
||||
if (targetNode) targetNode = targetNode.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
|
@ -68,6 +79,11 @@ 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");
|
||||
if (tree)
|
||||
{
|
||||
|
@ -96,6 +112,8 @@ function SearchPanelStartup()
|
|||
if (ref) categoryList.setAttribute("ref", ref);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -110,10 +128,16 @@ function SearchPanelStartup()
|
|||
dump("*** lastCategoryName = " + lastCategoryName + "\n");
|
||||
var categoryList = document.getElementById( "categoryList" );
|
||||
if( categoryList ) {
|
||||
//set to default value 'the web'
|
||||
//hack: hardcoded postion in here replace with a function that finds the entry 'the web'
|
||||
|
||||
// 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;
|
||||
|
||||
for( var i = 0; i < categoryList.options.length; i++ )
|
||||
{
|
||||
if( ( lastCategoryName == "" && categoryList.options[i].value == "NC:SearchEngineRoot" ) ||
|
||||
|
@ -155,6 +179,9 @@ function chooseCategory( aSelectElement )
|
|||
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();
|
||||
|
@ -375,7 +402,6 @@ function doSearch()
|
|||
var progressNode = top.document.getElementById("statusbar-icon");
|
||||
if( !stopButtonNode || !searchButtonNode )
|
||||
return;
|
||||
dump("*** foo\n");
|
||||
|
||||
// hide various columns
|
||||
if( parent.content.isMozillaSearchWindow ) {
|
||||
|
@ -393,8 +419,7 @@ function doSearch()
|
|||
return false;
|
||||
if ( !textNode.value )
|
||||
{
|
||||
// stringbundle
|
||||
alert("Enter some text to search for and select at least one location to search.");
|
||||
alert( bundle.GetStringFromName("enterstringandlocation") );
|
||||
return false;
|
||||
}
|
||||
// get selected search engines
|
||||
|
@ -442,10 +467,17 @@ function doSearch()
|
|||
engineURIs[engineURIs.length] = treeItem.getAttribute( "id" );
|
||||
}
|
||||
else {
|
||||
// more than one engine, flip the deck and demand input
|
||||
switchTab( 1 );
|
||||
alert("Select at least one location to search.");
|
||||
return false;
|
||||
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("Open_Directory") != -1 ) {
|
||||
|
||||
engineURIs[engineURIs.length] = treeItem.getAttribute("id");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -518,7 +550,19 @@ function FOO_doSearch()
|
|||
|
||||
function openURL(event, treeitem, root)
|
||||
{
|
||||
if ((event.button != 1) || (event.clickCount != 2))
|
||||
try {
|
||||
if( pref ) {
|
||||
var prefvalue = pref.GetBoolPref( "browser.search.use_double_clicks" );
|
||||
mClickCount = prefvalue ? 2 : 1;
|
||||
}
|
||||
else
|
||||
mClickCount = 1;
|
||||
}
|
||||
catch(e) {
|
||||
mClickCount = 1;
|
||||
}
|
||||
|
||||
if ((event.button != 1) || (event.clickCount != mClickCount))
|
||||
return(false);
|
||||
|
||||
if (treeitem.getAttribute("container") == "true")
|
||||
|
@ -650,35 +694,6 @@ function OpenSearch( tabName, forceDialogFlag, aSearchStr, engineURIs )
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( autoOpenSearchPanel )
|
||||
RevealSearchPanel();
|
||||
}
|
||||
|
||||
function RevealSearchPanel()
|
||||
{
|
||||
// rjc Note: the following is all a hack until the sidebar has appropriate APIs
|
||||
// to check whether its shown/hidden, open/closed, and can show a particular panel
|
||||
|
||||
var sidebar = top.document.getElementById("sidebar-box");
|
||||
var sidebar_splitter = top.document.getElementById("sidebar-splitter");
|
||||
var searchPanel = top.document.getElementById("urn:sidebar:panel:search");
|
||||
|
||||
if (sidebar && sidebar_splitter && searchPanel)
|
||||
{
|
||||
var is_hidden = sidebar.getAttribute("hidden");
|
||||
if (is_hidden && is_hidden == "true")
|
||||
{
|
||||
// SidebarShowHide() lives in sidebarOverlay.js
|
||||
SidebarShowHide();
|
||||
}
|
||||
var splitter_state = sidebar_splitter.getAttribute("state");
|
||||
if (splitter_state && splitter_state == "collapsed") {
|
||||
sidebar_splitter.removeAttribute("state");
|
||||
}
|
||||
// SidebarSelectPanel() lives in sidebarOverlay.js
|
||||
SidebarSelectPanel(searchPanel);
|
||||
}
|
||||
}
|
||||
|
||||
function switchTab( aPageIndex )
|
||||
|
|
|
@ -34,20 +34,22 @@
|
|||
onload="SearchPanelStartup();"
|
||||
onunload="SearchPanelShutdown();">
|
||||
|
||||
<html:script src="chrome://global/content/strres.js"/>
|
||||
<html:script src="chrome://search/content/search-panel.js" />
|
||||
|
||||
<tabcontrol align="vertical">
|
||||
<tabcontrol align="vertical">
|
||||
<box align="horizontal">
|
||||
<spring style="width: 5px;"/>
|
||||
<tabbox flex="100%">
|
||||
<tab flex="1" onclick="switchTab(0);">&search.results.tab;</tab>
|
||||
<tab flex="1" onclick="switchTab(1);">&search.advanced.tab;</tab>
|
||||
<tab flex="1" onclick="switchTab(0);" style="display: none;">&search.results.tab;</tab>
|
||||
<tab flex="1" onclick="switchTab(1);" style="display: none;">&search.advanced.tab;</tab>
|
||||
</tabbox>
|
||||
<spring style="width: 5px;"/>
|
||||
</box>
|
||||
<tabpanel style="display:none;"/>
|
||||
</tabcontrol>
|
||||
<deck id="advancedDeck" class="tabpanel" flex="100%">
|
||||
<deck id="advancedDeck" flex="100%" style="border:none;">
|
||||
|
||||
<!-- results panel -->
|
||||
<box align="vertical" flex="100%">
|
||||
<box align="horizontal" class="spaced">
|
||||
|
@ -112,18 +114,25 @@
|
|||
|
||||
</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 tab -->
|
||||
|
||||
<!-- advanced panel -->
|
||||
<box align="vertical">
|
||||
<box align="horizontal">
|
||||
<html:label>&whenSearching.label; &within.label;</html:label>
|
||||
|
||||
<box orient="horizontal" align="center">
|
||||
<text value="&whenSearching.label;"/><text value="&within.label;"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<box orient="horizontal" align="center" style="font-weight: bold">
|
||||
<text id="categoryNameText"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<html:label>&useTheseProviders.label;</html:label>
|
||||
<box orient="horizontal" align="center">
|
||||
<text value="&useTheseProviders.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="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name" sortActive="true" sortDirection="ascending" />
|
||||
|
@ -148,6 +157,11 @@
|
|||
</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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче