2000-12-07 01:39:05 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
|
|
|
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
|
|
|
|
|
|
|
|
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
|
|
|
|
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css" type="text/css"?>
|
|
|
|
|
|
|
|
<window id="toolbarTest"
|
|
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
|
|
xmlns:nc="http://home.netscape.com/NC-rdf#"
|
|
|
|
orient="vertical" onload="resetToolbars();">
|
|
|
|
|
|
|
|
<popupset id="aTooltipSet"/>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<![CDATA[
|
|
|
|
var rdfs = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
|
|
|
|
var rdfc = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer);
|
|
|
|
|
|
|
|
function recurse()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function resetToolbars()
|
|
|
|
{
|
|
|
|
var toolbox = document.getElementById("main-toolbox");
|
|
|
|
var bmds = rdfs.GetDataSource("rdf:bookmarks");
|
|
|
|
toolbox.database.AddDataSource(bmds);
|
|
|
|
bmds = rdfs.GetDataSource("rdf:chrome");
|
|
|
|
toolbox.database.AddDataSource(bmds);
|
|
|
|
bmds = rdfs.GetDataSource("rdf:window-mediator");
|
|
|
|
toolbox.database.AddDataSource(bmds);
|
|
|
|
|
|
|
|
var sidebarDS = rdfs.GetDataSource(get_sidebar_datasource_uri());
|
|
|
|
toolbox.database.AddDataSource(sidebarDS);
|
|
|
|
|
|
|
|
// poke around
|
|
|
|
var db = toolbox.database;
|
|
|
|
var panelsres = rdfs.GetResource("urn:sidebar:current-panel-list", true);
|
|
|
|
var panellist = rdfs.GetResource("http://home.netscape.com/NC-rdf#panel-list", true);
|
|
|
|
var foopy = db.GetTarget(panelsres, panellist, true);
|
|
|
|
rdfc.Init(db, foopy);
|
|
|
|
var elts = rdfc.GetElements();
|
|
|
|
var titletgt = rdfs.GetResource("http://home.netscape.com/NC-rdf#title", true);
|
|
|
|
while(elts.hasMoreElements()) {
|
|
|
|
var currElt = elts.getNext().QueryInterface(Components.interfaces.nsIRDFResource);
|
|
|
|
var title = db.GetTarget(currElt, titletgt, true).QueryInterface(Components.interfaces.nsIRDFLiteral);
|
|
|
|
dump("*** curr title = " + title.Value + "\n");
|
|
|
|
}
|
|
|
|
toolbox.builder.rebuild();
|
|
|
|
}
|
|
|
|
|
|
|
|
function exploreDS()
|
|
|
|
{
|
|
|
|
var tree = document.getElementById("dispTree");
|
|
|
|
var bmds = rdfs.GetDataSource("rdf:bookmarks");
|
|
|
|
tree.database.AddDataSource(bmds);
|
|
|
|
bmds = rdfs.GetDataSource("rdf:history");
|
|
|
|
tree.database.AddDataSource(bmds);
|
|
|
|
tree.builder.rebuild();
|
|
|
|
}
|
|
|
|
|
|
|
|
function initPopup ()
|
|
|
|
{
|
|
|
|
var element = document.popupNode;
|
|
|
|
var panelSrc = document.getElementById("panelsrc");
|
|
|
|
var src = element.getAttribute("content");
|
|
|
|
var popup = document.getElementById("panelpopup");
|
|
|
|
if (src != panelSrc.getAttribute("src")) {
|
|
|
|
panelSrc.setAttribute("src", src);
|
|
|
|
popup.setAttribute("title", element.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<popupset>
|
|
|
|
<popup type="floater" id="panelpopup" oncreate="initPopup();"
|
|
|
|
menugenerated="true" popupanchor="bottomleft" popupalign="topleft">
|
2001-07-09 18:41:07 +00:00
|
|
|
<vbox flex="1">
|
2001-03-22 00:59:29 +00:00
|
|
|
<menuitem label="Add Current Page" class="menuitem-floater"/>
|
|
|
|
<menuitem label="Manage Bookmarks..." class="menuitem-floater"/>
|
2000-12-07 01:39:05 +00:00
|
|
|
<iframe flex="1" id="panelsrc" style="min-width: 1px; min-height: 1px;"/>
|
2001-07-09 18:41:07 +00:00
|
|
|
</vbox>
|
2000-12-07 01:39:05 +00:00
|
|
|
</popup>
|
|
|
|
<!--
|
|
|
|
<popup id="panelpopup" oncreate="initPopup();" orient="vertical"
|
|
|
|
class="popup-resizable"
|
|
|
|
style="min-width: 100px; max-width: 300px;">
|
2001-07-09 18:41:07 +00:00
|
|
|
<vbox class="floater-box">
|
|
|
|
<hbox class="floater-box-top">
|
2000-12-07 01:39:05 +00:00
|
|
|
<titlebar flex="1"/>
|
2001-07-09 18:41:07 +00:00
|
|
|
</hbox>
|
|
|
|
<hbox class="floater-box-center" flex="1">
|
|
|
|
<hbox class="floater-children" flex="1">
|
2000-12-07 01:39:05 +00:00
|
|
|
<iframe flex="1" id="panelsrc" style="width: 170px; height: 200px;"/>
|
2001-07-09 18:41:07 +00:00
|
|
|
</hbox>
|
|
|
|
</hbox>
|
|
|
|
<hbox class="floater-box-bottom">
|
2000-12-07 01:39:05 +00:00
|
|
|
<resizer direction="bottom" flex="1"/>
|
|
|
|
<resizer direction="bottomright"/>
|
2001-07-09 18:41:07 +00:00
|
|
|
</hbox>
|
|
|
|
</vbox>
|
2000-12-07 01:39:05 +00:00
|
|
|
</popup>
|
|
|
|
-->
|
|
|
|
</popupset>
|
|
|
|
|
|
|
|
<toolbox id="main-toolbox"
|
|
|
|
datasources="chrome://navigator/content/toolbarTest.rdf rdf:bookmarks"
|
|
|
|
ref="urn:mozilla:navigator:toolbars:root">
|
|
|
|
<template>
|
|
|
|
|
|
|
|
<!-- toolbar -->
|
|
|
|
<rule>
|
|
|
|
<conditions>
|
|
|
|
<content uri="?uri"/>
|
|
|
|
<triple subject="?uri"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#child"
|
|
|
|
object="?items"/>
|
|
|
|
<member container="?items" child="?item"/>
|
|
|
|
<triple subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Element"
|
|
|
|
object="toolbar"/>
|
|
|
|
</conditions>
|
|
|
|
<bindings>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Class"
|
|
|
|
object="?item-class"/>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Name"
|
|
|
|
object="?item-name"/>
|
|
|
|
</bindings>
|
|
|
|
<action>
|
|
|
|
<toolbar uri="?item" class="?item-class"
|
|
|
|
grippytooltip="aTooltip" grippytooltiptext="?item-name"/>
|
|
|
|
</action>
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
<!-- bookmark separators -->
|
|
|
|
<rule>
|
|
|
|
<conditions>
|
|
|
|
<content uri="?uri"/>
|
|
|
|
<triple subject="?uri"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#child"
|
|
|
|
object="?items"/>
|
|
|
|
<member container="?items" child="?item"/>
|
|
|
|
<triple subject="?item"
|
|
|
|
predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
|
|
|
|
object="http://home.netscape.com/NC-rdf#BookmarkSeparator"/>
|
|
|
|
</conditions>
|
|
|
|
<action>
|
|
|
|
<toolbarseparator uri="?item"/>
|
|
|
|
</action>
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
<!-- installed themes -->
|
|
|
|
<rule>
|
|
|
|
<conditions>
|
|
|
|
<content uri="?uri"/>
|
|
|
|
<triple subject="?uri"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#child"
|
|
|
|
object="?items"/>
|
|
|
|
<member container="?items" child="?item"/>
|
|
|
|
<triple subject="?item"
|
|
|
|
predicate="http://www.mozilla.org/rdf/chrome#displayName"
|
|
|
|
object="?item-name"/>
|
|
|
|
</conditions>
|
|
|
|
<bindings>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Class"
|
|
|
|
object="?item-class"/>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Icon"
|
|
|
|
object="?item-icon"/>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Type"
|
|
|
|
object="?item-type"/>
|
|
|
|
</bindings>
|
|
|
|
<action>
|
2001-03-22 00:59:29 +00:00
|
|
|
<button uri="?items" class="?item-class button-toolbar bookmarkitem" label="?uri"
|
2000-12-07 01:39:05 +00:00
|
|
|
tooltip="aTooltip" tooltiptext="?item-name"
|
|
|
|
src="?item-icon" type="?item-icon" crop="right"/>
|
|
|
|
</action>
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
<!-- sidebar panels -->
|
|
|
|
<rule>
|
|
|
|
<conditions>
|
|
|
|
<content uri="?uri"/>
|
|
|
|
<triple subject="?uri"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#child"
|
|
|
|
object="?item"/>
|
|
|
|
<triple subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#panel-list"
|
|
|
|
object="?panel-list"/>
|
|
|
|
<member container="?panel-list" child="?panel"/>
|
|
|
|
<triple subject="?panel"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#title"
|
|
|
|
object="?title"/>
|
|
|
|
<triple subject="?panel"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#content"
|
|
|
|
object="?content"/>
|
|
|
|
</conditions>
|
|
|
|
<action>
|
|
|
|
<button uri="?panel" class="button-toolbar bookmarkitem"
|
2001-03-22 00:59:29 +00:00
|
|
|
label="?title" content="?content"
|
2000-12-07 01:39:05 +00:00
|
|
|
popup="panelpopup"/>
|
|
|
|
</action>
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
<!-- everything else -->
|
|
|
|
<rule>
|
|
|
|
<conditions>
|
|
|
|
<content uri="?uri"/>
|
|
|
|
<triple subject="?uri"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#child"
|
|
|
|
object="?items"/>
|
|
|
|
<member container="?items" child="?item"/>
|
|
|
|
</conditions>
|
|
|
|
<bindings>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Name"
|
|
|
|
object="?item-name"/>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Class"
|
|
|
|
object="?item-class"/>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Icon"
|
|
|
|
object="?item-icon"/>
|
|
|
|
<binding subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Type"
|
|
|
|
object="?item-type"/>
|
|
|
|
</bindings>
|
|
|
|
<action>
|
2001-03-22 00:59:29 +00:00
|
|
|
<button uri="?items" class="?item-class button-toolbar bookmarkitem" label="?item-name"
|
2000-12-07 01:39:05 +00:00
|
|
|
src="?item-icon" type="?item-icon" crop="right"/>
|
|
|
|
</action>
|
|
|
|
</rule>
|
|
|
|
</template>
|
|
|
|
</toolbox>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
<tree id="dispTree" datasources="rdf:bookmarks chrome://navigator/content/toolbarTest.rdf"
|
|
|
|
ref="urn:mozilla:navigator:toolbars:root"
|
|
|
|
style="height: 0px; width: 0px;" flex="1">
|
|
|
|
|
|
|
|
<treehead>
|
|
|
|
<treerow>
|
2001-03-22 00:59:29 +00:00
|
|
|
<treecell class="treecell-header" label="Item Name"/>
|
|
|
|
<treecell class="treecell-header" label="Item URI"/>
|
2000-12-07 01:39:05 +00:00
|
|
|
</treerow>
|
|
|
|
</treehead>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<rule>
|
|
|
|
<conditions>
|
|
|
|
<content uri="?uri"/>
|
|
|
|
<triple subject="?uri"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#child"
|
|
|
|
object="?items"/>
|
|
|
|
<member container="?items" child="?item"/>
|
|
|
|
<triple subject="?item"
|
|
|
|
predicate="http://home.netscape.com/NC-rdf#Name"
|
|
|
|
object="?name"/>
|
|
|
|
</conditions>
|
|
|
|
<action>
|
|
|
|
<treechildren>
|
|
|
|
<treeitem uri="?item">
|
|
|
|
<treerow>
|
2001-03-22 00:59:29 +00:00
|
|
|
<treecell class="treecell-indent bookmarkitem" label="?name"/>
|
|
|
|
<treecell label="?item"/>
|
2000-12-07 01:39:05 +00:00
|
|
|
</treerow>
|
|
|
|
</treeitem>
|
|
|
|
</treechildren>
|
|
|
|
</action>
|
|
|
|
</rule>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<treecolgroup>
|
|
|
|
<treecol/>
|
|
|
|
<splitter class="tree-splitter"/>
|
|
|
|
<treecol flex="1"/>
|
|
|
|
</treecolgroup>
|
|
|
|
|
|
|
|
<treechildren flex="1"/>
|
|
|
|
</tree>
|
|
|
|
-->
|
|
|
|
|
2001-07-09 18:41:07 +00:00
|
|
|
<hbox flex="1">
|
2001-07-17 03:12:00 +00:00
|
|
|
<vbox id="sidebar-box" class="chromeclass-extrachrome"/>
|
2000-12-07 01:39:05 +00:00
|
|
|
<splitter id="sidebar-splitter" class="chromeclass-extrachrome" />
|
2001-07-09 18:41:07 +00:00
|
|
|
<hbox flex="1"/>
|
|
|
|
</hbox>
|
2000-12-07 01:39:05 +00:00
|
|
|
|
|
|
|
</window>
|
|
|
|
|