More search UI tweaking so that any given search engine's HTML is displayable. Just JS changes.

git-svn-id: svn://10.0.0.236/trunk@44130 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rjc%netscape.com
1999-08-23 08:12:36 +00:00
parent ff6e66a823
commit 91b7fb9e7d
2 changed files with 76 additions and 4 deletions

View File

@@ -8,19 +8,55 @@ function doEngineClick(node)
var contentArea = document.getElementById("content");
if (!contentArea) return;
var html="";
var engineURI = node.getAttribute("id");
if (engineURI == "allEngines")
{
resultsTree.removeAttribute("style");
contentArea.setAttribute("style", "height: 100; width: 100%;");
dump("Show all engine results.\n");
resultsTree.setAttribute("style", "height: 70%; width: 100%;");
contentArea.setAttribute("style", "height: 100; width: 100%;");
html = "<HTML><BODY></BODY></HTML>\n";
}
else
{
dump("Show HTML for '" + engineURI + "'\n");
resultsTree.setAttribute("style", "display: none;");
contentArea.setAttribute("style", "height: 100%; width: 100%;");
try
{
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
if (rdf)
{
var internetSearchStore = rdf.GetDataSource("rdf:internetsearch");
if (internetSearchStore)
{
var src = rdf.GetResource(engineURI, true);
var htmlProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#HTML", true);
html = internetSearchStore.GetTarget(src, htmlProperty, true);
if (html) html = html.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (html) html = html.Value;
}
}
}
catch(ex)
{
}
}
if (html)
{
var doc = window.frames[0].document;
doc.open("text/html", "replace");
doc.writeln(html);
doc.close();
}
}
function doResultClick(node)

View File

@@ -8,19 +8,55 @@ function doEngineClick(node)
var contentArea = document.getElementById("content");
if (!contentArea) return;
var html="";
var engineURI = node.getAttribute("id");
if (engineURI == "allEngines")
{
resultsTree.removeAttribute("style");
contentArea.setAttribute("style", "height: 100; width: 100%;");
dump("Show all engine results.\n");
resultsTree.setAttribute("style", "height: 70%; width: 100%;");
contentArea.setAttribute("style", "height: 100; width: 100%;");
html = "<HTML><BODY></BODY></HTML>\n";
}
else
{
dump("Show HTML for '" + engineURI + "'\n");
resultsTree.setAttribute("style", "display: none;");
contentArea.setAttribute("style", "height: 100%; width: 100%;");
try
{
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
if (rdf)
{
var internetSearchStore = rdf.GetDataSource("rdf:internetsearch");
if (internetSearchStore)
{
var src = rdf.GetResource(engineURI, true);
var htmlProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#HTML", true);
html = internetSearchStore.GetTarget(src, htmlProperty, true);
if (html) html = html.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (html) html = html.Value;
}
}
}
catch(ex)
{
}
}
if (html)
{
var doc = window.frames[0].document;
doc.open("text/html", "replace");
doc.writeln(html);
doc.close();
}
}
function doResultClick(node)