|
From: <ma...@us...> - 2012-05-06 10:36:43
|
Revision: 789
http://openautomation.svn.sourceforge.net/openautomation/?rev=789&view=rev
Author: mayerch
Date: 2012-05-06 10:36:37 +0000 (Sun, 06 May 2012)
Log Message:
-----------
New feature: initial implementation of navbars
Added Paths:
-----------
CometVisu/trunk/visu/structure/pure/navbar.js
Added: CometVisu/trunk/visu/structure/pure/navbar.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/navbar.js (rev 0)
+++ CometVisu/trunk/visu/structure/pure/navbar.js 2012-05-06 10:36:37 UTC (rev 789)
@@ -0,0 +1,61 @@
+/* unknown.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('navbar', {
+ create: function( navbar, path, flavour ) {
+ var $n = $(navbar);
+ var childs = $n.children();
+ var container = $( '<div class="clearfix"/>' );
+ if( $n.attr('name') ) container.append( '<h2 ' + hstyle + '>' + $n.attr('name') + '</h2>' );
+ $( childs ).each( function(i){
+ container.append( create_pages( childs[i], path + '_' + i, flavour ) );
+ } );
+
+ var dynamic = $n.attr('dynamic') ? true : false;
+ var position = $n.attr('position') || 'left';
+ switch( position )
+ {
+ case 'top':
+ $('#navbarTop').append( container );
+ break;
+
+ case 'left':
+ $('#navbarLeft').append( container );
+ navbarSetSize( 'left', 300 ); // FIXME - only a temporal solution
+ break;
+
+ case 'right':
+ $('#navbarRight').append( container );
+ navbarSetSize( 'right', 300 ); // FIXME - only a temporal solution
+ break;
+
+ case 'bottom':
+ $('#navbarBottom').append( container );
+ break;
+ }
+ navbars[position].dynamic |= dynamic;
+
+ var ret_val = $('');
+ return ret_val;
+ },
+ attributes: {
+ name: { type: 'string', required: false },
+ position: { type: 'list' , required: true , list: { top: 'top', left: 'left', right: 'right', bottom: 'bottom' } },
+ dynamic: { type: 'list' , required: true , list: { 'false': 'Fixed size', 'true': 'Dynamic' } }
+ },
+ content: true
+});
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|