Search UI tweaks. Use ender widget to display HTML, until the problem with document.write()'ing html to an iframe is figured out.

This commit is contained in:
rjc%netscape.com 1999-08-21 08:16:17 +00:00
parent 557c3f3eaa
commit bc3fa3a93d
5 changed files with 96 additions and 36 deletions

View File

@ -1,8 +1,38 @@
var gEditorShell = null;
function doLoad()
{
dump("doLoad() entered.\n");
var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance();
if (editorShell) editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell);
if (editorShell)
{
window.editorShell = editorShell;
editorShell.Init();
dump("init\n");
// editorShell.SetWebShellWindow(window);
// dump("SetWebShellWindow\n");
// editorShell.SetToolbarWindow(window)
// dump("SetToolbarWindow\n");
editorShell.SetEditorType("html");
dump("SetEditorType\n");
editorShell.SetContentWindow(window.content);
// Get url for editor content and load it.
// the editor gets instantiated by the editor shell when the URL has finished loading.
editorShell.LoadUrl("about:blank");
gEditorShell = editorShell;
dump("doLoad() succeeded.\n");
}
else dump("doLoad(): problem loading component://netscape/editor/editorshell \n");
}
function doClick(node)
{
htmlText = "";
var theID = node.getAttribute("id");
if (!theID) return(false);
@ -22,20 +52,20 @@ function doClick(node)
if (target) target = target.Value;
if (target)
{
htmlText = target;
var htmlArea = window.content;
if (htmlArea)
if (gEditorShell == null)
{
htmlArea.open();
doLoad();
}
if (gEditorShell)
{
var text = target;
// htmlArea.write("<HTML><BODY><TABLE><TR><TD>");
// htmlArea.write(target);
// htmlArea.write("</TD></TR></TABLE></BODY></HTML>\n");
htmlArea.close();
dump("HTML\n----------\n" + target + "\n----------\n");
gEditorShell.SelectAll();
gEditorShell.DeleteSelection(2);
// gEditorShell.SetTextProperty("font", "size", "-2");
gEditorShell.InsertSource(text);
// gEditorShell.SelectAll();
// gEditorShell.SetTextProperty("font", "size", "-2");
}
}
}

View File

@ -18,7 +18,7 @@
]>
<window title="&window.title.label;" style="width:100%; height:100%; background-color:white" align="vertical"
<window title="&window.title.label;" style="width:100%; height:100%; background-color:white" align="vertical" onload="doLoad()"
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">
@ -67,7 +67,7 @@
</tree>
</box>
<tree id="internetresultstree" style="height: 75%; width: 100%;" flex="100%" datasources="rdf:internetsearch" ondblclick="return OpenURL(event, event.target.parentNode.parentNode);">
<tree id="internetresultstree" style="height: 65%; width: 100%;" flex="100%" datasources="rdf:internetsearch" ondblclick="return OpenURL(event, event.target.parentNode.parentNode);">
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
<treecol id="RelevanceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Relevance" sortActive="true" sortDirection="descending" />
<treecol id="SiteColumn" rdf:resource="http://home.netscape.com/NC-rdf#Site"/>
@ -136,5 +136,5 @@
</treehead>
</tree>
<html:iframe id="content" type="content-primary" width="100%" height="25%" flex="100%" src="about:blank" />
<html:iframe id="content" type="content-primary" width="100%" height="35%" flex="100%" src="about:blank" />
</window>

View File

@ -1,8 +1,38 @@
var gEditorShell = null;
function doLoad()
{
dump("doLoad() entered.\n");
var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance();
if (editorShell) editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell);
if (editorShell)
{
window.editorShell = editorShell;
editorShell.Init();
dump("init\n");
// editorShell.SetWebShellWindow(window);
// dump("SetWebShellWindow\n");
// editorShell.SetToolbarWindow(window)
// dump("SetToolbarWindow\n");
editorShell.SetEditorType("html");
dump("SetEditorType\n");
editorShell.SetContentWindow(window.content);
// Get url for editor content and load it.
// the editor gets instantiated by the editor shell when the URL has finished loading.
editorShell.LoadUrl("about:blank");
gEditorShell = editorShell;
dump("doLoad() succeeded.\n");
}
else dump("doLoad(): problem loading component://netscape/editor/editorshell \n");
}
function doClick(node)
{
htmlText = "";
var theID = node.getAttribute("id");
if (!theID) return(false);
@ -22,20 +52,20 @@ function doClick(node)
if (target) target = target.Value;
if (target)
{
htmlText = target;
var htmlArea = window.content;
if (htmlArea)
if (gEditorShell == null)
{
htmlArea.open();
doLoad();
}
if (gEditorShell)
{
var text = target;
// htmlArea.write("<HTML><BODY><TABLE><TR><TD>");
// htmlArea.write(target);
// htmlArea.write("</TD></TR></TABLE></BODY></HTML>\n");
htmlArea.close();
dump("HTML\n----------\n" + target + "\n----------\n");
gEditorShell.SelectAll();
gEditorShell.DeleteSelection(2);
// gEditorShell.SetTextProperty("font", "size", "-2");
gEditorShell.InsertSource(text);
// gEditorShell.SelectAll();
// gEditorShell.SetTextProperty("font", "size", "-2");
}
}
}

View File

@ -18,7 +18,7 @@
]>
<window title="&window.title.label;" style="width:100%; height:100%; background-color:white" align="vertical"
<window title="&window.title.label;" style="width:100%; height:100%; background-color:white" align="vertical" onload="doLoad()"
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">
@ -67,7 +67,7 @@
</tree>
</box>
<tree id="internetresultstree" style="height: 75%; width: 100%;" flex="100%" datasources="rdf:internetsearch" ondblclick="return OpenURL(event, event.target.parentNode.parentNode);">
<tree id="internetresultstree" style="height: 65%; width: 100%;" flex="100%" datasources="rdf:internetsearch" ondblclick="return OpenURL(event, event.target.parentNode.parentNode);">
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
<treecol id="RelevanceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Relevance" sortActive="true" sortDirection="descending" />
<treecol id="SiteColumn" rdf:resource="http://home.netscape.com/NC-rdf#Site"/>
@ -136,5 +136,5 @@
</treehead>
</tree>
<html:iframe id="content" type="content-primary" width="100%" height="25%" flex="100%" src="about:blank" />
<html:iframe id="content" type="content-primary" width="100%" height="35%" flex="100%" src="about:blank" />
</window>

View File

@ -33,7 +33,7 @@
<spring align="horizontal" flex="100%" />
</box>
<html:iframe style="height: 50%; width: 100%;" flex="100%" id="content" src="about:blank" />
<html:iframe style="height: 50%; width: 100%;" flex="100%" id="results" src="about:blank" />
<html:iframe style="height: 40%; width: 100%;" flex="100%" id="content" src="about:blank" />
<html:iframe style="height: 60%; width: 100%;" flex="100%" id="results" src="about:blank" />
</box>
</window>