зеркало из https://github.com/mozilla/pjs.git
fix for 46613 (classic skin polish) and 47636 (cannot go back to multiple
search engine listing)
This commit is contained in:
Родитель
a784505708
Коммит
52a769d625
|
@ -1,18 +1,10 @@
|
|||
function searchResultsOpenURL(event, node)
|
||||
function searchResultsOpenURL(event)
|
||||
{
|
||||
if (event.button != 1)
|
||||
return(false);
|
||||
|
||||
if (node.name != "treeitem")
|
||||
return(false);
|
||||
|
||||
var url = node.getAttribute('id');
|
||||
|
||||
if (node.getAttribute('container') == "true")
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
var node = event.target.parentNode.parentNode;
|
||||
if (node.localName != "treeitem" || node.getAttribute('container') == "true")
|
||||
return false;
|
||||
|
||||
var url = node.id;
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf)
|
||||
|
@ -26,50 +18,73 @@ function searchResultsOpenURL(event, node)
|
|||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target) url = target;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
return(false);
|
||||
return false;
|
||||
|
||||
if (top.appCore)
|
||||
top.appCore.loadUrl(url); // arghghghgh
|
||||
else
|
||||
top._content.location.href = url;
|
||||
|
||||
return(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function onLoadInternetResults()
|
||||
{
|
||||
// clear any previous results on load
|
||||
// HACK HACK HACK HACK HACK HACK - chrome urls are being stored in sh as file urls!
|
||||
// access to xpconnect is denied! ack! erk! ork!
|
||||
try {
|
||||
var pref = Components.classes["component://netscape/preferences"].getService();
|
||||
if (pref) pref = pref.QueryInterface(Components.interfaces.nsIPref);
|
||||
}
|
||||
catch(e) {
|
||||
// ok, we're toast. user clicked back, loaded as file url, no xpconnect. abort,
|
||||
// reload.
|
||||
const searchResults = "chrome://communicator/content/search/internetresults.xul"
|
||||
if (top.appCore) top.appCore.loadUrl(searchResults);
|
||||
else top._content.location.href = searchResults;
|
||||
return; // ABORT.
|
||||
}
|
||||
|
||||
// clear any previous results on load
|
||||
var iSearch = Components.classes["component://netscape/rdf/datasource?name=internetsearch"].getService();
|
||||
if (iSearch) iSearch = iSearch.QueryInterface(Components.interfaces.nsIInternetSearchService);
|
||||
if (iSearch) iSearch.ClearResultSearchSites();
|
||||
if (iSearch) iSearch = iSearch.QueryInterface(Components.interfaces.nsIInternetSearchService);
|
||||
if (iSearch) iSearch.ClearResultSearchSites();
|
||||
|
||||
// the search URI is passed in as a parameter, so get it and them root the results tree
|
||||
var searchURI = top._content.location.href;
|
||||
if (searchURI)
|
||||
{
|
||||
var offset = searchURI.indexOf("?");
|
||||
if (offset > 0)
|
||||
{
|
||||
searchURI = searchURI.substr(offset+1);
|
||||
loadResultsTree(searchURI);
|
||||
}
|
||||
// the search URI is passed in as a parameter, so get it and them root the results tree
|
||||
var searchURI = top._content.location.href;
|
||||
if (searchURI) {
|
||||
const lastSearchURIPref = "browser.search.lastMultipleSearchURI";
|
||||
var offset = searchURI.indexOf("?");
|
||||
if (offset > 0) {
|
||||
nsPreferences.setUnicharPref(lastSearchURIPref, searchURI); // evil
|
||||
searchURI = searchURI.substr(offset+1);
|
||||
loadResultsTree(searchURI);
|
||||
}
|
||||
return(true);
|
||||
else {
|
||||
searchURI = nsPreferences.copyUnicharPref(lastSearchURIPref, "");
|
||||
offset = searchURI.indexOf("?");
|
||||
if (offset > 0) {
|
||||
nsPreferences.setUnicharPref(lastSearchURIPref, searchURI); // evil
|
||||
searchURI = searchURI.substr(offset+1);
|
||||
loadResultsTree(searchURI);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadResultsTree( aSearchURL )
|
||||
{
|
||||
var resultsTree = document.getElementById( "internetresultstree" );
|
||||
if( !resultsTree )
|
||||
return false;
|
||||
resultsTree.setAttribute( "ref", aSearchURL );
|
||||
if (!resultsTree) return false;
|
||||
resultsTree.setAttribute("ref", aSearchURL);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -77,25 +92,27 @@ function loadResultsTree( aSearchURL )
|
|||
|
||||
function doEngineClick( event, aNode )
|
||||
{
|
||||
if (event.button != 1)
|
||||
return(false);
|
||||
// do toggling
|
||||
var engineTabBox = document.getElementById("engineTabs");
|
||||
var toggledEls = engineTabBox.getElementsByAttribute("toggled", "true");
|
||||
for (var i = 0; i < toggledEls.length; i++)
|
||||
toggledEls[i].removeAttribute("toggled");
|
||||
event.target.setAttribute("toggled", "true");
|
||||
|
||||
var html = null;
|
||||
|
||||
var resultsTree = document.getElementById("internetresultstree");
|
||||
var contentArea = document.getElementById("content");
|
||||
var splitter = document.getElementById("gray_horizontal_splitter");
|
||||
var engineURI = aNode.getAttribute("id");
|
||||
if (engineURI == "allEngines")
|
||||
{
|
||||
resultsTree.setAttribute("style", "display: table;");
|
||||
splitter.setAttribute("style","display: block;");
|
||||
contentArea.setAttribute("style", "height: 100; width: 100%;");
|
||||
var splitter = document.getElementById("results-splitter");
|
||||
var engineURI = aNode.id;
|
||||
if (engineURI == "allEngines") {
|
||||
resultsTree.removeAttribute("hidden");
|
||||
splitter.removeAttribute("hidden");
|
||||
}
|
||||
else
|
||||
{
|
||||
resultsTree.setAttribute("style", "display: none;");
|
||||
splitter.setAttribute("style","display: none");
|
||||
resultsTree.setAttribute("hidden", "true");
|
||||
splitter.setAttribute("hidden", "true");
|
||||
try
|
||||
{
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
|
@ -120,7 +137,7 @@ function doEngineClick( event, aNode )
|
|||
|
||||
if ( html )
|
||||
{
|
||||
var doc = window.frames[0].document;
|
||||
var doc = frames[0].document;
|
||||
if (doc)
|
||||
{
|
||||
doc.open("text/html", "replace");
|
||||
|
@ -129,16 +146,14 @@ function doEngineClick( event, aNode )
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
window.frames[0].document.location = "chrome://communicator/locale/search/default.htm";
|
||||
}
|
||||
frames[0].document.location = "chrome://communicator/locale/search/default.htm";
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doResultClick(node)
|
||||
{
|
||||
var theID = node.getAttribute("id");
|
||||
var theID = node.id;
|
||||
if (!theID) return(false);
|
||||
|
||||
try
|
||||
|
@ -179,14 +194,11 @@ function doResultClick(node)
|
|||
var text = "<HTML><HEAD><TITLE>Search</TITLE><BASE TARGET='_top'></HEAD><BODY><FONT POINT-SIZE='9'>";
|
||||
|
||||
if (banner)
|
||||
{
|
||||
// add a </A> and a <BR> just in case
|
||||
text += banner + "</A><BR>";
|
||||
}
|
||||
text += banner + "</A><BR>"; // add a </A> and a <BR> just in case
|
||||
text += target;
|
||||
text += "</FONT></BODY></HTML>"
|
||||
|
||||
var doc = window.frames[0].document;
|
||||
var doc = frames[0].document;
|
||||
doc.open("text/html", "replace");
|
||||
doc.writeln(text);
|
||||
doc.close();
|
||||
|
@ -200,3 +212,18 @@ function doResultClick(node)
|
|||
return(true);
|
||||
}
|
||||
|
||||
function treeSelect(event)
|
||||
{
|
||||
if (!event.target.selectedItems ||
|
||||
event.target.selectedItems && event.target.selectedItems.length != 1)
|
||||
return false;
|
||||
doResultClick(event.target.selectedItems[0]);
|
||||
}
|
||||
|
||||
function treeClick(event)
|
||||
{
|
||||
if (event.detail == 2 && event.which == 1)
|
||||
searchResultsOpenURL(event);
|
||||
else
|
||||
treeSelect(event);
|
||||
}
|
|
@ -10,6 +10,7 @@
|
|||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&internetresults.title;"
|
||||
context="disallowcontext">
|
||||
|
||||
<popupset>
|
||||
|
@ -17,25 +18,31 @@
|
|||
</popupset>
|
||||
|
||||
<script src="chrome://global/content/strres.js"></script>
|
||||
<script src="chrome://global/content/nsUserSettings.js"></script>
|
||||
<script src="chrome://global/content/nsJSComponentManager.js"></script>
|
||||
<script src="chrome://communicator/content/search/internetresults.js"></script>
|
||||
<script src="chrome://communicator/content/search/shared.js"></script>
|
||||
|
||||
<box id="multi-results-header">
|
||||
<text value="&results.header.label;"/>
|
||||
<spring flex="1"/>
|
||||
</box>
|
||||
|
||||
<box id="engineTabs" ref="NC:SearchResultsSitesRoot" datasources="rdf:internetsearch">
|
||||
<box id="engineTabs" autostretch="never"
|
||||
ref="NC:SearchResultsSitesRoot" datasources="rdf:internetsearch"
|
||||
style="overflow: none; min-width: 1px;">
|
||||
<template>
|
||||
<button uri="..." onclick="doEngineClick(event, this)" crop="right"
|
||||
<button class="engineTabs button-toolbar-3 button-slimline" uri="..."
|
||||
oncommand="doEngineClick(event, this)" 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>
|
||||
<button id="allEngines" onclick="doEngineClick(event, this)" value="&allresults.title.label;"/>
|
||||
<spring style="width: 1em;"/>
|
||||
<button class="engineTabs button-toolbar-3 button-slimline" id="allEngines"
|
||||
oncommand="doEngineClick(event, this)" value="&allresults.title.label;"
|
||||
toggled="true"/>
|
||||
<separator orient="vertical"/>
|
||||
<text value="&viewbyprovider.label;"/>
|
||||
<spring style="width: .25em;"/>
|
||||
<separator orient="vertical" class="thin"/>
|
||||
</box>
|
||||
|
||||
<popupset>
|
||||
|
@ -44,36 +51,36 @@
|
|||
</popup>
|
||||
</popupset>
|
||||
<tree id="internetresultstree" ref="" flex="1" datasources="rdf:internetsearch" context="contextual"
|
||||
onclick="if (event.detail == 2) return searchResultsOpenURL(event, event.target.parentNode.parentNode); else return doResultClick(event.target.parentNode.parentNode);">
|
||||
onselect="treeSelect(event);" onclick="treeClick(event);">
|
||||
|
||||
<treecolgroup>
|
||||
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="PageRankColumn" rdf:resource="http://home.netscape.com/NC-rdf#PageRank"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<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;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="PriceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Price"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Availability"
|
||||
style="width: 0; visibility: collapse;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="AvailabilityColumn" rdf:resource="http://home.netscape.com/NC-rdf#Availability"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Price"
|
||||
style="width: 0; visibility: collapse;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="DateColumn" rdf:resource="http://home.netscape.com/NC-rdf#Date"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"
|
||||
style="width: 0; visibility: collapse;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="SiteColumn" rdf:resource="http://home.netscape.com/NC-rdf#Site"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="EngineColumn" rdf:resource="http://home.netscape.com/NC-rdf#Engine"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
</treecolgroup>
|
||||
<treecolgroup>
|
||||
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="PageRankColumn" rdf:resource="http://home.netscape.com/NC-rdf#PageRank"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<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;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="PriceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Price"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Availability"
|
||||
style="width: 0; visibility: collapse;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="AvailabilityColumn" rdf:resource="http://home.netscape.com/NC-rdf#Availability"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Price"
|
||||
style="width: 0; visibility: collapse;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="DateColumn" rdf:resource="http://home.netscape.com/NC-rdf#Date"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"
|
||||
style="width: 0; visibility: collapse;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="SiteColumn" rdf:resource="http://home.netscape.com/NC-rdf#Site"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="EngineColumn" rdf:resource="http://home.netscape.com/NC-rdf#Engine"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||
</treecolgroup>
|
||||
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
|
@ -150,7 +157,11 @@
|
|||
|
||||
</tree>
|
||||
|
||||
<splitter id="gray_horizontal_splitter" persist="state" collapse="after" />
|
||||
<iframe id="content" style="height: 100; width: 100%;" flex="100%" src="chrome://communicator/locale/search/default.htm"/>
|
||||
|
||||
<splitter id="results-splitter" persist="state" collapse="after" orient="vertical" autostretch="never">
|
||||
<grippy/>
|
||||
</splitter>
|
||||
<box class="double-box-top" flex="1">
|
||||
<iframe id="content" flex="1" src="chrome://communicator/locale/search/default.htm"/>
|
||||
</box>
|
||||
|
||||
</window>
|
||||
|
|
|
@ -248,8 +248,9 @@ function chooseCategory( aNode )
|
|||
var treeNode = document.getElementById("engineList");
|
||||
if (treeNode)
|
||||
{
|
||||
debug("\nSet search engine list to category='" + category + "'\n\n");
|
||||
dump("*** Set search engine list to category=" + category + "\n");
|
||||
treeNode.setAttribute( "ref", category );
|
||||
treeNode.builder.rebuild();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
@ -386,12 +387,12 @@ function MoveDelta(delta)
|
|||
if (select_list.length != 1) return(false);
|
||||
|
||||
var ref = engineList.getAttribute("ref");
|
||||
if ((!ref) || (ref == "")) return(false);
|
||||
if (!ref) return(false);
|
||||
var categoryRes = RDF.GetResource(ref);
|
||||
if (!categoryRes) return(false);
|
||||
|
||||
var id = select_list[0].getAttribute("id");
|
||||
if ((!id) || (id == "")) return(false);
|
||||
var id = select_list[0].id;
|
||||
if (!id) return(false);
|
||||
var idRes = RDF.GetResource(id);
|
||||
if (!idRes) return(false);
|
||||
|
||||
|
@ -419,6 +420,26 @@ function MoveDelta(delta)
|
|||
return(true);
|
||||
}
|
||||
|
||||
function doMoveDirectionEnabling()
|
||||
{
|
||||
var tree = document.getElementById("engineList")
|
||||
var selectedItems = tree.selectedItems;
|
||||
if (!selectedItems && selectedItems.length != 1)
|
||||
return false;
|
||||
var ref = tree.getAttribute("ref");
|
||||
var categoryResource = RDF.GetResource(ref);
|
||||
var elementResource = RDF.GetResource(selectedItems[0].id);
|
||||
RDFC.Init(catDS, categoryResource);
|
||||
var nodeIndex = RDFC.IndexOf(elementResource);
|
||||
var moveUpButton = document.getElementById("up");
|
||||
var moveDownButton = document.getElementById("down");
|
||||
moveUpButton.removeAttribute("disabled");
|
||||
moveDownButton.removeAttribute("disabled");
|
||||
if (nodeIndex <= 1)
|
||||
moveUpButton.setAttribute("disabled", "true");
|
||||
if (nodeIndex >= RDFC.GetCount())
|
||||
moveDownButton.setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
|
||||
function NewCategory()
|
||||
|
|
|
@ -85,7 +85,8 @@
|
|||
<button class="dialog left" id="remove-button" oncommand="return RemoveEngine()" value="&remove.label;" />
|
||||
<spring flex="1"/>
|
||||
</box>
|
||||
<tree class="inset" multiple="true" flex="1" id="engineList" datasources="rdf:internetsearch">
|
||||
<tree class="inset" multiple="true" flex="1" id="engineList"
|
||||
datasources="rdf:internetsearch" onselect="doMoveDirectionEnabling()">
|
||||
<template>
|
||||
<treechildren>
|
||||
<treeitem uri="...">
|
||||
|
@ -103,7 +104,7 @@
|
|||
<treehead>
|
||||
<treerow>
|
||||
<treecell class="treecell-header sortDirectionIndicator outset" observes="EngineColumn"
|
||||
value="&engine.column.label;"
|
||||
value="&engine.column.label;" onclick="return doSort('EngineColumn', null);"
|
||||
resource="http://home.netscape.com/NC-rdf#Name" />
|
||||
</treerow>
|
||||
</treehead>
|
||||
|
@ -113,8 +114,8 @@
|
|||
</tree>
|
||||
<box orient="vertical">
|
||||
<spring flex="1"/>
|
||||
<button class="up plain" oncommand="MoveUp();" id="up"/>
|
||||
<button class="down plain" oncommand="MoveDown();" id="down"/>
|
||||
<button class="up" oncommand="MoveUp();" id="up" disabled="true"/>
|
||||
<button class="down" oncommand="MoveDown();" id="down" disabled="true"/>
|
||||
<spring flex="1"/>
|
||||
</box>
|
||||
</box>
|
||||
|
|
|
@ -507,7 +507,8 @@ function doStop()
|
|||
// show appropriate column(s)
|
||||
if ((rdf) && (internetSearch))
|
||||
{
|
||||
var resultsTree = top._content.document.getElementById("internetresultstree");
|
||||
var navWindow = getNavigatorWindow();
|
||||
var resultsTree = navWindow._content.document.getElementById("internetresultstree");
|
||||
if( !resultsTree )
|
||||
return(false);
|
||||
var searchURL = resultsTree.getAttribute("ref");
|
||||
|
@ -526,9 +527,10 @@ function doStop()
|
|||
var hasRelevanceFlag = internetSearch.HasAssertion(searchResource, relevanceProperty, trueProperty, true);
|
||||
var hasDateFlag = internetSearch.HasAssertion(searchResource, dateProperty, trueProperty, true);
|
||||
|
||||
var navWindow = getNavigatorWindow();
|
||||
if(hasPriceFlag == true)
|
||||
{
|
||||
var colNode = top._content.document.getElementById("PriceColumn");
|
||||
var colNode = navWindow._content.document.getElementById("PriceColumn");
|
||||
if (colNode)
|
||||
{
|
||||
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
||||
|
@ -541,25 +543,25 @@ function doStop()
|
|||
}
|
||||
if (hasAvailabilityFlag == true)
|
||||
{
|
||||
colNode = top._content.document.getElementById("AvailabilityColumn");
|
||||
colNode = navWindow._content.document.getElementById("AvailabilityColumn");
|
||||
if (colNode)
|
||||
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
||||
}
|
||||
if (hasDateFlag == true)
|
||||
{
|
||||
colNode = top._content.document.getElementById("DateColumn");
|
||||
colNode = navWindow._content.document.getElementById("DateColumn");
|
||||
if (colNode)
|
||||
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
||||
}
|
||||
if (hasRelevanceFlag == true)
|
||||
{
|
||||
colNode = top._content.document.getElementById("RelevanceColumn");
|
||||
colNode = navWindow._content.document.getElementById("RelevanceColumn");
|
||||
if (colNode)
|
||||
{
|
||||
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
||||
if (sortSetFlag == false)
|
||||
{
|
||||
top._content.setInitialSort(colNode, "descending");
|
||||
navWindow._content.setInitialSort(colNode, "descending");
|
||||
sortSetFlag = true;
|
||||
}
|
||||
}
|
||||
|
@ -568,9 +570,9 @@ function doStop()
|
|||
|
||||
if (sortSetFlag == false)
|
||||
{
|
||||
colNode = top._content.document.getElementById("PageRankColumn");
|
||||
colNode = navWindow._content.document.getElementById("PageRankColumn");
|
||||
if (colNode)
|
||||
top._content.setInitialSort(colNode, "ascending");
|
||||
navWindow._content.setInitialSort(colNode, "ascending");
|
||||
}
|
||||
switchTab(0);
|
||||
}
|
||||
|
@ -621,13 +623,14 @@ function doSearch()
|
|||
}
|
||||
|
||||
// hide various columns
|
||||
if( parent._content.isMozillaSearchWindow )
|
||||
var navWindow = getNavigatorWindow();
|
||||
if( navWindow._content.isMozillaSearchWindow )
|
||||
{
|
||||
colNode = parent._content.document.getElementById("RelevanceColumn");
|
||||
colNode = navWindow._content.document.getElementById("RelevanceColumn");
|
||||
if (colNode) colNode.setAttribute("style", "width: 0; visibility: collapse;");
|
||||
colNode = parent._content.document.getElementById("PriceColumn");
|
||||
colNode = navWindow._content.document.getElementById("PriceColumn");
|
||||
if (colNode) colNode.setAttribute("style", "width: 0; visibility: collapse;");
|
||||
colNode = parent._content.document.getElementById("AvailabilityColumn");
|
||||
colNode = navWindow._content.document.getElementById("AvailabilityColumn");
|
||||
if (colNode) colNode.setAttribute("style", "width: 0; visibility: collapse;");
|
||||
}
|
||||
|
||||
|
@ -720,7 +723,8 @@ function doSearch()
|
|||
function checkSearchProgress()
|
||||
{
|
||||
var activeSearchFlag = false;
|
||||
var resultsTree = top._content.document.getElementById("internetresultstree");
|
||||
var navWindow = getNavigatorWindow();
|
||||
var resultsTree = navWindow._content.document.getElementById("internetresultstree");
|
||||
if(resultsTree)
|
||||
{
|
||||
var treeref = resultsTree.getAttribute("ref");
|
||||
|
@ -1072,62 +1076,49 @@ function doCustomize()
|
|||
|
||||
function loadURLInContent(url)
|
||||
{
|
||||
var theWindow = null;
|
||||
var list = top.document.getElementsByTagName("window");
|
||||
var wtype = list[0].getAttribute("windowtype");
|
||||
|
||||
if (wtype == "navigator:browser")
|
||||
{
|
||||
theWindow = top.window;
|
||||
}
|
||||
else
|
||||
{
|
||||
var windowManager =
|
||||
Components.classes[WMEDIATOR_PROGID].getService(nsIWindowMediator);
|
||||
if (windowManager)
|
||||
{
|
||||
theWindow = windowManager.getMostRecentWindow("navigator:browser");
|
||||
}
|
||||
}
|
||||
|
||||
if (!theWindow)
|
||||
{
|
||||
window.openDialog (search_getBrowserURL(), "_blank",
|
||||
"chrome,all,dialog=no", url);
|
||||
}
|
||||
else
|
||||
{
|
||||
// try to use the BrowserAppCore in the content area
|
||||
// (for better session history);
|
||||
// if its unavailable, just blast the content location
|
||||
var appCore = theWindow._content.appCore;
|
||||
if(appCore)
|
||||
{
|
||||
appCore.loadUrl(url);
|
||||
}
|
||||
else
|
||||
{
|
||||
theWindow.top._content.location.href = url;
|
||||
}
|
||||
|
||||
}
|
||||
var appCore = getNavigatorWindowAppCore();
|
||||
if (appCore)
|
||||
appCore.loadUrl(url);
|
||||
}
|
||||
|
||||
// retrieves the most recent navigator window
|
||||
function getNavigatorWindow()
|
||||
{
|
||||
if (top.document) {
|
||||
var possibleNavigator = top.document.getElementById("main-window");
|
||||
if (possibleNavigator &&
|
||||
possibleNavigator.getAttribute("windowtype") == "navigator:browser")
|
||||
return top;
|
||||
else return openNewNavigator();
|
||||
}
|
||||
else {
|
||||
const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator";
|
||||
var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator");
|
||||
return wm ? wm.getMostRecentWindow("navigator:browser") : openNewNavigator();
|
||||
}
|
||||
}
|
||||
|
||||
// retrieves the most recent navigator window's crap core.
|
||||
function getNavigatorWindowAppCore()
|
||||
{
|
||||
var navigatorWindow = getNavigatorWindow();
|
||||
return navigatorWindow.appCore;
|
||||
}
|
||||
|
||||
function openNewNavigator()
|
||||
{
|
||||
return openDialog(search_getBrowserURL(), "_blank", "chrome,all,dialog=no");
|
||||
}
|
||||
|
||||
function search_getBrowserURL()
|
||||
{
|
||||
var url="chrome://navigator/content/navigator.xul";
|
||||
var url = "chrome://navigator/content/navigator.xul";
|
||||
|
||||
if (pref)
|
||||
{
|
||||
if (pref) {
|
||||
var temp = pref.CopyCharPref("browser.chromeURL");
|
||||
if (temp)
|
||||
{
|
||||
url = temp;
|
||||
}
|
||||
if (temp) url = temp;
|
||||
}
|
||||
return(url);
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -95,12 +95,12 @@
|
|||
|
||||
<rule>
|
||||
<treechildren flex="1">
|
||||
<treeitem uri="..." persist="open"
|
||||
<treeitem uri="..." persist="open" class="searchresult-item"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading"
|
||||
searchtype="rdf:http://home.netscape.com/NC-rdf#SearchType"
|
||||
type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
||||
<treerow class="searchresult">
|
||||
<treecell class="treecell-iconic"
|
||||
<treecell class="treecell-iconic searchresult-cell"
|
||||
src="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
value="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||
</treerow>
|
||||
|
@ -111,7 +111,11 @@
|
|||
|
||||
<treehead>
|
||||
<treerow>
|
||||
<treecell class="treecell-header sortDirectionIndicator outset" observes="SortNameColumn" align="center" value="&results.label;" resource="http://home.netscape.com/NC-rdf#Name" onclick="return doSort('SortNameColumn', 'http://home.netscape.com/NC-rdf#PageRank');" sortActive="true" sortDirection="ascending" flex="1"/>
|
||||
<treecell class="treecell-header treecell-header-sidebarpanel sortDirectionIndicator outset"
|
||||
observes="SortNameColumn" value="&results.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Name"
|
||||
onclick="return doSort('SortNameColumn', 'http://home.netscape.com/NC-rdf#PageRank');"
|
||||
sortActive="true" sortDirection="ascending" flex="1"/>
|
||||
</treerow>
|
||||
</treehead>
|
||||
|
||||
|
@ -123,7 +127,7 @@
|
|||
|
||||
<box>
|
||||
<spring flex="1" />
|
||||
<button id="saveQueryButton" value="&savesearch.button.label;" oncommand="return saveSearch();"/>
|
||||
<button class="button-toolbar-3 button-slimline" id="saveQueryButton" value="&savesearch.button.label;" oncommand="return saveSearch();"/>
|
||||
<spring flex="1" />
|
||||
</box>
|
||||
|
||||
|
@ -155,7 +159,7 @@
|
|||
|
||||
<treehead>
|
||||
<treerow>
|
||||
<treecell class="treecell-header sortDirectionIndicator outset"
|
||||
<treecell class="treecell-header treecell-header-sidebarpanel sortDirectionIndicator outset"
|
||||
observes="EngineColumn" value="&engine.column.label;"
|
||||
resource="http://home.netscape.com/NC-rdf#Name"
|
||||
sortActive="true" sortDirection="ascending"
|
||||
|
@ -168,7 +172,7 @@
|
|||
|
||||
<box>
|
||||
<spring flex="1" />
|
||||
<button id="customizeButton" value="&customize.button.label;" oncommand="return doCustomize();"/>
|
||||
<button class="button-toolbar-3 button-slimline" id="customizeButton" value="&customize.button.label;" oncommand="return doCustomize();"/>
|
||||
<spring flex="1" />
|
||||
</box>
|
||||
</box>
|
||||
|
|
|
@ -32,3 +32,4 @@
|
|||
<!ENTITY engine.column.label "Search Engine">
|
||||
<!ENTITY viewbyprovider.label "View by search engine:">
|
||||
<!ENTITY allresults.title.label "All results combined">
|
||||
<!ENTITY internetresults.title "Search Results">
|
Загрузка…
Ссылка в новой задаче