|
From: <han...@us...> - 2012-10-13 18:39:59
|
Revision: 1059
http://openautomation.svn.sourceforge.net/openautomation/?rev=1059&view=rev
Author: hannesloehr
Date: 2012-10-13 18:39:52 +0000 (Sat, 13 Oct 2012)
Log Message:
-----------
Added strftime example to plugin demo page.
Added rendered strftime content to top right corner.
Definition in xml by meta > topbar_datetime > strftime.
CSS changed only for metal design.
Added "var" to definition of function f in strftime structure_plugin because second strftime widget was not refreshed.
Modified Paths:
--------------
CometVisu/trunk/visu/designs/metal/basic.css
CometVisu/trunk/visu/index.html
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/plugins/strftime/structure_plugin.js
CometVisu/trunk/visu/visu_config_demo.xml
Modified: CometVisu/trunk/visu/designs/metal/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/metal/basic.css 2012-10-12 23:41:24 UTC (rev 1058)
+++ CometVisu/trunk/visu/designs/metal/basic.css 2012-10-13 18:39:52 UTC (rev 1059)
@@ -76,6 +76,26 @@
text-decoration:none;
}
+#top .nav_additional {
+ position: absolute;
+ right: 0;
+ top: 0;
+ margin-right: 15px;
+ float: right;
+}
+
+#top .nav_additional .widget {
+ padding: 0;
+ min-height: 0;
+ background: none;
+ border: 0;
+}
+
+#top .nav_additional .text > div {
+ line-height: 1.3em;
+}
+
+
.footer,
.footer *
{
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2012-10-12 23:41:24 UTC (rev 1058)
+++ CometVisu/trunk/visu/index.html 2012-10-13 18:39:52 UTC (rev 1059)
@@ -55,7 +55,7 @@
</head>
<body>
<div id="top" class="loading">
- <div class="nav_path">-</div>
+ <div class="nav_path">-</div><div class="nav_additional"></div>
</div>
<div id="navbarTop" class="loading"></div>
<div id="centerContainer">
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-10-12 23:41:24 UTC (rev 1058)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-10-13 18:39:52 UTC (rev 1059)
@@ -421,7 +421,22 @@
{
// and now setup the pages
var page = $( 'pages > page', xml )[0]; // only one page element allowed...
+
+ // read topbar datetime format
+ var topbar_datetime = $( 'meta > topbar_datetime > strftime', xml );
+
+ // if definition exists in xml
+ if (topbar_datetime.length) {
+ // get creator for strftime plugin
+ var creator = design.getCreator('strftime');
+ // get rendered datetime div
+ var retval = creator.create(topbar_datetime, 'id_0').html();
+ // show on top right corner
+ $('#top .nav_additional').html(retval);
+ }
+
+
create_pages(page, 'id_0');
adjustColumns();
Modified: CometVisu/trunk/visu/plugins/strftime/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/strftime/structure_plugin.js 2012-10-12 23:41:24 UTC (rev 1058)
+++ CometVisu/trunk/visu/plugins/strftime/structure_plugin.js 2012-10-13 18:39:52 UTC (rev 1059)
@@ -69,7 +69,7 @@
X: '%T'
};
- f = function() {
+ var f = function() {
var d = new Date();
d.locale = locale;
var iso = d.strftime(format);
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2012-10-12 23:41:24 UTC (rev 1058)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2012-10-13 18:39:52 UTC (rev 1059)
@@ -4,6 +4,7 @@
<plugins>
<plugin name="colorchooser"/>
<plugin name="diagram"/>
+ <plugin name="strftime"/>
</plugins>
<mappings>
<mapping name="Close_Open">
@@ -113,6 +114,9 @@
<entry value="17">olive</entry>
</styling>
</stylings>
+ <topbar_datetime>
+ <strftime lang="de" format="%A, %d. %b %H:%M"></strftime>
+ </topbar_datetime>
<statusbar>
<status type="html"><![CDATA[
<img src="icon/comet_64_ff8000.png" alt="CometVisu" /> by <a href="http://www.cometvisu.org/">CometVisu.org</a>
@@ -736,6 +740,7 @@
<label>Update Value</label>
<address transform="DPT:1.001" type="">12/7/1</address>
</trigger>
+ <strftime lang="de" format="%A, %d. %B %Y %H:%M:%S"><layout colspan="0"/></strftime>
</page>
</page>
</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|