|
From: <j-...@us...> - 2011-11-03 20:02:20
|
Revision: 497
http://openautomation.svn.sourceforge.net/openautomation/?rev=497&view=rev
Author: j-n-k
Date: 2011-11-03 20:02:14 +0000 (Thu, 03 Nov 2011)
Log Message:
-----------
Fix bug 3175343 part 1 (default width 100% of widget space)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-11-02 19:44:15 UTC (rev 496)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-11-03 20:02:14 UTC (rev 497)
@@ -685,7 +685,11 @@
ret_val.addClass( 'iframe' );
ret_val.append( '<div class="label">' + page.textContent + '</div>' );
var style = '';
- if( $p.attr('width' ) ) style += 'width:' + $p.attr('width' ) + ';';
+ if( $p.attr('width' ) ) {
+ style += 'width:' + $p.attr('width' ) + ';';
+ } else { // default width is 100% of widget space (fix bug #3175343 part 1)
+ style += 'width: 100%;';
+ }
if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
if( $p.attr('frameborder') == "false" ) style += 'border: 0px ;';
if( $p.attr('background') ) style += 'background-color:' + $p.attr('background') + ';';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-11-06 16:06:50
|
Revision: 503
http://openautomation.svn.sourceforge.net/openautomation/?rev=503&view=rev
Author: mayerch
Date: 2011-11-06 16:06:44 +0000 (Sun, 06 Nov 2011)
Log Message:
-----------
Bug fix: clip to min/max if old+delta is out of range (old and wrong behaviour was to do nothing, i.e. the value stays out of range)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-11-06 15:19:17 UTC (rev 502)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-11-06 16:06:44 UTC (rev 503)
@@ -830,7 +830,8 @@
{
value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
value = value + parseFloat(data.value);
- if (value < data.min || data.max < value) return; // check min/max
+ if (value < data.min ) value = data.min;
+ if( value > data.max ) value = data.max;
}
for( var addr in data.address )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-11-06 21:44:21
|
Revision: 508
http://openautomation.svn.sourceforge.net/openautomation/?rev=508&view=rev
Author: mayerch
Date: 2011-11-06 21:44:15 +0000 (Sun, 06 Nov 2011)
Log Message:
-----------
Bug Fix: if value doesn't exists in the sytling, reset it to default (= no) style
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-11-06 19:19:16 UTC (rev 507)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-11-06 21:44:15 UTC (rev 508)
@@ -1068,6 +1068,9 @@
}
if( not_found ) element.addClass( 'actor ' );
}
+ } else {
+ element.removeClass();
+ element.addClass( 'actor ' );
}
if( element.data( 'align' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2011-11-16 13:41:36
|
Revision: 520
http://openautomation.svn.sourceforge.net/openautomation/?rev=520&view=rev
Author: j-n-k
Date: 2011-11-16 13:41:25 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
Fixed default width of image too 100% (same behaviour as iframe)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-11-14 20:16:48 UTC (rev 519)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-11-16 13:41:25 UTC (rev 520)
@@ -627,7 +627,11 @@
var labelElement = $p.find('label')[0];
ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
var style = '';
- if( $p.attr('width' ) ) style += 'width:' + $p.attr('width' ) + ';';
+ if( $p.attr('width' ) ) {
+ style += 'width:' + $p.attr('width' ) + ';';
+ } else {
+ style += 'width: 100%';
+ }
if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
if( style != '' ) style = 'style="' + style + '"';
var actor = '<div class="actor"><img src="' +$p.attr('src') + '" ' + style + ' /></div>';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-12-13 12:44:03
|
Revision: 574
http://openautomation.svn.sourceforge.net/openautomation/?rev=574&view=rev
Author: mayerch
Date: 2011-12-13 12:43:52 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
Increase compatability for Opera with 2D pages
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-12-12 22:08:51 UTC (rev 573)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-12-13 12:43:52 UTC (rev 574)
@@ -97,7 +97,7 @@
container.append( '<h1>' + name + '</h1>' );
if( '2d' == type )
{
- container.append( '<embed src="' + backdrop + '" style="position: absolute; top: 0px; left: 0px;z-index:-1;"/>' );
+ container.append( '<embed src="' + backdrop + '" style="position: absolute; top: 0px; left: 0px;z-index:-1;width:100%;height:100%;"/>' );
}
$( childs ).each( function(i){
container.append( create_pages( childs[i], path + '_' + i, flavour ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2011-12-18 12:50:34
|
Revision: 585
http://openautomation.svn.sourceforge.net/openautomation/?rev=585&view=rev
Author: netzkind
Date: 2011-12-18 12:50:28 +0000 (Sun, 18 Dec 2011)
Log Message:
-----------
rearranged settings to make sense to the user
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-12-18 12:49:54 UTC (rev 584)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-12-18 12:50:28 UTC (rev 585)
@@ -109,9 +109,9 @@
return ret_val;
},
attributes: {
+ name: { type: 'string', required: true },
align: { type: 'string', required: false },
flavour: { type: 'string', required: false },
- name: { type: 'string', required: true },
ga: { type: 'addr', required: false },
visible: { type: 'string', required: false },
type: { type: 'string', required: false },
@@ -227,9 +227,9 @@
styling: { type: 'styling', required: false }
},
elements: {
- layout: { type: 'layout', required: false, multi: false },
label: { type: 'string', required: true, multi: false },
- address: { type: 'address', required: true, multi: true }
+ address: { type: 'address', required: true, multi: true },
+ layout: { type: 'layout', required: false, multi: false }
},
content: false
});
@@ -342,9 +342,9 @@
styling: { type: 'styling', required: false }
},
elements: {
- layout: { type: 'layout', required: false, multi: false },
label: { type: 'string', required: true, multi: false },
- address: { type: 'address', required: true, multi: true }
+ address: { type: 'address', required: true, multi: true },
+ layout: { type: 'layout', required: false, multi: false }
},
content: false
});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-12-26 21:33:59
|
Revision: 611
http://openautomation.svn.sourceforge.net/openautomation/?rev=611&view=rev
Author: mayerch
Date: 2011-12-26 21:33:53 +0000 (Mon, 26 Dec 2011)
Log Message:
-----------
New feature: include "widget"
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-12-26 15:46:24 UTC (rev 610)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-12-26 21:33:53 UTC (rev 611)
@@ -128,6 +128,26 @@
content: true
});
+ this.addCreator('include', {
+ maturity: Maturity.development,
+ create: function( page, path, flavour ) {
+ var p = $.get( $(page).attr('src') );
+ var p = $.ajax({
+ url: $(page).attr('src'),
+ dataType: 'xml',
+ async: false
+ });
+ var child = (p.responseXML.childNodes[0]);
+ return create_pages( child, path , flavour );
+ },
+ attributes: {
+ src: { type: 'string', required: true }
+ },
+ elements: {
+ },
+ content: true
+ });
+
this.addCreator('group', {
maturity: Maturity.development,
create: function( page, path, flavour ) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-01-06 19:01:41
|
Revision: 637
http://openautomation.svn.sourceforge.net/openautomation/?rev=637&view=rev
Author: mayerch
Date: 2012-01-06 19:01:35 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
Initial implementation of the writeonly attribute
=> To check if it's a solution to bug http://knx-user-forum.de/cometvisu/17655-bug-cometvisu-vergisst-manchmal-status.html
=> ONLY implemented for switch widget. (If it's a solution, the other widgets have to follow)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-01-06 00:17:44 UTC (rev 636)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-01-06 19:01:35 UTC (rev 637)
@@ -380,8 +380,9 @@
var src = this.textContent;
var transform = this.getAttribute('transform');
var readonly = this.getAttribute('readonly');
+ var writeonly = this.getAttribute('writeonly');
ga_list.push( src )
- address[ '_' + src ] = [ transform, readonly=='true' ];
+ address[ '_' + src ] = [ transform, readonly=='true', writeonly=='true' ];
});
var actor = '<div class="actor switchUnpressed"><div class="value">-</div></div>';
var $actor = $(actor).data( {
@@ -393,7 +394,10 @@
'align' : $p.attr('align'),
'type' : 'switch'
} ).bind( 'click', this.action );
- for( var addr in address ) $actor.bind( addr, this.update );
+ for( var addr in address )
+ {
+ if( !address[addr][2] ) $actor.bind( addr, this.update ); // no writeonly
+ }
ret_val.append( label ).append( $actor );
return ret_val;
},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-01-14 16:47:27
|
Revision: 652
http://openautomation.svn.sourceforge.net/openautomation/?rev=652&view=rev
Author: j-n-k
Date: 2012-01-14 16:47:21 +0000 (Sat, 14 Jan 2012)
Log Message:
-----------
Fix broken "height"-attribute of image-widget
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-01-14 16:26:53 UTC (rev 651)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-01-14 16:47:21 UTC (rev 652)
@@ -696,7 +696,7 @@
if( $p.attr('width' ) ) {
style += 'width:' + $p.attr('width' ) + ';';
} else {
- style += 'width: 100%';
+ style += 'width: 100%;';
}
if( $p.attr('height') ) style += 'height:' + $p.attr('height') + ';';
if( style != '' ) style = 'style="' + style + '"';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-01-24 17:18:16
|
Revision: 666
http://openautomation.svn.sourceforge.net/openautomation/?rev=666&view=rev
Author: j-n-k
Date: 2012-01-24 17:18:10 +0000 (Tue, 24 Jan 2012)
Log Message:
-----------
Added colspan/rowspan-support for standrad-widgets
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-01-23 17:59:41 UTC (rev 665)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-01-24 17:18:10 UTC (rev 666)
@@ -201,6 +201,12 @@
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix text" />');
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var style = '';
if( $p.attr('align') ) style += 'text-align:' + $p.attr('align') + ';';
if( style != '' ) style = 'style="' + style + '"';
@@ -208,7 +214,9 @@
return ret_val;
},
attributes: {
- align: { type: 'string', required: false }
+ align: { type: 'string', required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
},
@@ -221,6 +229,12 @@
var layout = $p.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix info" ' + style + ' />');
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
@@ -244,7 +258,9 @@
attributes: {
format: { type: 'format', required: false },
mapping: { type: 'mapping', required: false },
- styling: { type: 'styling', required: false }
+ styling: { type: 'styling', required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -260,6 +276,12 @@
var layout = $p.find('layout')[0];
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix slide" ' + style + ' />');
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
@@ -359,7 +381,9 @@
max: { type: 'numeric', required: false },
step: { type: 'numeric', required: false },
mapping: { type: 'mapping', required: false },
- styling: { type: 'styling', required: false }
+ styling: { type: 'styling', required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -373,6 +397,12 @@
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix switch" />');
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
@@ -421,7 +451,9 @@
off_value: { type: 'string' , required: false },
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ align: { type: 'string' , required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -435,6 +467,12 @@
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix toggle" />');
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
@@ -486,7 +524,9 @@
attributes: {
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
- align: { type: 'string' , required: false }
+ align: { type: 'string' , required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -499,6 +539,12 @@
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix switch" />');
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
@@ -633,7 +679,9 @@
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
align: { type: 'string' , required: false },
- showstatus: { type: 'list' , required: true, list: {'true': "yes", 'false': "no"} }
+ showstatus: { type: 'list' , required: true, list: {'true': "yes", 'false': "no"} },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -647,6 +695,12 @@
var $p = $(page);
var value = $p.attr('value') ? $p.attr('value') : 0;
var ret_val = $('<div class="widget clearfix switch" />');
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
var address = {};
@@ -695,6 +749,8 @@
mapping: { type: 'mapping' , required: false },
styling: { type: 'styling' , required: false },
align: { type: 'string' , required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: true, multi: false },
@@ -711,6 +767,9 @@
if ($p.attr("rowspan")) { // add rowspan only if not default
ret_val.addClass(rowspanClass($p.attr("rowspan")));
}
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var labelElement = $p.find('label')[0];
ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
@@ -733,7 +792,9 @@
src: { type: 'uri' , required: true },
width: { type: 'string' , required: false },
height: { type: 'string' , required: false },
- refresh: { type: 'numeric', required: false }
+ refresh: { type: 'numeric', required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: false, multi: false }
@@ -745,6 +806,12 @@
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix video" />');
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
var labelElement = $p.find('label')[0];
ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
var autoplay = ($p.attr('autoplay') && $p.attr('autoplay')=='true') ? ' autoplay="autoplay"' : '';
@@ -760,7 +827,9 @@
src: { type: 'uri' , required: true },
width: { type: 'string' , required: false },
height: { type: 'string' , required: false },
- autoplay:{ type: 'list' , required: true, list: {'true': "yes", 'false': "no"} }
+ autoplay:{ type: 'list' , required: true, list: {'true': "yes", 'false': "no"} },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: false, multi: false }
@@ -771,8 +840,15 @@
this.addCreator('iframe', {
create: function( page, path ) {
var $p = $(page);
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'iframe' );
+ var ret_val = $('<div class="widget iframe" />');
+
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
+
ret_val.append( '<div class="label">' + page.textContent + '</div>' );
var style = '';
if( $p.attr('width' ) ) {
@@ -798,7 +874,9 @@
height: { type: 'string', required: false },
frameborder: { type: 'list' , required: false, list: {'true': "yes", 'false': "no"} },
background: { type: 'string', required: false },
- refresh: { type: 'numeric', required: false }
+ refresh: { type: 'numeric', required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: false, multi: false }
@@ -810,7 +888,12 @@
create: function( page, path ) {
var $p = $(page);
var ret_val = $('<div class="widget clearfix switch" />');
-
+ if ($p.attr("rowspan")) { // add rowspan only if not default
+ ret_val.addClass(rowspanClass($p.attr("rowspan")));
+ }
+ if ($p.attr("colspan")) { // add colspan only if not default
+ ret_val.data("colspanClass", colspanClass($p.attr("colspan")));
+ }
// handle label
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
@@ -947,7 +1030,9 @@
format: { type: 'string' , required: false },
change: { type: 'list' , required: false , list: {'relative': 'Send relative/delta values', 'absolute': 'Send absolute values'} },
min: { type: 'numeric' , required: false },
- max: { type: 'numeric' , required: false }
+ max: { type: 'numeric' , required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false }
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-01-30 20:29:25
|
Revision: 671
http://openautomation.svn.sourceforge.net/openautomation/?rev=671&view=rev
Author: j-n-k
Date: 2012-01-30 20:29:19 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
Restore default behaviour: widget-size depends on content
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-01-30 20:25:43 UTC (rev 670)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-01-30 20:29:19 UTC (rev 671)
@@ -30,8 +30,10 @@
$.fn.setWidgetStyle = function(page) {
this.data('colspanClass', colspanClass(page.attr('colspan') || 1));
- this.data('rowspanClass', rowspanClass(page.attr('rowspan') || 1));
- this.addClass(innerRowspanClass(page.attr('rowspan') || 1));
+ if (page.attr('rowspan')) {
+ this.data('rowspanClass', rowspanClass(page.attr('rowspan') || 1));
+ this.addClass(innerRowspanClass(page.attr('rowspan') || 1));
+ }
return this;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-01-31 09:44:53
|
Revision: 672
http://openautomation.svn.sourceforge.net/openautomation/?rev=672&view=rev
Author: j-n-k
Date: 2012-01-31 09:44:42 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Added function for address-parsing (makeAddressList($(page)))
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-01-30 20:29:19 UTC (rev 671)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-01-31 09:44:42 UTC (rev 672)
@@ -48,8 +48,25 @@
}
return this;
}
-
+
/**
+ * this function extracts all addresses with attributes (JNK)
+ */
+
+function makeAddressList(page) {
+ var address = {};
+ page.find('address').each( function(){
+ var src = this.textContent;
+ var transform = this.getAttribute('transform');
+ var readonly = this.getAttribute('readonly');
+ var writeonly = this.getAttribute('writeonly');
+ ga_list.push( src )
+ address[ '_' + src ] = [ transform, readonly=='true', writeonly=='true' ];
+ });
+ return address;
+}
+
+/**
* This class defines all the building blocks for a Visu in the "Pure" design
*/
@@ -253,12 +270,12 @@
var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
var ret_val = $('<div class="widget clearfix info" ' + style + ' />');
ret_val.setWidgetStyle($p).makeWidgetLabel($p);
- var address = {};
- $p.find('address').each( function(){
+ var address = makeAddressList($p);
+ /*$p.find('address').each( function(){
var src = this.textContent;
ga_list.push( src )
address[ '_' + src ] = [ this.getAttribute('transform') ];
- });
+ }); */
var actor = '<div class="actor"><div class="value">-</div></div>';
var $actor = $(actor).data({
'address' : address,
@@ -409,15 +426,7 @@
ret_val.setWidgetStyle($p)
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = {};
- $p.find('address').each( function(){
- var src = this.textContent;
- var transform = this.getAttribute('transform');
- var readonly = this.getAttribute('readonly');
- var writeonly = this.getAttribute('writeonly');
- ga_list.push( src )
- address[ '_' + src ] = [ transform, readonly=='true', writeonly=='true' ];
- });
+ var address = makeAddressList($p);
var actor = '<div class="actor switchUnpressed"><div class="value">-</div></div>';
var $actor = $(actor).data( {
'address' : address,
@@ -474,14 +483,7 @@
ret_val.setWidgetStyle($p);
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = {};
- $p.find('address').each( function(){
- var src = this.textContent;
- var transform = this.getAttribute('transform');
- var readonly = this.getAttribute('readonly');
- ga_list.push( src )
- address[ '_' + src ] = [ transform, readonly=='true' ];
- });
+ var address = makeAddressList($p);
var actor = '<div class="actor switchUnpressed"><div class="value">-</div></div>';
var $actor = $(actor).data( {
'address' : address,
@@ -541,15 +543,8 @@
ret_val.setWidgetStyle($p)
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = {};
+ var address = makeAddressList($p);
var showstatus = $p.attr("showstatus") || "false";
- $p.find('address').each( function(){
- var src = this.textContent;
- var transform = this.getAttribute('transform');
- var readonly = this.getAttribute('readonly');
- ga_list.push( src )
- address[ '_' + src ] = [ transform, readonly=='true' ];
- });
ret_val.append( label );
var buttons = $('<div style="float:left"/>');
var buttonCount = 0;
@@ -692,14 +687,7 @@
ret_val.setWidgetStyle($p);
var labelElement = $p.find('label')[0];
var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
- var address = {};
- $p.find('address').each( function(){
- var src = this.textContent;
- var transform = this.getAttribute('transform');
- var readonly = this.getAttribute('readonly');
- ga_list.push( src )
- address[ '_' + src ] = [ transform, readonly=='true' ];
- });
+ var address = makeAddressList($p);
var actor = '<div class="actor switchUnpressed ';
if ( $p.attr( 'align' ) )
actor += $p.attr( 'align' );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-01-31 19:11:00
|
Revision: 673
http://openautomation.svn.sourceforge.net/openautomation/?rev=673&view=rev
Author: j-n-k
Date: 2012-01-31 19:10:49 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Added .setWidgetStyling($(page)) : apply stylings to widgets
implemented in trigger and default_update
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-01-31 09:44:42 UTC (rev 672)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-01-31 19:10:49 UTC (rev 673)
@@ -23,11 +23,38 @@
};
/**
- * this function implements all widget stylings that are identical (JNK)
+ * this function implements widget stylings
*
+ * implemented in: default_update, trigger-widget
+ */
+
+$.fn.setWidgetStyling = function(value) {
+ if (this.data('styling')) {
+ var styling = stylings[this.data('styling')];
+ this.removeClass(styling['classnames']); // remove only styling classes
+
+ if (styling[value]) { // fixed value
+ this.addClass(styling[value]);
+ } else { //
+ value = parseFloat(value);
+ var range = styling['range'];
+ for( var min in range ) {
+ if( min > value ) continue;
+ if( range[min][0] < value ) continue; // check max
+ this.addClass( range[min][1] );
+ break;
+ }
+ }
+ }
+ return this;
+}
+
+/**
+ * this function implements all widget layouts that are identical (JNK)
+ *
* implemented: rowspan, colspan
*/
-
+
$.fn.setWidgetStyle = function(page) {
this.data('colspanClass', colspanClass(page.attr('colspan') || 1));
if (page.attr('rowspan')) {
@@ -271,11 +298,7 @@
var ret_val = $('<div class="widget clearfix info" ' + style + ' />');
ret_val.setWidgetStyle($p).makeWidgetLabel($p);
var address = makeAddressList($p);
- /*$p.find('address').each( function(){
- var src = this.textContent;
- ga_list.push( src )
- address[ '_' + src ] = [ this.getAttribute('transform') ];
- }); */
+
var actor = '<div class="actor"><div class="value">-</div></div>';
var $actor = $(actor).data({
'address' : address,
@@ -709,7 +732,7 @@
$(this).removeClass('switchUnpressed').addClass('switchPressed');
} ).bind( 'mouseup mouseout', function(){ // not perfect but simple
$(this).removeClass('switchPressed').addClass('switchUnpressed');
- } );
+ } ).setWidgetStyling(value);
ret_val.append( label ).append( $actor );
return ret_val;
},
@@ -1174,38 +1197,15 @@
return { x: 0, y: 0 }; // sanity return
}
+
function defaultUpdate( e, data, passedElement )
{
var element = passedElement || $(this);
var thisTransform = element.data().address[ e.type ][0];
var value = transformDecode( element.data().address[ e.type ][0], data );
-
- var styling = element.data('styling');
- if( styling && stylings[styling] && (stylings[styling][value] || stylings[styling]['range']) )
- {
- if( stylings[styling]['range'] ) value = parseFloat( value );
- element.removeClass();
- if( stylings[styling][value] )
- {
- element.addClass( 'actor ' + stylings[styling][value] );
- } else {
- var range = stylings[styling]['range'];
- var not_found = true;
- for( var min in range )
- {
- if( min > value ) continue;
- if( range[min][0] < value ) continue; // check max
- element.addClass( 'actor ' + range[min][1] );
- not_found = false;
- break;
- }
- if( not_found ) element.addClass( 'actor ' );
- }
- } else {
- element.removeClass();
- element.addClass( 'actor ' );
- }
-
+
+ element.setWidgetStyling(value);
+
if( element.data( 'align' ) )
element.addClass(element.data( 'align' ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-01-31 20:42:12
|
Revision: 675
http://openautomation.svn.sourceforge.net/openautomation/?rev=675&view=rev
Author: j-n-k
Date: 2012-01-31 20:42:01 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Fix $.fn.setWidgetStyling (was broken when no styling defined)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-01-31 19:14:25 UTC (rev 674)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-01-31 20:42:01 UTC (rev 675)
@@ -29,10 +29,9 @@
*/
$.fn.setWidgetStyling = function(value) {
- if (this.data('styling')) {
- var styling = stylings[this.data('styling')];
+ var styling = stylings[this.data('styling')];
+ if (styling) {
this.removeClass(styling['classnames']); // remove only styling classes
-
if (styling[value]) { // fixed value
this.addClass(styling[value]);
} else { //
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-02-08 19:13:54
|
Revision: 691
http://openautomation.svn.sourceforge.net/openautomation/?rev=691&view=rev
Author: j-n-k
Date: 2012-02-08 19:13:45 +0000 (Wed, 08 Feb 2012)
Log Message:
-----------
Fix missing ,
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-02-08 18:38:45 UTC (rev 690)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-02-08 19:13:45 UTC (rev 691)
@@ -187,7 +187,7 @@
visible: { type: 'string', required: false },
type: { type: 'string', required: false },
colspan: { type: 'numeric', required: false },
- rowspan: { type: 'numeric', required: false }
+ rowspan: { type: 'numeric', required: false },
backdrop: { type: 'string', required: false }
},
elements: {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-03-11 19:52:20
|
Revision: 726
http://openautomation.svn.sourceforge.net/openautomation/?rev=726&view=rev
Author: j-n-k
Date: 2012-03-11 19:52:14 +0000 (Sun, 11 Mar 2012)
Log Message:
-----------
Restored imagetrigger (accidentally removed in Rev. 695)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-03-11 16:34:34 UTC (rev 725)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-03-11 19:52:14 UTC (rev 726)
@@ -852,7 +852,108 @@
},
content: false
});
-
+
+ this.addCreator("imagetrigger", {
+ create: function( page, path ) {
+ var $p = $(page);
+ var ret_val = $('<div class="widget clearfix image" />');
+ ret_val.setWidgetLayout($p);
+ ret_val.addClass ('imagetrigger');
+ var value = $p.attr('value') ? $p.attr('value') : 0;
+ var labelElement = $p.find('label')[0];
+ ret_val.append( labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '' );
+ var address = {};
+ $p.find('address').each( function(){
+ var src = this.textContent;
+ ga_list.push( src )
+ address[ '_' + src ] = [
+ this.getAttribute('transform'), {
+ 'readonly' : this.getAttribute('readonly'),
+ 'writeonly' : this.getAttribute('writeonly')
+ }
+ ];
+ });
+ var style = ' style=" ';
+ style += $p.attr('width' ) ? 'width:' + $p.attr('width' ) + ';' : 'width: 100%;';
+ style += $p.attr('height' ) ? 'height:' + $p.attr('height' ) + ';"' : '"';
+
+ var actor = '<div class="actor">';
+ if ( $p.attr('type')=='show' )
+ actor += '<img src="' + $p.attr('src') + '.' + $p.attr('suffix') + '" ' + style + ' />';
+ else
+ actor += '<img src="" ' + style + ' />';
+ actor += '</div>';
+
+ actor += '</div>';
+ var refresh = $p.attr('refresh') ? $p.attr('refresh')*1000 : 0;
+ var $actor = $(actor).data( {
+ 'address': address,
+ 'refresh': refresh,
+ 'src': $p.attr('src'),
+ 'suffix': $p.attr('suffix'),
+ 'type': $p.attr('type'),
+ 'mapping': map,
+ 'sendValue': $p.attr('sendValue') || ""
+ } )
+ .each(setupRefreshAction) // abuse "each" to call in context... refresh is broken with select right now
+ .bind( 'click', this.action );
+ for( var addr in address ) {
+ $actor.bind( addr, this.update );
+ }
+ ret_val.append( $actor );
+ return ret_val;
+ },
+ update: function(e,d) {
+ var data = $(this).data();
+ if ( data.address[e.type][1].writeonly == "true")
+ return; // skip writeonly FIXME: writeonly shouldnt bind to update at all
+ var val = transformDecode(data.address[e.type][0], d);
+ if (data.type == "show")
+ if (val == 0)
+ $(this).children().hide();
+ else
+ $(this).children().attr("src", data.src + '.' + data.suffix ).show();
+ else if (data.type == "select")
+ if (val == 0)
+ $(this).children().hide();
+ else
+ $(this).children().attr("src", data.src + val + '.' + data.suffix ).show();
+
+ //FIXME: add value if mapping exists
+ //FIXME: get image name from mapping
+ //FIXME: add bitmask for multiple images
+ //FIXME: add SVG-magics
+ },
+ action: function() {
+ var data = $(this).data();
+ sendValue = data.sendValue;
+ for( var addr in data.address ) {
+ if( data.address[addr][1].readonly == "true" )
+ continue; // skip read only
+ if( data.sendValue == "" )
+ continue; // skip empty
+ visu.write( addr.substr(1), transformEncode( data.address[addr][0], sendValue ) );
+ }
+ },
+ attributes: {
+ src: { type: 'uri' , required: true },
+ width: { type: 'string' , required: false },
+ height: { type: 'string' , required: false },
+ refresh: { type: 'numeric', required: false },
+ colspan: { type: 'numeric', required: false },
+ rowspan: { type: 'numeric', required: false },
+ sendValue: { type: 'numeric', required: false },
+ type: { type: 'list' , required: true, list: {'show': 'show', 'select': 'select' /* , 'bitmask': 'bitmask' */ } },
+ mapping: { type: 'mapping', required: false },
+ suffix: { type: 'list' , required: false, list: {'png': '.png', 'jpg': '.jpg', 'gif': '.gif', 'svg': '.svg', 'bmp': '.bmp'} }
+ },
+ elements: {
+ label: { type: 'string', required: false, multi: false },
+ address: { type: 'address', required: true, multi: true }
+ },
+ content: false
+ });
+
this.addCreator('video', {
create: function( page, path ) {
var $p = $(page);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-03-18 16:01:56
|
Revision: 730
http://openautomation.svn.sourceforge.net/openautomation/?rev=730&view=rev
Author: mayerch
Date: 2012-03-18 16:01:50 +0000 (Sun, 18 Mar 2012)
Log Message:
-----------
Move to room / floor in 3d when clicked.
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-03-17 23:38:56 UTC (rev 729)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-03-18 16:01:50 UTC (rev 730)
@@ -161,9 +161,10 @@
}
var childs = $p.children();
- var container = $( '<div class="clearfix" />' );
+ //var container = $( '<div class="clearfix" />' );
- var $container = $( '<div class="clearfix" path="'+path+'"/>');
+ var subpage = $( '<div class="page" id="' + path + '" style="'+pstyle+';"/>' );
+ var $container = $( '<div class="clearfix" path="'+path+'" style="height:100%;position:relative;" />');
for( var addr in address ) $container.bind( addr, this.update );
var container=$container;
@@ -177,6 +178,12 @@
floorplan.moveToRoom( 'Underground', false, true, false );
container.data( 'JSFloorPlan3D', floorplan );
container.find('canvas').css({position: 'absolute', top: '0px', left: '0px', 'z-index':'-1', width:'100%',height:'100%'});
+ subpage.click( {JSFloorPlan3D:floorplan,callback:function(event){
+ var j = this.JSFloorPlan3D;
+ j.moveToRoom( j.getState('showFloor'), event.room.room, true, true, function(){
+ container.trigger( 'update3d', j );
+ });
+ }}, floorplan.translateMouseEvent );
$(window).bind( 'resize', function(){ floorplan.resize($('.page').width(), $('.page').height(), true);} );
if ($p.attr('azimut')) {
ga_list.push($p.attr('azimut'));
@@ -198,7 +205,6 @@
$( childs ).each( function(i){
container.append( create_pages( childs[i], path + '_' + i, flavour, type ) );
} );
- var subpage = $( '<div class="page" id="' + path + '" style="'+pstyle+';"/>' );
subpage.append(container);
if( flavour ) subpage.addClass( 'flavour_' + flavour );
$('#pages').prepend( subpage );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|