mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Check-in search UI.
This commit is contained in:
parent
588b2ac593
commit
d0171c3cdb
89
suite/common/search/internetresults.xul
Normal file
89
suite/common/search/internetresults.xul
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?xml-stylesheet href="internetresults.css" type="text/css"?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE window
|
||||||
|
[
|
||||||
|
<!ENTITY window.title.label "Search Internet Results">
|
||||||
|
<!ENTITY results.title.label "Results:">
|
||||||
|
|
||||||
|
<!ENTITY name.column.label "Name">
|
||||||
|
<!ENTITY relevance.column.label "Relevance">
|
||||||
|
<!ENTITY site.column.label "Internet Site">
|
||||||
|
<!ENTITY engine.column.label "Search Engine">
|
||||||
|
]>
|
||||||
|
|
||||||
|
|
||||||
|
<window title="&window.title.label;" style="width:100%; height:100%"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<html:script src="shared.js" />
|
||||||
|
|
||||||
|
<titledbutton id="internetresultssummary" value="&results.title.label;" width="200" size="200" />
|
||||||
|
<html:p />
|
||||||
|
|
||||||
|
<tree id="internetresultstree" flex="100%" border="1" datasources="rdf:internetsearch" ondblclick="return OpenURL(event,event.target.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"/>
|
||||||
|
<treecol id="EngineColumn" rdf:resource="http://home.netscape.com/NC-rdf#Engine"/>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator" rootcontainment="treebody" subcontainment="treechildren">
|
||||||
|
<treeitem uri="...">
|
||||||
|
<treecell>
|
||||||
|
<html:hr width="75%" align="center" size="1" />
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule rootcontainment="treebody" subcontainment="treechildren">
|
||||||
|
<treeitem uri="...">
|
||||||
|
<treecell>
|
||||||
|
<treeindentation />
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Name" align="right" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<progressmeter value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="horizontal" mode="normal" />
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="left" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Site" align="right" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Engine" align="right" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</rule>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<treehead>
|
||||||
|
<treeitem>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Name" onclick="return doSort('NameColumn');">
|
||||||
|
<observes element="NameColumn" attribute="sortActive"/>
|
||||||
|
<observes element="NameColumn" attribute="sortDirection"/>
|
||||||
|
&name.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Relevance" onclick="return doSort('RelevanceColumn');" sortActive="true" sortDirection="descending" >
|
||||||
|
<observes element="RelevanceColumn" attribute="sortActive"/>
|
||||||
|
<observes element="RelevanceColumn" attribute="sortDirection"/>
|
||||||
|
&relevance.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Site" onclick="return doSort('SiteColumn');">
|
||||||
|
<observes element="SiteColumn" attribute="sortActive"/>
|
||||||
|
<observes element="SiteColumn" attribute="sortDirection"/>
|
||||||
|
&site.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Engine" onclick="return doSort('EngineColumn');">
|
||||||
|
<observes element="EngineColumn" attribute="sortActive"/>
|
||||||
|
<observes element="EngineColumn" attribute="sortDirection"/>
|
||||||
|
&engine.column.label;
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</treehead>
|
||||||
|
|
||||||
|
<treebody open="true" />
|
||||||
|
</tree>
|
||||||
|
</window>
|
67
suite/common/search/shared.js
Normal file
67
suite/common/search/shared.js
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
function OpenURL(event,node)
|
||||||
|
{
|
||||||
|
if (node.getAttribute('container') == "true")
|
||||||
|
{
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
url = node.getAttribute('id');
|
||||||
|
|
||||||
|
// Ignore "NC:" urls.
|
||||||
|
if (url.substring(0, 3) == "NC:")
|
||||||
|
{
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
||||||
|
if (!toolkitCore)
|
||||||
|
{
|
||||||
|
toolkitCore = new ToolkitCore();
|
||||||
|
if (toolkitCore)
|
||||||
|
{
|
||||||
|
toolkitCore.Init("ToolkitCore");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (toolkitCore)
|
||||||
|
{
|
||||||
|
toolkitCore.ShowWindow(url,window);
|
||||||
|
}
|
||||||
|
|
||||||
|
dump("OpenURL(" + url + ")\n");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Note: doSort() does NOT support natural order sorting! */
|
||||||
|
|
||||||
|
function doSort(sortColName)
|
||||||
|
{
|
||||||
|
var node = document.getElementById(sortColName);
|
||||||
|
// determine column resource to sort on
|
||||||
|
var sortResource = node.getAttribute('resource');
|
||||||
|
if (!sortResource) return(false);
|
||||||
|
|
||||||
|
var sortDirection="ascending";
|
||||||
|
var isSortActive = node.getAttribute('sortActive');
|
||||||
|
if (isSortActive == "true")
|
||||||
|
{
|
||||||
|
var currentDirection = node.getAttribute('sortDirection');
|
||||||
|
if (currentDirection == "ascending")
|
||||||
|
sortDirection = "descending";
|
||||||
|
else sortDirection = "ascending";
|
||||||
|
}
|
||||||
|
|
||||||
|
// get RDF Core service
|
||||||
|
var rdfCore = XPAppCoresManager.Find("RDFCore");
|
||||||
|
if (!rdfCore)
|
||||||
|
{
|
||||||
|
rdfCore = new RDFCore();
|
||||||
|
if (!rdfCore)
|
||||||
|
{
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
rdfCore.Init("RDFCore");
|
||||||
|
}
|
||||||
|
// sort!!!
|
||||||
|
rdfCore.doSort(node, sortResource, sortDirection);
|
||||||
|
return(true);
|
||||||
|
}
|
56
xpfe/components/search/resources/find.js
Normal file
56
xpfe/components/search/resources/find.js
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
function doFind()
|
||||||
|
{
|
||||||
|
// get RDF datasource to query
|
||||||
|
var datasourceNode = document.getElementById("datasource");
|
||||||
|
if (!datasourceNode) return(false);
|
||||||
|
var x = datasourceNode.selectedIndex;
|
||||||
|
if (x < 0) return(false);
|
||||||
|
var datasource = datasourceNode.options[x].value;
|
||||||
|
if (!datasource) return(false);
|
||||||
|
dump("Datasource: " + datasource + "\n");
|
||||||
|
|
||||||
|
// get match
|
||||||
|
var matchNode = document.getElementById("match");
|
||||||
|
if (!matchNode) return(false);
|
||||||
|
x = matchNode.selectedIndex;
|
||||||
|
if (x < 0) return(false);
|
||||||
|
var match = matchNode.options[x].value;
|
||||||
|
if (!match) return(false);
|
||||||
|
dump("Match: " + match + "\n");
|
||||||
|
|
||||||
|
// get method
|
||||||
|
var methodNode = document.getElementById("method");
|
||||||
|
if (!methodNode) return(false);
|
||||||
|
x = methodNode.selectedIndex;
|
||||||
|
if (x < 0) return(false);
|
||||||
|
var method = methodNode.options[x].value;
|
||||||
|
if (!method) return(false);
|
||||||
|
dump("Method: " + method + "\n");
|
||||||
|
|
||||||
|
// get user text to find
|
||||||
|
var textNode = document.getElementById("findtext");
|
||||||
|
if (!textNode) return(false);
|
||||||
|
var text = textNode.value;
|
||||||
|
if (!text) return(false);
|
||||||
|
dump("Find text: " + text + "\n");
|
||||||
|
|
||||||
|
// construct find URL
|
||||||
|
var url = "find:datasource=" + datasource;
|
||||||
|
url += "&match=" + match;
|
||||||
|
url += "&method=" + method;
|
||||||
|
url += "&text=" + text;
|
||||||
|
dump("Find URL: " + url + "\n");
|
||||||
|
|
||||||
|
// load find URL into results pane
|
||||||
|
var resultsTree = parent.frames[1].document.getElementById("findresultstree");
|
||||||
|
if (!resultsTree) return(false);
|
||||||
|
x = resultsTree.childNodes.length;
|
||||||
|
if (x < 1) return(false);
|
||||||
|
// XXX shouldn't assume that treebody is the last child node in the tree!
|
||||||
|
resultsTree.childNodes[x-1].setAttribute("id", url);
|
||||||
|
|
||||||
|
dump("doFind done.\n");
|
||||||
|
|
||||||
|
return(true);
|
||||||
|
}
|
76
xpfe/components/search/resources/find.xul
Normal file
76
xpfe/components/search/resources/find.xul
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE window
|
||||||
|
[
|
||||||
|
<!ENTITY window.title.label "Find Local Data">
|
||||||
|
|
||||||
|
<!ENTITY bookmarks.label "Bookmarks">
|
||||||
|
<!ENTITY history.label "History">
|
||||||
|
|
||||||
|
<!ENTITY name.label "Name">
|
||||||
|
<!ENTITY url.label "URL">
|
||||||
|
<!ENTITY shortcut.label "Shortcut URL">
|
||||||
|
<!ENTITY description.label "Description">
|
||||||
|
|
||||||
|
<!ENTITY contains.label "contains">
|
||||||
|
<!ENTITY startswith.label "starts with">
|
||||||
|
<!ENTITY endswith.label "ends with">
|
||||||
|
<!ENTITY is.label "is">
|
||||||
|
<!ENTITY isnot.label "is not">
|
||||||
|
<!ENTITY doesntcontain.label "doesn't contain">
|
||||||
|
]>
|
||||||
|
|
||||||
|
|
||||||
|
<window title="&window.title.label;" style="width:100%; height:100%"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<html:script src="find.js" />
|
||||||
|
|
||||||
|
<box align="horizontal">
|
||||||
|
<html:table>
|
||||||
|
<html:tr>
|
||||||
|
<html:td>
|
||||||
|
Find items in
|
||||||
|
<html:select id="datasource">
|
||||||
|
<html:option value="rdf:bookmarks">&bookmarks.label;</html:option>
|
||||||
|
<html:option value="rdf:history">&history.label;</html:option>
|
||||||
|
</html:select>
|
||||||
|
whose
|
||||||
|
<html:p />
|
||||||
|
</html:td>
|
||||||
|
</html:tr>
|
||||||
|
|
||||||
|
<html:tr>
|
||||||
|
<html:td>
|
||||||
|
<html:select id="match">
|
||||||
|
<html:option value="http://home.netscape.com/NC-rdf#Name">&name.label;</html:option>
|
||||||
|
<html:option value="http://home.netscape.com/NC-rdf#URL">&url.label;</html:option>
|
||||||
|
<html:option value="http://home.netscape.com/NC-rdf#ShortcutURL">&shortcut.label;</html:option>
|
||||||
|
<html:option value="http://home.netscape.com/NC-Description">&description.label;</html:option>
|
||||||
|
</html:select>
|
||||||
|
<html:select id="method">
|
||||||
|
<html:option value="contains">&contains.label;</html:option>
|
||||||
|
<html:option value="startswith">&startswith.label;</html:option>
|
||||||
|
<html:option value="endswith">&endswith.label;</html:option>
|
||||||
|
<html:option value="is">&is.label;</html:option>
|
||||||
|
<html:option value="isnot">&isnot.label;</html:option>
|
||||||
|
<html:option value="doesntcontain">&doesntcontain.label;</html:option>
|
||||||
|
</html:select>
|
||||||
|
<html:input id="findtext" type="text" width="20" onkeyup="if (event.which == 13) { doFind(); }" />
|
||||||
|
</html:td>
|
||||||
|
</html:tr>
|
||||||
|
|
||||||
|
<html:tr>
|
||||||
|
<html:td align="right">
|
||||||
|
<html:input type="button" value="Find" onclick="return doFind();" />
|
||||||
|
</html:td>
|
||||||
|
</html:tr>
|
||||||
|
</html:table>
|
||||||
|
<html:p />
|
||||||
|
<spring flex="100%" align="horizontal" />
|
||||||
|
</box>
|
||||||
|
</window>
|
127
xpfe/components/search/resources/findresults.css
Executable file
127
xpfe/components/search/resources/findresults.css
Executable file
@ -0,0 +1,127 @@
|
|||||||
|
window {
|
||||||
|
display: block;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
box {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
tree {
|
||||||
|
display: table;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border: 1;
|
||||||
|
border-spacing: 0px;
|
||||||
|
width: 90%;
|
||||||
|
align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem {
|
||||||
|
display: table-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
treehead {
|
||||||
|
display: table-header-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
treebody {
|
||||||
|
display: table-row-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecol {
|
||||||
|
display: table-column;
|
||||||
|
// width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell {
|
||||||
|
display: table-cell;
|
||||||
|
font-family: Verdana, Sans-Serif;
|
||||||
|
font-size: 8pt;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[selected] {
|
||||||
|
background-color: #000080;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell[sortActive="true"][sortDirection="ascending"] {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell[sortActive="true"][sortDirection="descending"] {
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecol[sortActive="true"] {
|
||||||
|
background-color: lightgreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
treehead treeitem treecell {
|
||||||
|
background-color: #c0c0c0;
|
||||||
|
border: outset 1px;
|
||||||
|
border-color: white #707070 #707070 white;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"][open="true"][loading="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/loading.gif") ! important ;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/personal-folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/personal-folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#BookmarkSeparator"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#IEFavorite"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/IEFavorite.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Bookmark"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/article.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/document.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton#bookmarks {
|
||||||
|
list-style-image:url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
85
xpfe/components/search/resources/findresults.xul
Normal file
85
xpfe/components/search/resources/findresults.xul
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?>
|
||||||
|
<?xml-stylesheet href="findresults.css" type="text/css"?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE window
|
||||||
|
[
|
||||||
|
<!ENTITY window.title.label "Find Results">
|
||||||
|
|
||||||
|
<!ENTITY name.column.label "Name">
|
||||||
|
<!ENTITY url.column.label "URL">
|
||||||
|
<!ENTITY shortcuturl.column.label "Shortcut URL">
|
||||||
|
<!ENTITY description.column.label "Description">
|
||||||
|
]>
|
||||||
|
|
||||||
|
|
||||||
|
<window title="&window.title.label;" style="width:100%; height:100%"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<html:script src="shared.js" />
|
||||||
|
|
||||||
|
<tree id="findresultstree" flex="100%" datasources="rdf:bookmarks rdf:history rdf:find" ondblclick="return OpenURL(event,event.target.parentNode);">
|
||||||
|
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name" sortActive="true" sortDirection="ascending" />
|
||||||
|
<treecol id="URLColumn" rdf:resource="http://home.netscape.com/NC-rdf#URL"/>
|
||||||
|
<treecol id="ShortcutURLColumn" rdf:resource="http://home.netscape.com/NC-rdf#ShortcutURL"/>
|
||||||
|
<treecol id="DescriptionColumn" rdf:resource="http://home.netscape.com/NC-rdf#Description"/>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator" rootcontainment="treebody" subcontainment="treechildren">
|
||||||
|
<treeitem uri="...">
|
||||||
|
<treecell>
|
||||||
|
<html:hr width="75%" align="center" size="1" />
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule rootcontainment="treebody" subcontainment="treechildren">
|
||||||
|
<treeitem uri="...">
|
||||||
|
<treecell>
|
||||||
|
<treeindentation />
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Name" align="right" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#URL" align="right" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" align="right" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Description" align="right" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</rule>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<treehead>
|
||||||
|
<treeitem>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Name" onclick="return doSort('NameColumn');" sortActive="true" sortDirection="ascending">
|
||||||
|
<observes element="NameColumn" attribute="sortActive"/>
|
||||||
|
<observes element="NameColumn" attribute="sortDirection"/>
|
||||||
|
&name.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#URL" onclick="return doSort('URLColumn');">
|
||||||
|
<observes element="URLColumn" attribute="sortActive"/>
|
||||||
|
<observes element="URLColumn" attribute="sortDirection"/>
|
||||||
|
&url.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#ShortcutURL" onclick="return doSort('ShortcutURLColumn');">
|
||||||
|
<observes element="ShortcutURLColumn" attribute="sortActive"/>
|
||||||
|
<observes element="ShortcutURLColumn" attribute="sortDirection"/>
|
||||||
|
&shortcuturl.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Description" onclick="return doSort('DescriptionColumn');">
|
||||||
|
<observes element="DescriptionColumn" attribute="sortActive"/>
|
||||||
|
<observes element="DescriptionColumn" attribute="sortDirection"/>
|
||||||
|
&description.column.label;
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</treehead>
|
||||||
|
|
||||||
|
<treebody />
|
||||||
|
</tree>
|
||||||
|
</window>
|
127
xpfe/components/search/resources/internet.css
Executable file
127
xpfe/components/search/resources/internet.css
Executable file
@ -0,0 +1,127 @@
|
|||||||
|
window {
|
||||||
|
display: block;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
box {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
tree[id="searchengines"] {
|
||||||
|
display: table;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border: 1;
|
||||||
|
border-spacing: 0px;
|
||||||
|
width: 300;
|
||||||
|
align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem {
|
||||||
|
display: table-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
treehead {
|
||||||
|
display: table-header-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
treebody {
|
||||||
|
display: table-row-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecol[id="CheckboxColumn"] {
|
||||||
|
display: table-column;
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecol[id="NameColumn"] {
|
||||||
|
display: table-column;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell {
|
||||||
|
display: table-cell;
|
||||||
|
font-family: Verdana, Sans-Serif;
|
||||||
|
font-size: 8pt;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell[sortActive="true"][sortDirection="ascending"] {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell[sortActive="true"][sortDirection="descending"] {
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecol[sortActive="true"] {
|
||||||
|
background-color: lightgreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
treehead treeitem treecell {
|
||||||
|
background-color: #c0c0c0;
|
||||||
|
border: outset 1px;
|
||||||
|
border-color: white #707070 #707070 white;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"][open="true"][loading="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/loading.gif") ! important ;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/personal-folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/personal-folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#BookmarkSeparator"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#IEFavorite"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/IEFavorite.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Bookmark"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/article.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/document.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton#bookmarks {
|
||||||
|
list-style-image:url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
91
xpfe/components/search/resources/internet.js
Normal file
91
xpfe/components/search/resources/internet.js
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
|
||||||
|
function doSearch()
|
||||||
|
{
|
||||||
|
// get user text to find
|
||||||
|
var textNode = document.getElementById("searchtext");
|
||||||
|
if (!textNode) return(false);
|
||||||
|
var text = textNode.value;
|
||||||
|
if (!text) return(false);
|
||||||
|
dump("Search text: " + text + "\n");
|
||||||
|
|
||||||
|
// get selected search engines
|
||||||
|
var treeBody = document.getElementById("NC:SearchEngineRoot");
|
||||||
|
if (!treeBody) return(false);
|
||||||
|
|
||||||
|
var searchURL="";
|
||||||
|
var foundEngine = false;
|
||||||
|
|
||||||
|
var numEngines = treeBody.childNodes.length;
|
||||||
|
dump("Found treebody, it has " + numEngines + " kids\n");
|
||||||
|
for (var x = 0; x<numEngines; x++)
|
||||||
|
{
|
||||||
|
var treeItem = treeBody.childNodes[x];
|
||||||
|
if (!treeItem) continue;
|
||||||
|
// XXX when its fully implemented, instead use
|
||||||
|
// var engines = document.getElementsByTagName("checkbox");
|
||||||
|
if (treeItem.childNodes[0].childNodes[0].getAttribute("value") == "1")
|
||||||
|
{
|
||||||
|
var engineURI = treeItem.getAttribute("id");
|
||||||
|
if (!engineURI) continue;
|
||||||
|
dump ("# " + x + ": " + engineURI + "\n");
|
||||||
|
|
||||||
|
if (searchURL == "")
|
||||||
|
{
|
||||||
|
searchURL = "internetsearch:";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchURL += "&";
|
||||||
|
}
|
||||||
|
searchURL += "engine=" + engineURI;
|
||||||
|
foundEngine = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (foundEngine == false) return(false);
|
||||||
|
|
||||||
|
searchURL += "&text=" + escape(text);
|
||||||
|
dump("Internet Search URL: " + searchURL + "\n");
|
||||||
|
|
||||||
|
// set text in results pane
|
||||||
|
var summaryNode = parent.frames[1].document.getElementById("internetresultssummary");
|
||||||
|
if (summaryNode)
|
||||||
|
{
|
||||||
|
var summaryText = "Results: term contains '";
|
||||||
|
summaryText += text + "'";
|
||||||
|
summaryNode.setAttribute("value", summaryText);
|
||||||
|
}
|
||||||
|
|
||||||
|
// load find URL into results pane
|
||||||
|
var resultsTree = parent.frames[1].document.getElementById("internetresultstree");
|
||||||
|
if (!resultsTree) return(false);
|
||||||
|
x = resultsTree.childNodes.length;
|
||||||
|
if (x < 1) return(false);
|
||||||
|
// XXX shouldn't assume that treebody is the last child node in the tree!
|
||||||
|
resultsTree.childNodes[x-1].setAttribute("id", searchURL);
|
||||||
|
|
||||||
|
dump("doSearch done.\n");
|
||||||
|
|
||||||
|
return(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function doUncheckAll()
|
||||||
|
{
|
||||||
|
// get selected search engines
|
||||||
|
var treeBody = document.getElementById("NC:SearchEngineRoot");
|
||||||
|
if (!treeBody) return(false);
|
||||||
|
|
||||||
|
var numEngines = treeBody.childNodes.length;
|
||||||
|
dump("Found treebody, it has " + numEngines + " kids\n");
|
||||||
|
for (var x = 0; x<numEngines; x++)
|
||||||
|
{
|
||||||
|
var treeItem = treeBody.childNodes[x];
|
||||||
|
if (!treeItem) continue;
|
||||||
|
// XXX when its fully implemented, instead use
|
||||||
|
// var engines = document.getElementsByTagName("checkbox");
|
||||||
|
treeItem.childNodes[0].childNodes[0].setAttribute("value", "0");
|
||||||
|
}
|
||||||
|
|
||||||
|
dump("doUncheckAll() done.\n");
|
||||||
|
|
||||||
|
return(true);
|
||||||
|
}
|
77
xpfe/components/search/resources/internet.xul
Normal file
77
xpfe/components/search/resources/internet.xul
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?>
|
||||||
|
<?xml-stylesheet href="internet.css" type="text/css"?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE window
|
||||||
|
[
|
||||||
|
<!ENTITY window.title.label "Search Internet">
|
||||||
|
<!ENTITY words.label "Words: ">
|
||||||
|
|
||||||
|
<!ENTITY checkbox.column.label "On">
|
||||||
|
<!ENTITY engine.column.label "Search Engines">
|
||||||
|
]>
|
||||||
|
|
||||||
|
|
||||||
|
<window title="&window.title.label;" style="width:100%; height:100%"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<html:script src="internet.js" />
|
||||||
|
<html:script src="shared.js" />
|
||||||
|
|
||||||
|
<box align="horizontal">
|
||||||
|
<html:center>
|
||||||
|
<html:table>
|
||||||
|
<html:tr>
|
||||||
|
<html:td>
|
||||||
|
&words.label;
|
||||||
|
<html:input id="searchtext" type="text" width="20" onkeyup="if (event.which == 13) { doSearch(); }" />
|
||||||
|
<html:input type="button" value="Search" onclick="return doSearch();" />
|
||||||
|
<html:p />
|
||||||
|
</html:td>
|
||||||
|
</html:tr>
|
||||||
|
|
||||||
|
<html:tr><html:td>
|
||||||
|
<tree id="searchengines" flex="100%" datasources="rdf:internetsearch" >
|
||||||
|
<treecol id="CheckboxColumn" />
|
||||||
|
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||||
|
|
||||||
|
<template rootcontainment="treebody" subcontainment="treechildren">
|
||||||
|
<treeitem uri="...">
|
||||||
|
<treecell treeallowevents="true">
|
||||||
|
<checkbox value="0" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Name" align="right" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<treehead>
|
||||||
|
<treeitem>
|
||||||
|
<treecell>
|
||||||
|
&checkbox.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Name" onclick="return doSort('NameColumn');">
|
||||||
|
<observes element="NameColumn" attribute="sortActive"/>
|
||||||
|
<observes element="NameColumn" attribute="sortDirection"/>
|
||||||
|
&engine.column.label;
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</treehead>
|
||||||
|
|
||||||
|
<treebody id="NC:SearchEngineRoot" />
|
||||||
|
</tree>
|
||||||
|
</html:td></html:tr>
|
||||||
|
|
||||||
|
<html:tr><html:td>
|
||||||
|
<html:input type="button" value="Uncheck All" onclick="return doUncheckAll();" />
|
||||||
|
</html:td></html:tr>
|
||||||
|
</html:table>
|
||||||
|
</html:center>
|
||||||
|
<html:p />
|
||||||
|
<spring flex="100%" align="horizontal" />
|
||||||
|
</box>
|
||||||
|
</window>
|
122
xpfe/components/search/resources/internetresults.css
Executable file
122
xpfe/components/search/resources/internetresults.css
Executable file
@ -0,0 +1,122 @@
|
|||||||
|
window {
|
||||||
|
display: block;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
box {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
tree {
|
||||||
|
display: table;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border: 1;
|
||||||
|
border-spacing: 0px;
|
||||||
|
width: 90%;
|
||||||
|
align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem {
|
||||||
|
display: table-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
treehead {
|
||||||
|
display: table-header-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
treebody {
|
||||||
|
display: table-row-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecol {
|
||||||
|
display: table-column;
|
||||||
|
// width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell {
|
||||||
|
display: table-cell;
|
||||||
|
font-family: Verdana, Sans-Serif;
|
||||||
|
font-size: 8pt;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell[sortActive="true"][sortDirection="ascending"] {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecell[sortActive="true"][sortDirection="descending"] {
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
treecol[sortActive="true"] {
|
||||||
|
background-color: lightgreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
treehead treeitem treecell {
|
||||||
|
background-color: #c0c0c0;
|
||||||
|
border: outset 1px;
|
||||||
|
border-color: white #707070 #707070 white;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"][open="true"][loading="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/loading.gif") ! important ;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/personal-folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/personal-folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#BookmarkSeparator"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#IEFavorite"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/IEFavorite.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#Bookmark"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/article.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"][open="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-open.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem[container="true"] > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/folder-closed.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
treeitem > treecell > titledbutton {
|
||||||
|
list-style-image: url("resource:/res/rdf/document.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton#bookmarks {
|
||||||
|
list-style-image:url("resource:/res/samples/bookmark-item.gif");
|
||||||
|
}
|
89
xpfe/components/search/resources/internetresults.xul
Normal file
89
xpfe/components/search/resources/internetresults.xul
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?xml-stylesheet href="internetresults.css" type="text/css"?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE window
|
||||||
|
[
|
||||||
|
<!ENTITY window.title.label "Search Internet Results">
|
||||||
|
<!ENTITY results.title.label "Results:">
|
||||||
|
|
||||||
|
<!ENTITY name.column.label "Name">
|
||||||
|
<!ENTITY relevance.column.label "Relevance">
|
||||||
|
<!ENTITY site.column.label "Internet Site">
|
||||||
|
<!ENTITY engine.column.label "Search Engine">
|
||||||
|
]>
|
||||||
|
|
||||||
|
|
||||||
|
<window title="&window.title.label;" style="width:100%; height:100%"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<html:script src="shared.js" />
|
||||||
|
|
||||||
|
<titledbutton id="internetresultssummary" value="&results.title.label;" width="200" size="200" />
|
||||||
|
<html:p />
|
||||||
|
|
||||||
|
<tree id="internetresultstree" flex="100%" border="1" datasources="rdf:internetsearch" ondblclick="return OpenURL(event,event.target.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"/>
|
||||||
|
<treecol id="EngineColumn" rdf:resource="http://home.netscape.com/NC-rdf#Engine"/>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator" rootcontainment="treebody" subcontainment="treechildren">
|
||||||
|
<treeitem uri="...">
|
||||||
|
<treecell>
|
||||||
|
<html:hr width="75%" align="center" size="1" />
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule rootcontainment="treebody" subcontainment="treechildren">
|
||||||
|
<treeitem uri="...">
|
||||||
|
<treecell>
|
||||||
|
<treeindentation />
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Name" align="right" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<progressmeter value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="horizontal" mode="normal" />
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="left" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Site" align="right" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
<treecell>
|
||||||
|
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Engine" align="right" style="list-style-image: none;" />
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</rule>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<treehead>
|
||||||
|
<treeitem>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Name" onclick="return doSort('NameColumn');">
|
||||||
|
<observes element="NameColumn" attribute="sortActive"/>
|
||||||
|
<observes element="NameColumn" attribute="sortDirection"/>
|
||||||
|
&name.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Relevance" onclick="return doSort('RelevanceColumn');" sortActive="true" sortDirection="descending" >
|
||||||
|
<observes element="RelevanceColumn" attribute="sortActive"/>
|
||||||
|
<observes element="RelevanceColumn" attribute="sortDirection"/>
|
||||||
|
&relevance.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Site" onclick="return doSort('SiteColumn');">
|
||||||
|
<observes element="SiteColumn" attribute="sortActive"/>
|
||||||
|
<observes element="SiteColumn" attribute="sortDirection"/>
|
||||||
|
&site.column.label;
|
||||||
|
</treecell>
|
||||||
|
<treecell resource="http://home.netscape.com/NC-rdf#Engine" onclick="return doSort('EngineColumn');">
|
||||||
|
<observes element="EngineColumn" attribute="sortActive"/>
|
||||||
|
<observes element="EngineColumn" attribute="sortDirection"/>
|
||||||
|
&engine.column.label;
|
||||||
|
</treecell>
|
||||||
|
</treeitem>
|
||||||
|
</treehead>
|
||||||
|
|
||||||
|
<treebody open="true" />
|
||||||
|
</tree>
|
||||||
|
</window>
|
74
xpfe/components/search/resources/search.css
Executable file
74
xpfe/components/search/resources/search.css
Executable file
@ -0,0 +1,74 @@
|
|||||||
|
window {
|
||||||
|
display: block;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
box {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
box.sidebartitle {
|
||||||
|
background-color: #505888;
|
||||||
|
padding: 2px 3px 3px 3px;
|
||||||
|
border: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
font: 10pt sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
box.panelbar {
|
||||||
|
background-color: #006870;
|
||||||
|
padding: 2px 3px 3px 3px;
|
||||||
|
border: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
font: 10pt sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
box#sidebox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton.sidebartitle:hover {
|
||||||
|
border: 0px;
|
||||||
|
margin: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton.active {
|
||||||
|
color: yellow;
|
||||||
|
border: 0px;
|
||||||
|
margin: 1px;
|
||||||
|
padding: 3px 2px 0px 1px
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton[disabled] {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton:hover[disabled] {
|
||||||
|
border: 0px;
|
||||||
|
margin: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton.paneltitle {
|
||||||
|
horizontal-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton {
|
||||||
|
color: white;
|
||||||
|
margin: 1px;
|
||||||
|
padding: 2px 1px 1px 2px
|
||||||
|
}
|
||||||
|
|
||||||
|
titledbutton:hover {
|
||||||
|
border: 1px outset white;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
40
xpfe/components/search/resources/search.js
Normal file
40
xpfe/components/search/resources/search.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
function loadPage(thePage)
|
||||||
|
{
|
||||||
|
var content="", results="";
|
||||||
|
|
||||||
|
if (thePage == "find")
|
||||||
|
{
|
||||||
|
content="find.xul";
|
||||||
|
results="findresults.xul";
|
||||||
|
}
|
||||||
|
else if (thePage == "internet")
|
||||||
|
{
|
||||||
|
content="internet.xul";
|
||||||
|
results="internetresults.xul";
|
||||||
|
}
|
||||||
|
else if (thePage == "mailnews")
|
||||||
|
{
|
||||||
|
content="about:blank";
|
||||||
|
results="about:blank";
|
||||||
|
}
|
||||||
|
else if (thePage == "addressbook")
|
||||||
|
{
|
||||||
|
content="about:blank";
|
||||||
|
results="about:blank";
|
||||||
|
}
|
||||||
|
if ((content != "") && (results != ""))
|
||||||
|
{
|
||||||
|
var contentFrame = document.getElementById("content");
|
||||||
|
if (contentFrame)
|
||||||
|
{
|
||||||
|
contentFrame.setAttribute("src", content);
|
||||||
|
}
|
||||||
|
var resultsFrame = document.getElementById("results");
|
||||||
|
if (resultsFrame)
|
||||||
|
{
|
||||||
|
resultsFrame.setAttribute("src", results);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(true);
|
||||||
|
}
|
44
xpfe/components/search/resources/search.xul
Normal file
44
xpfe/components/search/resources/search.xul
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?>
|
||||||
|
<?xml-stylesheet href="search.css" type="text/css"?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE window
|
||||||
|
[
|
||||||
|
<!ENTITY window.title.label "Super Search">
|
||||||
|
<!ENTITY find.title.label "Find Local Data">
|
||||||
|
<!ENTITY internet.title.label "Search Internet">
|
||||||
|
<!ENTITY mailnews.title.label "Search Mail/News">
|
||||||
|
<!ENTITY addressbook.title.label "Search Addressbook">
|
||||||
|
]>
|
||||||
|
|
||||||
|
|
||||||
|
<window title="&window.title.label;" style="width:100%; height:100%"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<html:script src="search.js" />
|
||||||
|
|
||||||
|
<box id="sidebox" align="vertical" >
|
||||||
|
<box class="sidebartitle" align="horizontal">
|
||||||
|
<titledbutton value="&find.title.label;" onclick="return loadPage('find');" />
|
||||||
|
<spring flex="5%"/>
|
||||||
|
<titledbutton value="&internet.title.label;" onclick="return loadPage('internet');" />
|
||||||
|
<spring flex="5%"/>
|
||||||
|
<titledbutton value="&mailnews.title.label;" onclick="return loadPage('mailnews');" />
|
||||||
|
<spring flex="5%"/>
|
||||||
|
<titledbutton value="&addressbook.title.label;" onclick="return loadPage('addressbook');" />
|
||||||
|
<spring flex="100%"/>
|
||||||
|
</box>
|
||||||
|
|
||||||
|
<html:iframe flex="100%" id="content" src="about:blank" />
|
||||||
|
<html:iframe flex="100%" id="results" src="about:blank" />
|
||||||
|
</box>
|
||||||
|
|
||||||
|
|
||||||
|
<html:script>
|
||||||
|
// load initial page
|
||||||
|
loadPage('internet');
|
||||||
|
</html:script>
|
||||||
|
</window>
|
67
xpfe/components/search/resources/shared.js
Normal file
67
xpfe/components/search/resources/shared.js
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
function OpenURL(event,node)
|
||||||
|
{
|
||||||
|
if (node.getAttribute('container') == "true")
|
||||||
|
{
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
url = node.getAttribute('id');
|
||||||
|
|
||||||
|
// Ignore "NC:" urls.
|
||||||
|
if (url.substring(0, 3) == "NC:")
|
||||||
|
{
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
||||||
|
if (!toolkitCore)
|
||||||
|
{
|
||||||
|
toolkitCore = new ToolkitCore();
|
||||||
|
if (toolkitCore)
|
||||||
|
{
|
||||||
|
toolkitCore.Init("ToolkitCore");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (toolkitCore)
|
||||||
|
{
|
||||||
|
toolkitCore.ShowWindow(url,window);
|
||||||
|
}
|
||||||
|
|
||||||
|
dump("OpenURL(" + url + ")\n");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Note: doSort() does NOT support natural order sorting! */
|
||||||
|
|
||||||
|
function doSort(sortColName)
|
||||||
|
{
|
||||||
|
var node = document.getElementById(sortColName);
|
||||||
|
// determine column resource to sort on
|
||||||
|
var sortResource = node.getAttribute('resource');
|
||||||
|
if (!sortResource) return(false);
|
||||||
|
|
||||||
|
var sortDirection="ascending";
|
||||||
|
var isSortActive = node.getAttribute('sortActive');
|
||||||
|
if (isSortActive == "true")
|
||||||
|
{
|
||||||
|
var currentDirection = node.getAttribute('sortDirection');
|
||||||
|
if (currentDirection == "ascending")
|
||||||
|
sortDirection = "descending";
|
||||||
|
else sortDirection = "ascending";
|
||||||
|
}
|
||||||
|
|
||||||
|
// get RDF Core service
|
||||||
|
var rdfCore = XPAppCoresManager.Find("RDFCore");
|
||||||
|
if (!rdfCore)
|
||||||
|
{
|
||||||
|
rdfCore = new RDFCore();
|
||||||
|
if (!rdfCore)
|
||||||
|
{
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
rdfCore.Init("RDFCore");
|
||||||
|
}
|
||||||
|
// sort!!!
|
||||||
|
rdfCore.doSort(node, sortResource, sortDirection);
|
||||||
|
return(true);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user