Move sidebar files into componnent directory

This commit is contained in:
slamm%netscape.com 1999-08-03 22:50:42 +00:00
parent 8057a954de
commit ea6953e9a8
20 changed files with 5 additions and 1247 deletions

View File

@ -27,11 +27,11 @@ include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
FILES = \
article.gif \
customize.css \
customize.js \
customize.xul \
document.gif \
article.gif \
document.gif \
folder-closed.gif \
folder-open.gif \
loading.gif \
dom-test-1.xul \
dom-test-2.xul \
dom-test-3.xul \
@ -41,28 +41,7 @@ FILES = \
dom-test-6.xul \
dom-test-7.xul \
dom-test-8.xul \
dummy-flash.rdf \
flash-registry.rdf \
flash.css \
flash.js \
flash.xul \
flames.gif \
folder-closed.gif \
folder-open.gif \
ignore-test.xul \
list-down.gif \
list-down-dis.gif \
list-up.gif \
list-up-dis.gif \
loading.gif \
online.gif \
sidebar.css \
sidebar.js \
sidebar-browser.rdf \
sidebar-browser.xul \
sidebar-registry.rdf \
stock.gif \
unread.gif \
xpidl-test-1.xul \
$(NULL)

View File

@ -1,64 +0,0 @@
/* -*- Mode: C; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
Style rules specific to the Customize dialog.
*/
#main-box {
padding: 1px;
}
div.title {
font: 4mm tahoma,arial,helvetica,sans-serif;
margin: 2px;
}
box.box-group {
padding: 2px;
}
box.button-group {
padding: 1mm;
}
#selectList {
width: 12em;
}
#tree {
width: 17em;
}
titledbutton.up {
list-style-image:url(resource:/res/rdf/list-up.gif);
}
titledbutton.up[disabled="true"] {
list-style-image:url(resource:/res/rdf/list-up-dis.gif);
}
titledbutton.down {
list-style-image:url(resource:/res/rdf/list-down.gif);
}
titledbutton.down[disabled="true"] {
list-style-image:url(resource:/res/rdf/list-down-dis.gif);
}

View File

@ -1,300 +0,0 @@
// -*- Mode: Java -*-
// the rdf service
var RDF;
var NC = "http://home.netscape.com/NC-rdf#";
var sidebar;
function Init()
{
RDF=Components.classes['component://netscape/rdf/rdf-service'].getService();
RDF=RDF.QueryInterface(Components.interfaces.nsIRDFService);
sidebar = new Object;
sidebar.db = window.arguments[0];
sidebar.resource = window.arguments[1];
var registry;
try {
// First try to construct a new one and load it
// synchronously. nsIRDFService::GetDataSource() loads RDF/XML
// asynchronously by default.
registry = Components.classes['component://netscape/rdf/datasource?name=xml-datasource'].createInstance();
registry = registry.QueryInterface(Components.interfaces.nsIRDFDataSource);
var remote = registry.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
remote.Init(sidebar.db); // this will throw if it's already been opened and registered.
// read it in synchronously.
remote.Refresh(true);
}
catch (ex) {
// if we get here, then the RDF/XML has been opened and read
// once. We just need to grab the datasource.
registry = RDF.GetDataSource(sidebar.db);
}
// Create a 'container' wrapper around the sidebar.resources
// resource so we can use some utility routines that make access a
// bit easier.
var sb_datasource = Components.classes['component://netscape/rdf/container'].createInstance();
sb_datasource = sb_datasource.QueryInterface(Components.interfaces.nsIRDFContainer);
sb_datasource.Init(registry, RDF.GetResource(sidebar.resource));
// Now enumerate all of the flash datasources.
var enumerator = sb_datasource.GetElements();
var count = 0;
while (enumerator.HasMoreElements()) {
count = ++count;
var service = enumerator.GetNext();
service = service.QueryInterface(Components.interfaces.nsIRDFResource);
addOption(registry, service);
}
enableButtons();
}
function addOption(registry, service) {
var option_title = getAttr(registry, service, 'title');
var option_customize = getAttr(registry, service, 'customize');
var option_content = getAttr(registry, service, 'content');
var optionSelect = createOptionTitle(option_title);
var option = document.createElement('html:option');
option.setAttribute('title', option_title);
option.setAttribute('customize', option_customize);
option.setAttribute('content', option_content);
option.appendChild(optionSelect);
var sideoption = document.getElementById('selectList');
sideoption.appendChild(option);
}
function createOptionTitle(titletext)
{
var title = document.createElement('html:option');
var textOption = document.createTextNode(titletext);
title.appendChild(textOption);
return textOption;
}
function getAttr(registry,service,attr_name) {
var attr = registry.GetTarget(service,
RDF.GetResource(NC + attr_name),
true);
if (attr)
attr = attr.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (attr)
attr = attr.Value;
return attr;
}
function selectChange() {
enableButtons();
}
function moveUp() {
var list = document.getElementById('selectList');
var index = list.selectedIndex;
if (index > 0) {
var optionBefore = list.childNodes.item(index-1);
var selectedOption = list.childNodes.item(index);
list.remove(index);
list.insertBefore(selectedOption, optionBefore);
list.selectedIndex = index - 1;
enableButtons();
enableSave();
}
}
function moveDown() {
var list = document.getElementById('selectList');
var index = list.selectedIndex;
if (index != -1 &&
index != list.options.length - 1) {
var selectedOption = list.childNodes.item(index);
var optionAfter = list.childNodes.item(index+1);
list.remove(index+1);
list.insertBefore(optionAfter, selectedOption);
enableButtons();
enableSave();
}
}
function enableButtons() {
var up = document.getElementById('up');
var down = document.getElementById('down');
var list = document.getElementById('selectList');
var customize = document.getElementById('customize-button');
var index = list.selectedIndex;
var isFirst = index == 0;
var isLast = index == list.options.length - 1;
// up /\ button
if (isFirst) {
up.setAttribute('disabled', 'true');
} else {
up.setAttribute('disabled', '');
}
// down \/ button
if (isLast) {
down.setAttribute('disabled', 'true');
} else {
down.setAttribute('disabled', '');
}
// "Customize..." button
var customizeURL = null;
if (index != -1) {
var option = list.childNodes.item(index);
customizeURL = option.getAttribute('customize');
}
if (customizeURL == 'null') {
customize.setAttribute('disabled','true');
} else {
customize.setAttribute('disabled','');
}
}
function RemovePanel()
{
var list = document.getElementById('selectList');
var index = list.selectedIndex;
if (index != -1) {
// XXX prompt user
list.options[index] = null;
}
enableSave();
}
// Note that there is a bug with resource: URLs right now.
var FileURL = "file:////u/slamm/tt/sidebar-browser.rdf";
// var the "NC" namespace. Used to construct resources
function Save()
{
// Open the RDF file synchronously. This is tricky, because
// GetDataSource() will do it asynchronously. So, what we do is
// this. First try to manually construct the RDF/XML datasource
// and read it in. This might throw an exception if the datasource
// has already been read in once. In which case, we'll just get
// the existing datasource from the RDF service.
var datasource;
try {
datasource = Components.classes["component://netscape/rdf/datasource?name=xml-datasource"].createInstance();
datasource = datasource.QueryInterface(Components.interfaces.nsIRDFXMLDataSource);
//datasource.Init(FileURL);
datasource.Init(sidebar.db);
datasource.Open(true);
dump("datasource = " + datasource + ", opened for the first time.\n");
}
catch (ex) {
//datasource = RDF.GetDataSource(FileURL);
datasource = RDF.GetDataSource(sidebar.db);
dump("datasource = " + datasource + ", using registered datasource.\n");
}
// Create a "container" wrapper around the "NC:BrowserSidebarRoot"
// object. This makes it easier to manipulate the RDF:Seq correctly.
var container = Components.classes["component://netscape/rdf/container"].createInstance();
container = container.QueryInterface(Components.interfaces.nsIRDFContainer);
container.Init(datasource, RDF.GetResource(sidebar.resource));
dump("initialized container " + container + " on " + sidebar.resource+"\n");
// Remove all the current panels
//
var enumerator = container.GetElements();
while (enumerator.HasMoreElements()) {
var service = enumerator.GetNext();
service = service.QueryInterface(Components.interfaces.nsIRDFResource);
container.RemoveElement(service, true);
}
// Add the new panel list
//
var count = container.GetCount();
dump("container has " + count + " elements\n");
var list = document.getElementById('selectList');
var list_length = list.childNodes.length;
for (var ii=0; ii < list_length; ii++, count++) {
dump(list.childNodes.item(ii).getAttribute('title') + '\n');
var title = list.childNodes.item(ii).getAttribute('title');
var content = list.childNodes.item(ii).getAttribute('content');
var customize = list.childNodes.item(ii).getAttribute('customize');
var element = RDF.GetResource(FileURL + "#" + count);
dump(FileURL + "#" + count + "\n");
container.AppendElement(element);
dump("appended " + element + " to the container\n");
// Now make some sidebar-ish assertions about it...
datasource.Assert(element,
RDF.GetResource(NC + "title"),
RDF.GetLiteral(title + ' ' + count),
true);
datasource.Assert(element,
RDF.GetResource(NC + "content"),
RDF.GetLiteral(content),
true);
datasource.Assert(element,
RDF.GetResource(NC + "customize"),
RDF.GetLiteral(customize),
true);
dump("added assertions about " + element + "\n");
}
// Now serialize it back to disk
datasource.Flush();
dump("wrote " + FileURL + " back to disk.\n");
//window.close();
}
function selected()
{
var add_button = document.getElementById('add_button');
var preview_button = document.getElementById('preview_button');
var select_list = document.getElementsByAttribute("selected", "true");
if (select_list.length >= 1) {
add_button.setAttribute('disabled','');
preview_button.setAttribute('disabled','');
} else {
add_button.setAttribute('disabled','true');
preview_button.setAttribute('disabled','true');
}
}
function AddPanel()
{
var tree = document.getElementById('other-panels');
var database = tree.database;
var select_list = document.getElementsByAttribute("selected", "true");
for (var nodeIndex=0; nodeIndex<select_list.length; nodeIndex++) {
var node = select_list[nodeIndex];
if (!node) break;
var id = node.getAttribute("id");
if (!id) break;
var rdfNode = RDF.GetResource(id);
if (!rdfNode) break;
addOption(database,rdfNode);
}
enableSave();
}
function enableSave() {
var save_button = document.getElementById('save_button');
save_button.setAttribute('disabled','');
}

View File

@ -1,115 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://sidebar/skin/" type="text/css"?>
<?xml-stylesheet href="resource:/res/rdf/customize.css" type="text/css"?>
<!DOCTYPE window>
<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"
onload="Init();">
<html:script src="resource:/res/rdf/customize.js" />
<box align="vertical" flex="100%" id="main-box">
<html:div class="title">
Current Panels
</html:div>
<box align="horizontal" class="box-group">
<box align="vertical">
<spring flex="50%"/>
<titledbutton onclick="moveUp();" id="up" class="borderless up" />
<titledbutton onclick="moveDown();" id="down" class="borderless down" />
<spring flex="50%"/>
</box>
<html:form name="one" >
<html:select name="two" id="selectList" size="10"
onclick="selectChange();">
</html:select>
</html:form>
<box align="vertical" class="button-group">
<spring flex="50%"/>
<titledbutton id="customize-button" onclick="" value="Customize..." />
<titledbutton onclick="RemovePanel()" value="Remove" />
<spring flex="50%"/>
</box>
</box>
<html:hr/>
<html:div class="title">
Select a Panel to Add
</html:div>
<box align="horizontal" class="box-group">
<tree id="other-panels" style="width:15em;height:15em;"
datasources="resource:/res/rdf/sidebar-registry.rdf"
onclick="selected()"
ref="NC:SidebarRoot" >
<!-- The template we'll use to build rows in the content model. -->
<template>
<rule>
<treechildren>
<treeitem uri="..." type="rdf:http://home.netscape.com/NC-rdf#type">
<treerow>
<treecell>
<treeindentation />
<titledbutton align="right"
value="rdf:http://home.netscape.com/NC-rdf#title" />
</treecell>
</treerow>
</treeitem>
</treechildren>
</rule>
</template>
<treehead>
<treerow>
<treecell>Name</treecell>
</treerow>
</treehead>
</tree>
<box align="vertical" class="button-group">
<spring flex="50%"/>
<titledbutton id="add_button" onclick="AddPanel()" value="Add"
disabled="true"/>
<titledbutton id="preview_button" onclick="" value="Preview..."
disabled="true"/>
<spring flex="50%"/>
</box>
</box>
<html:a href="http://dmoz.org/Computers/Internet/WWW/Web_Portals/Netscape.com/My_Netscape_Network/">
Find more panels
</html:a>
|
<html:a href="http://my.netscape.com/publish/">
Create a panel
</html:a>
<html:hr/>
<box align="horizontal">
<spring flex="48%"/>
<titledbutton onclick="window.close()" value="Cancel" />
<spring flex="4%"/>
<titledbutton id="save_button" onclick="Save();" value="Save"
disabled="true"/>
<spring flex="48%"/>
</box>
</box>
</window>

View File

@ -1,15 +0,0 @@
<?xml version="1.0"?> <!-- 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="flash">
<NC:type resource='http://www.mozilla.org/RDF#Flash' />
<NC:source>Dummy</NC:source>
<NC:description>Testing 1-2-3</NC:description>
<NC:timestamp>Jul 30 15:02 1999</NC:timestamp>
</RDF:Description>
</NC:child>
</RDF:Description>
</RDF:RDF>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -1,30 +0,0 @@
<?xml version="1.0"?> <!-- -*- 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:Bag about="NC:FlashDataSources">
<RDF:li>
<!-- The Tinderbox Flash -->
<RDF:Description about="http://cvs-mirror.mozilla.org/webtools/tinderbox/SeaMonkey/flash.rdf">
<NC:poll-interval>300</NC:poll-interval>
</RDF:Description>
</RDF:li>
<RDF:li>
<!-- Messenger Flashes -->
<RDF:Description about="rdf:msgnotifications" />
</RDF:li>
<!-- for testing purposes only -->
<!--
<RDF:li>
<RDF:Description about="resource:/res/rdf/dummy-flash.rdf">
<NC:poll-interval>15</NC:poll-interval>
</RDF:Description>
</RDF:li>
-->
</RDF:Bag>
<RDF:Bag about="NC:FlashStyleSheets">
</RDF:Bag>
</RDF:RDF>

View File

@ -1,21 +0,0 @@
/* -*- Mode: C; c-basic-offset: 2 -*-
Style rules specific to the Flash Panel. These are kludged right now.
*/
window {
background-color: white;
}
treeitem[type="http://www.mozilla.org/RDF#TinderboxFlash"] > treerow > treecell > titledbutton {
list-style-image: url("resource:/res/rdf/flames.gif");
}
treeitem[type="http://home.netscape.com/NC-rdf#MsgNewMessages"] > treerow > treecell > titledbutton {
list-style-image: url("chrome://messenger/skin/folderHasMail.gif");
}
treeitem[type="http://www.mozilla.org/rdf#XPInstallNotification"] > treerow > treecell > titledbutton {
list-style-image: url("resource:/res/rdf/document.gif");
}

View File

@ -1,156 +0,0 @@
/* -*- Mode: Java; tab-width: 4; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// 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
var profiledir = 'resource:/res/rdf/';
// the location of the flash registry.
var flashdb = profiledir + 'flash-registry.rdf';
function Init()
{
// Initialize the Flash panel.
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;
try {
// First try to construct a new one and load it
// synchronously. nsIRDFService::GetDataSource() loads RDF/XML
// asynchronously by default.
registry = Components.classes['component://netscape/rdf/datasource?name=xml-datasource'].createInstance();
registry = registry.QueryInterface(Components.interfaces.nsIRDFDataSource);
var remote = registry.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
remote.Init(flashdb); // this will throw if it's already been opened and registered.
// read it in synchronously.
remote.Refresh(true);
}
catch (ex) {
// if we get here, then the RDF/XML has been opened and read
// once. We just need to grab the datasource.
registry = RDF.GetDataSource(flashdb);
}
// Create a 'container' wrapper around the NC:FlashDataSources
// resource so we can use some utility routines that make access a
// bit easier.
var flashdatasources = Components.classes['component://netscape/rdf/container'].createInstance();
flashdatasources = flashdatasources.QueryInterface(Components.interfaces.nsIRDFContainer);
flashdatasources.Init(registry, RDF.GetResource('NC:FlashDataSources'));
// Now enumerate all of the flash datasources.
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');
try {
// Create a new RDF/XML datasource. If this is a 'remote'
// datasource (e.g., a 'http:' URL), it will be loaded
// asynchronously.
var flashservice = RDF.GetDataSource(service.Value);
flashservice = flashservice.QueryInterface(Components.interfaces.nsIRDFDataSource);
// Add it to the tree control's composite datasource.
tree.database.AddDataSource(flashservice);
var pollInterval =
registry.GetTarget(service,
RDF.GetResource('http://home.netscape.com/NC-rdf#poll-interval'),
true);
if (pollInterval)
pollInterval = pollInterval.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (pollInterval)
pollInterval = pollInterval.Value;
if (pollInterval) {
dump(service.Value + ': setting poll interval to ' + pollInterval + 'sec.\n');
Schedule(service.Value, pollInterval);
}
}
catch (ex) {
dump('an exception occurred trying to load "' + service.Value + '":\n');
dump(ex + '\n');
}
}
// Install all of the stylesheets in the Flash Registry into the
// panel.
// TODO
// XXX hack to force the tree to rebuild
tree.setAttribute('ref', 'NC:FlashRoot');
}
function Reload(url, pollInterval)
{
// Reload the specified datasource and reschedule.
dump('Reload(' + url + ', ' + pollInterval + ')\n');
var datasource = RDF.GetDataSource(url);
datasource = datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
// Reload, asynchronously.
datasource.Refresh(false);
// Reschedule
Schedule(url, pollInterval);
}
function Schedule(url, pollInterval)
{
setTimeout('Reload("' + url + '", ' + pollInterval + ')', pollInterval * 1000);
}
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);

View File

@ -1,80 +0,0 @@
<?xml version="1.0"?> <!-- -*- Mode: SGML -*- -->
<!--
The contents of this file are subject to the Netscape Public License
Version 1.0 (the "NPL"); you may not use this file except in
compliance with the NPL. You may obtain a copy of the NPL at
http://www.mozilla.org/NPL/
Software distributed under the NPL is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
for the specific language governing rights and limitations under the
NPL.
The Initial Developer of this code under the NPL is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998 Netscape Communications Corporation. All Rights
Reserved.
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://sidebar/skin/" type="text/css"?>
<?xml-stylesheet href="resource:/res/rdf/flash.css" type="text/css"?>
<!DOCTYPE window
[
<!ENTITY tree.header.source.label "Source">
<!ENTITY tree.header.description.label "Description">
<!ENTITY tree.header.time.label "Time">
]>
<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"
align="vertical">
<html:script src="flash.js" />
<tree id="tree"
ref="NC:FlashRoot"
flex="100%"
style="height: 100%"
datasources="rdf:null"
rdf:containment="http://home.netscape.com/NC-rdf#child"
onclick="OpenURL(event.target.parentNode.parentNode);">
<template>
<treechildren>
<treeitem uri="..." type="rdf:http://home.netscape.com/NC-rdf#type">
<treerow>
<treecell>
<treeindentation />
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#source" align="left" />
</treecell>
<treecell>
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#description" align="left"
style="list-style-image: none;" />
</treecell>
<treecell>
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#timestamp" align="left"
style="list-style-image: none;" />
</treecell>
</treerow>
</treeitem>
</treechildren>
</template>
<!-- remove the TREEHEAD when bug 9923 is fixed. -->
<treehead>
<treerow>
<treecell/>
<treecell/>
<treecell/>
</treerow>
</treehead>
</tree>
</window>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 B

View File

@ -21,12 +21,6 @@ MODULE=rdf
include <$(DEPTH)\config\rules.mak>
FILES=\
article.gif \
customize.css \
customize.js \
customize.xul \
sidebar-registry.rdf \
document.gif \
dom-test-1.xul \
dom-test-2.xul \
dom-test-3.xul \
@ -36,27 +30,7 @@ FILES=\
dom-test-6.xul \
dom-test-7.xul \
dom-test-8.xul \
dummy-flash.rdf \
flash-registry.rdf \
flash.css \
flash.js \
flash.xul \
flames.gif \
folder-closed.gif \
folder-open.gif \
ignore-test.xul \
list-down.gif \
list-down-dis.gif \
list-up.gif \
list-up-dis.gif \
loading.gif \
online.gif \
sidebar.css \
sidebar.js \
sidebar-browser.rdf \
sidebar-browser.xul \
stock.gif \
unread.gif \
xpidl-test-1.xul \
$(NULL)

View File

@ -1,44 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE RDF
[
<!ENTITY sidebar.whats-related.label "What's Related">
<!ENTITY sidebar.flash.label "Flashes">
<!ENTITY sidebar.tinderbox.label "Tinderbox">
<!ENTITY sidebar.bookmarks.label "Bookmarks">
]>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:NC="http://home.netscape.com/NC-rdf#">
<RDF:Seq about="NC:BrowserSidebarRoot">
<RDF:li>
<RDF:Description ID="whats-related">
<NC:title>&sidebar.whats-related.label;</NC:title>
<NC:content>resource:/res/samples/related-panel.xul</NC:content>
<NC:customize>resource:/res/samples/related-panel-cust.xul</NC:customize>
</RDF:Description>
</RDF:li>
<RDF:li>
<RDF:Description ID="flash">
<NC:title>&sidebar.flash.label;</NC:title>
<NC:content>resource:/res/rdf/flash.xul</NC:content>
<NC:customize>resource:/res/rdf/flash-cust.xul</NC:customize>
<NC:height>5em</NC:height>
</RDF:Description>
</RDF:li>
<RDF:li>
<RDF:Description ID="tinderbox">
<NC:title>&sidebar.tinderbox.label;</NC:title>
<NC:content>http://cvs-mirror.mozilla.org/webtools/tinderbox/SeaMonkey/panel.html</NC:content>
</RDF:Description>
</RDF:li>
<RDF:li>
<RDF:Description ID="bookmarks">
<NC:title>&sidebar.bookmarks.label;</NC:title>
<NC:content>resource:/res/samples/bm-panel.xul</NC:content>
<NC:customize>resource:/res/samples/bm-panel-cust.xul</NC:customize>
</RDF:Description>
</RDF:li>
</RDF:Seq>
</RDF:RDF>

View File

@ -1,30 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://sidebar/skin/" type="text/css"?>
<!DOCTYPE window
[
<!ENTITY sidebar.reload.label "reload">
<!ENTITY sidebar.customize.label "customize...">
]>
<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"
onload="Init('resource:/res/rdf/sidebar-browser.rdf',
'NC:BrowserSidebarRoot');" align="vertical">
<html:script src="resource:/res/rdf/sidebar.js" />
<box id="sidebox" align="vertical" flex="100%">
<box class="sidebartitle">
<spring flex="100%"/>
<titledbutton class="borderless paneltitle"
value="&sidebar.reload.label;"
onclick="window.location.reload()" />
<titledbutton class="borderless paneltitle"
value="&sidebar.customize.label;"
onclick="dialogWindow=customize();" />
</box>
</box>
</window>

View File

@ -1,36 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE RDF
[
<!ENTITY sidebar.whats-related.label "What's Related">
<!ENTITY sidebar.flash.label "Flashes">
<!ENTITY sidebar.tinderbox.label "Mozilla Tinderbox">
<!ENTITY sidebar.bookmarks.label "Bookmarks">
]>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:NC="http://home.netscape.com/NC-rdf#">
<RDF:Seq about="NC:SidebarRoot">
<RDF:li>
<RDF:Description ID="Headlines">
<NC:title>Headlines</NC:title>
<NC:content>http://my.netscape.com/topstories_subchannel.tmpl</NC:content>
<NC:customize>resource:/res/samples/related-panel-cust.xul</NC:customize>
</RDF:Description>
</RDF:li>
<RDF:li>
<RDF:Description ID="Local News">
<NC:title>Local News</NC:title>
<NC:content>http://my.netscape.com/localnews_content.tmpl</NC:content>
<NC:customize>resource:/res/rdf/flash-cust.xul</NC:customize>
</RDF:Description>
</RDF:li>
<RDF:li>
<RDF:Description ID="Weather">
<NC:title>Weather</NC:title>
<NC:content>http://my.netscape.com/weather_content.tmpl</NC:content>
</RDF:Description>
</RDF:li>
</RDF:Seq>
</RDF:RDF>

View File

@ -1,142 +0,0 @@
/* -*- Mode: C; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
Style rules specific to the Sidebar.
*/
iframe
{
height: 125px;
border: 0px;
}
treecell
{
font-family: Verdana, Sans-Serif;
font-size: 8pt;
}
treecell[sortActive="true"][sortDirection="ascending"]
{
background-color: green;
}
treecell[sortActive="true"][sortDirection="descending"]
{
background-color: red;
}
treecol[sortActive="true"]
{
background-color: lightgreen;
}
treehead > treerow > treecell
{
background-color: #c0c0c0;
border: outset 1px;
border-color: white #707070 #707070 white;
vertical-align: middle;
}
treeitem[container="true"][open="true"][loading="true"] > treerow > treecell > titledbutton
{
list-style-image: url("resource:/res/rdf/loading.gif") ! important ;
}
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"][open="true"] > treerow > treecell > titledbutton
{
list-style-image: url("resource:/res/rdf/folder-open.gif");
}
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"] > treerow > treecell > titledbutton
{
list-style-image: url("resource:/res/rdf/folder-closed.gif");
}
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"] > treerow > treecell > titledbutton
{
list-style-image: url("resource:/res/rdf/article.gif");
}
treeitem[container="true"][open="true"] > treerow > treecell > titledbutton
{
list-style-image: url("resource:/res/rdf/folder-open.gif");
}
treeitem[container="true"] > treerow > treecell > titledbutton
{
list-style-image: url("resource:/res/rdf/folder-closed.gif");
}
treeitem > treerow > treecell > titledbutton
{
height: 16px;
width: 16px;
color: inherit;
border: none;
padding: 0px;
margin: 0px;
font: inherit;
}
/*
* Sidebar and Panel title buttons
*/
box#sidebox
{
width: 100%;
height: 100%;
}
box.sidebartitle
{
background-color: #505888;
font: 10pt sans-serif;
}
box.panelbar
{
background-color: #006870;
font: 10pt sans-serif;
}
div.sidebartitlelabel
{
color: white;
padding: 5px;
font: 3mm tahoma,arial,helvetica,sans-serif;
}
titledbutton.paneltitle
{
margin: 1px;
padding: 1px;
color: white;
font: 3mm tahoma,arial,helvetica,sans-serif;
}
treecell titledbutton
{
color: inherit;
}

View File

@ -1,162 +0,0 @@
/* -*- Mode: Java; tab-width: 2; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// the rdf service
var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
var sidebar = new Object;
function Init(sidebar_db, sidebar_resource)
{
// Initialize the Sidebar
sidebar.db = sidebar_db;
sidebar.resource = sidebar_resource;
var registry;
try {
// First try to construct a new one and load it
// synchronously. nsIRDFService::GetDataSource() loads RDF/XML
// asynchronously by default.
registry = Components.classes['component://netscape/rdf/datasource?name=xml-datasource'].createInstance();
registry = registry.QueryInterface(Components.interfaces.nsIRDFDataSource);
var remote = registry.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
remote.Init(sidebar.db); // this will throw if it's already been opened and registered.
// read it in synchronously.
remote.Refresh(true);
}
catch (ex) {
// if we get here, then the RDF/XML has been opened and read
// once. We just need to grab the datasource.
registry = RDF.GetDataSource(sidebar.db);
}
// Create a 'container' wrapper around the sidebar.resources
// resource so we can use some utility routines that make access a
// bit easier.
var sb_datasource = Components.classes['component://netscape/rdf/container'].createInstance();
sb_datasource = sb_datasource.QueryInterface(Components.interfaces.nsIRDFContainer);
sb_datasource.Init(registry, RDF.GetResource(sidebar.resource));
var sidebox = document.getElementById('sidebox');
// Now enumerate all of the flash datasources.
var enumerator = sb_datasource.GetElements();
while (enumerator.HasMoreElements()) {
var service = enumerator.GetNext();
service = service.QueryInterface(Components.interfaces.nsIRDFResource);
var new_panel = createPanel(registry, service);
if (new_panel) {
sidebox.appendChild(new_panel);
}
}
}
function createPanel(registry, service) {
var panel_title = getAttr(registry, service, 'title');
var panel_content = getAttr(registry, service, 'content');
var panel_height = getAttr(registry, service, 'height');
var box = document.createElement('box');
var iframe = document.createElement('html:iframe');
var iframeId = iframe.getAttribute('id');
var panelbar = createPanelTitle(panel_title, iframeId);
box.setAttribute('align', 'vertical');
iframe.setAttribute('src', panel_content);
if (panel_height) {
var height_style = 'height:' + panel_height + ';';
iframe.setAttribute('style', height_style);
iframe.setAttribute('save_height', height_style);
}
box.appendChild(panelbar);
box.appendChild(iframe);
return box;
}
function createPanelTitle(titletext, id)
{
var panelbar = document.createElement('box');
var title = document.createElement('titledbutton');
var spring = document.createElement('spring');
title.setAttribute('value', titletext);
title.setAttribute('class', 'borderless paneltitle');
title.setAttribute('onclick', 'resize("'+id+'")');
spring.setAttribute('flex', '100%');
panelbar.setAttribute('class', 'panelbar');
panelbar.appendChild(title);
panelbar.appendChild(spring);
return panelbar;
}
function getAttr(registry,service,attr_name) {
var attr = registry.GetTarget(service,
RDF.GetResource('http://home.netscape.com/NC-rdf#' + attr_name),
true);
if (attr)
attr = attr.QueryInterface(
Components.interfaces.nsIRDFLiteral);
if (attr)
attr = attr.Value;
return attr;
}
function resize(id) {
var box = document.getElementById('sidebox');
var iframe = document.getElementById(id);
if (iframe.getAttribute('display') == 'none') {
var height_style = iframe.getAttribute('save_height');
iframe.setAttribute('style', height_style + 'visibility:visible');
iframe.setAttribute('display','block');
} else {
iframe.setAttribute('style', 'height:0px; visibility:hidden');
iframe.setAttribute('display','none');
}
}
function customize() {
var newWin = window.openDialog('resource:/res/rdf/customize.xul','New','chrome', sidebar.db, sidebar.resource);
return newWin;
}
function dumpTree(node, depth) {
var indent = "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | + ";
var kids = node.childNodes;
dump(indent.substr(indent.length - depth*2));
// Print your favorite attributes here
dump(node.nodeName)
dump(" "+node.getAttribute('id'));
dump("\n");
for (var ii=0; ii < kids.length; ii++) {
dumpTree(kids[ii], depth + 1);
}
}