|
From: <ma...@us...> - 2011-02-13 16:55:27
|
Revision: 295
http://openautomation.svn.sourceforge.net/openautomation/?rev=295&view=rev
Author: mayerch
Date: 2011-02-13 16:55:20 +0000 (Sun, 13 Feb 2011)
Log Message:
-----------
New Feature: The footer entries containing an href attribute can be automatically extended by the current config-file information or by all search parameters.
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config.xml
CometVisu/trunk/visu/visu_config_demo.xml
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-02-13 13:16:42 UTC (rev 294)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-02-13 16:55:20 UTC (rev 295)
@@ -198,13 +198,26 @@
$( 'meta > statusbar status', xml ).each( function(i){
var type = $(this).attr('type');
var condition = $(this).attr('condition');
+ var extend = $(this).attr('hrefextend');
var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
var editMode = 'edit_config.html' == sPage;
if( editMode && '!edit' == condition ) return;
if( !editMode && 'edit' == condition ) return;
- //$('.footer').append( $(this.textContent) );
- $('.footer').html( $('.footer').html() + this.textContent );
+ var text = this.textContent;
+ switch( extend )
+ {
+ case 'all': // append all parameters
+ var search = window.location.search.replace( /\$/g, '$$$$' );
+ text = text.replace( /(href="[^"]*)(")/g, '$1' + search + '$2' );
+ break;
+ case 'config': // append config file info
+ var search = window.location.search.replace( /\$/g, '$$$$' );
+ search = search.replace( /.*(config=[^&]*).*|.*/, '?$1' );
+ text = text.replace( /(href="[^"]*)(")/g, '$1' + search + '$2' );
+ break;
+ }
+ $('.footer').html( $('.footer').html() + text );
});
// adapt width for pages to show
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2011-02-13 13:16:42 UTC (rev 294)
+++ CometVisu/trunk/visu/visu_config.xml 2011-02-13 16:55:20 UTC (rev 295)
@@ -13,10 +13,10 @@
- <a href=".">Reload</a>
- <a href="?config=demo">Widget Demo</a>
]]></status>
- <status type="html" condition="!edit"><![CDATA[
+ <status type="html" condition="!edit" hrefextend="config"><![CDATA[
- <a href="edit_config.html">Edit</a>
]]></status>
- <status type="html" condition="edit"><![CDATA[
+ <status type="html" condition="edit" hrefextend="all"><![CDATA[
- <a href=".">normal Mode</a>
]]></status>
<status type="html"><![CDATA[
@@ -25,7 +25,8 @@
</statusbar>
</meta>
<page name="Overview">
- <line />
+ <line/>
<text align="center">Welcome to the CometVisu!</text>
+ <line/>
</page>
</pages>
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2011-02-13 13:16:42 UTC (rev 294)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2011-02-13 16:55:20 UTC (rev 295)
@@ -38,13 +38,13 @@
<statusbar>
<status type="html"><![CDATA[
<img src="icon/comet_64_ff8000.png" alt="CometVisu" /> by <a href="http://www.cometvisu.org/">CometVisu.org</a>
- - <a href=".?config=neu">Reload</a>
+ - <a href=".?config=demo">Reload</a>
- <a href=".">Default Config</a>
]]></status>
- <status type="html" condition="!edit"><![CDATA[
+ <status type="html" condition="!edit" hrefextend="config"><![CDATA[
- <a href="edit_config.html">Edit</a>
]]></status>
- <status type="html" condition="edit"><![CDATA[
+ <status type="html" condition="edit" hrefextend="all"><![CDATA[
- <a href=".">normal Mode</a>
]]></status>
<status type="html"><![CDATA[
@@ -69,7 +69,7 @@
<address transform="DPT:9">12/4/250</address>
<address transform="DPT:9.001" readonly="true">12/4/253</address>
</slide>
- <break />
+ <break/>
<trigger value="0" mapping="OnOff">
<label>Terrase Licht 0</label>
<address transform="DPT:1.001">1/0/2</address>
@@ -78,7 +78,7 @@
<label>Terrase Licht 1</label>
<address transform="DPT:1.001">1/0/2</address>
</trigger>
- <line />
+ <line/>
<image src="icon/comet_128_ff8000.png" width="500px" height="46px"/>
<image src="http://www.e-zeeinternet.com/count.php?page=546016&style=default&nbdigits=9&reloads=1" refresh="10">
<label>Update every 10 sec</label>
@@ -88,17 +88,36 @@
<iframe src="http://www.cometvisu.org" width="500px" height="500px"/>
</page>
<colorchooser>
- <label>A colorChooser</label>
- <address transform="DPT:5.001" color="r">1/2/59</address>
- <address transform="DPT:5.001" color="g">1/2/60</address>
- <address transform="DPT:5.001" color="b">1/2/61</address>
+ A colorChooser
+ 1/2/59
+ 1/2/60
+ 1/2/61
</colorchooser>
- <info precision="4"><label>R</label><address transform="DPT:5.001">1/2/59</address></info>
- <slide><label>R</label><address transform="DPT:5.001">1/2/59</address></slide>
- <info precision="4"><label>G</label><address transform="DPT:5.001">1/2/60</address></info>
- <slide><label>G</label><address transform="DPT:5.001">1/2/60</address></slide>
- <info precision="4"><label>B</label><address transform="DPT:5.001">1/2/61</address></info>
- <slide><label>B</label><address transform="DPT:5.001">1/2/61</address></slide>
- <diagram_popup undefined="DALI Strom L1" rrd="200_DALI_Linie_1_Strom" unit="mA" series="day" refresh="300">DALI Strom L1</diagram_popup>
+ <info precision="4">
+ <label>R</label>
+ <address transform="DPT:5.001">1/2/59</address>
+ </info>
+ <slide>
+ <label>R</label>
+ <address transform="DPT:5.001">1/2/59</address>
+ </slide>
+ <info precision="4">
+ <label>G</label>
+ <address transform="DPT:5.001">1/2/60</address>
+ </info>
+ <slide>
+ <label>G</label>
+ <address transform="DPT:5.001">1/2/60</address>
+ </slide>
+ <info precision="4">
+ <label>B</label>
+ <address transform="DPT:5.001">1/2/61</address>
+ </info>
+ <slide>
+ <label>B</label>
+ <address transform="DPT:5.001">1/2/61</address>
+ </slide>
+ <diagram_popup rrd="200_DALI_Linie_1_Strom" unit="mA" series="day" refresh="300">DALI Strom L1</diagram_popup>
+ <diagram_inline rrd="200_DALI_Linie_1_Strom" width="600" height="400"/>
</page>
</pages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|