|
From: <ha...@us...> - 2012-12-08 14:35:48
|
Revision: 1190
http://openautomation.svn.sourceforge.net/openautomation/?rev=1190&view=rev
Author: hausl
Date: 2012-12-08 14:35:42 +0000 (Sat, 08 Dec 2012)
Log Message:
-----------
possibility to add individual icons (author: hausl)
Modified Paths:
--------------
CometVisu/trunk/ChangeLog
CometVisu/trunk/visu/lib/iconhandler.js
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2012-12-07 21:19:41 UTC (rev 1189)
+++ CometVisu/trunk/ChangeLog 2012-12-08 14:35:42 UTC (rev 1190)
@@ -1,6 +1,7 @@
HEAD
====
+- New feature: individual icons can be added in the meta area
- New plugin: strftime
- Obsolete plugin removed: jqclock
- New plugin: clock
Modified: CometVisu/trunk/visu/lib/iconhandler.js
===================================================================
--- CometVisu/trunk/visu/lib/iconhandler.js 2012-12-07 21:19:41 UTC (rev 1189)
+++ CometVisu/trunk/visu/lib/iconhandler.js 2012-12-08 14:35:42 UTC (rev 1190)
@@ -91,13 +91,14 @@
var uri = arguments[1];
var type = arguments[2] || '*';
var flavour = arguments[3] || '*';
+ var style = arguments[4];
if( ! db[ name ] ) db[ name ] = {};
if( ! db[ name ][ type ] ) db[ name ][ type ] = {};
- db[ name ][ type ][ flavour ] = { uri: uri };
+ db[ name ][ type ][ flavour ] = { uri: uri, style: style };
}
-
+
/**
* Get the icon information for a name.
* @method get
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-12-07 21:19:41 UTC (rev 1189)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-12-08 14:35:42 UTC (rev 1190)
@@ -403,6 +403,18 @@
};
});
+ // then the icons
+ $('meta > icons icon-definition', xml).each(
+ function(i) {
+ var $this = $(this);
+ var name = $this.attr('name');
+ var uri = $this.attr('uri');
+ var style = $this.attr('style');
+ var type = $this.attr('type');
+ var flavour = $this.attr('flavour');
+ icons.insert(name, uri, type, flavour, style);
+ });
+
// then the mappings
$('meta > mappings mapping', xml).each(
function(i) {
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2012-12-07 21:19:41 UTC (rev 1189)
+++ CometVisu/trunk/visu/visu_config.xsd 2012-12-08 14:35:42 UTC (rev 1190)
@@ -250,6 +250,7 @@
<xsd:complexType name="meta">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="plugins" type="plugins" />
+ <xsd:element name="icons" type="icons" />
<xsd:element name="mappings" type="mappings" />
<xsd:element name="stylings" type="stylings" />
<xsd:element name="statusbar" type="statusbar" />
@@ -266,6 +267,20 @@
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
+ <xsd:complexType name="icons">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="icon-definition" type="icon-definition" />
+ </xsd:choice>
+ </xsd:complexType>
+
+ <xsd:complexType name="icon-definition">
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="uri" type="xsd:string" use="required" />
+ <xsd:attribute name="style" type="xsd:string" use="optional" />
+ <xsd:attribute name="type" type="xsd:string" use="optional" />
+ <xsd:attribute name="flavour" type="xsd:string" use="optional" />
+ </xsd:complexType>
+
<xsd:complexType name="mappings">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="mapping" type="mapping" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|