|
From: <ma...@us...> - 2012-05-06 11:12:07
|
Revision: 791
http://openautomation.svn.sourceforge.net/openautomation/?rev=791&view=rev
Author: mayerch
Date: 2012-05-06 11:12:01 +0000 (Sun, 06 May 2012)
Log Message:
-----------
New feature: initial implementation of <pagejump> widget
Modified Paths:
--------------
CometVisu/trunk/visu/index.html
CometVisu/trunk/visu/visu_config_demo.xml
Added Paths:
-----------
CometVisu/trunk/visu/structure/pure/pagejump.js
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2012-05-06 10:41:10 UTC (rev 790)
+++ CometVisu/trunk/visu/index.html 2012-05-06 11:12:01 UTC (rev 791)
@@ -31,6 +31,7 @@
<script src="structure/pure/multitrigger.js" type="text/javascript"></script>
<script src="structure/pure/navbar.js" type="text/javascript"></script>
<script src="structure/pure/page.js" type="text/javascript"></script>
+ <script src="structure/pure/pagejump.js" type="text/javascript"></script>
<script src="structure/pure/slide.js" type="text/javascript"></script>
<script src="structure/pure/switch.js" type="text/javascript"></script>
<script src="structure/pure/text.js" type="text/javascript"></script>
Added: CometVisu/trunk/visu/structure/pure/pagejump.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/pagejump.js (rev 0)
+++ CometVisu/trunk/visu/structure/pure/pagejump.js 2012-05-06 11:12:01 UTC (rev 791)
@@ -0,0 +1,68 @@
+/* trigger.js (c) 2012 by Christian Mayer [CometVisu at ChristianMayer dot de]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+basicdesign.addCreator('pagejump', {
+ create: function( element, path ) {
+ var $e = $(element);
+ var layout = $e.children('layout')[0];
+ var style = layout ? 'style="' + extractLayout( layout ) + '"' : '';
+ var target = $e.attr('target') ? $e.attr('target') : '0';
+ var ret_val = $('<div class="widget clearfix switch" ' + style + ' />');
+ ret_val.setWidgetLayout($e);
+ var labelElement = $e.find('label')[0];
+ var label = labelElement ? '<div class="label">' + labelElement.textContent + '</div>' : '';
+ var address = makeAddressList($e);
+ var actor = '<div class="actor switchUnpressed ';
+ if ( $e.attr( 'align' ) )
+ actor += $e.attr( 'align' );
+ actor += '">';
+ if( $e.attr( 'name' ) )
+ actor += '<div class="value">' + $e.attr( 'name' ) + '</div>';
+ else
+ actor += '<div class="value">' + target + '</div>';
+ actor += '</div>';
+ var $actor = $(actor).data( {
+ 'styling' : $(element).attr('styling'),
+ 'type' : 'pagejump',
+ 'align' : $e.attr('align'),
+ 'target' : target
+ } ).bind( 'click', this.action ).bind( 'mousedown', function(){
+ $(this).removeClass('switchUnpressed').addClass('switchPressed');
+ } ).bind( 'mouseup mouseout', function(){ // not perfect but simple
+ $(this).removeClass('switchPressed').addClass('switchUnpressed');
+ } ).setWidgetStyling(target);
+ ret_val.append( label ).append( $actor );
+ return ret_val;
+ },
+ action: function() {
+ var data = $(this).data();
+ scrollToPage( data.target );
+ },
+ attributes: {
+ traget: { type: 'string' , required: true },
+ name: { type: 'string' , 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 },
+ layout: { type: 'layout' , required: false, multi: false }
+ },
+ content: false
+});
\ No newline at end of file
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2012-05-06 10:41:10 UTC (rev 790)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2012-05-06 11:12:01 UTC (rev 791)
@@ -108,7 +108,15 @@
<navbar position="left" dynamic="true" width="200px">
<text>Test 1</text>
<line/>
- <text>Test 2</text>
+ <pagejump target="0_33_7" name="Lithium">
+ <label>Flavour</label>
+ </pagejump>
+ <pagejump target="0_33_8" name="Potassium">
+ <label>Flavour</label>
+ </pagejump>
+ <pagejump target="0_36">
+ <label>2D</label>
+ </pagejump>
</navbar>
<text align="center">Herzlich willkommen bei dem CometVisu Widget Demo!</text>
<text><b>Hinweis:</b><br/>Alle Widgets verwenden KNX-Addressen mit der Haupt- und Mittelgruppe 12/7, da diese meist unbenutzt sind und so beim Testen oft keine Nebenwirkungen auftreten können. Sollten diese Gruppe bei Ihnen verwendet werden, so sollten Sie diese Widgets hier nicht betätigen!</text>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|