|
From: <pe...@us...> - 2012-08-22 19:16:09
|
Revision: 982
http://openautomation.svn.sourceforge.net/openautomation/?rev=982&view=rev
Author: peuter
Date: 2012-08-22 19:15:58 +0000 (Wed, 22 Aug 2012)
Log Message:
-----------
* additional attributes in pages element
* max_mobile_screen_width: defines the maximum screen width where the mobile.css is used
* scroll_speed: defines the page scrolling speed (setiing to 0 disables scrolling)
* XSD definition for label allows icon-subelements now
* default widget_container width removed
Modified Paths:
--------------
CometVisu/trunk/visu/designs/metal/basic.css
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/visu/designs/metal/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/metal/basic.css 2012-08-22 18:20:23 UTC (rev 981)
+++ CometVisu/trunk/visu/designs/metal/basic.css 2012-08-22 19:15:58 UTC (rev 982)
@@ -90,8 +90,11 @@
.widget_container {
float: left;
- width: 100%;
}
+.navbar .widget_container {
+ width: 100%;
+ display: block;
+}
.widget
{
margin: 0;
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-22 18:20:23 UTC (rev 981)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-22 19:15:58 UTC (rev 982)
@@ -35,6 +35,8 @@
var main_scroll;
var old_scroll = '';
+var scrollSpeed;
+
var resizeAfterScroll = false;
visu = new CometVisu('/cgi-bin/');
@@ -205,6 +207,8 @@
// read predefined design in config
predefinedDesign = $( 'pages', xml ).attr("design");
+
+ scrollSpeed = $( 'pages', xml ).attr("scroll_speed");
// design by url
if ($.getUrlVar("design")) {
@@ -218,10 +222,11 @@
else {
selectDesign();
}
+ var maxMobileScreenWidth = $('pages',xml).attr('max_mobile_screen_width') || 480;
$( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/designglobals.css" />' );
$( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + clientDesign + '/basic.css" />' );
- $( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + clientDesign + '/mobile.css" media="only screen and (max-device-width: 480px)" />' );
+ $( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + clientDesign + '/mobile.css" media="only screen and (max-device-width: '+maxMobileScreenWidth+'px)" />' );
$( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + clientDesign + '/custom.css" />' );
$( 'head' ).append( '<script src="designs/' + clientDesign + '/design_setup.js" type="text/javascript" />' );
@@ -375,6 +380,9 @@
// setup the scrollable
main_scroll = $('#main').scrollable({keyboard: false, touch: false}).data('scrollable');
main_scroll.onSeek( updateTopNavigation );
+ if (scrollSpeed!=undefined) {
+ main_scroll.getConf().speed = scrollSpeed;
+ }
if ($.getUrlVar('startpage')) {
scrollToPage( 'id_'+$.getUrlVar('startpage'), 0 );
@@ -595,7 +603,7 @@
}
}
//push new state to history
- if (skipHistory==undefined)
+ if (skipHistory===undefined)
window.history.pushState(page_id, page_id, window.location.href);
main_scroll.seekTo( page, speed ); // scroll to it
@@ -706,7 +714,7 @@
/* FIXME - Question: should this belong to the VisuDesign object so that it */
/* is possible to overload?!? */
/** ************************************************************************* */
-function refreshAction( target, src ) {
+function refreshAction( target, src ) {
/* Special treatment for (external) iframes:
* we need to clear it and reload it in another thread as otherwise stays
* blank for some targets/sites and src = src doesnt work anyway on external
@@ -721,7 +729,7 @@
}, 0);
} else {
target.src = src + '&' + new Date().getTime();
- }
+ }
}
function setupRefreshAction() {
@@ -1025,7 +1033,13 @@
break;
}
navbar.css(initCss);
- navbar.animate(targetCss,main_scroll.getConf().speed,main_scroll.getConf().easing,fn);
+ if (main_scroll.getConf().speed==0) {
+ navbar.css(targetCss);
+ fn();
+ }
+ else {
+ navbar.animate(targetCss,main_scroll.getConf().speed,main_scroll.getConf().easing,fn);
+ }
}
function removeInactiveNavbars(page_id) {
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2012-08-22 18:20:23 UTC (rev 981)
+++ CometVisu/trunk/visu/visu_config.xsd 2012-08-22 19:15:58 UTC (rev 982)
@@ -97,6 +97,8 @@
<xsd:element ref="page" minOccurs="1" />
</xsd:choice>
<xsd:attribute name="design" type="xsd:string" use="required" />
+ <xsd:attribute name="scroll_speed" type="xsd:decimal" use="optional" />
+ <xsd:attribute name="max_mobile_screen_width" type="xsd:decimal" use="optional" />
</xsd:complexType>
</xsd:element>
@@ -349,7 +351,7 @@
<xsd:complexType name="toogle">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" />
+ <xsd:element name="label" type="label" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" />
</xsd:choice>
@@ -360,7 +362,7 @@
<xsd:complexType name="trigger">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" />
+ <xsd:element name="label" type="label" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" />
</xsd:choice>
@@ -371,7 +373,7 @@
<xsd:complexType name="infotrigger">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" />
+ <xsd:element name="label" type="label" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" maxOccurs="unbounded" />
</xsd:choice>
@@ -391,7 +393,7 @@
<xsd:complexType name="multitrigger">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" />
+ <xsd:element name="label" type="label" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" />
</xsd:choice>
@@ -410,7 +412,7 @@
<xsd:complexType name="slide">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="label" type="label" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
</xsd:choice>
@@ -423,7 +425,7 @@
<xsd:complexType name="info">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
</xsd:choice>
@@ -435,7 +437,7 @@
<xsd:complexType name="image">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
- <xsd:element name="label" type="xsd:string" />
+ <xsd:element name="label" type="label" />
</xsd:choice>
<xsd:attribute name="src" type="uri" use="required" />
<xsd:attribute name="width" type="dimension" />
@@ -445,7 +447,7 @@
<xsd:complexType name="imagetrigger">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="label" type="xsd:string" />
+ <xsd:element name="label" type="label" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" />
</xsd:choice>
@@ -462,7 +464,7 @@
<xsd:complexType name="video">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
</xsd:choice>
<xsd:attribute name="src" type="uri" use="required" />
<xsd:attribute name="width" type="dimension" />
@@ -473,7 +475,7 @@
<xsd:complexType name="iframe">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
</xsd:choice>
<xsd:attribute name="src" type="uri" use="required" />
<xsd:attribute name="width" type="dimension" />
@@ -486,7 +488,7 @@
<xsd:complexType name="pagejump">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
</xsd:choice>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="target" type="xsd:string" />
@@ -494,7 +496,7 @@
<xsd:complexType name="colorchooser">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="3" maxOccurs="3" />
</xsd:choice>
@@ -502,7 +504,7 @@
<xsd:complexType name="diagram_inline">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="axis" type="axis"></xsd:element>
<xsd:element name="rrd" type="rrd"></xsd:element>
@@ -523,7 +525,7 @@
<xsd:complexType name="diagram_popup">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="axis" type="axis"></xsd:element>
<xsd:element name="rrd" type="rrd"></xsd:element>
@@ -543,7 +545,7 @@
<xsd:complexType name="diagram_info">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
<xsd:element name="address" type="address" minOccurs="1" />
<xsd:element name="axis" type="axis"></xsd:element>
@@ -567,7 +569,7 @@
<xsd:complexType name="gweather">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
</xsd:choice>
<xsd:attribute name="width" type="dimension" use="optional" />
@@ -582,7 +584,7 @@
<xsd:complexType name="rss">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
</xsd:choice>
<xsd:attribute name="src" type="xsd:string" use="required" />
@@ -603,7 +605,7 @@
<xsd:complexType name="rsslog">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
</xsd:choice>
<xsd:attribute name="src" type="xsd:string" use="required" />
@@ -617,7 +619,7 @@
<xsd:complexType name="jqclock">
<xsd:choice maxOccurs="unbounded" minOccurs="1">
- <xsd:element name="label" type="xsd:string" maxOccurs="1" />
+ <xsd:element name="label" type="label" maxOccurs="1" />
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1" />
</xsd:choice>
<xsd:attribute name="width" type="dimension" use="optional" />
@@ -637,6 +639,12 @@
<xsd:complexType name="break" />
<xsd:complexType name="line" />
+
+ <xsd:complexType name="label" mixed="true">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element ref="icon" />
+ </xsd:choice>
+ </xsd:complexType>
<!-- toggle is not yet implemented -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|