[Zope-CVS] CVS: Packages/Moztop/moztop/content/StatusBar - LogMessagesOverlay.xul:1.1 StatusBarOverlay.xul:1.4 TaskManager.js:1.6 TransactionsOverlay.xul:1.2 TasksOverlay.xul:1.3
Paul Everitt
paul@zope.com
Sat, 15 Feb 2003 06:02:30 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/StatusBar
In directory cvs.zope.org:/tmp/cvs-serv19080/StatusBar
Modified Files:
StatusBarOverlay.xul TaskManager.js TransactionsOverlay.xul
TasksOverlay.xul
Added Files:
LogMessagesOverlay.xul
Log Message:
Rewrite finished.
=== Added File Packages/Moztop/moztop/content/StatusBar/LogMessagesOverlay.xul ===
<?xml version="1.0"?>
<overlay id="TasksOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<tabpanel id="logmessages-panel" orient="vertical" flex="1">
<tree id="logmessages-tree" flex="1" height="100"
ref="urn:moztop:logmessages" datasources="rdf:null"
ondblclick="logmanager.viewSelectedMessage();">
<treecols>
<treecol id="title" label="Title" primary="true" flex="2" />
<splitter class="statusbar-splitter"/>
<treecol id="location" label="Location" flex="1" />
<splitter class="statusbar-splitter"/>
<treecol id="time" label="Time" flex="1" sortDirection="descending"
sort="rdf:http://www.zope.org/task#time" sortActive="true" />
</treecols>
<template>
<rule>
<treechildren flex="1">
<treeitem uri="rdf:*">
<treerow>
<treecell label="rdf:http://www.purl.org/dc/1.1#title"/>
<treecell label="rdf:http://www.purl.org/dc/1.1#description"/>
<treecell label="rdf:http://www.zope.org/rdf#time"/>
</treerow>
</treeitem>
</treechildren>
</rule>
</template>
</tree>
</tabpanel>
</overlay>
=== Packages/Moztop/moztop/content/StatusBar/StatusBarOverlay.xul 1.3 => 1.4 ===
--- Packages/Moztop/moztop/content/StatusBar/StatusBarOverlay.xul:1.3 Thu Jan 30 14:01:31 2003
+++ Packages/Moztop/moztop/content/StatusBar/StatusBarOverlay.xul Sat Feb 15 06:01:59 2003
@@ -1,90 +1,26 @@
<?xml version="1.0"?>
-<!--?xul-overlay href="chrome://moztop/content/StatusBar/TasksOverlay.xul"?-->
<?xul-overlay href="chrome://moztop/content/StatusBar/TransactionsOverlay.xul"?>
+<?xul-overlay href="chrome://moztop/content/StatusBar/TasksOverlay.xul"?>
+<?xul-overlay href="chrome://moztop/content/StatusBar/LogMessagesOverlay.xul"?>
<overlay id="StatusBarOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <tabbox id="statusbar" orient="horizontal" align="start" flex="1"
- style="padding: 5px;">
+<tabbox id="statusbar" orient="horizontal" align="start">
- <tabs orient="vertical">
- <tab id="statusbartasks" class="statusboxpanel"
- style="background-image: url('chrome://moztop/content/StatusBar/task.gif');"/>
- <tab id="statusbarerrors" class="statusboxpanel"
- style="background-image: url('chrome://moztop/content/StatusBar/errors.gif');" />
- <tab id="statusbarlog" class="statusboxpanel"
- style="background-image: url('chrome://moztop/content/StatusBar/errors.gif');" />
- </tabs>
- <tabpanels style="border-top: 3px solid;
- border-left: 1px solid;
- -moz-border-top-colors: #000000 #DFE2E6 #D0D7DD;
- "
- flex="1">
- <tabpanel id="mailtab" orient="vertical" flex="1">
-<tree id="tasks-tree" flex="1" seltype="multiple"
- datasources="rdf:null"
- flags="dont-build-content"
- containment="http://www.zope.org/rdf/task#child">
- <treecols>
- <treecol id="id" label="Id" flex="1" style="text-align: right"/>
- <treecol id="name" label="Name" primary="true" flex="8" />
- <splitter/>
- <treecol id="descr" label="Description" flex="16" />
- <splitter/>
- <treecol id="status" label="Status" flex="3" />
- </treecols>
-
- <template>
- <rule>
- <treechildren flex="1">
- <treeitem uri="rdf:*">
- <treerow>
- <treecell label="rdf:http://www.zope.org/rdf/task#id"/>
- <treecell label="rdf:http://www.zope.org/rdf/task#name"/>
- <treecell label="rdf:http://www.zope.org/rdf/task#descr"/>
- <treecell label="rdf:http://www.zope.org/rdf/task#status"/>
- </treerow>
- </treeitem>
- </treechildren>
- </rule>
- </template>
-</tree>
- </tabpanel>
- <tabpanel id="transactions-panel" />
-
-
-
- <tabpanel id="logtab" orient="vertical" flex="1">
-<tree id="logmessages-tree" flex="1" ref="urn:moztop:logmessages"
- datasources="rdf:null"
- ondblclick="logmanager.viewSelectedMessage();">
- <treecols>
- <treecol id="title" label="Title" primary="true" flex="2" />
- <splitter/>
- <treecol id="location" label="Location" flex="1" />
- <splitter/>
- <treecol id="time" label="Time" flex="1" sortDirection="descending"
- sort="rdf:http://www.zope.org/rdf/task#time" sortActive="true" />
- </treecols>
-
- <template>
- <rule>
- <treechildren flex="1">
- <treeitem uri="rdf:*">
- <treerow>
- <treecell label="rdf:http://www.zope.org/rdf/task#title"/>
- <treecell label="rdf:http://www.zope.org/rdf/task#location"/>
- <treecell label="rdf:http://www.zope.org/rdf/task#time"/>
- </treerow>
- </treeitem>
- </treechildren>
- </rule>
- </template>
-</tree>
-</tabpanel>
-
- </tabpanels>
- </tabbox>
-</overlay>
\ No newline at end of file
+ <tabs orient="vertical">
+ <tab id="statusbarlog" tooltiptext="Log Messages"/>
+ <tab id="statusbartasks" tooltiptext="Tasks"/>
+ <tab id="statusbarerrors" tooltiptext="Errors"/>
+ </tabs>
+
+ <tabpanels flex="1">
+ <tabpanel id="logmessages-panel"/>
+ <tabpanel id="tasks-panel"/>
+ <tabpanel id="transactions-panel"/>
+ </tabpanels>
+
+</tabbox>
+
+</overlay>
=== Packages/Moztop/moztop/content/StatusBar/TaskManager.js 1.5 => 1.6 ===
--- Packages/Moztop/moztop/content/StatusBar/TaskManager.js:1.5 Fri Feb 7 06:34:08 2003
+++ Packages/Moztop/moztop/content/StatusBar/TaskManager.js Sat Feb 15 06:01:59 2003
@@ -17,33 +17,52 @@
******************************************************************************/
+/* Now subclass, then add methods */
+LogManager.prototype = new DataSourceManager();
+LogManager.prototype.constructor = LogManager;
+LogManager.superclass = DataSourceManager;
function LogManager () {
- // This prototype manages interaction with the log viewer.
- // It creates an RDFDataSource from rdfds.js, grabs the
- // existing datasource from the logmessages-tree. It also
- // knows how to add messages and view the selected message.
- // Finally, it has a method for viewing the RDF contents in
- // a popup text box.
+ /* This prototype manages interaction with the log viewer.
+ It creates an RDFDataSource from rdfds.js, grabs the
+ existing datasource from the logmessages-tree. It also
+ knows how to add messages and view the selected message.
+ Finally, it has a method for viewing the RDF contents in
+ a popup text box. */
+
+ if( !(this instanceof LogManager) ) return new LogManager( );
+ DataSourceManager.call(this);
+
+ this.dcns = "http://www.purl.org/dc/1.1#";
+ this.zoperdfns = "http://www.zope.org/rdf#";
+ this.ncns ="http://home.netscape.com/NC-rdf#";
+
+ this.titleprop = this.dcns + "title";
+ this.descriptionprop = this.dcns + "description";
+ this.resourcetypeprop = this.zoperdfns + "resourcetype";
+ this.urlprop = this.zoperdfns + "url";
+ this.usernameprop = this.zoperdfns + "username";
+ this.passwordprop = this.zoperdfns + "password";
+ this.styleidprop = this.zoperdfns + "styleid";
+ this.subitemsprop = this.ncns + "subitems";
+
+ this.profileurl = this.getProfileDirURL();
+ this.elementid = null;
this.elementid = "logmessages-tree";
this.ds = new RDFDataSource();
this.urn = "urn:moztop:logmessages";
- this.titleref = "http://www.zope.org/rdf/task#title";
- this.locationref = "http://www.zope.org/rdf/task#location";
- this.timeref = "http://www.zope.org/rdf/task#time";
- this.messageref = "http://www.zope.org/rdf/task#message";
+ this.timeprop = "http://www.zope.org/rdf#time";
+ this.messageprop = "http://www.zope.org/rdf#message";
- // this.loadDataSource();
}
+
LogManager.prototype.attachDataSource=
function()
{
-
- // This is called once, when the overlay is first
- // loaded, to attach the datasource to the tree.
+ /* Called once when log is first loaded */
var lms=this.ds.getNode(this.urn);
lms.makeSeq();
@@ -57,17 +76,17 @@
return;
}
-LogManager.prototype.addMessage = function (title, location, msg) {
-
- var d = new Date();
- var now = d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds();
- var rootnode = this.ds.getNode(this.urn);
- var thismsg = this.ds.getNode(this.urn + ":" + now);
- rootnode.addChild(thismsg);
- thismsg.addTarget(this.titleref,title);
- thismsg.addTarget(this.locationref,location);
- thismsg.addTarget(this.timeref,now);
- thismsg.addTarget(this.messageref,msg);
+LogManager.prototype.addMessage = function (msgtitle, msglocation, msg) {
+ /* title is the short message, msg is full text displayed on dblclick */
+ var d = new Date();
+ var now = d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds();
+ var rootnode = this.ds.getNode(this.urn);
+ var thismsg = this.ds.getNode(this.urn + ":" + d.getTime());
+ rootnode.addChild(thismsg);
+ thismsg.addTarget(this.titleprop,msgtitle);
+ thismsg.addTarget(this.descriptionprop,msglocation);
+ thismsg.addTarget(this.timeprop,now);
+ thismsg.addTarget(this.messageprop,msg);
}
@@ -83,14 +102,15 @@
// Grab the RDF value and popup a dialog window
var n = this.ds.getNode(rdf.Value);
- var nt = n.getTarget(this.messageref);
+ var nt = n.getTarget(this.messageprop);
window.openDialog("chrome://moztop/content/StatusBar/LogMessageDialog.xul",
"viewlogmessage","chrome",nt.getValue());
- //alert('viewing log message ' + nt.getValue());
-
}
+
+
+
/* Initialize Tasks datasource. */
var tasks_source =
Components
@@ -101,7 +121,7 @@
function initTaskList() {
// Remember that logmanager was defined globally, but not initialized.
- logmanager = new LogManager();
+ logmanager = LogManager();
logmanager.attachDataSource();
var tree = document.getElementById("tasks-tree");
tree.database.AddDataSource(tasks_source);
@@ -163,14 +183,3 @@
}
}
-
-function viewLogMessage () {
- var tree = document.getElementById("logmessages-tree");
- var index = tree.view.selection.currentIndex;
- var rdf = tree.view.getItemAtIndex(index).resource;
-
- // Grab the datasources
- var n = logds.getNode(rdf.Value);
- var nt = n.getTarget("http://www.zope.org/rdf/task#title");
- alert('viewing log message ' + nt);
-}
=== Packages/Moztop/moztop/content/StatusBar/TransactionsOverlay.xul 1.1.1.1 => 1.2 ===
--- Packages/Moztop/moztop/content/StatusBar/TransactionsOverlay.xul:1.1.1.1 Sun Jan 12 17:30:15 2003
+++ Packages/Moztop/moztop/content/StatusBar/TransactionsOverlay.xul Sat Feb 15 06:01:59 2003
@@ -5,15 +5,16 @@
<tabpanel id="transactions-panel" orient="vertical" flex="1">
- <tree id="transactions" height="100" flex="1"
+ <tree id="transactions" flex="1" height="100"
datasources="chrome://moztop/content/Data/transactions.rdf"
ref="urn:tasks:data">
<treecols>
<treecol id="id" label="Id" flex="1" style="text-align: right"/>
+ <splitter class="statusbar-splitter"/>
<treecol id="name" label="Name" primary="true" flex="8" />
- <splitter/>
+ <splitter class="statusbar-splitter"/>
<treecol id="descr" label="Description" flex="16" />
- <splitter/>
+ <splitter class="statusbar-splitter"/>
<treecol id="status" label="Status" flex="3" />
</treecols>
@@ -33,7 +34,7 @@
</template>
</tree>
- <box orient="horizontal">
+ <box orient="horizontal" flex="1">
<spacer flex="100%"/>
<button label="Undo" />
<button label="Redo" />
=== Packages/Moztop/moztop/content/StatusBar/TasksOverlay.xul 1.2 => 1.3 ===
--- Packages/Moztop/moztop/content/StatusBar/TasksOverlay.xul:1.2 Mon Jan 13 21:43:48 2003
+++ Packages/Moztop/moztop/content/StatusBar/TasksOverlay.xul Sat Feb 15 06:01:59 2003
@@ -3,16 +3,17 @@
<overlay id="TasksOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<tree id="tasks-tree" flex="1"
+<tabpanel id="tasks-panel" orient="vertical" flex="1">
+<tree id="tasks-tree" flex="1" seltype="multiple" height="100"
datasources="rdf:null"
flags="dont-build-content"
containment="http://www.zope.org/rdf/task#child">
<treecols>
- <treecol id="id" label="Id" flex="1" style="text-align: right"/>
+ <treecol id="id" label="Id" flex="1"/>
<treecol id="name" label="Name" primary="true" flex="8" />
- <splitter/>
+ <splitter class="statusbar-splitter"/>
<treecol id="descr" label="Description" flex="16" />
- <splitter/>
+ <splitter class="statusbar-splitter"/>
<treecol id="status" label="Status" flex="3" />
</treecols>
@@ -31,5 +32,7 @@
</rule>
</template>
</tree>
+
+</tabpanel>
</overlay>