зеркало из 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)
|
var node = event.target.parentNode.parentNode;
|
||||||
return(false);
|
if (node.localName != "treeitem" || node.getAttribute('container') == "true")
|
||||||
|
return false;
|
||||||
if (node.name != "treeitem")
|
|
||||||
return(false);
|
|
||||||
|
|
||||||
var url = node.getAttribute('id');
|
|
||||||
|
|
||||||
if (node.getAttribute('container') == "true")
|
|
||||||
{
|
|
||||||
return(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var url = node.id;
|
||||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||||
if (rdf)
|
if (rdf)
|
||||||
|
@ -26,50 +18,73 @@ function searchResultsOpenURL(event, node)
|
||||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||||
if (target) target = target.Value;
|
if (target) target = target.Value;
|
||||||
if (target) url = target;
|
if (target) url = target;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore "NC:" urls.
|
// Ignore "NC:" urls.
|
||||||
if (url.substring(0, 3) == "NC:")
|
if (url.substring(0, 3) == "NC:")
|
||||||
return(false);
|
return false;
|
||||||
|
|
||||||
|
if (top.appCore)
|
||||||
|
top.appCore.loadUrl(url); // arghghghgh
|
||||||
|
else
|
||||||
top._content.location.href = url;
|
top._content.location.href = url;
|
||||||
|
|
||||||
return(true);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function onLoadInternetResults()
|
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();
|
var iSearch = Components.classes["component://netscape/rdf/datasource?name=internetsearch"].getService();
|
||||||
if (iSearch) iSearch = iSearch.QueryInterface(Components.interfaces.nsIInternetSearchService);
|
if (iSearch) iSearch = iSearch.QueryInterface(Components.interfaces.nsIInternetSearchService);
|
||||||
if (iSearch) iSearch.ClearResultSearchSites();
|
if (iSearch) iSearch.ClearResultSearchSites();
|
||||||
|
|
||||||
// the search URI is passed in as a parameter, so get it and them root the results tree
|
// the search URI is passed in as a parameter, so get it and them root the results tree
|
||||||
var searchURI = top._content.location.href;
|
var searchURI = top._content.location.href;
|
||||||
if (searchURI)
|
if (searchURI) {
|
||||||
{
|
const lastSearchURIPref = "browser.search.lastMultipleSearchURI";
|
||||||
var offset = searchURI.indexOf("?");
|
var offset = searchURI.indexOf("?");
|
||||||
if (offset > 0)
|
if (offset > 0) {
|
||||||
{
|
nsPreferences.setUnicharPref(lastSearchURIPref, searchURI); // evil
|
||||||
searchURI = searchURI.substr(offset+1);
|
searchURI = searchURI.substr(offset+1);
|
||||||
loadResultsTree(searchURI);
|
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 )
|
function loadResultsTree( aSearchURL )
|
||||||
{
|
{
|
||||||
var resultsTree = document.getElementById( "internetresultstree" );
|
var resultsTree = document.getElementById( "internetresultstree" );
|
||||||
if( !resultsTree )
|
if (!resultsTree) return false;
|
||||||
return false;
|
resultsTree.setAttribute("ref", aSearchURL);
|
||||||
resultsTree.setAttribute( "ref", aSearchURL );
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,25 +92,27 @@ function loadResultsTree( aSearchURL )
|
||||||
|
|
||||||
function doEngineClick( event, aNode )
|
function doEngineClick( event, aNode )
|
||||||
{
|
{
|
||||||
if (event.button != 1)
|
// do toggling
|
||||||
return(false);
|
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 html = null;
|
||||||
|
|
||||||
var resultsTree = document.getElementById("internetresultstree");
|
var resultsTree = document.getElementById("internetresultstree");
|
||||||
var contentArea = document.getElementById("content");
|
var contentArea = document.getElementById("content");
|
||||||
var splitter = document.getElementById("gray_horizontal_splitter");
|
var splitter = document.getElementById("results-splitter");
|
||||||
var engineURI = aNode.getAttribute("id");
|
var engineURI = aNode.id;
|
||||||
if (engineURI == "allEngines")
|
if (engineURI == "allEngines") {
|
||||||
{
|
resultsTree.removeAttribute("hidden");
|
||||||
resultsTree.setAttribute("style", "display: table;");
|
splitter.removeAttribute("hidden");
|
||||||
splitter.setAttribute("style","display: block;");
|
|
||||||
contentArea.setAttribute("style", "height: 100; width: 100%;");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resultsTree.setAttribute("style", "display: none;");
|
resultsTree.setAttribute("hidden", "true");
|
||||||
splitter.setAttribute("style","display: none");
|
splitter.setAttribute("hidden", "true");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||||
|
@ -120,7 +137,7 @@ function doEngineClick( event, aNode )
|
||||||
|
|
||||||
if ( html )
|
if ( html )
|
||||||
{
|
{
|
||||||
var doc = window.frames[0].document;
|
var doc = frames[0].document;
|
||||||
if (doc)
|
if (doc)
|
||||||
{
|
{
|
||||||
doc.open("text/html", "replace");
|
doc.open("text/html", "replace");
|
||||||
|
@ -129,16 +146,14 @@ function doEngineClick( event, aNode )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
frames[0].document.location = "chrome://communicator/locale/search/default.htm";
|
||||||
window.frames[0].document.location = "chrome://communicator/locale/search/default.htm";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function doResultClick(node)
|
function doResultClick(node)
|
||||||
{
|
{
|
||||||
var theID = node.getAttribute("id");
|
var theID = node.id;
|
||||||
if (!theID) return(false);
|
if (!theID) return(false);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -179,14 +194,11 @@ function doResultClick(node)
|
||||||
var text = "<HTML><HEAD><TITLE>Search</TITLE><BASE TARGET='_top'></HEAD><BODY><FONT POINT-SIZE='9'>";
|
var text = "<HTML><HEAD><TITLE>Search</TITLE><BASE TARGET='_top'></HEAD><BODY><FONT POINT-SIZE='9'>";
|
||||||
|
|
||||||
if (banner)
|
if (banner)
|
||||||
{
|
text += banner + "</A><BR>"; // add a </A> and a <BR> just in case
|
||||||
// add a </A> and a <BR> just in case
|
|
||||||
text += banner + "</A><BR>";
|
|
||||||
}
|
|
||||||
text += target;
|
text += target;
|
||||||
text += "</FONT></BODY></HTML>"
|
text += "</FONT></BODY></HTML>"
|
||||||
|
|
||||||
var doc = window.frames[0].document;
|
var doc = frames[0].document;
|
||||||
doc.open("text/html", "replace");
|
doc.open("text/html", "replace");
|
||||||
doc.writeln(text);
|
doc.writeln(text);
|
||||||
doc.close();
|
doc.close();
|
||||||
|
@ -200,3 +212,18 @@ function doResultClick(node)
|
||||||
return(true);
|
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:html="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
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"
|
||||||
|
title="&internetresults.title;"
|
||||||
context="disallowcontext">
|
context="disallowcontext">
|
||||||
|
|
||||||
<popupset>
|
<popupset>
|
||||||
|
@ -17,25 +18,31 @@
|
||||||
</popupset>
|
</popupset>
|
||||||
|
|
||||||
<script src="chrome://global/content/strres.js"></script>
|
<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/internetresults.js"></script>
|
||||||
<script src="chrome://communicator/content/search/shared.js"></script>
|
<script src="chrome://communicator/content/search/shared.js"></script>
|
||||||
|
|
||||||
<box id="multi-results-header">
|
<box id="multi-results-header">
|
||||||
<text value="&results.header.label;"/>
|
<text value="&results.header.label;"/>
|
||||||
<spring flex="1"/>
|
|
||||||
</box>
|
</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>
|
<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"
|
src="rdf:http://home.netscape.com/NC-rdf#StatusIcon"
|
||||||
value="rdf:http://home.netscape.com/NC-rdf#Name"
|
value="rdf:http://home.netscape.com/NC-rdf#Name"
|
||||||
loading="rdf:http://home.netscape.com/NC-rdf#loading" />
|
loading="rdf:http://home.netscape.com/NC-rdf#loading" />
|
||||||
</template>
|
</template>
|
||||||
<button id="allEngines" onclick="doEngineClick(event, this)" value="&allresults.title.label;"/>
|
<button class="engineTabs button-toolbar-3 button-slimline" id="allEngines"
|
||||||
<spring style="width: 1em;"/>
|
oncommand="doEngineClick(event, this)" value="&allresults.title.label;"
|
||||||
|
toggled="true"/>
|
||||||
|
<separator orient="vertical"/>
|
||||||
<text value="&viewbyprovider.label;"/>
|
<text value="&viewbyprovider.label;"/>
|
||||||
<spring style="width: .25em;"/>
|
<separator orient="vertical" class="thin"/>
|
||||||
</box>
|
</box>
|
||||||
|
|
||||||
<popupset>
|
<popupset>
|
||||||
|
@ -44,36 +51,36 @@
|
||||||
</popup>
|
</popup>
|
||||||
</popupset>
|
</popupset>
|
||||||
<tree id="internetresultstree" ref="" flex="1" datasources="rdf:internetsearch" context="contextual"
|
<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>
|
<treecolgroup>
|
||||||
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol id="PageRankColumn" rdf:resource="http://home.netscape.com/NC-rdf#PageRank"
|
<treecol id="PageRankColumn" rdf:resource="http://home.netscape.com/NC-rdf#PageRank"
|
||||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol id="RelevanceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Relevance"
|
<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"
|
||||||
style="width: 0; visibility: collapse;" flex="1"/>
|
style="width: 0; visibility: collapse;" flex="1"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol id="PriceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Price"
|
<treecol id="PriceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Price"
|
||||||
rdf:resource2="http://home.netscape.com/NC-rdf#Availability"
|
rdf:resource2="http://home.netscape.com/NC-rdf#Availability"
|
||||||
style="width: 0; visibility: collapse;" flex="1"/>
|
style="width: 0; visibility: collapse;" flex="1"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol id="AvailabilityColumn" rdf:resource="http://home.netscape.com/NC-rdf#Availability"
|
<treecol id="AvailabilityColumn" rdf:resource="http://home.netscape.com/NC-rdf#Availability"
|
||||||
rdf:resource2="http://home.netscape.com/NC-rdf#Price"
|
rdf:resource2="http://home.netscape.com/NC-rdf#Price"
|
||||||
style="width: 0; visibility: collapse;" flex="1"/>
|
style="width: 0; visibility: collapse;" flex="1"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol id="DateColumn" rdf:resource="http://home.netscape.com/NC-rdf#Date"
|
<treecol id="DateColumn" rdf:resource="http://home.netscape.com/NC-rdf#Date"
|
||||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"
|
rdf:resource2="http://home.netscape.com/NC-rdf#Name"
|
||||||
style="width: 0; visibility: collapse;" flex="1"/>
|
style="width: 0; visibility: collapse;" flex="1"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol id="SiteColumn" rdf:resource="http://home.netscape.com/NC-rdf#Site"
|
<treecol id="SiteColumn" rdf:resource="http://home.netscape.com/NC-rdf#Site"
|
||||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol id="EngineColumn" rdf:resource="http://home.netscape.com/NC-rdf#Engine"
|
<treecol id="EngineColumn" rdf:resource="http://home.netscape.com/NC-rdf#Engine"
|
||||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
rdf:resource2="http://home.netscape.com/NC-rdf#Name" flex="1"/>
|
||||||
</treecolgroup>
|
</treecolgroup>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||||
|
@ -150,7 +157,11 @@
|
||||||
|
|
||||||
</tree>
|
</tree>
|
||||||
|
|
||||||
<splitter id="gray_horizontal_splitter" persist="state" collapse="after" />
|
<splitter id="results-splitter" persist="state" collapse="after" orient="vertical" autostretch="never">
|
||||||
<iframe id="content" style="height: 100; width: 100%;" flex="100%" src="chrome://communicator/locale/search/default.htm"/>
|
<grippy/>
|
||||||
|
</splitter>
|
||||||
|
<box class="double-box-top" flex="1">
|
||||||
|
<iframe id="content" flex="1" src="chrome://communicator/locale/search/default.htm"/>
|
||||||
|
</box>
|
||||||
|
|
||||||
</window>
|
</window>
|
||||||
|
|
|
@ -248,8 +248,9 @@ function chooseCategory( aNode )
|
||||||
var treeNode = document.getElementById("engineList");
|
var treeNode = document.getElementById("engineList");
|
||||||
if (treeNode)
|
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.setAttribute( "ref", category );
|
||||||
|
treeNode.builder.rebuild();
|
||||||
}
|
}
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
@ -386,12 +387,12 @@ function MoveDelta(delta)
|
||||||
if (select_list.length != 1) return(false);
|
if (select_list.length != 1) return(false);
|
||||||
|
|
||||||
var ref = engineList.getAttribute("ref");
|
var ref = engineList.getAttribute("ref");
|
||||||
if ((!ref) || (ref == "")) return(false);
|
if (!ref) return(false);
|
||||||
var categoryRes = RDF.GetResource(ref);
|
var categoryRes = RDF.GetResource(ref);
|
||||||
if (!categoryRes) return(false);
|
if (!categoryRes) return(false);
|
||||||
|
|
||||||
var id = select_list[0].getAttribute("id");
|
var id = select_list[0].id;
|
||||||
if ((!id) || (id == "")) return(false);
|
if (!id) return(false);
|
||||||
var idRes = RDF.GetResource(id);
|
var idRes = RDF.GetResource(id);
|
||||||
if (!idRes) return(false);
|
if (!idRes) return(false);
|
||||||
|
|
||||||
|
@ -419,6 +420,26 @@ function MoveDelta(delta)
|
||||||
return(true);
|
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()
|
function NewCategory()
|
||||||
|
|
|
@ -85,7 +85,8 @@
|
||||||
<button class="dialog left" id="remove-button" oncommand="return RemoveEngine()" value="&remove.label;" />
|
<button class="dialog left" id="remove-button" oncommand="return RemoveEngine()" value="&remove.label;" />
|
||||||
<spring flex="1"/>
|
<spring flex="1"/>
|
||||||
</box>
|
</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>
|
<template>
|
||||||
<treechildren>
|
<treechildren>
|
||||||
<treeitem uri="...">
|
<treeitem uri="...">
|
||||||
|
@ -103,7 +104,7 @@
|
||||||
<treehead>
|
<treehead>
|
||||||
<treerow>
|
<treerow>
|
||||||
<treecell class="treecell-header sortDirectionIndicator outset" observes="EngineColumn"
|
<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" />
|
resource="http://home.netscape.com/NC-rdf#Name" />
|
||||||
</treerow>
|
</treerow>
|
||||||
</treehead>
|
</treehead>
|
||||||
|
@ -113,8 +114,8 @@
|
||||||
</tree>
|
</tree>
|
||||||
<box orient="vertical">
|
<box orient="vertical">
|
||||||
<spring flex="1"/>
|
<spring flex="1"/>
|
||||||
<button class="up plain" oncommand="MoveUp();" id="up"/>
|
<button class="up" oncommand="MoveUp();" id="up" disabled="true"/>
|
||||||
<button class="down plain" oncommand="MoveDown();" id="down"/>
|
<button class="down" oncommand="MoveDown();" id="down" disabled="true"/>
|
||||||
<spring flex="1"/>
|
<spring flex="1"/>
|
||||||
</box>
|
</box>
|
||||||
</box>
|
</box>
|
||||||
|
|
|
@ -507,7 +507,8 @@ function doStop()
|
||||||
// show appropriate column(s)
|
// show appropriate column(s)
|
||||||
if ((rdf) && (internetSearch))
|
if ((rdf) && (internetSearch))
|
||||||
{
|
{
|
||||||
var resultsTree = top._content.document.getElementById("internetresultstree");
|
var navWindow = getNavigatorWindow();
|
||||||
|
var resultsTree = navWindow._content.document.getElementById("internetresultstree");
|
||||||
if( !resultsTree )
|
if( !resultsTree )
|
||||||
return(false);
|
return(false);
|
||||||
var searchURL = resultsTree.getAttribute("ref");
|
var searchURL = resultsTree.getAttribute("ref");
|
||||||
|
@ -526,9 +527,10 @@ function doStop()
|
||||||
var hasRelevanceFlag = internetSearch.HasAssertion(searchResource, relevanceProperty, trueProperty, true);
|
var hasRelevanceFlag = internetSearch.HasAssertion(searchResource, relevanceProperty, trueProperty, true);
|
||||||
var hasDateFlag = internetSearch.HasAssertion(searchResource, dateProperty, trueProperty, true);
|
var hasDateFlag = internetSearch.HasAssertion(searchResource, dateProperty, trueProperty, true);
|
||||||
|
|
||||||
|
var navWindow = getNavigatorWindow();
|
||||||
if(hasPriceFlag == true)
|
if(hasPriceFlag == true)
|
||||||
{
|
{
|
||||||
var colNode = top._content.document.getElementById("PriceColumn");
|
var colNode = navWindow._content.document.getElementById("PriceColumn");
|
||||||
if (colNode)
|
if (colNode)
|
||||||
{
|
{
|
||||||
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
||||||
|
@ -541,25 +543,25 @@ function doStop()
|
||||||
}
|
}
|
||||||
if (hasAvailabilityFlag == true)
|
if (hasAvailabilityFlag == true)
|
||||||
{
|
{
|
||||||
colNode = top._content.document.getElementById("AvailabilityColumn");
|
colNode = navWindow._content.document.getElementById("AvailabilityColumn");
|
||||||
if (colNode)
|
if (colNode)
|
||||||
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
||||||
}
|
}
|
||||||
if (hasDateFlag == true)
|
if (hasDateFlag == true)
|
||||||
{
|
{
|
||||||
colNode = top._content.document.getElementById("DateColumn");
|
colNode = navWindow._content.document.getElementById("DateColumn");
|
||||||
if (colNode)
|
if (colNode)
|
||||||
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
||||||
}
|
}
|
||||||
if (hasRelevanceFlag == true)
|
if (hasRelevanceFlag == true)
|
||||||
{
|
{
|
||||||
colNode = top._content.document.getElementById("RelevanceColumn");
|
colNode = navWindow._content.document.getElementById("RelevanceColumn");
|
||||||
if (colNode)
|
if (colNode)
|
||||||
{
|
{
|
||||||
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
colNode.removeAttribute("style", "width: 0; visibility: collapse;");
|
||||||
if (sortSetFlag == false)
|
if (sortSetFlag == false)
|
||||||
{
|
{
|
||||||
top._content.setInitialSort(colNode, "descending");
|
navWindow._content.setInitialSort(colNode, "descending");
|
||||||
sortSetFlag = true;
|
sortSetFlag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -568,9 +570,9 @@ function doStop()
|
||||||
|
|
||||||
if (sortSetFlag == false)
|
if (sortSetFlag == false)
|
||||||
{
|
{
|
||||||
colNode = top._content.document.getElementById("PageRankColumn");
|
colNode = navWindow._content.document.getElementById("PageRankColumn");
|
||||||
if (colNode)
|
if (colNode)
|
||||||
top._content.setInitialSort(colNode, "ascending");
|
navWindow._content.setInitialSort(colNode, "ascending");
|
||||||
}
|
}
|
||||||
switchTab(0);
|
switchTab(0);
|
||||||
}
|
}
|
||||||
|
@ -621,13 +623,14 @@ function doSearch()
|
||||||
}
|
}
|
||||||
|
|
||||||
// hide various columns
|
// 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;");
|
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;");
|
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;");
|
if (colNode) colNode.setAttribute("style", "width: 0; visibility: collapse;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,7 +723,8 @@ function doSearch()
|
||||||
function checkSearchProgress()
|
function checkSearchProgress()
|
||||||
{
|
{
|
||||||
var activeSearchFlag = false;
|
var activeSearchFlag = false;
|
||||||
var resultsTree = top._content.document.getElementById("internetresultstree");
|
var navWindow = getNavigatorWindow();
|
||||||
|
var resultsTree = navWindow._content.document.getElementById("internetresultstree");
|
||||||
if(resultsTree)
|
if(resultsTree)
|
||||||
{
|
{
|
||||||
var treeref = resultsTree.getAttribute("ref");
|
var treeref = resultsTree.getAttribute("ref");
|
||||||
|
@ -1072,62 +1076,49 @@ function doCustomize()
|
||||||
|
|
||||||
function loadURLInContent(url)
|
function loadURLInContent(url)
|
||||||
{
|
{
|
||||||
var theWindow = null;
|
var appCore = getNavigatorWindowAppCore();
|
||||||
var list = top.document.getElementsByTagName("window");
|
if (appCore)
|
||||||
var wtype = list[0].getAttribute("windowtype");
|
appCore.loadUrl(url);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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()
|
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");
|
var temp = pref.CopyCharPref("browser.chromeURL");
|
||||||
if (temp)
|
if (temp) url = temp;
|
||||||
{
|
|
||||||
url = temp;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(url);
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -95,12 +95,12 @@
|
||||||
|
|
||||||
<rule>
|
<rule>
|
||||||
<treechildren flex="1">
|
<treechildren flex="1">
|
||||||
<treeitem uri="..." persist="open"
|
<treeitem uri="..." persist="open" class="searchresult-item"
|
||||||
loading="rdf:http://home.netscape.com/NC-rdf#loading"
|
loading="rdf:http://home.netscape.com/NC-rdf#loading"
|
||||||
searchtype="rdf:http://home.netscape.com/NC-rdf#SearchType"
|
searchtype="rdf:http://home.netscape.com/NC-rdf#SearchType"
|
||||||
type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
||||||
<treerow class="searchresult">
|
<treerow class="searchresult">
|
||||||
<treecell class="treecell-iconic"
|
<treecell class="treecell-iconic searchresult-cell"
|
||||||
src="rdf:http://home.netscape.com/NC-rdf#Icon"
|
src="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||||
value="rdf:http://home.netscape.com/NC-rdf#Name" />
|
value="rdf:http://home.netscape.com/NC-rdf#Name" />
|
||||||
</treerow>
|
</treerow>
|
||||||
|
@ -111,7 +111,11 @@
|
||||||
|
|
||||||
<treehead>
|
<treehead>
|
||||||
<treerow>
|
<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>
|
</treerow>
|
||||||
</treehead>
|
</treehead>
|
||||||
|
|
||||||
|
@ -123,7 +127,7 @@
|
||||||
|
|
||||||
<box>
|
<box>
|
||||||
<spring flex="1" />
|
<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" />
|
<spring flex="1" />
|
||||||
</box>
|
</box>
|
||||||
|
|
||||||
|
@ -155,7 +159,7 @@
|
||||||
|
|
||||||
<treehead>
|
<treehead>
|
||||||
<treerow>
|
<treerow>
|
||||||
<treecell class="treecell-header sortDirectionIndicator outset"
|
<treecell class="treecell-header treecell-header-sidebarpanel sortDirectionIndicator outset"
|
||||||
observes="EngineColumn" value="&engine.column.label;"
|
observes="EngineColumn" value="&engine.column.label;"
|
||||||
resource="http://home.netscape.com/NC-rdf#Name"
|
resource="http://home.netscape.com/NC-rdf#Name"
|
||||||
sortActive="true" sortDirection="ascending"
|
sortActive="true" sortDirection="ascending"
|
||||||
|
@ -168,7 +172,7 @@
|
||||||
|
|
||||||
<box>
|
<box>
|
||||||
<spring flex="1" />
|
<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" />
|
<spring flex="1" />
|
||||||
</box>
|
</box>
|
||||||
</box>
|
</box>
|
||||||
|
|
|
@ -32,3 +32,4 @@
|
||||||
<!ENTITY engine.column.label "Search Engine">
|
<!ENTITY engine.column.label "Search Engine">
|
||||||
<!ENTITY viewbyprovider.label "View by search engine:">
|
<!ENTITY viewbyprovider.label "View by search engine:">
|
||||||
<!ENTITY allresults.title.label "All results combined">
|
<!ENTITY allresults.title.label "All results combined">
|
||||||
|
<!ENTITY internetresults.title "Search Results">
|
Загрузка…
Ссылка в новой задаче