mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Initial revision.
This commit is contained in:
parent
bc8f1b12e4
commit
abb29e889b
14
rdf/resources/flash-registry.rdf
Normal file
14
rdf/resources/flash-registry.rdf
Normal file
@ -0,0 +1,14 @@
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<RDF:Bag ID="NC:FlashDataSources">
|
||||
<!-- demo ware! -->
|
||||
<RDF:li resource="resource:/res/rdf/remote-flash-1.rdf" />
|
||||
<RDF:li resource="resource:/res/rdf/remote-flash-2.rdf" />
|
||||
<RDF:li resource="resource:/res/rdf/remote-flash-3.rdf" />
|
||||
</RDF:Bag>
|
||||
|
||||
<RDF:Bag ID="NC:FlashStyleSheets">
|
||||
</RDF:Bag>
|
||||
</RDF:RDF>
|
||||
|
107
rdf/resources/flash.css
Normal file
107
rdf/resources/flash.css
Normal file
@ -0,0 +1,107 @@
|
||||
window {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#treebox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
tree {
|
||||
display: table;
|
||||
background-color: #eeeeee;
|
||||
border: none;
|
||||
border-spacing: 0px;
|
||||
// border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
treehead treeitem treecell {
|
||||
background-color: #a0a0a0;
|
||||
border: thin black solid;
|
||||
}
|
||||
|
||||
treecell[selectedcell] {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
treecell[sortActive="true"] {
|
||||
background-color: #404040;
|
||||
}
|
||||
|
||||
treecol[sortActive="true"] {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-folder-closed.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-folder-open.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/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/rdf/personal-folder-open.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#BookmarkSeparator"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-item.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Bookmark"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/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");
|
||||
}
|
73
rdf/resources/flash.js
Normal file
73
rdf/resources/flash.js
Normal file
@ -0,0 +1,73 @@
|
||||
// -*- Mode: Java -*-
|
||||
|
||||
// the rdf service
|
||||
var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService();
|
||||
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
// the current profile directory
|
||||
// XXX obviously, this shouldn't be hard-coded
|
||||
profiledir = 'file:///D|/tmp/flash/';
|
||||
|
||||
// the location of the flash registry.
|
||||
flashdb = profiledir + 'flash-registry.rdf';
|
||||
|
||||
|
||||
function Init()
|
||||
{
|
||||
dump('Init!\n');
|
||||
|
||||
var tree = document.getElementById('tree');
|
||||
|
||||
// Install all the datasources named in the Flash Registry into
|
||||
// the tree control. Datasources are listed as members of the
|
||||
// NC:FlashDataSources sequence, and are loaded in the order that
|
||||
// they appear in that sequence.
|
||||
var registry = RDF.GetDataSource(flashdb);
|
||||
|
||||
var flashdatasources = Components.classes['component://netscape/rdf/container'].createInstance();
|
||||
flashdatasources = flashdatasources.QueryInterface(Components.interfaces.nsIRDFContainer);
|
||||
|
||||
flashdatasources.Init(registry, RDF.GetResource('NC:FlashDataSources'));
|
||||
|
||||
var enumerator = flashdatasources.GetElements();
|
||||
while (enumerator.HasMoreElements()) {
|
||||
var service = enumerator.GetNext();
|
||||
service = service.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
|
||||
dump('adding "' + service.Value + '" to the tree\n');
|
||||
|
||||
// XXX should be in a "try" block b/c this could fail if a
|
||||
// datasource URI is bogus.
|
||||
var datasource = RDF.GetDataSource(service.Value);
|
||||
tree.database.AddDataSource(datasource);
|
||||
}
|
||||
|
||||
// Install all of the stylesheets in the Flash Registry into the
|
||||
// panel.
|
||||
|
||||
// TODO
|
||||
|
||||
// XXX hack to force the tree to rebuild
|
||||
var treebody = document.getElementById('NC:FlashRoot');
|
||||
treebody.setAttribute('id', 'NC:FlashRoot');
|
||||
}
|
||||
|
||||
function OpenURL(node)
|
||||
{
|
||||
dump("open-url(" + node + ")\n");
|
||||
}
|
||||
|
||||
|
||||
// To get around "window.onload" not working in viewer.
|
||||
function Boot()
|
||||
{
|
||||
var tree = document.getElementById('tree');
|
||||
if (tree == null) {
|
||||
setTimeout(Boot, 0);
|
||||
}
|
||||
else {
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(Boot, 0);
|
31
rdf/resources/flash.xul
Normal file
31
rdf/resources/flash.xul
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="resource:/res/rdf/sidebar.css" type="text/css"?>
|
||||
|
||||
<window
|
||||
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="flash.js" />
|
||||
|
||||
<tree id="tree"
|
||||
flex="100%"
|
||||
datasources="rdf:bookmarks"
|
||||
onclick="OpenURL(event.target.parentNode);">
|
||||
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#source" />
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#description" />
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#timestamp" />
|
||||
|
||||
<!-- XXX We probably won't have a treehead in the end, but we'll put it here for now... -->
|
||||
<treehead>
|
||||
<treeitem>
|
||||
<treecell>Source</treecell>
|
||||
<treecell>Description</treecell>
|
||||
<treecell>Time</treecell>
|
||||
</treeitem>
|
||||
</treehead>
|
||||
|
||||
<treebody id="NC:FlashRoot" rdf:containment="http://home.netscape.com/NC-rdf#child" />
|
||||
</tree>
|
||||
</window>
|
16
rdf/resources/remote-flash-1.rdf
Normal file
16
rdf/resources/remote-flash-1.rdf
Normal file
@ -0,0 +1,16 @@
|
||||
<!-- Mode: SGML -->
|
||||
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<RDF:Description about="NC:FlashRoot">
|
||||
<NC:child>
|
||||
<RDF:Description id="flash1">
|
||||
<NC:type resource="http://home.netscape.com/NC-rdf#StockFlash" />
|
||||
<NC:source>StockWatch</NC:source>
|
||||
<NC:description>AOL 162 (+15 1/2)</NC:description>
|
||||
<NC:timestamp>Tue Apr 27 01:05:34 PDT 1999</NC:timestamp>
|
||||
</RDF:Description>
|
||||
</NC:child>
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
15
rdf/resources/remote-flash-2.rdf
Normal file
15
rdf/resources/remote-flash-2.rdf
Normal file
@ -0,0 +1,15 @@
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<RDF:Description about="NC:FlashRoot">
|
||||
<NC:child>
|
||||
<RDF:Description id="flash2">
|
||||
<NC:type resource="http://home.netscape.com/NC-rdf#OnlinePresence" />
|
||||
<NC:source>Chris Waterson</NC:source>
|
||||
<NC:description>Are you there?</NC:description>
|
||||
<NC:timestamp>Tue Apr 27 01:05:34 PDT 1999</NC:timestamp>
|
||||
</RDF:Description>
|
||||
</NC:child>
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
||||
|
15
rdf/resources/remote-flash-3.rdf
Normal file
15
rdf/resources/remote-flash-3.rdf
Normal file
@ -0,0 +1,15 @@
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<RDF:Description about="NC:FlashRoot">
|
||||
<NC:child>
|
||||
<RDF:Description id="flash3">
|
||||
<NC:type resource="http://home.netscape.com/NC-rdf#Biff" />
|
||||
<NC:source>Inbox</NC:source>
|
||||
<NC:description>3 new messages</NC:description>
|
||||
<NC:timestamp>Tue Apr 27 01:05:34 PDT 1999</NC:timestamp>
|
||||
</RDF:Description>
|
||||
</NC:child>
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
||||
|
Loading…
Reference in New Issue
Block a user