|
From: <pe...@us...> - 2013-01-20 10:15:55
|
Revision: 1349
http://openautomation.svn.sourceforge.net/openautomation/?rev=1349&view=rev
Author: peuter
Date: 2013-01-20 10:15:48 +0000 (Sun, 20 Jan 2013)
Log Message:
-----------
more bugfixes on function calls of the refactored templateengine
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
CometVisu/trunk/visu/plugins/rsslog/structure_plugin.js
CometVisu/trunk/visu/plugins/svg/structure_plugin.js
CometVisu/trunk/visu/structure/pure/imagetrigger.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-01-20 10:05:44 UTC (rev 1348)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-01-20 10:15:48 UTC (rev 1349)
@@ -86,7 +86,7 @@
this.clientDesign = "";
- if (typeof forceReload == "undefined") {
+ if (typeof this.forceReload == "undefined") {
this.forceReload = false;
}
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-20 10:05:44 UTC (rev 1348)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-20 10:15:48 UTC (rev 1349)
@@ -154,7 +154,7 @@
bDiagram.data(data);
bDiagram.data("ispopup", true);
bDiagram.css({height: "90%"});
- showPopup("unknown", {title: bDiagram.data('label'), content: bDiagram});
+ templateEngine.showPopup("unknown", {title: bDiagram.data('label'), content: bDiagram});
bDiagram.parent("div").css({height: "100%", width: "90%", margin: "auto"}); // define parent as 100%!
bDiagram.empty();
var bDiagramOpts = {yaxis: {labelWidth: null}, yaxes: [{ticks: null}]};
@@ -299,7 +299,7 @@
bDiagram.css({height: "90%"});
bDiagram.data("ispopup", true);
- showPopup("unknown", {title: bDiagram.data('label'), content: bDiagram});
+ templateEngine.showPopup("unknown", {title: bDiagram.data('label'), content: bDiagram});
bDiagram.parent("div").css({height: "100%", width: "90%", margin: "auto"}); // define parent as 100%!
bDiagram.empty();
var bDiagramOpts = {yaxis: {labelWidth: null}};
Modified: CometVisu/trunk/visu/plugins/rsslog/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/rsslog/structure_plugin.js 2013-01-20 10:05:44 UTC (rev 1348)
+++ CometVisu/trunk/visu/plugins/rsslog/structure_plugin.js 2013-01-20 10:15:48 UTC (rev 1349)
@@ -59,7 +59,7 @@
var data = jQuery.extend({}, rss.data());
ret_val.bind("click", function() {
- showPopup("rsslog", {title: $('.label', ret_val).text() || '', content: brss});
+ templateEngine.showPopup("rsslog", {title: $('.label', ret_val).text() || '', content: brss});
brss.parent("div").css({height: "90%", width: "90%", margin: "auto"}); // define parent as 100%!
brss.data(data);
brss.data("refresh", "");
Modified: CometVisu/trunk/visu/plugins/svg/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/svg/structure_plugin.js 2013-01-20 10:05:44 UTC (rev 1348)
+++ CometVisu/trunk/visu/plugins/svg/structure_plugin.js 2013-01-20 10:15:48 UTC (rev 1349)
@@ -49,7 +49,7 @@
$actor.data( {
'address': address,
'refresh': refresh
- } ).each(setupRefreshAction); // abuse "each" to call in context...
+ } ).each(templateEngine.setupRefreshAction); // abuse "each" to call in context...
for( var addr in address ) {
$actor.bind( addr, this.update );
}
Modified: CometVisu/trunk/visu/structure/pure/imagetrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/imagetrigger.js 2013-01-20 10:05:44 UTC (rev 1348)
+++ CometVisu/trunk/visu/structure/pure/imagetrigger.js 2013-01-20 10:15:48 UTC (rev 1349)
@@ -47,7 +47,7 @@
'mapping': map,
'sendValue': $e.attr('sendValue') || ""
} )
- .each(setupRefreshAction) // abuse "each" to call in context... refresh is broken with select right now
+ .each(templateEngine.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 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2013-01-21 08:26:04
|
Revision: 1352
http://openautomation.svn.sourceforge.net/openautomation/?rev=1352&view=rev
Author: peuter
Date: 2013-01-21 08:25:57 +0000 (Mon, 21 Jan 2013)
Log Message:
-----------
fix for backend initialization: should fix problems with diagrams
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-01-20 12:33:40 UTC (rev 1351)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-01-21 08:25:57 UTC (rev 1352)
@@ -69,8 +69,8 @@
}
this.initBackendClient = function() {
- var backend = '/' + thisTemplateEngine.backend + '/';
- thisTemplateEngine.visu = new CometVisu(backend);
+ thisTemplateEngine.backend = '/' + thisTemplateEngine.backend + '/';
+ thisTemplateEngine.visu = new CometVisu(thisTemplateEngine.backend);
thisTemplateEngine.visu.update = function(json) { // overload the handler
for (key in json) {
$.event.trigger('_' + key, json[key]);
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-20 12:33:40 UTC (rev 1351)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-21 08:25:57 UTC (rev 1352)
@@ -431,7 +431,7 @@
var idx = num;
$.ajax({
- url: templateEngine.backend+"/rrdfetch?rrd=" + src + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
+ url: templateEngine.backend+"rrdfetch?rrd=" + src + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
dataType: "json",
type: "GET",
context: this,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2013-01-23 20:31:20
|
Revision: 1353
http://openautomation.svn.sourceforge.net/openautomation/?rev=1353&view=rev
Author: netzkind
Date: 2013-01-23 20:31:08 +0000 (Wed, 23 Jan 2013)
Log Message:
-----------
simplish preview of the whole configuration, implementation of sequence in editor, re-commit sequenced version of xsd (originally by hausl), other stuff (see DEVELOPMENT.txt)
upgrade-scripts to pull config to current version of library, speed-improvements on the editor (might be improved upon)
backups of config on saving, backups of config on upgrade; other stuff i can remember right now :)
Modified Paths:
--------------
CometVisu/trunk/visu/editor/DEVELOPMENT.txt
CometVisu/trunk/visu/editor/bin/save_config.php
CometVisu/trunk/visu/editor/init.js
CometVisu/trunk/visu/editor/lib/Configuration.js
CometVisu/trunk/visu/editor/lib/Editor.css
CometVisu/trunk/visu/editor/lib/Editor.js
CometVisu/trunk/visu/editor/lib/Messages.js
CometVisu/trunk/visu/editor/lib/Schema.js
CometVisu/trunk/visu/visu_config.xml
CometVisu/trunk/visu/visu_config.xsd
CometVisu/trunk/visu/visu_config_2d3d.xml
CometVisu/trunk/visu/visu_config_demo.xml
CometVisu/trunk/visu/visu_config_demorss.xml
CometVisu/trunk/visu/visu_config_metal.xml
Added Paths:
-----------
CometVisu/trunk/visu/backup/
CometVisu/trunk/visu/upgrade/
CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php
CometVisu/trunk/visu/upgrade/index.php
CometVisu/trunk/visu/visu_config_previewtemp.xml
Modified: CometVisu/trunk/visu/editor/DEVELOPMENT.txt
===================================================================
--- CometVisu/trunk/visu/editor/DEVELOPMENT.txt 2013-01-21 08:25:57 UTC (rev 1352)
+++ CometVisu/trunk/visu/editor/DEVELOPMENT.txt 2013-01-23 20:31:08 UTC (rev 1353)
@@ -1,33 +1,36 @@
=== KNOWN BUGS AND LIMITATIONS ===
* loading the XSD is done in Javascript. The Schema-Loader knows a certain set an structure of an XSD. If "unknown"
XSD-features are being used in the schema, the Schema-Loader may not know about them, and the editor will thus fail.
-* the Schema care a little for bounds. It does, however, not support 'multi-dimensional'-bounds.
-* user-feedback is done using window.alert() - this works accross all devices and browsers, has no ux-issues on small
- screens, and enforces the users attention.
-* XSD is fucked up. minOccurs on elements in a choice are ignored if said choice is bounded otherwise
+
=== ROADMAP ===
* MS1 - done
- OOP-representation of the schema/XSD
- OOP-representation of the configuration
- validate configuration against XSD
-* MS2 - week 46/47 2012
+* MS2 - done
- browser loads configuration, checks it against an XSD, warns if not compliant
- editor is displayed in browser, nodes are shown as a tree
- node-attributes can be edited
- node children can be added, removed
-* MS3 - week 52 2012
+* MS3 - done
- nodes have copy&paste, move.
- configuration can be saved
- attributes like rrd, addr can be selected from a list; said list is loaded from the server
- attributes like styling, mapping can be selected from a dynamic list; list is based on current configuration
-* MS4 - early 2013
- - better check bounds of configuration, including multi-dimensional bounds, sequences?
- - preview for a selected node without the need of replacing the configuration on the server
+* MS4 - done
+ - better check bounds of configuration, including multi-dimensional bounds, sequences
+ - preview of the complete configuration without the need of replacing the configuration on the server
+ - integrated sequences, force specific order of elements
+ - use xsd:appinfo to mark attributes as <xsd:appinfo>level:expert</xsd:appinfo> to hide them in non-complex mode
+ - use xsd:documentation, respecting xml:lang, to show documentation next to attributes
+ - configurationUpgrader for anything below version 1 to version 1.
+* no MS planned
+ - preview for a SINGLE node without the need of replacing the configuration on the server
=== TODO ===
@@ -41,10 +44,13 @@
- done
* MS4:
- - allow for multi-dimensional bounds, as well as sequence?
+ - done
+
+* future:
- frontend: preview node incl. children
+
=== IDEAS ===
-* read xsd:annotation and xsd:documentation including xml:lang for tooltips/...
* transparently exchange whitespaces with for text-nodes to make sure the user gets what he entered ...
+* backups on saving
Modified: CometVisu/trunk/visu/editor/bin/save_config.php
===================================================================
--- CometVisu/trunk/visu/editor/bin/save_config.php 2013-01-21 08:25:57 UTC (rev 1352)
+++ CometVisu/trunk/visu/editor/bin/save_config.php 2013-01-23 20:31:08 UTC (rev 1353)
@@ -30,6 +30,7 @@
*/
define('CONFIG_FILENAME', '../../visu_config%s.xml');
+define('BACKUP_FILENAME', '../../backup/visu_config%s-%s.xml');
// get everything the user has provided ...
$strJson = (true === isset($_POST['data'])) ? $_POST['data'] : null;
@@ -49,6 +50,20 @@
exitWithResponse(false, 'config-file is not writeable by webserver-process; please chmod/chown config-file \'' . $strConfigFQFilename . '\' (\'' . $strConfigFilename. '\').');
}
+// create a backup, but not for the previewtemp
+if ($strConfigCleaned !== '_previewtemp') {
+ // generate the backups filename
+ $strBackupFilename = sprintf(BACKUP_FILENAME, $strConfigCleaned, date('YmdHis'));
+ $strBackupFQDirname = realpath(dirname($strBackupFilename));
+
+ if (false === is_writeable($strBackupFQDirname)) {
+ exitWithResponse(false, 'backup-file is not writeable, please chmod/chown directory \'' . $strBackupFQDirname . '\'');
+ }
+
+ // make a copy of the file for backup-purposes
+ copy($strConfigFQFilename, $strBackupFilename);
+}
+
// bail out if no json/configuration-data was provided
if (true === empty($strJson)) {
exitWithResponse(false, 'no configuration-content given');
Modified: CometVisu/trunk/visu/editor/init.js
===================================================================
--- CometVisu/trunk/visu/editor/init.js 2013-01-21 08:25:57 UTC (rev 1352)
+++ CometVisu/trunk/visu/editor/init.js 2013-01-23 20:31:08 UTC (rev 1353)
@@ -49,23 +49,6 @@
alert(result.message);
});
-
- $(document).unbind('configuration_saving_error').bind('configuration_saving_error', function (event, result) {
- // something went wrong
- // we can not fix it, so let's simply inform the user, and leave.
- alert(result.message);
- });
-
-
- $(document).unbind('configuration_saving_success').bind('configuration_saving_success', function (event) {
- // everything is cool, configuration was saved
- // @TODO: maybe implement some sort of "traffic light" that goes to green when the configuration was saved?
- var tmpResult = new Result(false, Messages.configuration.saved);
- alert(tmpResult.message);
- });
-
-
-
$(document).unbind('schema_loaded').bind('schema_loaded', function () {
try {
Modified: CometVisu/trunk/visu/editor/lib/Configuration.js
===================================================================
--- CometVisu/trunk/visu/editor/lib/Configuration.js 2013-01-21 08:25:57 UTC (rev 1352)
+++ CometVisu/trunk/visu/editor/lib/Configuration.js 2013-01-23 20:31:08 UTC (rev 1353)
@@ -95,15 +95,21 @@
/**
* send the configuration to the server for saving
*
+ * @param filename string the filename to save to (optional, e.g. for saving to a temporary file)
* @return boolean success
*/
- _config.save = function () {
+ _config.save = function (filename) {
+ if (filename == undefined) {
+ // if no filename is given, use the one that we had for loading the file
+ filename = _filename;
+ }
+
var data = _config.getAsSerializable();
$.ajax('editor/bin/save_config.php',
{
dataType: 'json',
data: {
- config: _filename,
+ config: filename,
data: JSON.stringify(data),
},
type: 'POST',
@@ -379,6 +385,15 @@
};
/**
+ * return an id unique to this element
+ *
+ * @return integer the unique id
+ */
+ _element.getUID = function () {
+ return _uid;
+ };
+
+ /**
* set the SchemaElement for this ConfigurationElement.
* Goes recursive.
*
@@ -471,101 +486,32 @@
return false;
}
-
- // counting all our sub-elements
- var allSubElements = {};
-
- // populate this list with all allowed elements (with a counting of 0 (zero))
- var allowedSubElements = _schemaElement.getAllowedElements();
- if (allowedSubElements != undefined) {
- $.each(allowedSubElements, function (name, item) {
- allSubElements[name] = 0;
- });
- }
- delete allowedSubElements;
-
-
- if (_element.children.length > 0) {
- // if we have children, check them
-
- // go over list of all elements, and see if some are not valid
- // that's it
- $.each(_element.children, function (i, child) {
- if (isValid == false) {
+
+ var regexString = _schemaElement.getChildrenRegex(';');
+ var regExp = regexFromString(regexString);
+
+ var childrenString = '';
+ $.each(_element.children, function (i, child) {
+ if (child.name == '#text') {
+ // this is a text
+ if (false === _schemaElement.isMixed && false === _schemaElement.isTextContentAllowed()) {
+ informListeners('invalid', {type: 'text_not_allowed'});
+ isValid = false;
return;
}
-
- var childName = child.name;
- isValid = isValid && _schemaElement.isChildElementAllowed(childName);
+ // #text-nodes are not part of the string to match
- if (isValid == false) {
- informListeners('invalid', {type: 'element_disallowed', item: childName});
- return;
- }
-
- // count the number of occurences for this element
- if (undefined == allSubElements[childName]) {
- allSubElements[childName] = 0;
- }
- ++allSubElements[childName];
-
- // go recursive.
- isValid = isValid && child.isValid();
- });
- }
-
- if (false === isValid) {
- // bail out, if we already know that we failed
- return false;
- }
-
- // secondly, check with the bounds of their parent (i.e. their 'choice')
- // is NOT capable of multi-dimensional-choice-bounds (like in complexType mapping)
- var childBounds = _schemaElement.getChildBounds();
- if (childBounds != undefined) {
- // check bounds only if we have them :)
-
- // check all allowed and used elements against their personal bounds.
- // only if the choice-bounds of our parent are not undefined! (undefined = no choice, or multi-dimensional)
- // @FIXME: this is not how XSD-specifications say this works!
-// $.each(allSubElements, function (name, count) {
-// var bounds = _schemaElement.getSchemaElementForElementName(name).getBounds();
-//
-// if (bounds.min > count) {
-// // this element does not appear often enough
-// informListeners('invalid', {type: 'element_bounds_under', item: name});
-// isValid = false;
-// }
-//
-// if (bounds.max < count) {
-// // this element does not appear often enough
-// informListeners('invalid', {type: 'element_bounds_over', item: name});
-// isValid = false;
-// }
-// });
-
-
-
- if (childBounds.min > _element.children.length) {
- // less elements than defined by the bounds
- informListeners('invalid', {type: 'element_bounds_under'});
- isValid = false;
+ } else {
+ childrenString += child.name + ';';
}
-
- if (childBounds.max != 'unbounded') {
- if (childBounds.max < _element.children.length) {
- // more elements than defined by the bounds
- informListeners('invalid', {type: 'element_bounds_over'});
- isValid = false;
- }
- }
- }
-
- if (false === isValid) {
- // bail out, if we already know that we failed
+ });
+
+ if (false == regExp.test(childrenString)) {
+ // the children of this element do not match what the regex says is valid
+ informListeners('invalid', {type: 'regex_not_matched', regex: regexString, children: childrenString});
return false;
}
-
+
if (_element.children.length == 0 || _schemaElement.isMixed) {
// if this element has no children, it appears to be a text-node
// also, if it may be of mixed value
@@ -673,9 +619,84 @@
// set the parent of the new child!
childNode.setParentNode(_element);
+
+ // sort the child-nodes
+ sortChildNodes();
};
/**
+ * the list of sort-values for our children; needed and filled by sortChildNodes*
+ * @var object
+ */
+ var childSortValues = undefined;
+
+ /**
+ * re-sort child-elements based on a given sorting we might have from our schema
+ */
+ var sortChildNodes = function () {
+ // make a copy of the children-list
+ var tmpChildren = $.extend([], _element.children);
+
+ // get the sortValues once
+ if (childSortValues == undefined) {
+ childSortValues = _schemaElement.getAllowedElementsSorting();
+ }
+
+ // do the actual sorting
+ tmpChildren.sort(sortChildNodesHelper);
+
+ // set the children-list to the newly created, sorted, one
+ _element.children = tmpChildren;
+ };
+
+ /**
+ * the comparison-function that helps the sorting
+ *
+ * @param a mixed whatever sort gives us
+ * @param b mixed whatever sort gives us
+ * @return integer -1, 0, 1 - depending on sort-order
+ */
+ var sortChildNodesHelper = function (a, b) {
+ var aSortvalue = childSortValues[a.name];
+ var bSortvalue = childSortValues[b.name];
+
+ if (aSortvalue == undefined || bSortvalue == undefined) {
+ // undefined means: no sorting available
+ return 0;
+ }
+
+ if (aSortvalue == bSortvalue) {
+ // identical means 'no sorting necessary'
+ return 0;
+ }
+
+ // we need to go through the complete list of values the sorting is composed of,
+ // to find the first one that distinguishes a from b
+
+ // first, typecast to string!
+ if (typeof aSortvalue != 'string') {
+ aSortvalue = aSortvalue.toString();
+ }
+ if (typeof bSortvalue != 'string') {
+ bSortvalue = bSortvalue.toString();
+ }
+
+ var aSortvaluesList = aSortvalue.split('.');
+ var bSortvaluesList = bSortvalue.split('.');
+
+ for (var i = 0; i < aSortvaluesList.length; ++i) {
+ if (aSortvaluesList[i] < bSortvaluesList[i]) {
+ return -1;
+ } else if (aSortvaluesList[i] > bSortvaluesList[i]) {
+ return 1;
+ }
+ }
+
+ // if nothing else matched, then they are treated equal
+ return 0;
+ };
+
+ /**
* set the parent of this element.
* Needed for duplication, as we need to re-set the parent
*
@@ -721,6 +742,9 @@
// add the child
_element.children.splice(position, 0, child);
+
+ // we need to sort it afterwards, maybe the arbitrary position was too arbitrary :)
+ sortChildNodes();
}
/**
@@ -777,29 +801,22 @@
}
// the bounds of ourself, this means the maximum number of children as defined by a choice
- var myChildBounds = _schemaElement.getChildBounds();
- if (myChildBounds != undefined && myChildBounds.max >= _element.children.length) {
+ var myChildBounds = _schemaElement.getBoundsForElementName(childName);
+
+ var childCount = 0;
+
+ $.each(_element.children, function (i, child) {
+ if (child.name == childName) {
+ ++childCount;
+ }
+ });
+
+ if (myChildBounds != undefined && myChildBounds.max <= childCount) {
// no more children are allowed.
// sorry, you can not enter
return false;
}
- // the bounds of the specific element (child-to-be)
- var typeBounds = _schemaElement.getSchemaElementForElementName(childName).getBounds();
-
- // count the number of elements of this type we already have
- var count = 0;
- $.each(_element.children, function (i, item) {
- if (item.name == childName) {
- ++count;
- }
- });
-
- if (count >= typeBounds.max) {
- // if there are more elements of this type than allowed, then we're not ok
- return false;
- }
-
// no reason why to disallow the child-to-be
return true;
};
@@ -812,30 +829,27 @@
*/
_element.initFromScratch = function () {
+ // set the default-value, if one is given
+ if (_schemaElement.defaultValue != undefined) {
+ _element.setTextValue(_schemaElement.defaultValue);
+ }
+
+ // set the default-value to the attributes, if given
+ $.each(_schemaElement.allowedAttributes, function (attributeName, attributeSchema) {
+ if (attributeSchema.defaultValue != undefined) {
+ _element.setAttributeValue(attributeName, attributeSchema.defaultValue);
+ }
+ });
+
// empty our list of children (this is init, after all)
_element.children = [];
- // create a list of all elements that define their own min-occurences
- var neededElements = {};
- var allowedSubElements = _schemaElement.getAllowedElements();
- if (allowedSubElements != undefined) {
- $.each(allowedSubElements, function (name, item) {
- var bounds = item.getBounds();
-
- if (bounds.min > 0) {
- neededElements[name] = bounds.min;
- }
- });
- }
- delete allowedSubElements;
-
+ var requiredElements = _schemaElement.getRequiredElements();
+
// create elements for all items with min-occurences
- $.each(neededElements, function (name, count) {
- // create the appropriate amount of children of each needed type
- for (var i = 0; i < count; ++i) {
- // create a new child; this auto-recurses!
- _element.createChildNode(name);
- }
+ $.each(requiredElements, function (i, name) {
+ // create a new child; this auto-recurses!
+ _element.createChildNode(name);
});
};
@@ -1098,4 +1112,22 @@
*/
var listeners = [];
+ /**
+ * unique id
+ * @var integer
+ */
+ var _uid = uniqueID();
+
};
+
+/**
+ * creator of unique IDs
+ * source: http://arguments.callee.info/2008/10/31/generating-unique-ids-with-javascript/
+ * no license mentioned.
+ */
+var uniqueID = function() {
+ var id = 1; // initial value
+ return function() {
+ return id++;
+ }; // NOTE: return value is a function reference
+}(); // execute immediately
\ No newline at end of file
Modified: CometVisu/trunk/visu/editor/lib/Editor.css
===================================================================
--- CometVisu/trunk/visu/editor/lib/Editor.css 2013-01-21 08:25:57 UTC (rev 1352)
+++ CometVisu/trunk/visu/editor/lib/Editor.css 2013-01-23 20:31:08 UTC (rev 1353)
@@ -455,6 +455,11 @@
background-color: #D88F8F;
}
+#config .element > .attributes > .attribute .documentation {
+ display: inline-block;
+ font-size: 85%;
+}
+
#config .element .value.notset {
opacity: 0.3;
filter: alpha(opacity=30);
Modified: CometVisu/trunk/visu/editor/lib/Editor.js
===================================================================
--- CometVisu/trunk/visu/editor/lib/Editor.js 2013-01-21 08:25:57 UTC (rev 1352)
+++ CometVisu/trunk/visu/editor/lib/Editor.js 2013-01-23 20:31:08 UTC (rev 1353)
@@ -50,21 +50,133 @@
*/
var _config = config;
+
/**
- * save the configuration, but validate it first
+ * filename-suffix for the preview-configuration
+ * @var string
*/
- var saveHandler = function () {
- if (false === _config.isValid()) {
- // configuration is not valid
- alert(Messages.editor.notSavingInvalidConfiguration);
- return;
+ var _previewSuffix = 'previewtemp';
+
+ /**
+ * disable the feedback on a successful 'save configuration'
+ * will be honoured once only, and then reset!
+ * @var boolean
+ */
+ var savingPreview = false;
+
+ /**
+ * is the expert-mode active?
+ * @var boolean
+ */
+ var isExpert = false;
+
+ var clickHandler = function (event) {
+ var $button = $(this);
+
+ if ($button.is('.save')) {
+ // save configuration
+ if (false === _config.isValid()) {
+ // configuration is not valid
+ alert(Messages.editor.notSavingInvalidConfiguration);
+ return;
+ }
+
+ // save the configuration
+ _config.save();
}
- // save the configuration
- _config.save();
+ if ($button.is('.preview')) {
+ // preview configuration
+
+ if ($('iframe#preview').length > 0) {
+ // there already is a preview - so toggle back and return to editing
+ $('iframe#preview').remove();
+ $('ul#config').show();
+ $('.menu .button.preview').removeClass('active');
+ return;
+ }
+
+ if (false === _config.isValid()) {
+ // configuration is not valid
+ alert(Messages.editor.notSavingInvalidConfiguration);
+ return;
+ }
+
+ savingPreview = true;
+ $(document).one('configuration_saving_success', previewShowHandler);
+
+ // save the configuration
+ _config.save('visu_config_' + _previewSuffix + '.xml');
+ }
+
+
+ if ($button.is('.expert')) {
+ // show/hide expert-attributes
+ $('#config').find('.expert').toggle();
+ $button.toggleClass('active');
+
+ isExpert = $button.hasClass('active');
+ }
};
+
+
+ /**
+ * eventHandler
+ *
+ * @param event jQuery-Event
+ */
+ var eventHandler = function (event, result) {
+ switch (event.type) {
+ case 'configuration_saving_error':
+ // something went wrong
+ // we can not fix it, so let's simply inform the user, and leave.
+ alert(result.message);
+ break;
+ case 'configuration_saving_success':
+ // everything is cool, configuration was saved
+ // @TODO: maybe implement some sort of "traffic light" that goes to green when the configuration was saved?
+
+ if (false === savingPreview) {
+ // only show feedback if this is not saving a preview ...
+ var tmpResult = new Result(false, Messages.configuration.saved);
+ alert(tmpResult.message);
+ }
+
+ break;
+ }
+
+ // re-enable saving success feedback to 'true'
+ savingPreview = false;
+ };
/**
+ * preview the configuration.
+ * this handler is called AFTER the preview-configuration has already been saved
+ */
+ var previewShowHandler = function () {
+ // remove a preview if there is one (should never happen, but better be safe than sorry)
+ $('iframe#preview').remove();
+
+ // mark the button as being active
+ $('.menu .button.preview').addClass('active');
+
+
+ // hide the editing-view
+ $('ul#config').hide();
+
+ // create, and render the preview
+ var $preview = $('<iframe />')
+ $preview.attr({id: 'preview', src: 'index.html?config=' + _previewSuffix});
+
+
+ var height = $(window).height() - $('#editor .menu').height() - $('#editor .menu').position().top;
+
+ $preview.css({width: '100%', height: height + 'px', border: 'none'});
+
+ $('#editor').append($preview);
+ };
+
+ /**
* render the Editor.
* Will render the editor in the specified DOMNode.
*
@@ -96,15 +208,35 @@
.addClass('save')
.html(Messages.editor.ui.save.text)
.attr('title', Messages.editor.ui.save.tooltip)
- .click(saveHandler);
+ .click(clickHandler);
$menu.append($save);
-
+
+ var $expert = $('<span />')
+ .addClass('button')
+ .addClass('expert')
+ .html(Messages.editor.ui.expert.text)
+ .attr('title', Messages.editor.ui.expert.tooltip)
+ .click(clickHandler);
+ $menu.append($expert);
+
+ var $preview = $('<span />')
+ .addClass('button')
+ .addClass('preview')
+ .html(Messages.editor.ui.preview.text)
+ .attr('title', Messages.editor.ui.preview.tooltip)
+ .click(clickHandler);
+ $menu.append($preview);
+
$editor.append($menu);
$editor.append($container);
$target.append($editor);
+
+ // register event-handlers
+ $(document).bind('configuration_saving_error', eventHandler);
+ $(document).bind('configuration_saving_success', eventHandler);
};
var rememberedElement = {
@@ -144,6 +276,15 @@
_editor.getRememberedElementOptions = function () {
return rememberedElement.options;
};
+
+ /**
+ * find out if expert attributes are to be visible
+ *
+ * @return boolean
+ */
+ _editor.areExpertAttributesVisible = function () {
+ return isExpert;
+ }
}
/**
@@ -177,6 +318,12 @@
var KEYCODE_ESCAPE = 27;
/**
+ * cache of children
+ * @var array
+ */
+ var _childrenCache = {};
+
+ /**
* everything to do with buttons
* @var object
*/
@@ -274,8 +421,8 @@
// Spacer
$html.append($menuitem.clone().addClass('spacer'));
- // cut, copy, paste, sort (like move with same parent)
- $.each(['cut', 'copy', 'paste', 'sort'], function (i, item) {
+ // cut, copy, paste
+ $.each(['cut', 'copy', 'paste'], function (i, item) {
$tmpItem = $menuitem.clone();
$tmpItem.addClass(item).click(UIElements.clickHandler);
$tmpItem.attr('title', Messages.editor.ui[item].tooltip);
@@ -283,8 +430,21 @@
$html.append($tmpItem);
delete $tmpItem;
});
+
+ // sort (like move with same parent); only if the parent allows for sorting!
+ // (check tyepof getConfigurationElement, as the root-element has no such thing)
+ if (typeof _parent.getConfigurationElement == 'function'
+ && true === _parent.getConfigurationElement().getSchemaElement().areChildrenSortable()) {
+ $tmpItem = $menuitem.clone();
+ $tmpItem.addClass('sort').click(UIElements.clickHandler);
+ $tmpItem.attr('title', Messages.editor.ui['sort'].tooltip);
+ $tmpItem.text(Messages.editor.ui['sort'].text);
+ $html.append($tmpItem);
+ delete $tmpItem;
+ }
+
// search for the paste-button, and tell it which elements to allow
var $paste = $html.find('.menuitem.paste');
$.each(_element.getAllowedElements(), function (name) {
@@ -446,8 +606,7 @@
var newElement = originalElement.getDuplicateForParent(_element);
_element.appendChildNode(newElement);
- var newEditorElement = new EditorConfigurationElement(_self, newElement);
- _self.appendChildNode(newEditorElement);
+ _self.redrawHTML();
if (options.type == 'cut') {
// remove the original element if type was cut
@@ -497,16 +656,16 @@
var sortableElement = _self.getConfigurationElement();
// clone the ConfigurationElement, and create a new EditorConfigurationElement with that
- var sortedElement = $.extend(true, {}, sortableElement);
+ sor...
[truncated message content] |
|
From: <pe...@us...> - 2013-01-29 09:03:10
|
Revision: 1371
http://openautomation.svn.sourceforge.net/openautomation/?rev=1371&view=rev
Author: peuter
Date: 2013-01-29 09:03:03 +0000 (Tue, 29 Jan 2013)
Log Message:
-----------
- new possibility to enable a simple status-update-queue, which loads the startpage items status first and then all other items status, can be enabled via URL-Parameter ?enableQueue=1
Modified Paths:
--------------
CometVisu/trunk/visu/lib/cometvisu-client.js
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/plugins/clock/structure_plugin.js
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
CometVisu/trunk/visu/plugins/svg/structure_plugin.js
CometVisu/trunk/visu/structure/pure/_common.js
CometVisu/trunk/visu/structure/pure/page.js
Modified: CometVisu/trunk/visu/lib/cometvisu-client.js
===================================================================
--- CometVisu/trunk/visu/lib/cometvisu-client.js 2013-01-28 19:53:55 UTC (rev 1370)
+++ CometVisu/trunk/visu/lib/cometvisu-client.js 2013-01-29 09:03:03 UTC (rev 1371)
@@ -33,18 +33,23 @@
var thisCometVisu = this;
this.urlPrefix = (null == urlPrefix) ? '' : urlPrefix; // the address of the service
this.addresses = []; // the subscribed addresses
+ this.initialAddresses = []; // the addresses which should be loaded before the subscribed addresses
this.filters = []; // the subscribed filters
this.user = ''; // the current user
this.pass = ''; // the current password
this.device = ''; // the current device ID
this.running = false; // is the communication running at the moment?
- this.doRestart = false; // are we currently in a reastart, e.g. due to the watchdog
+ this.doRestart = false; // are we currently in a restart, e.g. due to the watchdog
this.xhr = false; // the ongoing AJAX request
- this.watchdogTimer = 5; // in Seconds - the alive check intervall of the watchdog
+ this.watchdogTimer = 5; // in Seconds - the alive check interval of the watchdog
this.maxConnectionAge = 60; // in Seconds - restart if last read is older
- this.maxDataAge = 3200; // in Seconds - reload all data when last successfull read is older
+ this.maxDataAge = 3200; // in Seconds - reload all data when last successful read is older
// (should be faster than the index overflow at max data rate, i.e. 2^16 @ 20 tps for KNX TP)
this.lastIndex = -1; // index returned by the last request
+
+ this.setInitialAddresses = function(addresses) {
+ this.initialAddresses = addresses;
+ }
/**
* This function gets called once the communication is established and session information is available
@@ -60,7 +65,13 @@
// send first request
this.running = true;
- this.xhr = $.ajax( {url:this.urlPrefix + 'r',dataType: 'json',context:this,data:this.buildRequest()+'&t=0', success:this.handleRead ,error:this.handleError/*,complete:this.handleComplete*/ } );
+ if (this.initialAddresses.length) {
+ this.xhr = $.ajax({url:this.urlPrefix + 'r',dataType: 'json',context:this,data:this.buildRequest(this.initialAddresses)+'&t=0', success:this.handleReadStart} );
+ }
+ else {
+ // old behaviour -> start full query
+ this.xhr = $.ajax({url:this.urlPrefix + 'r',dataType: 'json',context:this,data:this.buildRequest()+'&t=0', success:this.handleRead ,error:this.handleError/*,complete:this.handleComplete*/ } );
+ }
};
/**
@@ -92,6 +103,28 @@
watchdog.ping();
}
};
+
+ this.handleReadStart = function( json )
+ {
+ if( !json && (-1 == this.lastIndex) )
+ {
+ if( this.running )
+ { // retry initial request
+ this.xhr = $.ajax({url:this.urlPrefix + 'r',dataType: 'json',context:this,data:this.buildRequest(this.startPageAddresses)+'&t=0', success:this.handleReadStart} );
+ watchdog.ping();
+ }
+ return;
+ }
+ if( json && !this.doRestart )
+ {
+ this.update( json.d );
+ }
+ if( this.running )
+ { // keep the requests going
+ this.xhr = $.ajax({url:this.urlPrefix + 'r',dataType: 'json',context:this,data:this.buildRequest()+'&t=0', success:this.handleRead ,error:this.handleError/*,complete:this.handleComplete*/ } );
+ watchdog.ping();
+ }
+ };
/**
* This function gets called on an error
@@ -123,11 +156,12 @@
* Build the URL part that contains the addresses and filters
* @method buildRequest
*/
- this.buildRequest = function()
+ this.buildRequest = function(addresses)
{
- var requestAddresses = (this.addresses.length)?'a=' + this.addresses.join( '&a=' ):'';
+ addresses = addresses ? addresses : this.addresses;
+ var requestAddresses = (addresses.length)?'a=' + addresses.join( '&a=' ):'';
var requestFilters = (this.filters.length )?'f=' + this.filters.join( '&f=' ):'';
- return 's=' + this.session + '&' + requestAddresses + ( (this.addresses.length&&this.filters.length)?'&':'' ) + requestFilters;
+ return 's=' + this.session + '&' + requestAddresses + ( (addresses.length&&this.filters.length)?'&':'' ) + requestFilters;
}
/**
@@ -138,14 +172,7 @@
this.subscribe = function( addresses, filters )
{
var startCommunication = !this.addresses.length; // start when addresses were empty
- this.addresses=[];
- var obj={};
- for (var i=0;i<addresses.length;i++) {
- obj[addresses[i]]=0;
- }
- for (var i in obj) {
- this.addresses.push(i);
- }
+ this.addresses= addresses ? addresses : [];
this.filters = filters ? filters : [] ;
if( !addresses.length ) this.stop(); // stop when new addresses are empty
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-01-28 19:53:55 UTC (rev 1370)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-01-29 09:03:03 UTC (rev 1371)
@@ -51,7 +51,7 @@
this.mappings = {}; // store the mappings
this.stylings = {}; // store the stylings
- this.ga_list = [];
+ var ga_list = {};
this.main_scroll;
this.old_scroll = '';
@@ -63,6 +63,9 @@
this.defaultColumns = 12;
this.minColumnWidth = 150;
this.enableColumnAdjustment = false;
+
+ this.enableAddressQueue = $.getUrlVar('enableQueue') ? true : false;
+
this.backend = 'cgi-bin'; // default path to backend
if ($.getUrlVar("backend")) {
this.backend = $.getUrlVar("backend");
@@ -132,6 +135,14 @@
.decode(value) : (basetrans in Transform ? Transform[basetrans]
.decode(value) : value);
};
+
+ this.addAddress = function(address) {
+ ga_list[address]=1;
+ };
+
+ this.getAddresses = function() {
+ return Object.keys(ga_list);
+ };
this.map = function(value, this_map) {
if (this_map && thisTemplateEngine.mappings[this_map]) {
@@ -520,14 +531,11 @@
if (thisTemplateEngine.scrollSpeed != undefined) {
thisTemplateEngine.main_scroll.getConf().speed = thisTemplateEngine.scrollSpeed;
}
-
+ var startpage = 'id_0';
if ($.getUrlVar('startpage')) {
- thisTemplateEngine.scrollToPage('id_' + $.getUrlVar('startpage'), 0);
- } else {
- thisTemplateEngine.scrollToPage('id_0', 0); // simple solution to show
- // page name on top at
- // start
+ startpage='id_' + $.getUrlVar('startpage');
}
+ thisTemplateEngine.scrollToPage(startpage,0);
$('.fast').bind('click', function() {
thisTemplateEngine.main_scroll.seekTo($(this).text());
@@ -662,8 +670,18 @@
$('svg', svg).prepend(s);
};
});
-
- thisTemplateEngine.visu.subscribe(thisTemplateEngine.ga_list);
+ if (thisTemplateEngine.enableAddressQueue) {
+ // identify addresses on startpage
+ var startPageAddresses = {};
+ $('.actor','#'+startpage).each(function() {
+ var address = $(this).data('address');
+ for (var ga in address) {
+ startPageAddresses[ga.substring(1)]=1;
+ }
+ });
+ thisTemplateEngine.visu.setInitialAddresses(Object.keys(startPageAddresses));
+ }
+ thisTemplateEngine.visu.subscribe(thisTemplateEngine.getAddresses());
$(window).trigger('resize');
$("#pages").triggerHandler("done");
};
Modified: CometVisu/trunk/visu/plugins/clock/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/clock/structure_plugin.js 2013-01-28 19:53:55 UTC (rev 1370)
+++ CometVisu/trunk/visu/plugins/clock/structure_plugin.js 2013-01-29 09:03:03 UTC (rev 1371)
@@ -35,7 +35,7 @@
var transform = this.getAttribute('transform');
var color = this.getAttribute('variant' );
var readonly = this.getAttribute('readonly' );
- templateEngine.ga_list.push( src );
+ templateEngine.addAddress( src );
address[ '_' + src ] = [ transform, color, readonly=='true' ];
});
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-28 19:53:55 UTC (rev 1370)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-29 09:03:03 UTC (rev 1371)
@@ -231,7 +231,7 @@
var address = {};
$p.find('address').each( function(){
var src = this.textContent;
- templateEngine.ga_list.push( src );
+ templateEngine.addAddress( src );
address[ '_' + src ] = [ this.getAttribute('transform') ];
});
Modified: CometVisu/trunk/visu/plugins/svg/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/svg/structure_plugin.js 2013-01-28 19:53:55 UTC (rev 1370)
+++ CometVisu/trunk/visu/plugins/svg/structure_plugin.js 2013-01-29 09:03:03 UTC (rev 1371)
@@ -35,7 +35,7 @@
var transform = this.getAttribute('transform');
var color = this.getAttribute('variant' );
var readonly = this.getAttribute('readonly' );
- templateEngine.ga_list.push( src );
+ templateEngine.addAddress( src );
address[ '_' + src ] = [ transform, color, readonly=='true' ];
});
Modified: CometVisu/trunk/visu/structure/pure/_common.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/_common.js 2013-01-28 19:53:55 UTC (rev 1370)
+++ CometVisu/trunk/visu/structure/pure/_common.js 2013-01-29 09:03:03 UTC (rev 1371)
@@ -108,8 +108,8 @@
break;
}
var variantInfo = handleVariant ? handleVariant( src, transform, mode, this.getAttribute('variant') ) : [true, undefined];
- if( variantInfo[0] )
- templateEngine.ga_list.push( src );
+ if( variantInfo[0])
+ templateEngine.addAddress( src );
address[ '_' + src ] = [ transform, mode, variantInfo[1] ];
return; // end of each-func
});
Modified: CometVisu/trunk/visu/structure/pure/page.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/page.js 2013-01-28 19:53:55 UTC (rev 1370)
+++ CometVisu/trunk/visu/structure/pure/page.js 2013-01-29 09:03:03 UTC (rev 1371)
@@ -22,7 +22,7 @@
var address = {};
if ($p.attr('ga')) {
src = $p.attr('ga');
- templateEngine.ga_list.push($p.attr('ga'));
+ templateEngine.addAddress($p.attr('ga'));
address[ '_' + $p.attr('ga') ] = [ 'DPT:1.001', 0 ];
}
@@ -80,17 +80,17 @@
}}, floorplan.translateMouseEvent );
$(window).bind( 'resize', function(){ floorplan.resize($('.page').width(), $('.page').height(), true);} );
if ($p.attr('azimut')) {
- templateEngine.ga_list.push($p.attr('azimut'));
+ templateEngine.addAddress($p.attr('azimut'));
address[ '_' + $p.attr('azimut') ] = [ 'DPT:9.001', 0, 'azimut' ];
container.bind( '_' + $p.attr('azimut'), this.update );
}
if ($p.attr('elevation')) {
- templateEngine.ga_list.push($p.attr('elevation'));
+ templateEngine.addAddress($p.attr('elevation'));
address[ '_' + $p.attr('elevation') ] = [ 'DPT:9.001', 0, 'elevation' ];
container.bind( '_' + $p.attr('elevation'), this.update );
};
if ($p.attr('floor')) {
- templateEngine.ga_list.push($p.attr('floor'));
+ templateEngine.addAddress($p.attr('floor'));
address[ '_' + $p.attr('floor') ] = [ 'DPT:5.004', 0, 'floor' ];
container.bind( '_' + $p.attr('floor'), this.update );
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2013-02-02 20:08:19
|
Revision: 1388
http://openautomation.svn.sourceforge.net/openautomation/?rev=1388&view=rev
Author: mayerch
Date: 2013-02-02 20:08:12 +0000 (Sat, 02 Feb 2013)
Log Message:
-----------
Improve scrolling for iOS devices (see bug tracker 3603028)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/designglobals.css
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/designs/designglobals.css
===================================================================
--- CometVisu/trunk/visu/designs/designglobals.css 2013-02-02 17:00:22 UTC (rev 1387)
+++ CometVisu/trunk/visu/designs/designglobals.css 2013-02-02 20:08:12 UTC (rev 1388)
@@ -23,6 +23,7 @@
}
#main {
width: 100%;
+ -webkit-overflow-scrolling:touch;
}
#navbarLeft {
width: 0px; /* left bar width */
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-02-02 17:00:22 UTC (rev 1387)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-02-02 20:08:12 UTC (rev 1388)
@@ -500,6 +500,14 @@
$e.css('width', ourWidth + '%');
});
+ // Prevent elastic scrolling apart the main pane for iOS devices
+ $(document).bind( 'touchmove', function(e) {
+ e.preventDefault();
+ });
+ $('#main').bind( 'touchmove', function(e) {
+ e.stopPropagation();
+ });
+
// setup the scrollable
thisTemplateEngine.main_scroll = $('#main').scrollable({
keyboard : false,
@@ -1340,4 +1348,4 @@
}
});
};
-}
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2013-02-02 22:45:05
|
Revision: 1391
http://openautomation.svn.sourceforge.net/openautomation/?rev=1391&view=rev
Author: mayerch
Date: 2013-02-02 22:44:58 +0000 (Sat, 02 Feb 2013)
Log Message:
-----------
Extend infotrigger also for shorttime
Modified Paths:
--------------
CometVisu/trunk/visu/structure/pure/_common.js
CometVisu/trunk/visu/structure/pure/infotrigger.js
CometVisu/trunk/visu/visu_config.xsd
CometVisu/trunk/visu/visu_config_demo.xml
Modified: CometVisu/trunk/visu/structure/pure/_common.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/_common.js 2013-02-02 21:22:00 UTC (rev 1390)
+++ CometVisu/trunk/visu/structure/pure/_common.js 2013-02-02 22:44:58 UTC (rev 1391)
@@ -82,8 +82,12 @@
/*
* this function extracts all addresses with attributes (JNK)
+ *
+ * @param handleVariant is a callback function that returns an array of two
+ * elements. The first is a boolean that determins if
+ * the visu should listen for that address. The second
+ * is added as it is to the returned object.
*/
-
function makeAddressList( page, handleVariant ) {
var address = {};
page.find('address').each( function(){
@@ -314,9 +318,9 @@
function defaultValueHandling( e, data, passedElement )
{
var element = passedElement || $(this);
- var thisTransform = element.data().address[ e.type ][0];
+ var thisTransform = element.data().address[ e.type ][0];
// #1: transform the raw value to a JavaScript type
- var value = templateEngine.transformDecode( element.data().address[ e.type ][0], data );
+ var value = templateEngine.transformDecode( element.data().address[ e.type ][0], data );
element.data( 'basicvalue', value ); // store it to be able to supress sending of unchanged data
Modified: CometVisu/trunk/visu/structure/pure/infotrigger.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/infotrigger.js 2013-02-02 21:22:00 UTC (rev 1390)
+++ CometVisu/trunk/visu/structure/pure/infotrigger.js 2013-02-02 22:44:58 UTC (rev 1391)
@@ -28,7 +28,7 @@
// handle addresses
var address = makeAddressList($e,
function( src, transform, mode, variant ) {
- return [ variant != 'button', variant == 'button' ];
+ return [ variant != 'button' && variant != 'short', variant == 'button' ? 1 : (variant == 'short' ? 2 : 0) ];
}
);
@@ -43,20 +43,25 @@
actordown += '<div class="value">' + ($e.attr('downlabel') ? $e.attr('downlabel') : '-') + '</div>';
actordown += '</div>';
var $actordown = $(actordown).data( {
- 'address' : address,
- 'mapping' : $e.attr('mapping'),
- 'styling' : $e.attr('styling'),
- 'value' : $e.attr('downvalue') || 0,
- 'align' : $e.attr('align'),
- 'change' : $e.attr('change') || 'relative',
- 'min' : parseFloat($e.attr('min')) || 0,
- 'max' : parseFloat($e.attr('max')) || 255,
- 'type' : 'switch'
- } ).bind( 'click', this.action ).bind( 'mousedown', function(){
+ 'address' : address,
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'value' : $e.attr('downvalue') || 0,
+ 'shortvalue' : $e.attr('shortdownvalue') || 0,
+ 'shorttime' : parseFloat($e.attr('shorttime')) || -1,
+ 'align' : $e.attr('align'),
+ 'change' : $e.attr('change') || 'relative',
+ 'min' : parseFloat($e.attr('min')) || 0,
+ 'max' : parseFloat($e.attr('max')) || 255,
+ 'type' : 'switch'
+ } ).bind( 'mousedown touchstart', this.mousedown ).
+ bind( 'mouseup touchend', this.mouseup ).
+ bind( 'mouseout touchout', this.mouseout );/*.
+ .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');
- } );
+ } );*/
var actorup = '<div class="actor switchUnpressed uplabel" ';
if ( $e.attr( 'align' ) )
@@ -65,20 +70,24 @@
actorup += '<div class="value">' + ($e.attr('uplabel') ? $e.attr('uplabel') : '+') + '</div>';
actorup += '</div>';
var $actorup = $(actorup).data( {
- 'address' : address,
- 'mapping' : $e.attr('mapping'),
- 'styling' : $e.attr('styling'),
- 'value' : $e.attr('upvalue') || 1,
- 'align' : $e.attr('align'),
- 'change' : $e.attr('change') || 'relative',
- 'min' : parseFloat($e.attr('min')) || 0,
- 'max' : parseFloat($e.attr('max')) || 255,
- 'type' : 'switch'
- } ).bind( 'click', this.action ).bind( 'mousedown', function(){
+ 'address' : address,
+ 'mapping' : $e.attr('mapping'),
+ 'styling' : $e.attr('styling'),
+ 'value' : $e.attr('upvalue') || 1,
+ 'shortvalue' : $e.attr('shortupvalue') || 1,
+ 'shorttime' : parseFloat($e.attr('shorttime')) || -1,
+ 'align' : $e.attr('align'),
+ 'change' : $e.attr('change') || 'relative',
+ 'min' : parseFloat($e.attr('min')) || 0,
+ 'max' : parseFloat($e.attr('max')) || 255,
+ 'type' : 'switch'
+ } ).bind( 'mousedown touchstart', this.mousedown ).
+ bind( 'mouseup touchend', this.mouseup ).
+ bind( 'mouseout touchout', this.mouseout );/*..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');
- } );
+ } );*/
var actorinfo = '<div class="actor switchInvisible " ';
if ( $e.attr( 'align' ) )
@@ -120,24 +129,44 @@
var value = defaultUpdate( e, d, element );
element.addClass('switchInvisible');
},
- action: function() {
- var data = $(this).data();
- var value = data.value;
- var relative = ( data.change != 'absolute' );
- if( !relative )
+ mousedown: function(event) {
+ $(this).removeClass('switchUnpressed').addClass('switchPressed').data( 'downtime', new Date().getTime() );
+ if( 'touchstart' == event.type )
{
- value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
- if( isNaN( value ) )
- value = 0; // anything is better than NaN...
- value = value + parseFloat(data.value);
- if (value < data.min ) value = data.min;
- if( value > data.max ) value = data.max;
+ // touchscreen => disable mouse emulation
+ $(this).unbind('mousedown').unbind('mouseup').unbind('mouseout');
}
- for( var addr in data.address )
+ },
+ mouseup: function(event) {
+ var $this = $(this);
+ if( $this.data( 'downtime' ) )
{
- if( !(data.address[addr][1] & 2) ) continue; // skip when write flag not set
- if( data.address[addr][2] != relative ) continue; // skip when address mode doesn't fit action mode
- templateEngine.visu.write( addr.substr(1), templateEngine.transformEncode( data.address[addr][0], value ) );
+ var data = $this.data();
+ var isShort = (new Date().getTime()) - data.downtime < data.shorttime;
+ var value = data.value;
+ var relative = ( data.change != 'absolute' );
+ if( !relative )
+ {
+ value = parseFloat($(this).parent().find('.switchInvisible').data('basicvalue'));
+ if( isNaN( value ) )
+ value = 0; // anything is better than NaN...
+ value = value + parseFloat(data.value);
+ if (value < data.min ) value = data.min;
+ if( value > data.max ) value = data.max;
+ }
+ for( var addr in data.address )
+ {
+ if( !(data.address[addr][1] & 2) ) continue; // skip when write flag not set
+ if( !isShort && 1 == data.address[addr][2] )
+ templateEngine.visu.write( addr.substr(1), templateEngine.transformEncode( data.address[addr][0], data.shortvalue ) );
+ if( ( isShort && 2 == data.address[addr][2]) ||
+ (!relative && 0 == data.address[addr][2]) )
+ templateEngine.visu.write( addr.substr(1), templateEngine.transformEncode( data.address[addr][0], value ) );
+ }
}
+ $this.removeClass('switchPressed').addClass('switchUnpressed').removeData( 'downtime' );
+ },
+ mouseout: function(event) {
+ $(this).removeClass('switchPressed').addClass('switchUnpressed').removeData( 'downtime' );
}
});
\ No newline at end of file
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2013-02-02 21:22:00 UTC (rev 1390)
+++ CometVisu/trunk/visu/visu_config.xsd 2013-02-02 22:44:58 UTC (rev 1391)
@@ -570,10 +570,22 @@
<xsd:element name="address" type="address" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="upvalue" type="xsd:string" use="optional" />
+ <xsd:attribute name="shortupvalue" type="xsd:string" use="optional" />
<xsd:attribute name="downvalue" type="xsd:string" use="optional" />
+ <xsd:attribute name="shortdownvalue" type="xsd:string" use="optional" />
<xsd:attribute name="uplabel" type="xsd:string" use="optional" />
<xsd:attribute name="downlabel" type="xsd:string" use="optional" />
- <xsd:attribute name="change" type="xsd:string" use="optional" />
+ <xsd:attribute name="shorttime" type="xsd:decimal" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Time in milliseconds that is accepted as shorttime.</xsd:documentation>
+ <xsd:documentation xml:lang="de">Zeit in Millisekunden innerhalb der der Tastendruck als Kurzzeit interpretiert wird.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="change" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Might be 'absolute' or 'relative'.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
<xsd:attribute ref="min" />
<xsd:attribute ref="max" />
<xsd:attribute ref="mapping" use="optional" />
Modified: CometVisu/trunk/visu/visu_config_demo.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_demo.xml 2013-02-02 21:22:00 UTC (rev 1390)
+++ CometVisu/trunk/visu/visu_config_demo.xml 2013-02-02 22:44:58 UTC (rev 1391)
@@ -231,14 +231,20 @@
<address transform="DPT:1.001" type="">12/7/1</address>
<address transform="DPT:1.001" type="" variant="short">12/7/10</address>
</trigger>
- <info mapping="KonnexHVAC">
+ <info>
<label>Info: Kurzzeit</label>
<address transform="DPT:1.001" type="">12/7/10</address>
</info>
- <info mapping="KonnexHVAC">
+ <info>
<label>Info: Langzeit</label>
<address transform="DPT:1.001" type="">12/7/1</address>
</info>
+ <infotrigger uplabel="Sende 1" upvalue="1" shortupvalue="1" downlabel="Sende 0" downvalue="0" shortdownvalue="0" shorttime="300" align="center" infoposition="1" change="relative" format="%.1f%%">
+ <label>Infotrigger mit 300ms Kurzzeit</label>
+ <address transform="DPT:16.000" mode="read" variant="display">12/7/16</address>
+ <address transform="DPT:1.001" variant="button">12/7/1</address>
+ <address transform="DPT:1.001" variant="short">12/7/10</address>
+ </infotrigger>
</page>
<break/>
<slide min="-18" max="26">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ha...@us...> - 2013-02-02 23:14:58
|
Revision: 1392
http://openautomation.svn.sourceforge.net/openautomation/?rev=1392&view=rev
Author: hausl
Date: 2013-02-02 23:14:52 +0000 (Sat, 02 Feb 2013)
Log Message:
-----------
changed shownavbar attribute of a page into 4 single attributes for top, bottom, left, right
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/structure/pure/page.js
CometVisu/trunk/visu/visu_config.xsd
CometVisu/trunk/visu/visu_config_metal.xml
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-02-02 22:44:58 UTC (rev 1391)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-02-02 23:14:52 UTC (rev 1392)
@@ -1025,65 +1025,26 @@
};
/**
- * parse a string with up to four, space-separated values usage like css
- * settings, e.g width: 1px 2px 3px 4px (top-, right-, bottom-, left-width)
+ * update the visibility of top-navigation, footer and navbar for this page
*
- * @param value
- */
- this.parseTopRightBottomLeftString = function(value) {
- var parts = value.split(" ");
- if (parts.length == 4) {
- return {
- top : parts[0],
- right : parts[1],
- bottom : parts[2],
- left : parts[3]
- };
- } else if (parts.length == 3) {
- return {
- top : parts[0],
- right : parts[1],
- bottom : parts[2],
- left : parts[1]
- };
- } else if (parts.length == 2) {
- return {
- top : parts[0],
- right : parts[1],
- bottom : parts[0],
- left : parts[1]
- };
- } else if (parts.length == 1) {
- return {
- top : parts[0],
- right : parts[0],
- bottom : parts[0],
- left : parts[0]
- };
- } else
- return {
- top : '',
- right : '',
- bottom : '',
- left : ''
- };
- };
-
- /**
- * update the visibility ob top-navigation, footer and navbar for this page
- *
* @param page
*/
this.updatePageParts = function(page) {
// default values
var showtopnavigation = true;
var showfooter = true;
- var shownavbar = {
- top : "true",
- right : "true",
- bottom : "true",
- left : "true"
- };
+ var shownavbar = (page.data().shownavbar != undefined ? page.data().shownavbar : {
+ top : 'inherit',
+ bottom : 'inherit',
+ left : 'inherit',
+ right : 'inherit'
+ });
+ // set inherit for undefined
+ for (var pos in shownavbar) {
+ if (shownavbar[pos] == undefined) {
+ shownavbar[pos] = 'inherit';
+ }
+ }
if (page.data() != null) {
if (page.data().showtopnavigation != undefined) {
@@ -1112,46 +1073,44 @@
parentPage = templateEngine.getParentPage(parentPage);
}
}
- if (page.data().shownavbar != undefined) {
- shownavbar = thisPagePartsHandler.parseTopRightBottomLeftString(page.data().shownavbar);
- } else {
- // traverse up the page tree
- var inheritedShowNavbar = {
- top : 'inherit',
- right : 'inherit',
- bottom : 'inherit',
- left : 'inherit'
- };
- var parentPage = templateEngine.getParentPage(page);
- while (parentPage != null) {
+
+ // traverse up the page tree for shownavbar
+ var parentPage = templateEngine.getParentPage(page);
+ while (parentPage != null) {
+ // do we need to go further? Check for inheritance
+ var inherit = false;
+ for (var pos in shownavbar) {
+ if (shownavbar[pos] == 'inherit') {
+ inherit = true;
+ break;
+ }
+ }
+ if (inherit) {
if (parentPage.data().shownavbar != undefined) {
- var pageShowNavBar = thisPagePartsHandler.parseTopRightBottomLeftString(parentPage
- .data().shownavbar);
- for ( var pos in pageShowNavBar) {
- if (pageShowNavBar[pos] != 'inherit'
- && inheritedShowNavbar[pos] == 'inherit') {
- inheritedShowNavbar[pos] = pageShowNavBar[pos];
+ for (var pos in shownavbar) {
+ if (shownavbar[pos] == 'inherit') {
+ // set value of parent page
+ shownavbar[pos] = parentPage.data().shownavbar[pos];
+ if (shownavbar[pos] == undefined) {
+ shownavbar[pos] = 'inherit';
+ }
}
}
- if (inheritedShowNavbar.top != 'inherit'
- && inheritedShowNavbar.right != 'inherit'
- && inheritedShowNavbar.bottom != 'inherit'
- && inheritedShowNavbar.left != 'inherit') {
- // we are done
- break;
- }
}
- parentPage = templateEngine.getParentPage(parentPage);
+ } else {
+ // we are done
+ break;
}
- // set default values if not set otherwise
- for ( var pos in inheritedShowNavbar) {
- if (inheritedShowNavbar[pos] == 'inherit') {
- inheritedShowNavbar[pos] = shownavbar[pos];
- }
- }
- shownavbar = inheritedShowNavbar;
+ parentPage = templateEngine.getParentPage(parentPage);
}
}
+ // set default values for shownavbar if not set otherwise
+ for (var pos in shownavbar) {
+ if (shownavbar[pos] == undefined || shownavbar[pos] == 'inherit') {
+ shownavbar[pos] = true;
+ }
+ }
+
var resize = false;
if (showtopnavigation) {
if ($('#top').css("display") == "none") {
@@ -1185,16 +1144,15 @@
}
$.each([ 'Left', 'Top', 'Right', 'Bottom' ], function(index, value) {
var key = value.toLowerCase();
- if (shownavbar[key] == "true") {
+ if (shownavbar[key] == true) {
if ($('#navbar' + value).css("display") == "none") {
thisPagePartsHandler.fadeNavbar(value, "in");
thisPagePartsHandler.removeInactiveNavbars(page.attr('id'));
// resize=true;
}
- } else if (shownavbar[key] == "false") {
- // the loading class prevents any element from beeing disabled, we have
- // to
- // remove it
+ } else {
+ // the loading class prevents any element from being disabled, we have
+ // to remove it
$('#navbar' + value + '.loading').removeClass('loading');
if ($('#navbar' + value).css("display") != "none") {
thisPagePartsHandler.fadeNavbar(value, "out");
Modified: CometVisu/trunk/visu/structure/pure/page.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/page.js 2013-02-02 22:44:58 UTC (rev 1391)
+++ CometVisu/trunk/visu/structure/pure/page.js 2013-02-02 23:14:52 UTC (rev 1392)
@@ -31,7 +31,10 @@
var backdrop = $p.attr('backdrop');
var showtopnavigation = $p.attr('showtopnavigation');
var showfooter = $p.attr('showfooter');
- var shownavbar = $p.attr('shownavbar');
+ var shownavbar_top = $p.attr('shownavbar-top');
+ var shownavbar_bottom = $p.attr('shownavbar-bottom');
+ var shownavbar_left = $p.attr('shownavbar-left');
+ var shownavbar_right = $p.attr('shownavbar-right');
if( $p.attr('flavour') ) flavour = $p.attr('flavour');// sub design choice
var wstyle = ''; // widget style
if( $p.attr('align') ) wstyle += 'text-align:' + $p.attr('align') + ';';
@@ -57,7 +60,12 @@
var subpage = $( '<div class="page" id="' + path + '"/>' );
subpage.data('showtopnavigation',showtopnavigation);
subpage.data('showfooter',showfooter);
- subpage.data('shownavbar',shownavbar);
+ subpage.data('shownavbar',{
+ top : shownavbar_top,
+ bottom : shownavbar_bottom,
+ left : shownavbar_left,
+ right : shownavbar_right
+ });
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;
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2013-02-02 22:44:58 UTC (rev 1391)
+++ CometVisu/trunk/visu/visu_config.xsd 2013-02-02 23:14:52 UTC (rev 1392)
@@ -424,7 +424,10 @@
</xsd:attribute>
<xsd:attribute name="showtopnavigation" type="xsd:boolean" use="optional" />
<xsd:attribute name="showfooter" type="xsd:boolean" use="optional" />
- <xsd:attribute name="shownavbar" type="xsd:string" use="optional" />
+ <xsd:attribute name="shownavbar-top" type="xsd:boolean" use="optional" />
+ <xsd:attribute name="shownavbar-bottom" type="xsd:boolean" use="optional" />
+ <xsd:attribute name="shownavbar-left" type="xsd:boolean" use="optional" />
+ <xsd:attribute name="shownavbar-right" type="xsd:boolean" use="optional" />
</xsd:complexType>
<xsd:complexType name="group">
Modified: CometVisu/trunk/visu/visu_config_metal.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_metal.xml 2013-02-02 22:44:58 UTC (rev 1391)
+++ CometVisu/trunk/visu/visu_config_metal.xml 2013-02-02 23:14:52 UTC (rev 1392)
@@ -60,7 +60,7 @@
</statusbar>
</meta>
<page name="Übersicht" showtopnavigation="false" showfooter="false"
- shownavbar="true false">
+ shownavbar-top="true">
<navbar position="top">
<pagejump target="Übersicht">
<layout colspan="0"/>
@@ -193,7 +193,7 @@
</slide>
</group>
</page>
- <page name="KNX" shownavbar="true" visible="false">
+ <page name="KNX" shownavbar-left="true" visible="false">
<navbar position="left" dynamic="true" width="200px">
<group name="Räume">
<pagejump target="Wohnzimmer" name="Wohnen">
@@ -424,7 +424,7 @@
<page name="Video" visible="false">
<text><label>Video Page</label></text>
</page>
- <page name="Audio" shownavbar="true" visible="false">
+ <page name="Audio" shownavbar-left="true" visible="false">
<navbar position="left" dynamic="true" width="200px">
<group name="Sonstiges">
<pagejump target="Audio">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2013-02-03 15:22:33
|
Revision: 1398
http://openautomation.svn.sourceforge.net/openautomation/?rev=1398&view=rev
Author: peuter
Date: 2013-02-03 15:22:25 +0000 (Sun, 03 Feb 2013)
Log Message:
-----------
- fixes bug #3603122: handleResize is called multiple times
the handleResize-function is called only once on every resize event
- fixed bug on available screen width + height, which sometimes lead to display errors + switching between landscape and portrait on mobile devices improved
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config_metal.xml
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-02-03 12:17:15 UTC (rev 1397)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-02-03 15:22:25 UTC (rev 1398)
@@ -49,6 +49,16 @@
this.designReady = false;
this.design = new VisuDesign_Custom();
this.pagePartsHandler = new PagePartsHandler();
+
+ this.currentPage = null;
+ this.currentPageUnavailableWidth = -1;
+ this.currentPageUnavailableHeight = -1;
+ this.currentPageNavbarVisibility = null;
+
+ // threshold where the mobile.css is loaded
+ this.maxMobileScreenWidth = 480;
+ // use to recognize if the screen width has crossed the maxMobileScreenWidth
+ var lastBodyWidth=0;
this.mappings = {}; // store the mappings
this.stylings = {}; // store the stylings
@@ -61,7 +71,6 @@
this.scrollSpeed;
- this.resizeAfterScroll = false;
this.defaultColumns = 12;
this.minColumnWidth = 150;
this.enableColumnAdjustment = false;
@@ -169,15 +178,27 @@
}
return value;
};
+
+ this.resetPageValues = function() {
+ thisTemplateEngine.currentPage = null;
+ thisTemplateEngine.currentPageUnavailableWidth=-1;
+ thisTemplateEngine.currentPageUnavailableHeight=-1;
+ thisTemplateEngine.currentPageNavbarVisibility=null;
+ };
+
+ this.getCurrentPageNavbarVisibility = function() {
+ if (thisTemplateEngine.currentPageNavbarVisibility==null) {
+ thisTemplateEngine.currentPageNavbarVisibility = thisTemplateEngine.pagePartsHandler.getNavbarsVisibility(thisTemplateEngine.currentPage);
+ }
+ return thisTemplateEngine.currentPageNavbarVisibility;
+ };
this.adjustColumns = function() {
if (thisTemplateEngine.enableColumnAdjustment == false)
return false;
var factor = window.devicePixelRatio || 1;
- var widthNavbarLeft = $('#navbarLeft').css('display') != 'none' ? $('#navbarLeft').width() : 0;
- var widthNavbarRight = $('#navbarRight').css('display') != 'none' ? $('#navbarRight').width() : 0;
- var width = $('body').width() - widthNavbarLeft - widthNavbarRight - 1; // remove an additional pixel for Firefox
+ var width = thisTemplateEngine.getAvailableWidth();
width = width / factor;
var $main = $('#main');
@@ -197,17 +218,108 @@
return false;
}
};
+
+ /**
+ * return the available width for a the currently visible page
+ * the available width is calculated by subtracting the following elements widths (if they are visible) from the body width
+ * - Left-Navbar
+ * - Right-Navbar
+ */
+ this.getAvailableWidth = function() {
+ // currently this calculation is done once after every page scroll (where thisTemplateEngine.currentPageUnavailableWidth is reseted)
+ // if the screen width falls below the threshold which activates/deactivates the mobile.css
+ // the calculation has to be done again, even if the page hasn´t changed (e.g. switching between portrait and landscape mode on a mobile can cause that)
+ var bodyWidth = $('body').width();
+ var mobileUseChanged = (lastBodyWidth<thisTemplateEngine.maxMobileScreenWidth)!=(bodyWidth<thisTemplateEngine.maxMobileScreenWidth);
+ if (thisTemplateEngine.currentPageUnavailableWidth<0 || mobileUseChanged) {
+// console.log("Mobile.css use changed "+mobileUseChanged);
+ thisTemplateEngine.currentPageUnavailableWidth=0;
+ var navbarVisibility = thisTemplateEngine.getCurrentPageNavbarVisibility(thisTemplateEngine.currentPage);
+ var widthNavbarLeft = navbarVisibility.left=="true" && $('#navbarLeft').css('display')!="none" ? $('#navbarLeft').width() : 0;
+ if (widthNavbarLeft>=bodyWidth) {
+ // Left-Navbar has the same size as the complete body, this can happen, when the navbar has no content
+ // maybe there is a better solution to solve this problem
+ widthNavbarLeft = 0;
+ }
+ var widthNavbarRight = navbarVisibility.right=="true" && $('#navbarRight').css('display')!="none" ? $('#navbarRight').width() : 0;
+ if (widthNavbarRight>=bodyWidth) {
+ // Right-Navbar has the same size as the complete body, this can happen, when the navbar has no content
+ // maybe there is a better solution to solve this problem
+ widthNavbarRight = 0;
+ }
+ thisTemplateEngine.currentPageUnavailableWidth = widthNavbarLeft + widthNavbarRight + 1; // remove an additional pixel for Firefox
+// console.log("Width: "+bodyWidth+" - "+widthNavbarLeft+" - "+widthNavbarRight);
+ }
+ lastBodyWidth = bodyWidth;
+ return bodyWidth - thisTemplateEngine.currentPageUnavailableWidth;
+ };
+
+ /**
+ * return the available height for a the currently visible page
+ * the available height is calculated by subtracting the following elements heights (if they are visible) from the window height
+ * - Top-Navigation
+ * - Top-Navbar
+ * - Bottom-Navbar
+ * - Statusbar
+ *
+ * Notice: the former way to use the subtract the $main.position().top value from the total height leads to errors in certain cases
+ * because the value of $main.position().top is not reliable all the time
+ */
+ this.getAvailableHeight = function() {
+ var windowHeight = $(window).height();
+ if (thisTemplateEngine.currentPageUnavailableHeight<0) {
+ thisTemplateEngine.currentPageUnavailableHeight=0;
+ var navbarVisibility = thisTemplateEngine.getCurrentPageNavbarVisibility(thisTemplateEngine.currentPage);
+ console.log(thisTemplateEngine.designReady);
+ console.log(navbarVisibility);
+ var heightStr = "Height: "+windowHeight;
+ if ($('#top').css('display') != 'none' && $('#top').outerHeight(true)>0) {
+ thisTemplateEngine.currentPageUnavailableHeight+=$('#top').outerHeight(true);
+ heightStr+=" - "+$('#top').outerHeight(true);
+ }
+ else {
+ heightStr+=" - 0";
+ }
+ console.log($('#navbarTop').css('display')+": "+$('#navbarTop').outerHeight(true));
+ if ($('#navbarTop').css('display') != 'none' && navbarVisibility.top=="true" && $('#navbarTop').outerHeight(true)>0) {
+ thisTemplateEngine.currentPageUnavailableHeight+=$('#navbarTop').outerHeight(true);
+ heightStr+=" - "+$('#navbarTop').outerHeight(true);
+ }
+ else {
+ heightStr+=" - 0";
+ }
+ if ($('#navbarBottom').css('display') != 'none' && navbarVisibility.bottom=="true" && $('#navbarBottom').outerHeight(true)>0) {
+ thisTemplateEngine.currentPageUnavailableHeight+=$('#navbarBottom').outerHeight(true);
+ heightStr+=" - "+$('#navbarBottom').outerHeight(true);
+ }
+ else {
+ heightStr+=" - 0";
+ }
+ if ($('#bottom').css('display') != 'none' && $('#bottom').outerHeight(true)>0) {
+ thisTemplateEngine.currentPageUnavailableHeight+=$('#bottom').outerHeight(true);
+ heightStr+=" - "+$('#bottom').outerHeight(true);
+ }
+ else {
+ heightStr+=" - 0";
+ }
+ if (thisTemplateEngine.currentPageUnavailableHeight>0) {
+ thisTemplateEngine.currentPageUnavailableHeight+=1;// remove an additional pixel for Firefox
+ }
+ console.log(heightStr);
+ console.log(windowHeight+" - "+thisTemplateEngine.currentPageUnavailableHeight);
+ }
+ return windowHeight - thisTemplateEngine.currentPageUnavailableHeight;
+ };
/*
* Make sure everything looks right when the window gets resized. This is
* necessary as the scroll effect requires a fixed element size
*/
this.handleResize = function(resize, skipScrollFix) {
+ console.log("handleResize");
+// console.trace();
var uagent = navigator.userAgent.toLowerCase();
- var widthNavbarLeft = $('#navbarLeft').css('display') != 'none' ? $('#navbarLeft').width() : 0;
- var widthNavbarRight = $('#navbarRight').css('display') != 'none' ? $('#navbarRight').width() : 0;
- var width = $('body').width() - widthNavbarLeft - widthNavbarRight - 1; // remove an additional pixel for Firefox
-
+ var width = thisTemplateEngine.getAvailableWidth();
var $main = $('#main');
// if (/(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i.test(uagent)) {
var mobileDevice = (/(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i.test(uagent));
@@ -217,48 +329,15 @@
$('#pageSize').text('.page{width:' + (width - 0) + 'px;}');
//do nothing
} else {
- var height = $(window).height() - $main.position().top;
- if ($('#navbarBottom').css('display') != 'none') {
- height -= $('#navbarBottom').outerHeight(true) - 1;
- }
- if ($('#bottom').css('display') != 'none') {
- height -= $('#bottom').outerHeight(true) - 1;
- }
+ var height = thisTemplateEngine.getAvailableHeight();
$main.css('width', width).css('height', height);
$('#pageSize').text('.page{width:' + (width - 0) + 'px;height:' + height + 'px;}');
- if (skipScrollFix === undefined) {
- if (thisTemplateEngine.adjustColumns()) {
- var allContainer = $('.widget_container');
- allContainer.each(function(i, e) {
- var $e = $(e);
- var ourColspan = $e.children('*:first-child').data('colspan');
- if (ourColspan <= 0)
- return;
- var areaColspan = $e.parentsUntil('#centerContainer').last().data('columns') || thisTemplateEngine.defaultColumns;
- var ourWidth = Math.min(100, ourColspan / areaColspan * 100);
- $e.css('width', ourWidth + '%');
- });
- // and elements inside groups
- var adjustableElements = $('.group .widget_container');
- adjustableElements.each(function(i, e) {
- var $e = $(e);
- var ourColspan = $e.children('.widget').data('colspan');
- if (ourColspan <= 0)
- return;
- if (ourColspan == undefined) {
- // workaround for nowidget groups
- ourColspan = $e.children('.group').data('colspan');
- }
- var areaColspan = $e.parentsUntil('#centerContainer').last().data('columns') || thisTemplateEngine.defaultColumns;
- var groupColspan = Math.min(areaColspan, $e.parentsUntil('.widget_container', '.group').data('colspan'));
- var ourWidth = Math.min(100, ourColspan / groupColspan * 100); // in percent
- $e.css('width', ourWidth + '%');
- });
- }
+ }
+ if (skipScrollFix === undefined) {
+ if (thisTemplateEngine.adjustColumns()) {
+ // the amount of columns has changed -> recalculate the widgets widths
+ thisTemplateEngine.applyColumnWidths();
}
- // main_scroll != undefined && main_scroll.seekTo( main_scroll.getIndex(),
- // 0
- // ); // fix scroll
}
};
@@ -308,9 +387,13 @@
thisTemplateEngine.initBackendClient();
thisTemplateEngine.scrollSpeed = $('pages', xml).attr("scroll_speed");
- if ($('pages', xml).attr('enable_column_adjustment') == "true") {
+ var enableColumnAdjustment = null;
+ if ($('pages', xml).attr('enable_column_adjustment')!=undefined) {
+ enableColumnAdjustment = $('pages', xml).attr('enable_column_adjustment')=="true" ? true : false;
+ }
+ if (enableColumnAdjustment) {
thisTemplateEngine.enableColumnAdjustment = true;
- } else if (/(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i
+ } else if (enableColumnAdjustment==null && /(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i
.test(navigator.userAgent.toLowerCase())) {
thisTemplateEngine.enableColumnAdjustment = true;
}
@@ -333,13 +416,14 @@
else {
thisTemplateEngine.selectDesign();
}
- var maxMobileScreenWidth = $('pages', xml).attr('max_mobile_screen_width') || 480;
+ if ($('pages', xml).attr('max_mobile_screen_width'))
+ thisTemplateEngine.maxMobileScreenWidth = $('pages', xml).attr('max_mobile_screen_width');
$.getCSS( 'designs/designglobals.css' );
$.getCSS( 'designs/' + thisTemplateEngine.clientDesign + '/basic.css' );
$.getCSS( 'designs/' + thisTemplateEngine.clientDesign + '/mobile.css',
- {media: 'only screen and (max-device-width: '
- + maxMobileScreenWidth + 'px)'} );
+ {media: 'only screen and (max-width: '
+ + thisTemplateEngine.maxMobileScreenWidth + 'px)'} );
$.getCSS( 'designs/' + thisTemplateEngine.clientDesign + '/custom.css' );
$.getScript( 'designs/' + thisTemplateEngine.clientDesign + '/design_setup.js',
function(){
@@ -462,20 +546,11 @@
thisTemplateEngine.pageReady = true;
thisTemplateEngine.setup_page(xml);
};
-
- this.setup_page = function(xml) {
- // and now setup the pages
-
- // check if the page and the plugins are ready now
- if( !this.pageReady || !this.pluginsReady || !this.designReady )
- return; // we'll be called again...
-
- var page = $('pages > page', xml)[0]; // only one page element allowed...
-
- thisTemplateEngine.create_pages(page, 'id_0');
-
- thisTemplateEngine.adjustColumns();
+ /**
+ * applies the correct width to the widgets corresponding to the given colspan setting
+ */
+ this.applyColumnWidths = function() {
// all containers
var allContainer = $('.widget_container');
allContainer.each(function(i, e) {
@@ -505,12 +580,34 @@
// percent
$e.css('width', ourWidth + '%');
});
+ };
+
+ this.setup_page = function(xml) {
+ // and now setup the pages
+
+ // check if the page and the plugins are ready now
+ if( !this.pageReady || !this.pluginsReady || !this.designReady)
+ return; // we'll be called again...
+
+ var page = $('pages > page', xml)[0]; // only one page element allowed...
+
+ thisTemplateEngine.create_pages(page, 'id_0');
+
+ var startpage = 'id_0';
+ if ($.getUrlVar('startpage')) {
+ startpage='id_' + $.getUrlVar('startpage');
+ }
+ thisTemplateEngine.currentPage = $('#'+startpage);
+
+ thisTemplateEngine.adjustColumns();
+ thisTemplateEngine.applyColumnWidths();
+
// Prevent elastic scrolling apart the main pane for iOS devices
$(document).bind( 'touchmove', function(e) {
e.preventDefault();
});
- $('#pages').bind( 'touchmove', function(e) {
+ $('#main').bind( 'touchmove', function(e) {
e.stopPropagation();
});
@@ -523,10 +620,7 @@
if (thisTemplateEngine.scrollSpeed != undefined) {
thisTemplateEngine.main_scroll.getConf().speed = thisTemplateEngine.scrollSpeed;
}
- var startpage = 'id_0';
- if ($.getUrlVar('startpage')) {
- startpage='id_' + $.getUrlVar('startpage');
- }
+
thisTemplateEngine.scrollToPage(startpage,0);
$('.fast').bind('click', function() {
@@ -674,7 +768,7 @@
thisTemplateEngine.visu.setInitialAddresses(Object.keys(startPageAddresses));
}
thisTemplateEngine.visu.subscribe(thisTemplateEngine.getAddresses());
- $(window).trigger('resize');
+// $(window).trigger('resize');
$("#pages").triggerHandler("done");
};
@@ -691,13 +785,14 @@
}
return retval;
- }
+ };
this.scrollToPage = function(page_id, speed, skipHistory) {
$('.activePage', '#pages').removeClass('activePage');
$('.pageActive', '#pages').removeClass('pageActive');
$('.pagejump.active').removeClass('active');
$('.pagejump.active_ancestor').removeClass('active_ancestor');
+ thisTemplateEngine.resetPageValues();
if (page_id.match(/^id_[0-9_]+$/) == null) {
// find Page-ID by name
@@ -708,6 +803,7 @@
});
}
var page = $('#' + page_id);
+ thisTemplateEngine.currentPage = page;
page.addClass('pageActive activePage');// show new page
// update visibility ob navbars, top-navigation, footer
@@ -800,11 +896,7 @@
}
}
});
- $(window).trigger('scrolltopage', page_id);
- if (thisTemplateEngine.resizeAfterScroll) {
- //thisTemplateEngine.handleResize(null,true);
- thisTemplateEngine.resizeAfterScroll = false;
- }
+ $(window).trigger('scrolltopage', page_id);
};
@@ -1003,6 +1095,7 @@
id += '_';
}
$('.nav_path').html(nav);
+ templateEngine.handleResize();
};
/**
@@ -1027,11 +1120,72 @@
});
break;
}
- templateEngine.handleResize();
};
+
+ this.getNavbarsVisibility = function(page) {
+ if (templateEngine.currentPageNavbarVisibility==null) {
+ if (page==null) {
+ page = templateEngine.currentPage;
+ }
+ if (page==null || page.data()==null) return { top : 'true', bottom : 'true', left : 'true', right : 'true' };
+ var shownavbar = (page.data().shownavbar != undefined ? page.data().shownavbar : {
+ top : 'inherit',
+ bottom : 'inherit',
+ left : 'inherit',
+ right : 'inherit'
+ });
+
+ // set inherit for undefined
+ for (var pos in shownavbar) {
+ if (shownavbar[pos] == undefined) {
+ shownavbar[pos] = 'inherit';
+ }
+ }
+ if (page.data() != null) {
+ // traverse up the page tree for shownavbar
+ var parentPage = templateEngine.getParentPage(page);
+ while (parentPage != null) {
+ // do we need to go further? Check for inheritance
+ var inherit = false;
+ for (var pos in shownavbar) {
+ if (shownavbar[pos] == 'inherit') {
+ inherit = true;
+ break;
+ }
+ }
+ if (inherit) {
+ if (parentPage.data().shownavbar != undefined) {
+ for (var pos in shownavbar) {
+ if (shownavbar[pos] == 'inherit') {
+ // set value of parent page
+ shownavbar[pos] = parentPage.data().shownavbar[pos];
+ if (shownavbar[pos] == undefined) {
+ shownavbar[pos] = 'inherit';
+ }
+ }
+ }
+ }
+ } else {
+ // we are done
+ break;
+ }
+ parentPage = templateEngine.getParentPage(parentPage);
+ }
+ }
+ // set default values for shownavbar if not set otherwise
+ for (var pos in shownavbar) {
+ if (shownavbar[pos] == undefined || shownavbar[pos] == 'inherit') {
+ shownavbar[pos] = 'true';
+ }
+ }
+ templateEngine.currentPageNavbarVisibility = shownavbar;
+// console.log(shownavbar);
+ }
+ return templateEngine.currentPageNavbarVisibility;
+ };
/**
- * update the visibility of top-navigation, footer and navbar for this page
+ * update the visibility ob top-navigation, footer and navbar for this page
*
* @param page
*/
@@ -1039,19 +1193,7 @@
// default values
var showtopnavigation = true;
var showfooter = true;
- var shownavbar = (page.data().shownavbar != undefined ? page.data().shownavbar : {
- top : 'inherit',
- bottom : 'inherit',
- left : 'inherit',
- right : 'inherit'
- });
- // set inherit for undefined
- for (var pos in shownavbar) {
- if (shownavbar[pos] == undefined) {
- shownavbar[pos] = 'inherit';
- }
- }
-
+ var shownavbar = thisPagePartsHandler.getNavbarsVisibility(page);
if (page.data() != null) {
if (page.data().showtopnavigation != undefined) {
showtopnavigation = page.data().showtopnavigation != "false";
@@ -1079,64 +1221,24 @@
parentPage = templateEngine.getParentPage(parentPage);
}
}
-
- // traverse up the page tree for shownavbar
- var parentPage = templateEngine.getParentPage(page);
- while (parentPage != null) {
- // do we need to go further? Check for inheritance
- var inherit = false;
- for (var pos in shownavbar) {
- if (shownavbar[pos] == 'inherit') {
- inherit = true;
- break;
- }
- }
- if (inherit) {
- if (parentPage.data().shownavbar != undefined) {
- for (var pos in shownavbar) {
- if (shownavbar[pos] == 'inherit') {
- // set value of parent page
- shownavbar[pos] = parentPage.data().shownavbar[pos];
- if (shownavbar[pos] == undefined) {
- shownavbar[pos] = 'inherit';
- }
- }
- }
- }
- } else {
- // we are done
- break;
- }
- parentPage = templateEngine.getParentPage(parentPage);
- }
}
- // set default values for shownavbar if not set otherwise
- for (var pos in shownavbar) {
- if (shownavbar[pos] == undefined || shownavbar[pos] == 'inherit') {
- shownavbar[pos] = 'true';
- }
- }
-
- var resize = false;
+
if (showtopnavigation) {
if ($('#top').css("display") == "none") {
$('#top, #top > *').css("display", "block");
- resize = true;
- // console.log("#top hidden");
+ thisPagePartsHandler.removeInactiveNavbars(page.attr('id'));
}
} else {
$('#top.loading').removeClass('loading');
if ($('#top').css("display") != "none") {
$('#top').css("display", "none");
- resize = true;
- // console.log("#top visible");
+ thisPagePartsHandler.removeInactiveNavbars(page.attr('id'));
}
}
if (showfooter) {
if ($('#bottom').css("display") == "none") {
$('#bottom').css("display", "block");
- // console.log("#bottom hidden");
- resize = true;
+ thisPagePartsHandler.removeInactiveNavbars(page.attr('id'));
}
} else {
// the loading class prevents any element from beeing disabled, we have to
@@ -1144,8 +1246,7 @@
$('#bottom.loading').removeClass('loading');
if ($('#bottom').css("display") != "none") {
$('#bottom').css("display", "none");
- // console.log("#bottom "+$('#bottom').css("display"));
- resize = true;
+ thisPagePartsHandler.removeInactiveNavbars(page.attr('id'));
}
}
$.each([ 'Left', 'Top', 'Right', 'Bottom' ], function(index, value) {
@@ -1154,7 +1255,6 @@
if ($('#navbar' + value).css("display") == "none") {
thisPagePartsHandler.fadeNavbar(value, "in");
thisPagePartsHandler.removeInactiveNavbars(page.attr('id'));
- // resize=true;
}
} else {
// the loading class prevents any element from being disabled, we have
@@ -1162,15 +1262,10 @@
$('#navbar' + value + '.loading').removeClass('loading');
if ($('#navbar' + value).css("display") != "none") {
thisPagePartsHandler.fadeNavbar(value, "out");
- // resize=true;
}
}
});
- if (resize) {
- templateEngine.resizeAfterScroll = true;
- } else {
- thisPagePartsHandler.removeInactiveNavbars(page.attr('id'));
- }
+ console.log("updatePageParts");
};
/**
@@ -1187,7 +1282,7 @@
var navbar = $('#navbar' + position);
var key = position.toLowerCase();
var fn = function() {
- templateEngine.handleResize(true);
+
};
switch (direction) {
case "in":
@@ -1210,7 +1305,6 @@
if (navbar.css("display") != "none") {
fn = function() {
navbar.css("display", "none");
- templateEngine.handleResize(true);
};
}
switch (position) {
Modified: CometVisu/trunk/visu/visu_config_metal.xml
===================================================================
--- CometVisu/trunk/visu/visu_config_metal.xml 2013-02-03 12:17:15 UTC (rev 1397)
+++ CometVisu/trunk/visu/visu_config_metal.xml 2013-02-03 15:22:25 UTC (rev 1398)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" design="metal"
- xsi:noNamespaceSchemaLocation="./visu_config.xsd" enable_column_adjustment="true">
+ xsi:noNamespaceSchemaLocation="./visu_config.xsd" enable_column_adjustment="true" scroll_speed="0">
<meta>
<mappings>
<mapping name="OpenClose">
@@ -60,7 +60,7 @@
</statusbar>
</meta>
<page name="Übersicht" showtopnavigation="false" showfooter="false"
- shownavbar-top="true">
+ shownavbar-left="false">
<navbar position="top">
<pagejump target="Übersicht">
<layout colspan="0"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2013-02-03 17:44:18
|
Revision: 1400
http://openautomation.svn.sourceforge.net/openautomation/?rev=1400&view=rev
Author: peuter
Date: 2013-02-03 17:44:11 +0000 (Sun, 03 Feb 2013)
Log Message:
-----------
removed some debug messages
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/structure/pure/switch.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-02-03 17:40:25 UTC (rev 1399)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-02-03 17:44:11 UTC (rev 1400)
@@ -396,7 +396,6 @@
if ($('pages', xml).attr('bind_click_to_widget')!=undefined) {
thisTemplateEngine.bindClickToWidget = $('pages', xml).attr('bind_click_to_widget')=="true" ? true : false;
}
- console.log($('pages', xml).attr('bind_click_to_widget'));
if (enableColumnAdjustment) {
thisTemplateEngine.enableColumnAdjustment = true;
} else if (enableColumnAdjustment==null && /(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i
Modified: CometVisu/trunk/visu/structure/pure/switch.js
===================================================================
--- CometVisu/trunk/visu/structure/pure/switch.js 2013-02-03 17:40:25 UTC (rev 1399)
+++ CometVisu/trunk/visu/structure/pure/switch.js 2013-02-03 17:44:11 UTC (rev 1400)
@@ -32,7 +32,6 @@
var address = makeAddressList($e);
var bindClickToWidget = templateEngine.bindClickToWidget;
if ($e.attr("bind_click_to_widget")) bindClickToWidget = $e.attr("bind_click_to_widget")=="true";
- console.log(bindClickToWidget+" "+$e.attr("bind_click_to_widget"));
var actor = '<div class="actor switchUnpressed"><div class="value">-</div></div>';
var $actor = $(actor).data( {
'address' : address,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2013-02-05 21:09:04
|
Revision: 1430
http://openautomation.svn.sourceforge.net/openautomation/?rev=1430&view=rev
Author: netzkind
Date: 2013-02-05 21:08:56 +0000 (Tue, 05 Feb 2013)
Log Message:
-----------
hopefully fixed problem with multi-dimensional bounds (http://knx-user-forum.de/289905-post256.html); remember the complex-setting across reloads via cookie; pre-check config before loading; allow to appinfo 'descriptor:' in order to have a description for any element; bugfix for adding required elements to a newly created element
Modified Paths:
--------------
CometVisu/trunk/visu/editor/lib/Editor.js
CometVisu/trunk/visu/editor/lib/Schema.js
CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php
CometVisu/trunk/visu/upgrade/index.php
CometVisu/trunk/visu/visu_config.xml
CometVisu/trunk/visu/visu_config.xsd
Added Paths:
-----------
CometVisu/trunk/visu/editor/dependencies/jquery.cookie.js
CometVisu/trunk/visu/editor/editor.html
CometVisu/trunk/visu/editor/index.php
CometVisu/trunk/visu/lib/library_version.inc.php
Removed Paths:
-------------
CometVisu/trunk/visu/editor/index.html
Property Changed:
----------------
CometVisu/trunk/visu/
Property changes on: CometVisu/trunk/visu
___________________________________________________________________
Modified: svn:ignore
- visu_config.xml
visu_config_previewtemp.xml
+ visu_config.xml
Added: CometVisu/trunk/visu/editor/dependencies/jquery.cookie.js
===================================================================
--- CometVisu/trunk/visu/editor/dependencies/jquery.cookie.js (rev 0)
+++ CometVisu/trunk/visu/editor/dependencies/jquery.cookie.js 2013-02-05 21:08:56 UTC (rev 1430)
@@ -0,0 +1,92 @@
+/*!
+ * jQuery Cookie Plugin v1.3.1
+ * https://github.com/carhartl/jquery-cookie
+ *
+ * Copyright 2013 Klaus Hartl
+ * Released under the MIT license
+ */
+(function (factory) {
+ if (typeof define === 'function' && define.amd && define.amd.jQuery) {
+ // AMD. Register as anonymous module.
+ define(['jquery'], factory);
+ } else {
+ // Browser globals.
+ factory(jQuery);
+ }
+}(function ($) {
+
+ var pluses = /\+/g;
+
+ function raw(s) {
+ return s;
+ }
+
+ function decoded(s) {
+ return decodeURIComponent(s.replace(pluses, ' '));
+ }
+
+ function converted(s) {
+ if (s.indexOf('"') === 0) {
+ // This is a quoted cookie as according to RFC2068, unescape
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
+ }
+ try {
+ return config.json ? JSON.parse(s) : s;
+ } catch(er) {}
+ }
+
+ var config = $.cookie = function (key, value, options) {
+
+ // write
+ if (value !== undefined) {
+ options = $.extend({}, config.defaults, options);
+
+ if (typeof options.expires === 'number') {
+ var days = options.expires, t = options.expires = new Date();
+ t.setDate(t.getDate() + days);
+ }
+
+ value = config.json ? JSON.stringify(value) : String(value);
+
+ return (document.cookie = [
+ encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+ options.path ? '; path=' + options.path : '',
+ options.domain ? '; domain=' + options.domain : '',
+ options.secure ? '; secure' : ''
+ ].join(''));
+ }
+
+ // read
+ var decode = config.raw ? raw : decoded;
+ var cookies = document.cookie.split('; ');
+ var result = key ? undefined : {};
+ for (var i = 0, l = cookies.length; i < l; i++) {
+ var parts = cookies[i].split('=');
+ var name = decode(parts.shift());
+ var cookie = decode(parts.join('='));
+
+ if (key && key === name) {
+ result = converted(cookie);
+ break;
+ }
+
+ if (!key) {
+ result[name] = converted(cookie);
+ }
+ }
+
+ return result;
+ };
+
+ config.defaults = {};
+
+ $.removeCookie = function (key, options) {
+ if ($.cookie(key) !== undefined) {
+ $.cookie(key, '', $.extend(options, { expires: -1 }));
+ return true;
+ }
+ return false;
+ };
+
+}));
Copied: CometVisu/trunk/visu/editor/editor.html (from rev 1352, CometVisu/trunk/visu/editor/index.html)
===================================================================
--- CometVisu/trunk/visu/editor/editor.html (rev 0)
+++ CometVisu/trunk/visu/editor/editor.html 2013-02-05 21:08:56 UTC (rev 1430)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CometVisu - configuration editor</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <script src="../dependencies/jquery.js" type="text/javascript"></script>
+ <script src="dependencies/json2.js" type="text/javascript"></script>
+ <script src="dependencies/jquery.cookie.js" type="text/javascript"></script>
+ <script src="dataproviders/DataProviderConfig.js" type="text/javascript"></script>
+ <script src="lib/DataProvider.js" type="text/javascript"></script>
+ <script src="lib/Messages.js" type="text/javascript"></script>
+ <script src="lib/Result.js" type="text/javascript"></script>
+ <script src="lib/ListenerEvent.js" type="text/javascript"></script>
+ <script src="lib/Schema.js" type="text/javascript"></script>
+ <script src="lib/Configuration.js" type="text/javascript"></script>
+ <script src="lib/ActiveInput.js" type="text/javascript"></script>
+ <script src="lib/Editor.js" type="text/javascript"></script>
+ <script src="init.js" type="text/javascript"></script>
+
+ <link rel="stylesheet" type="text/css" href="lib/Editor.css" />
+ <base href="../" />
+ </head>
+ <body style="margin: 0; padding: 0;">
+ <h1>Editor</h1>
+ <p>If you keep seeing this text, then there is something wrong with the cable, and/or Javascript is inactive,
+ and/or there is some heavy problem with this editor. Anyways, please report (and tell us which browser you are
+ using).</p>
+
+ </body>
+</html>
Deleted: CometVisu/trunk/visu/editor/index.html
===================================================================
--- CometVisu/trunk/visu/editor/index.html 2013-02-05 21:00:54 UTC (rev 1429)
+++ CometVisu/trunk/visu/editor/index.html 2013-02-05 21:08:56 UTC (rev 1430)
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>CometVisu - configuration editor</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <script src="../dependencies/jquery.js" type="text/javascript"></script>
- <script src="dependencies/json2.js" type="text/javascript"></script>
- <script src="dataproviders/DataProviderConfig.js" type="text/javascript"></script>
- <script src="lib/DataProvider.js" type="text/javascript"></script>
- <script src="lib/Messages.js" type="text/javascript"></script>
- <script src="lib/Result.js" type="text/javascript"></script>
- <script src="lib/ListenerEvent.js" type="text/javascript"></script>
- <script src="lib/Schema.js" type="text/javascript"></script>
- <script src="lib/Configuration.js" type="text/javascript"></script>
- <script src="lib/ActiveInput.js" type="text/javascript"></script>
- <script src="lib/Editor.js" type="text/javascript"></script>
- <script src="init.js" type="text/javascript"></script>
-
- <link rel="stylesheet" type="text/css" href="lib/Editor.css" />
- <base href="../" />
- </head>
- <body style="margin: 0; padding: 0;">
- <h1>Editor</h1>
- <p>If you keep seeing this text, then there is something wrong with the cable, and/or Javascript is inactive,
- and/or there is some heavy problem with this editor. Anyways, please report (and tell us which browser you are
- using).</p>
-
- </body>
-</html>
Added: CometVisu/trunk/visu/editor/index.php
===================================================================
--- CometVisu/trunk/visu/editor/index.php (rev 0)
+++ CometVisu/trunk/visu/editor/index.php 2013-02-05 21:08:56 UTC (rev 1430)
@@ -0,0 +1,122 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Pre-Check the configuration using the embedded schema.
+ * This should make sure that we do not confront the user with javascript-errors
+ * because of an invalid configuration.
+ *
+ *
+ * LICENSE: 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, see <http://opensource.org/licenses/gpl-license.php>;.
+ *
+ * @category editor
+ * @package CometVisu
+ * @author Julian Makowski (julian at makowskis dot de)
+ * @copyright 2013 Julian Makowski
+ * @license GPLv3 or later, http://opensource.org/licenses/gpl-license.php
+ * @version SVN: $Id$
+ * @link http://cometvisu.de
+ * @since 2013-02-05
+ */
+
+require_once('../lib/lib_version.inc.php');
+
+define('CONFIG_FILENAME', '../visu_config%s.xml');
+define('SCHEMA_FILENAME', '../%s');
+
+// get everything the user has provided ...
+$strConfigSuffix = (true === isset($_GET['config'])) ? $_GET['config'] : null;
+
+// clean-up filename, we want no security-holes. work with a whitelist.
+$strConfigCleaned = preg_replace("/[^\-\_0-9a-z]/i", "", $strConfigSuffix);
+
+if (false === empty($strConfigCleaned)) {
+ // prefix the postfix with an underscore
+ $strConfigCleaned = '_' . $strConfigCleaned;
+}
+
+// generate the configurations filename
+$strConfigFilename = sprintf(CONFIG_FILENAME, $strConfigCleaned);
+// .. as a fully qualified filename
+$strConfigFQFilename = realpath($strConfigFilename);
+
+if (false === is_writeable($strConfigFQFilename)) {
+ exitWithError('config-file is not writeable by webserver-process; please chmod/chown config-file \'' . $strConfigFQFilename . '\' (\'' . $strConfigFilename. '\').');
+}
+
+// load the configuration
+$objDOM = new DOMDocument("1.0", "UTF-8");
+$objDOM->load($strConfigFQFilename);
+
+// get the configurations schema.
+$strSchemaFile = $objDOM->getElementsByTagName('pages')->item(0)->getAttribute('xsi:noNamespaceSchemaLocation');
+
+if (true === empty($strSchemaFile)) {
+ exitWithError('config-file has no schema associated; do not worry, you probably only need to upgrade its ' .
+ 'structure. This can be done automatically. ' .
+ '<a href="../upgrade/index.php?config=' . $strConfigSuffix . '">Click here to upgrade</a>');
+}
+
+$intConfigurationVersion = $objDOM->getElementsByTagName('pages')->item(0)->getAttribute('lib_version');
+if ($intConfigurationVersion < LIBRARY_VERSION) {
+ exitWithError('Your configuration is not suited for the current version of the library/editor; ' .
+ ' do not worry, you only need to upgrade its structure. This can be done automatically. ' .
+ '<a href="../upgrade/index.php?config=' . $strConfigSuffix . '">Click here to upgrade</a>');
+}
+
+$strSchemaFilename = sprintf(SCHEMA_FILENAME, $strSchemaFile);
+// .. as a fully qualified filename
+$strSchemaFQFilename = realpath($strSchemaFilename);
+
+// disable output of validator
+ob_start();
+// validate the configuration
+$boolValid = $objDOM->schemaValidate($strSchemaFQFilename);
+
+// and flush the validators output
+ob_end_clean();
+
+
+if (true === $boolValid) {
+ // everything is good
+ header('Location: editor.html?config=' . $strConfigSuffix);
+ exit;
+} else {
+ // not everything is good, have check_config look at it.
+ header('Location: ../check_config.php?config=' . $strConfigSuffix);
+ exit;
+}
+
+/**
+ * create and send a response.
+ * This function will issue an exit command!
+ *
+ * @param string $strMessage a message, if any
+ */
+function exitWithError($strMessage = '') {
+
+ header('Content-type: text/html');
+ print '<html><head>';
+ print '<title>configuration pre-check</title>';
+ print '</head><body>';
+
+ print '<b style="color: red;">ERROR</b>: ';
+ print $strMessage;
+
+ print '</body></html>';
+
+ exit;
+}
+
+?>
\ No newline at end of file
Modified: CometVisu/trunk/visu/editor/lib/Editor.js
===================================================================
--- CometVisu/trunk/visu/editor/lib/Editor.js 2013-02-05 21:00:54 UTC (rev 1429)
+++ CometVisu/trunk/visu/editor/lib/Editor.js 2013-02-05 21:08:56 UTC (rev 1430)
@@ -70,6 +70,11 @@
*/
var isExpert = false;
+ if ($.cookie('editor_complex') == true || $.cookie('editor_complex') == 'true') {
+ // read the expert-cookie
+ isExpert = true;
+ }
+
var clickHandler = function (event) {
var $button = $(this);
@@ -116,6 +121,9 @@
$button.toggleClass('active');
isExpert = $button.hasClass('active');
+
+ // save the current state to the cookie
+ $.cookie('editor_complex', isExpert, {expires: 365});
}
};
@@ -218,6 +226,10 @@
.attr('title', Messages.editor.ui.expert.tooltip)
.click(clickHandler);
$menu.append($expert);
+ if (isExpert == true) {
+ // add the active-class even at startup, it might be pre-set
+ $expert.addClass('active');
+ }
var $preview = $('<span />')
.addClass('button')
@@ -1733,9 +1745,30 @@
var $name = $('<span />').addClass('name').html(_element.name).addClass('nodeType_' + _element.name);
var $nameValue = $('<span />').addClass('nameValue');
- if (typeof _element.attributes.name != 'undefined' && _element.attributes.name.trim() != '') {
- $nameValue.text(_element.attributes.name);
- $nameValue.addClass('set');
+ // find out which fields functions as descriptor for this element, if any
+ var properties = _element.getSchemaElement().getAppinfo();
+
+ var descriptor = 'name'; // default to the field 'name' as descriptor
+ $.each(properties, function (i, value) {
+ if (/^descriptor:/.test(value)) {
+ descriptor = value.replace(/^descriptor:/, '');
+ }
+ });
+ delete properties;
+
+ if (descriptor == '#text') {
+ // we need to get the text-content as descriptor. do not abuse this, or you might get punched
+ // in the face by adding markup to the editor at places you did not expect
+ if (_element.value != undefined && _element.value.trim() != '') {
+ $nameValue.text(_element.value);
+ $nameValue.addClass('set');
+ }
+ } else {
+ // its an attribute
+ if (typeof _element.attributes[descriptor] != 'undefined' && _element.attributes[descriptor].trim() != '') {
+ $nameValue.text(_element.attributes[descriptor]);
+ $nameValue.addClass('set');
+ }
}
$name.append($nameValue);
delete $nameValue;
Modified: CometVisu/trunk/visu/editor/lib/Schema.js
===================================================================
--- CometVisu/trunk/visu/editor/lib/Schema.js 2013-02-05 21:00:54 UTC (rev 1429)
+++ CometVisu/trunk/visu/editor/lib/Schema.js 2013-02-05 21:08:56 UTC (rev 1430)
@@ -796,6 +796,8 @@
* @return boolean are children sortable?
*/
_element.areChildrenSortable = function () {
+ var allowedContent = _element.getAllowedContent();
+
if (allowedContent._grouping == undefined) {
return undefined;
}
@@ -812,6 +814,8 @@
* @return array list of required elements
*/
_element.getRequiredElements = function () {
+ var allowedContent = _element.getAllowedContent();
+
if (allowedContent._grouping != undefined) {
// we do have a grouping as a child
return allowedContent._grouping.getRequiredElements();
@@ -849,6 +853,8 @@
* @return object list of allowed elements, with their sort-number as value
*/
_element.getAllowedElementsSorting = function () {
+ var allowedContent = _element.getAllowedContent();
+
if (allowedContent._grouping != undefined) {
return allowedContent._grouping.getAllowedElementsSorting();
}
@@ -862,6 +868,8 @@
* @return object bounds ({min: x, max: y})
*/
_element.getChildBounds = function () {
+ var allowedContent = _element.getAllowedContent();
+
if (allowedContent._grouping == undefined) {
// no choice = no idea about bounds
return undefined;
@@ -883,6 +891,8 @@
* @return object {min: x, max: y}
*/
_element.getBoundsForElementName = function (childName) {
+ var allowedContent = _element.getAllowedContent();
+
return allowedContent._grouping.getBoundsForElementName(childName);
};
@@ -1130,6 +1140,8 @@
return true;
}
+ var allowedContent = _element.getAllowedContent();
+
return allowedContent._text.isValueValid(value);
}
@@ -1187,6 +1199,8 @@
separator = '';
}
+ var allowedContent = _element.getAllowedContent();
+
if (allowedContent._grouping == undefined) {
// not really something to match
return '^';
@@ -1558,29 +1572,37 @@
* @return object {max: x, min: y}, or undefined if none found
*/
_choice.getBoundsForElementName = function (childName) {
- // if this element is our immediate child, we have to say about bounds
- if (typeof allowedElements[childName] !== 'undefined') {
+ // as we are a choice, we can define the number of occurences for children of ANY level
+ if (true === _choice.isElementAllowed(childName)) {
return _choice.getBounds();
}
-
- // though we are a child-element, our sub-grouping might have another saying than we do about the bounds
- var childBounds = undefined;
- $.each(subGroupings, function (i, subGroup) {
- if (typeof childBounds != 'undefined') {
- // do not look further if we already have bounds
- return;
- }
-
- // if the subGroup allows this element, we get the bounds from there
- if (true === subGroup.isElementAllowed(childName)) {
- childBounds = subGroup.getBoundsForElementName(childName);
- }
-
- });
-
-
- return childBounds;
+ return undefined;
+//
+// // if this element is our immediate child, we have to say about bounds
+// if (typeof allowedElements[childName] !== 'undefined') {
+// return _choice.getBounds();
+// }
+//
+// // though we are a child-element, our sub-grouping might have another saying than we do about the bounds
+// var childBounds = undefined;
+//
+// $.each(subGroupings, function (i, subGroup) {
+// if (typeof childBounds != 'undefined') {
+// // do not look further if we already have bounds
+// return;
+// }
+//
+// // if the subGroup allows this element, we still use our own bounds, as they are superior, and we still
+// // are a choice!
+// if (true === subGroup.isElementAllowed(childName)) {
+// childBounds = _choice.getBounds();
+// }
+//
+// });
+//
+//
+// return childBounds;
};
/**
Added: CometVisu/trunk/visu/lib/library_version.inc.php
===================================================================
--- CometVisu/trunk/visu/lib/library_version.inc.php (rev 0)
+++ CometVisu/trunk/visu/lib/library_version.inc.php 2013-02-05 21:08:56 UTC (rev 1430)
@@ -0,0 +1,37 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * define the current version of the library
+ *
+ *
+ * LICENSE: 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, see <http://opensource.org/licenses/gpl-license.php>;.
+ *
+ * @category visu
+ * @package CometVisu
+ * @author Julian Makowski (julian at makowskis dot de)
+ * @copyright 2013 Julian Makowski
+ * @license GPLv3 or later, http://opensource.org/licenses/gpl-license.php
+ * @version SVN: $Id$
+ * @link http://cometvisu.de
+ * @since 2013-02-05
+ */
+
+/**
+ * the current lib version
+ * @const integer
+ */
+define('LIBRARY_VERSION', 1);
+
+?>
Modified: CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php
===================================================================
--- CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php 2013-02-05 21:00:54 UTC (rev 1429)
+++ CometVisu/trunk/visu/upgrade/ConfigurationUpgrader.class.php 2013-02-05 21:08:56 UTC (rev 1430)
@@ -28,11 +28,14 @@
* @since 2013-01-22
*/
+// get the current library version
+require_once('../lib/lib_version.inc.php');
+
/**
- * the current lib version
+ * the library-version the upgrader understands
* @const integer
*/
-define('LIBRARY_VERSION', 1);
+define('UPGRADER_LIBRARY_VERSION', 1);
/**
Modified: CometVisu/trunk/visu/upgrade/index.php
===================================================================
--- CometVisu/trunk/visu/upgrade/index.php 2013-02-05 21:00:54 UTC (rev 1429)
+++ CometVisu/trunk/visu/upgrade/index.php 2013-02-05 21:08:56 UTC (rev 1430)
@@ -34,6 +34,15 @@
require_once('ConfigurationUpgrader.class.php');
+if (LIBRARY_VERSION > UPGRADER_LIBRARY_VERSION) {
+ // the library moved faster than the upgrader
+ exitWithResponse(false, 'The upgrader itself is not up-to-date. ' .
+ 'Library is at version ' . LIBRARY_VERSION . ', ' .
+ 'upgrader at version ' . UPGRADER_LIBRARY_VERSION . '. ' .
+ 'Please report this problem at http://www.knx-user-forum.de/cometvisu/');
+}
+
+
define('CONFIG_FILENAME', '../visu_config%s.xml');
define('BACKUP_FILENAME', '../backup/visu_config%s-%s.xml');
@@ -132,7 +141,7 @@
* @param string $strMessage a message, if any
*/
function exitWithResponse($boolSuccess, $strMessage = '') {
- if ($boolSuccess == true) {
+ if (true === $boolSuccess) {
print '<b style="color: green;">SUCCESS</b>';
} else {
print '<b style="color: red;">ERROR</b>';
@@ -143,6 +152,14 @@
print $strMessage;
}
+ if (true === $boolSuccess) {
+ // despite globals being bad in general, this is way easier.
+ global $strConfigSuffix;
+
+ print '<p><a href="../editor/?config=' . $strConfigSuffix . '">open config in editor</a></p>';
+ print '<p><a href="../?config=' . $strConfigSuffix . '">show in CometVisu</a></p>';
+ }
+
outputFooter();
exit;
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2013-02-05 21:00:54 UTC (rev 1429)
+++ CometVisu/trunk/visu/visu_config.xml 2013-02-05 21:08:56 UTC (rev 1430)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" design="pure" xsi:noNamespaceSchemaLocation="./visu_config.xsd" lib_version="0">
+<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" design="pure" lib_version="0" xsi:noNamespaceSchemaLocation="./visu_config.xsd">
<meta>
<plugins>
<plugin name="colorchooser"/>
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2013-02-05 21:00:54 UTC (rev 1429)
+++ CometVisu/trunk/visu/visu_config.xsd 2013-02-05 21:08:56 UTC (rev 1430)
@@ -37,6 +37,9 @@
</xsd:complexType>
<xsd:complexType name="entry" mixed="true">
+ <xsd:annotation>
+ <xsd:appinfo>descriptor:#text</xsd:appinfo>
+ </xsd:annotation>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="icon" type="icon" />
</xsd:choice>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2013-02-09 18:30:48
|
Revision: 1451
http://openautomation.svn.sourceforge.net/openautomation/?rev=1451&view=rev
Author: mayerch
Date: 2013-02-09 18:30:36 +0000 (Sat, 09 Feb 2013)
Log Message:
-----------
New try at handling the script includes
Modified Paths:
--------------
CometVisu/trunk/visu/index.html
CometVisu/trunk/visu/lib/compatibility.js
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/plugins/clock/structure_plugin.js
CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
CometVisu/trunk/visu/plugins/rsslog/structure_plugin.js
CometVisu/trunk/visu/plugins/strftime/structure_plugin.js
CometVisu/trunk/visu/plugins/svg/structure_plugin.js
CometVisu/trunk/visu/plugins/upnpcontroller/structure_plugin.js
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/index.html 2013-02-09 18:30:36 UTC (rev 1451)
@@ -17,7 +17,7 @@
<script src="lib/compatibility.js" type="text/javascript"></script>
<script type="text/javascript">
$.ajaxSetup({ crossDomain: true, cache: 'true' != $.getUrlVar('forceReload') }); // make scripts debugable
- $.getOrderedScripts([
+ $.includeScripts([
"dependencies/jquery-ui.js",
"dependencies/strftime.js",
"dependencies/scrollable.js",
Modified: CometVisu/trunk/visu/lib/compatibility.js
===================================================================
--- CometVisu/trunk/visu/lib/compatibility.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/lib/compatibility.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -177,25 +177,16 @@
getUrlVar: function(name){
return $.getUrlVars()[name];
},
- getScriptSync: function( url ) {
- $.ajax({
- url: url,
- dataType: 'script',
- async: false
- });
- },
- // heavily inspired by: http://stackoverflow.com/questions/13066712/how-to-load-a-list-of-javascript-files-and-call-a-callback-after-all-of-them-are
+ /**
+ * heavily inspired by: http://stackoverflow.com/questions/13066712/how-to-load-a-list-of-javascript-files-and-call-a-callback-after-all-of-them-are
+ */
getOrderedScripts: function(files, callback) {
if( 'object' === typeof files && 0 == files.length && callback )
+ {
callback();
- else
- /*
- $.getScript( files.shift(), files.length
- ? function(){ $.getOrderedScripts(files, callback);}
- : callback
- );
- */
- // temporary fix till a better solution could be implemented:
+ } else {
+ if( 'string' === typeof files )
+ files = [ files ];
$.ajax({
url: files.shift(),
dataType: 'script',
@@ -204,7 +195,15 @@
? function(){ $.getOrderedScripts(files, callback);}
: callback
});
+ }
},
+ /**
+ * Include files on this place. This will be replaced by the content of the
+ * script during packaging
+ */
+ includeScripts: function(files, callback) {
+ this.getOrderedScripts(files, callback);
+ },
// inspired by http://stackoverflow.com/questions/2685614/load-external-css-file-like-scripts-in-jquery-which-is-compatible-in-ie-also
getCSS: function( url, parameters ) {
var cssLink = $( '<link/>' );
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -373,7 +373,10 @@
return className;
};
- this.parseXML = function(xml) {
+ var pluginsToLoadCount = 0;
+ var xml;
+ this.parseXML = function(loaded_xml) {
+ xml = loaded_xml;
// erst mal den Cache für AJAX-Requests wieder aktivieren
/*
$.ajaxSetup({
@@ -436,22 +439,19 @@
{media: 'only screen and (max-width: '
+ thisTemplateEngine.maxMobileScreenWidth + 'px)'} );
$.getCSS( 'designs/' + thisTemplateEngine.clientDesign + '/custom.css' );
- $.getScript( 'designs/' + thisTemplateEngine.clientDesign + '/design_setup.js',
+ $.getOrderedScripts( ['designs/' + thisTemplateEngine.clientDesign + '/design_setup.js'],
function(){
thisTemplateEngine.designReady = true;
- thisTemplateEngine.setup_page(xml);
+ thisTemplateEngine.setup_page();
}
);
// start with the plugins
var pluginsToLoad = [];
$('meta > plugins plugin', xml).each(function(i) {
- pluginsToLoad.push( 'plugins/' + $(this).attr('name') + '/structure_plugin.js' );
+ pluginsToLoadCount++;
+ $.getOrderedScripts( ['plugins/' + $(this).attr('name') + '/structure_plugin.js'] );
});
- $.getOrderedScripts( pluginsToLoad, function(){
- thisTemplateEngine.pluginsReady = true;
- thisTemplateEngine.setup_page(xml);
- });
// then the icons
$('meta > icons icon-definition', xml).each(function(i) {
@@ -555,7 +555,7 @@
});
thisTemplateEngine.pageReady = true;
- thisTemplateEngine.setup_page(xml);
+ thisTemplateEngine.setup_page();
};
/**
@@ -594,7 +594,7 @@
};
- this.setup_page = function(xml) {
+ this.setup_page = function() {
// and now setup the pages
// check if the page and the plugins are ready now
@@ -651,7 +651,8 @@
$('embed').each(function() {
this.onload = function() {
var svg = this.getSVGDocument();
-
+ if( !svg ) return;
+
// Pipe-O-Matic:
var pipes = svg.getElementsByClassName('pipe_group');
$(pipes).each(function() {
@@ -779,6 +780,8 @@
thisTemplateEngine.visu.setInitialAddresses(Object.keys(startPageAddresses));
}
thisTemplateEngine.visu.subscribe(thisTemplateEngine.getAddresses());
+
+ delete xml; // not needed anymore - free the space
// $(window).trigger('resize');
$("#pages").triggerHandler("done");
};
@@ -1076,6 +1079,26 @@
}
}
};
+
+ /**
+ * Load a script and run it before page setup.
+ * This is needed for plugin that depend on an external library.
+ */
+ this.getPluginDependency = function( url ){
+ $.getScriptSync( url );
+ }
+
+ /**
+ * This has to be called by a plugin once it was loaded.
+ */
+ this.pluginLoaded = function(){
+ pluginsToLoadCount--;
+ if( 0 == pluginsToLoadCount )
+ {
+ thisTemplateEngine.pluginsReady = true;
+ thisTemplateEngine.setup_page();
+ }
+ }
}
function PagePartsHandler() {
Modified: CometVisu/trunk/visu/plugins/clock/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/clock/structure_plugin.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/plugins/clock/structure_plugin.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -124,4 +124,6 @@
templateEngine.visu.write( addr.substr(1), templateEngine.transformEncode( data.address[addr][0], data.value ) );
}
}
-});
\ No newline at end of file
+});
+
+templateEngine.pluginLoaded();
\ No newline at end of file
Modified: CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/plugins/colorchooser/structure_plugin.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -162,6 +162,6 @@
/**
* Include the needed stuff
*/
-$.getScriptSync( 'plugins/colorchooser/farbtastic/farbtastic.js' );
$.getCSS( 'plugins/colorchooser/farbtastic/farbtastic.css' );
+$.includeScripts( 'plugins/colorchooser/farbtastic/farbtastic.js', templateEngine.pluginLoaded );
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -52,10 +52,10 @@
*
*/
-$.getOrderedScripts([
+$.includeScripts([
'plugins/diagram/flot/jquery.flot.js',
'plugins/diagram/flot/jquery.flot.axislabels.js'
-]);
+], templateEngine.pluginLoaded );
function diagram_get_content( page ) {
Modified: CometVisu/trunk/visu/plugins/rsslog/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/rsslog/structure_plugin.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/plugins/rsslog/structure_plugin.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -15,9 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-$.get("plugins/rsslog/rsslog.css", function(css) {
- $("head").append("<style>"+css+"</style>");
-});
+$.getCSS( 'plugins/rsslog/rsslog.css' );
VisuDesign_Custom.prototype.addCreator("rsslog", {
create: function( page, path ) {
@@ -253,3 +251,4 @@
});
})(jQuery);
+templateEngine.pluginLoaded();
\ No newline at end of file
Modified: CometVisu/trunk/visu/plugins/strftime/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/strftime/structure_plugin.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/plugins/strftime/structure_plugin.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -22,7 +22,7 @@
* Thanks to Michael Markstaller for implementing the jqclock as reference.
*/
-$('head').append('<link rel="stylesheet" href="plugins/strftime/strftime.css" type="text/css" />');
+$.getCSS( 'plugins/strftime/strftime.css' );
VisuDesign_Custom.prototype.addCreator("strftime", {
create : function(page, path) {
@@ -84,3 +84,5 @@
return ret_val;
}
});
+
+templateEngine.pluginLoaded();
\ No newline at end of file
Modified: CometVisu/trunk/visu/plugins/svg/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/svg/structure_plugin.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/plugins/svg/structure_plugin.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -72,4 +72,6 @@
element.find('#line'+(i+1)).attr('y2',9);
}
}
-});
\ No newline at end of file
+});
+
+templateEngine.pluginLoaded();
\ No newline at end of file
Modified: CometVisu/trunk/visu/plugins/upnpcontroller/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/upnpcontroller/structure_plugin.js 2013-02-09 18:01:44 UTC (rev 1450)
+++ CometVisu/trunk/visu/plugins/upnpcontroller/structure_plugin.js 2013-02-09 18:30:36 UTC (rev 1451)
@@ -15,8 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-
-$( 'head' ).append( '<link rel="stylesheet" href="plugins/upnpcontroller/upnpcontroller.css" type="text/css" />' );
+$.getCSS( 'plugins/upnpcontroller/upnpcontroller.css' );
var upnpcontroller_uid;
var upnpcontroller_trace_flag;
@@ -393,3 +392,4 @@
}
}
+templateEngine.pluginLoaded();
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2013-02-10 11:24:30
|
Revision: 1456
http://openautomation.svn.sourceforge.net/openautomation/?rev=1456&view=rev
Author: mayerch
Date: 2013-02-10 11:24:23 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
Implement feature request ID: 3575661 "Screensaver Mode: Back to Home or Slider through pages..."
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2013-02-10 10:16:04 UTC (rev 1455)
+++ CometVisu/trunk/visu/lib/templateengine.js 2013-02-10 11:24:23 UTC (rev 1456)
@@ -431,6 +431,8 @@
if ($('pages', xml).attr('min_column_width')) {
thisTemplateEngine.minColumnWidth = $('pages', xml).attr('min_column_width');
}
+ thisTemplateEngine.screensave_time = $('pages', xml).attr('screensave_time');
+ thisTemplateEngine.screensave_page = $('pages', xml).attr('screensave_page');
// design by url
if ($.getUrlVar("design")) {
@@ -803,6 +805,14 @@
delete xml; // not needed anymore - free the space
// $(window).trigger('resize');
$("#pages").triggerHandler("done");
+ if( undefined !== thisTemplateEngine.screensave_time )
+ {
+ thisTemplateEngine.screensave = setTimeout( function(){thisTemplateEngine.scrollToPage();}, thisTemplateEngine.screensave_time*1000 );
+ $(document).click( function(){
+ clearInterval( thisTemplateEngine.screensave );
+ thisTemplateEngine.screensave = setTimeout( function(){thisTemplateEngine.scrollToPage();}, thisTemplateEngine.screensave_time*1000 );
+ });
+ }
};
this.create_pages = function(page, path, flavour, type) {
@@ -821,12 +831,9 @@
};
this.scrollToPage = function(page_id, speed, skipHistory) {
- $('.activePage', '#pages').removeClass('activePage');
- $('.pageActive', '#pages').removeClass('pageActive');
- $('.pagejump.active').removeClass('active');
- $('.pagejump.active_ancestor').removeClass('active_ancestor');
- thisTemplateEngine.resetPageValues();
-
+ if( undefined === page_id )
+ page_id = this.screensave_page;
+
if (page_id.match(/^id_[0-9_]+$/) == null) {
// find Page-ID by name
$('.page h1:contains(' + page_id + ')', '#pages').each(function(i) {
@@ -835,7 +842,19 @@
}
});
}
+ // don't scroll when target is already active
+ if( thisTemplateEngine.currentPageID == page_id )
+ return;
+ thisTemplateEngine.currentPageID = page_id;
+
+ $('.activePage', '#pages').removeClass('activePage');
+ $('.pageActive', '#pages').removeClass('pageActive');
+ $('.pagejump.active').removeClass('active');
+ $('.pagejump.active_ancestor').removeClass('active_ancestor');
+ thisTemplateEngine.resetPageValues();
+
var page = $('#' + page_id);
+
thisTemplateEngine.currentPage = page;
page.addClass('pageActive activePage');// show new page
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2013-02-10 10:16:04 UTC (rev 1455)
+++ CometVisu/trunk/visu/visu_config.xsd 2013-02-10 11:24:23 UTC (rev 1456)
@@ -53,6 +53,7 @@
<xsd:attribute name="type" type="xsd:string" use="optional" />
<xsd:attribute ref="flavour" use="optional" />
<xsd:attribute name="color" type="xsd:string" use="optional" />
+ <xsd:attribute ref="styling" use="optional" />
</xsd:complexType>
<!-- attributes -->
@@ -291,6 +292,18 @@
<xsd:appinfo>level:expert</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute name="screensave_time" type="xsd:decimal" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Time in seconds till the screensave_page will be jumped to.</xsd:documentation>
+ <xsd:appinfo>level:expert</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="screensave_page" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Page to jump to when after the screensave_time elapsed without user input.</xsd:documentation>
+ <xsd:appinfo>level:expert</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
</xsd:complexType>
</xsd:element>
@@ -316,6 +329,7 @@
<xsd:group name="AvailablePlugins">
<xsd:choice>
+ <xsd:element name="clock" type="clock" />
<xsd:element name="colorchooser" type="colorchooser" />
<xsd:element name="diagram_popup" type="diagram_popup" />
<xsd:element name="diagram_inline" type="diagram_inline" />
@@ -759,6 +773,14 @@
<xsd:attribute ref="bind_click_to_widget" use="optional"/>
</xsd:complexType>
+ <xsd:complexType name="clock">
+ <xsd:sequence>
+ <xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="label" type="label" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="address" type="address" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
<xsd:complexType name="colorchooser">
<xsd:sequence>
<xsd:element name="layout" type="layout" minOccurs="0" maxOccurs="1"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-01 17:28:24
|
Revision: 62
http://openautomation.svn.sourceforge.net/openautomation/?rev=62&view=rev
Author: mayerch
Date: 2010-11-01 17:28:18 +0000 (Mon, 01 Nov 2010)
Log Message:
-----------
Bugfix: <text> will use full space
New Feature: <text> has new optional attribute "align"
Modified Paths:
--------------
CometVisu/trunk/visu/lib/visudesign_pure.js
CometVisu/trunk/visu/visu_config.xml
Modified: CometVisu/trunk/visu/lib/visudesign_pure.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-01 17:17:16 UTC (rev 61)
+++ CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-01 17:28:18 UTC (rev 62)
@@ -53,7 +53,10 @@
{
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'text' );
- ret_val.append( '<div class="label">' + page.textContent + '</div>' );
+ var style = '';
+ if( $(page).attr('align') ) style += 'text-align:' + $(page).attr('align') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ ret_val.append( '<div ' + style + '>' + page.textContent + '</div>' );
return ret_val;
}
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2010-11-01 17:17:16 UTC (rev 61)
+++ CometVisu/trunk/visu/visu_config.xml 2010-11-01 17:28:18 UTC (rev 62)
@@ -31,7 +31,7 @@
</style>
</styles>
<page name="Übersicht">
- <text>Willkommen bei der CometVisu!</text>
+ <text align="center">Willkommen bei der CometVisu!</text>
<toggle address="1/0/2" datatype="1.001" response_address="1/0/2" mapping="OnOff">Terrase Licht</toggle>
<trigger address="1/0/2" datatype="1.001" value="0" mapping="OnOff">Terrase Licht 0</trigger>
<trigger address="1/0/2" datatype="1.001" value="1" mapping="OnOff">Terrase Licht 1</trigger>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-05 18:35:36
|
Revision: 81
http://openautomation.svn.sourceforge.net/openautomation/?rev=81&view=rev
Author: mayerch
Date: 2010-11-05 18:35:30 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
New Feature: images allow refresh attribute
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/lib/visudesign_pure.js
CometVisu/trunk/visu/visu_config.xml
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-05 10:25:12 UTC (rev 80)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-05 18:35:30 UTC (rev 81)
@@ -290,6 +290,22 @@
visu.write( data.GA, data.sendValue, data.datatype );
}
+function refreshAction( target, src )
+{
+ target.src = src + '&' + new Date().getTime();
+}
+function setupRefreshAction()
+{
+ var refresh = $(this).data('refresh');
+ if( refresh && refresh > 0 )
+ {
+ var target = $('img', $(this) )[0];
+ var src = target.src;
+ if( src.indexOf('?') < 0 ) src += '?';
+ $(this).data('interval', setInterval( function(){refreshAction(target, src);}, refresh ) );
+ }
+}
+
/**
* The update thread to send the slider position to the bus
*/
Modified: CometVisu/trunk/visu/lib/visudesign_pure.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-05 10:25:12 UTC (rev 80)
+++ CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-05 18:35:30 UTC (rev 81)
@@ -168,7 +168,11 @@
if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
if( style != '' ) style = 'style="' + style + '"';
- ret_val.append( '<div class="actor"><img src="' +$(page).attr('src') + '" ' + style + ' /></div>' );
+ var actor = '<div class="actor"><img src="' +$(page).attr('src') + '" ' + style + ' /></div>';
+ var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
+ ret_val.append( $(actor).data( {
+ 'refresh': refresh
+ } ).each(setupRefreshAction) ); // abuse "each" to call in context...
return ret_val;
}
@@ -198,4 +202,14 @@
//visu.write( data.GA, data.value=='1' ? '0' : '1', data.datatype );
//FIXME eigentlich richtig... visu.write( data.GA, ui.value, data.datatype );
}
+
+ /**
+ * Setup a refresh interval in seconds if the 'refresh' in the .data()
+ * ist bigger than 0
+ */
+ this.refreshAction = function(that)
+ {
+ var data = $(this).data();
+ alert('this.refreshAction');
+ }
};
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2010-11-05 10:25:12 UTC (rev 80)
+++ CometVisu/trunk/visu/visu_config.xml 2010-11-05 18:35:30 UTC (rev 81)
@@ -48,6 +48,9 @@
<image src="icon/comet_128_ff8000.png" >Ein Bild</image>
<image src="icon/comet_128_ff8000.png" />
<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" >Update every 10 sec</image>
+ <break />
+ <image src="http://www.yr.no/place/Germany/Bavaria/Holzkirchen~2899676/meteogram.png" refresh="1800" />
<line />
<info address="1/0/41" datatype="1.000" mapping="OnOff">Treppenlicht</info>
<page name="Fenster Kontakte">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-12 20:56:18
|
Revision: 113
http://openautomation.svn.sourceforge.net/openautomation/?rev=113&view=rev
Author: mayerch
Date: 2010-11-12 20:56:09 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
Initial support for configurable designs
Modified Paths:
--------------
CometVisu/trunk/visu/visu_config.xml
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2010-11-12 10:33:27 UTC (rev 112)
+++ CometVisu/trunk/visu/visu_config.xml 2010-11-12 20:56:09 UTC (rev 113)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<pages>
+<pages design="pure">
<mappings>
<mapping name="OpenClose">
<entry value="0">zu</entry>
@@ -30,9 +30,9 @@
<entry range_min="0" range_max="100">red</entry>
</style>
</styles>
- <page name="Übersicht">
+ <page name="Übersicht" flavour="orange">
<text align="center">Willkommen bei der CometVisu!</text>
- <toggle address="1/0/2" datatype="1.001" response_address="1/0/2" mapping="OnOff">Terrase Licht</toggle>
+ <toggle address="1/0/2" datatype="1.001" response_address="1/0/2" mapping="OnOff" style="RedGreen" >Terrase Licht</toggle>
<trigger address="1/0/2" datatype="1.001" value="0" mapping="OnOff">Terrase Licht 0</trigger>
<trigger address="1/0/2" datatype="1.001" value="1" mapping="OnOff">Terrase Licht 1</trigger>
<trigger address="2/2/5" datatype="5.001" value="0" >Rolladen Licht 0</trigger>
@@ -53,7 +53,7 @@
<image src="http://www.yr.no/place/Germany/Bavaria/Holzkirchen~2899676/meteogram.png" refresh="1800" />
<line />
<info address="1/0/41" datatype="1.000" mapping="OnOff">Treppenlicht</info>
- <page name="Fenster Kontakte">
+ <page name="Fenster Kontakte" flavour="blue">
<info address="4/3/10" datatype="1" mapping="OpenClose" style="GreenRed">Bad EG Reed Fenster</info>
<info address="4/3/20" datatype="1.001" mapping="OpenClose" style="GreenRed">WC Reed Fenster</info>
<info address="4/3/30" datatype="1" mapping="OpenClose" style="GreenRed">Schlafen Reed Fenster links</info>
@@ -76,7 +76,7 @@
<info address="4/3/210" datatype="1.001">Lueftung Filter</info>
<info address="4/3/250" datatype="1.001" mapping="OnOff">Rauchmelder</info>
</page>
- <page name="Temperaturen">
+ <page name="Temperaturen" flavour="red">
<info address="4/0/10" datatype="9.001" pre="ca. " post=" °C">Bad EG Boden Temperatur</info>
<info address="4/0/11" datatype="9.001" pre="ca. " post=" °C">Bad EG Luft Temperatur</info>
<info address="4/0/15" datatype="9.001" pre="ca. " post=" °C">Bad EG Dusche Temperatur</info>
@@ -101,7 +101,7 @@
<info address="4/0/203" datatype="9.001" pre="ca. " post=" °C">Kaltwasser Temperatur</info>
<info address="4/0/205" datatype="9.001" pre="ca. " post=" °C">Warmwasser UG Temperatur</info>
</page>
- <page name="Rollläden">
+ <page name="Rollläden" flavour="green">
<shade address="2/4/0" datatype="5.001">Rollladen Bad</shade>
<shade address="2/4/1" datatype="5.001">Rollladen Schlafen Fenster</shade>
<shade address="2/4/2" datatype="5.001">Rollladen Schlafen Türe</shade>
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2010-11-12 10:33:27 UTC (rev 112)
+++ CometVisu/trunk/visu/visu_config.xsd 2010-11-12 20:56:09 UTC (rev 113)
@@ -51,6 +51,7 @@
<xsd:element ref="styles" />
<xsd:element ref="page" minOccurs="1" />
</xsd:choice>
+ <xsd:attribute name="design" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
@@ -108,6 +109,7 @@
<xsd:element ref="page" />
</xsd:choice>
<xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="flavour" type="xsd:string" />
</xsd:complexType>
</xsd:element>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-12 20:59:39
|
Revision: 114
http://openautomation.svn.sourceforge.net/openautomation/?rev=114&view=rev
Author: mayerch
Date: 2010-11-12 20:59:33 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
new directory structure for designs
Added Paths:
-----------
CometVisu/trunk/visu/designs/
CometVisu/trunk/visu/designs/discreet/
CometVisu/trunk/visu/designs/pure/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-12 21:11:31
|
Revision: 115
http://openautomation.svn.sourceforge.net/openautomation/?rev=115&view=rev
Author: mayerch
Date: 2010-11-12 21:11:21 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
Moved stylesheets et al. to the newly created diretories
Modified Paths:
--------------
CometVisu/trunk/visu/index.html
Added Paths:
-----------
CometVisu/trunk/visu/designs/discreet/basic.css
CometVisu/trunk/visu/designs/discreet/fonts/
CometVisu/trunk/visu/designs/discreet/images/
CometVisu/trunk/visu/designs/pure/basic.css
CometVisu/trunk/visu/designs/pure/mobile.css
Removed Paths:
-------------
CometVisu/trunk/visu/fonts/
CometVisu/trunk/visu/images/
CometVisu/trunk/visu/style_discreet.css
CometVisu/trunk/visu/style_orange.css
CometVisu/trunk/visu/style_orange_mobile.css
Copied: CometVisu/trunk/visu/designs/discreet/basic.css (from rev 112, CometVisu/trunk/visu/style_discreet.css)
===================================================================
--- CometVisu/trunk/visu/designs/discreet/basic.css (rev 0)
+++ CometVisu/trunk/visu/designs/discreet/basic.css 2010-11-12 21:11:21 UTC (rev 115)
@@ -0,0 +1,290 @@
+@font-face { font-family: Liberation; src:url(fonts/liberationsans-regular.ttf); }
+@font-face { font-family: Liberation; font-weight: bold; src:url(fonts/liberationsans-bold.ttf); }
+
+body
+{
+ color: white;
+ font-family: Liberation;
+ font-size: 5.5mm;
+ overflow: hidden;
+ margin:0;
+ background: #1d1d1d url(images/body_bg.png) repeat-x;
+}
+
+h1
+{
+ font-size: 2em;
+ margin-left: 15px;
+}
+
+body hr
+{
+ clear:both;
+ color: #81664b;
+ background-color: #81664b;
+ height: 1px;
+ border:none;
+ padding:0px;
+ margin:0.1em;
+}
+
+#pages hr {
+ border: 0; height: 30px; margin: 0 .1em;
+ background: transparent url(images/hr_bg.png) 50% repeat-x;
+ clear: both;
+}
+
+
+body br
+{
+ clear:both;
+}
+
+div#top {
+ margin-top: 8px;
+}
+
+.nav_path
+{
+ color: #81664b;
+ margin-left: 15px;
+}
+.nav_path a
+{
+ color: white;
+ text-decoration:none;
+}
+
+.footer,
+.footer *
+{
+ color: #000000;
+ font-size: 0.9em;
+ vertical-align: middle;
+}
+
+.widget
+{
+ float:left;
+ width:48%;
+ margin: .2em;
+ padding: 0.3em;
+ /* border:yellow 1px solid; */
+ border-color: #020202;
+ border-style: solid;
+ border-width: 2px 0px 0px 2px;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ min-height: 2em;
+ background-color: #101010;
+}
+
+.text > div,
+.link > a {
+ float:left;
+ text-align:left;
+ padding-left: 1em;
+}
+
+.widget .label,
+.widget.info .actor,
+.text > div,
+.link > a {
+ line-height: 2em;
+}
+
+.widget .label
+{
+ float:left;
+ width:49%;
+/* color:red; */
+/* padding-right:0.25em; */
+ text-align:left;
+ padding-left: 1em;
+/* border:blue 1px solid; */
+}
+.widget .actor
+{
+ float:left;
+ margin-left:1em;
+ text-align:left;
+}
+.widget .actor div
+{
+ float:left;
+ white-space: pre-wrap;
+}
+
+
+.green.switchPressed div, .green.switchUnpressed div{
+ background: transparent url(images/dot_green.png) no-repeat center center;
+ color: white !important;
+}
+.red.switchPressed div, .red.switchUnpressed div{
+ background: transparent url(images/dot_red.png) no-repeat center center;
+ color: white !important;
+}
+
+
+.red
+{
+ color:#f44;
+ font-weight:bold;
+}
+
+.green
+{
+ color:#4f4;
+}
+
+.blue
+{
+ color:#44f;
+}
+
+.purple
+{
+ color:#f4f;
+}
+
+.link a
+{
+ color: #81664b;
+ width: 49%;
+}
+
+.page
+{
+ float:left;
+ width: 900px;
+ overflow: auto;
+ position: relative;
+}
+
+.switchPressed, .switchUnpressed {
+ border-style: solid;
+ -moz-border-radius: 12px;
+ -webkit-border-radius: 12px;
+ border-radius: 12px;
+ padding: 1px;
+ background: url(images/button_bg.png) #171717 repeat-x;
+}
+
+.switchUnpressed
+{
+ border-width: 1px 2px 2px 1px;
+ border-color: #282828 #010101 #010101 #282828;
+ margin-top: 0px;
+ background-color: #3A3A3A;
+ background-position: center +2px;
+}
+.switchUnpressed div, .switchPressed div
+{
+ padding: 5px;
+ width: 5em;
+ float: left;
+ background: transparent;
+ text-align: center;
+ cursor: pointer;
+}
+
+.switchPressed
+{
+ border-width: 2px 1px 1px 2px;
+ border-color: #010101 #282828 #282828 #010101;
+ margin-top: 1px;
+ background-position: center -2px;
+}
+
+.switchUnpressed div {
+ margin-left: -1px;
+}
+
+.switchPressed div {
+ margin-top: -1px;
+}
+
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }
+.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; }
+.ui-widget-content a { color: #333333; }
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
+.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
+
+.dim .actor
+{
+ width: 3em;
+}
+.widget .ui-slider
+{
+ width: 30%;
+ float: left;
+ margin-left: 10px;
+ margin-left: 1em;
+ margin-top: 0.5em;
+ border-color: #010101 #282828 #282828 #010101;
+ background: url(images/gradient.png) #a7a7a7 repeat-y;
+}
+
+.widget .ui-slider-handle
+{
+ border-style: solid;
+ -moz-border-radius: 12px;
+ -webkit-border-radius: 12px;
+ border-radius: 12px;
+ padding: 1px;
+ background: url(images/button_bg.png) #171717 repeat-x;
+ border-width: 1px 2px 2px 1px;
+ border-color: #282828 #010101 #010101 #282828;
+}
+/* Clearfix */
+.clearfix:after {
+ content: ".";
+ display: block;
+ clear: both;
+ visibility: hidden;
+ line-height: 0;
+ height: 0;
+}
+
+.clearfix {
+ display: inline-block;
+}
+
+html[xmlns] .clearfix {
+ display: block;
+}
+
+*:first-child+html .clearfix {
+ min-height: 0;
+}
+
+* html .clearfix {
+ height: 1%;
+}
+
+* html>body .clearfix {
+ display: inline-block;
+ width: 100%;
+}
+
+* html .clearfix {
+ /* Hides from IE-mac \*/
+ height: 1%;
+ /* End hide from IE-mac */
+}
Copied: CometVisu/trunk/visu/designs/pure/basic.css (from rev 112, CometVisu/trunk/visu/style_orange.css)
===================================================================
--- CometVisu/trunk/visu/designs/pure/basic.css (rev 0)
+++ CometVisu/trunk/visu/designs/pure/basic.css 2010-11-12 21:11:21 UTC (rev 115)
@@ -0,0 +1,253 @@
+body
+{
+ background-color: black;
+ color: white;
+ font-family: Verdana, Helvetica, sans-serif;
+ font-family: 'URW Gothic L','Century Gothic','Apple Gothic',Arial,sans-serif;
+ font-size: 6mm;
+ overflow: hidden;
+ margin:0;
+}
+
+h1
+{
+ font-size: 2em;
+}
+
+body hr
+{
+ clear:both;
+ color: #ff8000;
+ background-color: #ff8000;
+ height: 1px;
+ border:none;
+ padding:0px;
+ margin:0.1em;
+}
+
+body br
+{
+ clear:both;
+}
+
+.nav_path
+{
+ color: #ff8000;
+}
+.nav_path a
+{
+ color: white;
+ text-decoration:none;
+}
+
+.footer,
+.footer *
+{
+ color: #ff8000;
+ font-size: 0.9em;
+ vertical-align: middle;
+}
+
+.widget
+{
+ float:left;
+ width:48%;
+ margin:0.10em;
+ padding:0.1em;
+ /* border:yellow 1px solid; */
+ border: 1px solid #444;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ min-height: 2em;
+}
+
+.widget .label
+{
+ float:left;
+ width:49%;
+/* color:red; */
+/* padding-right:0.25em; */
+ text-align:right;
+/* border:blue 1px solid; */
+}
+.widget .actor
+{
+ float:left;
+ margin-left:1em;
+ /*width:49%;*/
+ text-align:left;
+/* color:green; */
+/* border:blue 1px solid; */
+}
+.widget .actor div
+{
+ float:left;
+ white-space: pre-wrap;
+}
+
+.red
+{
+ color:#f44;
+ font-weight:bold;
+}
+
+.green
+{
+ color:#4f4;
+}
+
+.blue
+{
+ color:#44f;
+}
+
+.purple
+{
+ color:#f4f;
+}
+
+.link a
+{
+ color: #ff8000;
+ text-align: right;
+ width: 49%;
+}
+
+.page
+{
+ float:left;
+ width: 900px;
+ overflow: auto;
+ position: relative;
+}
+
+.switchUnpressed
+{
+ border-style: solid;
+ border-width: 1px;
+ border-color: #666 #444 #444 #666;
+ -moz-border-radius: 7px;
+ -webkit-border-radius: 7px;
+ border-radius: 7px;
+ padding: 1px;
+}
+.switchUnpressed div
+{
+ border-style: solid;
+ border-width: 1px;
+ border-color: #fff #666 #666 #fff;
+ padding: 5px;
+ width: 5em;
+ float: left;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.switchPressed
+{
+ border-top: 1px solid #666;
+ border-left: 1px solid #666;
+ border-right: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+}
+.switchPressed
+{
+ border-style: solid;
+ border-width: 1px;
+ border-color: #666 #fff #fff #666;
+ -moz-border-radius: 7px;
+ -webkit-border-radius: 7px;
+ border-radius: 7px;
+ padding: 1px;
+}
+.switchPressed div
+{
+ border-style: solid;
+ border-width: 1px;
+ border-color: #444 #666 #666 #444;
+ padding: 5px;
+ width: 5em;
+ float: left;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }
+.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; }
+.ui-widget-content a { color: #333333; }
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
+.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
+
+.dim .actor
+{
+ width: 3em;
+}
+.widget .ui-slider
+{
+ width: 30%;
+ float: left;
+ margin-left: 10px;
+ margin-left: 1em;
+ margin-top: 0.2em;
+ border-color: #666 #fff #fff #666;
+}
+
+.widget .ui-slider-handle
+{
+ border-color: #fff #666 #666 #fff;
+}
+/* Clearfix */
+.clearfix:after {
+ content: ".";
+ display: block;
+ clear: both;
+ visibility: hidden;
+ line-height: 0;
+ height: 0;
+}
+
+.clearfix {
+ display: inline-block;
+}
+
+html[xmlns] .clearfix {
+ display: block;
+}
+
+*:first-child+html .clearfix {
+ min-height: 0;
+}
+
+* html .clearfix {
+ height: 1%;
+}
+
+* html>body .clearfix {
+ display: inline-block;
+ width: 100%;
+}
+
+* html .clearfix {
+ /* Hides from IE-mac \*/
+ height: 1%;
+ /* End hide from IE-mac */
+}
Copied: CometVisu/trunk/visu/designs/pure/mobile.css (from rev 112, CometVisu/trunk/visu/style_orange_mobile.css)
===================================================================
--- CometVisu/trunk/visu/designs/pure/mobile.css (rev 0)
+++ CometVisu/trunk/visu/designs/pure/mobile.css 2010-11-12 21:11:21 UTC (rev 115)
@@ -0,0 +1,12 @@
+.widget
+{
+ width:98%;
+}
+
+#bottom {
+ display: none;
+}
+
+.page {
+ overflow: visible;
+}
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2010-11-12 20:59:33 UTC (rev 114)
+++ CometVisu/trunk/visu/index.html 2010-11-12 21:11:21 UTC (rev 115)
@@ -5,8 +5,8 @@
<head>
<title>CometVisu-Client</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <link rel="stylesheet" type="text/css" href="style_discreet.css" />
- <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="style_orange_mobile.css" type="text/css" />
+ <link rel="stylesheet" type="text/css" href="designs/discreet/basic.css" />
+ <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="designs/pure/mobile.css" type="text/css" />
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/jquery-ui.js" type="text/javascript"></script>
<script src="lib/scrollable.js" type="text/javascript"></script>
Deleted: CometVisu/trunk/visu/style_discreet.css
===================================================================
--- CometVisu/trunk/visu/style_discreet.css 2010-11-12 20:59:33 UTC (rev 114)
+++ CometVisu/trunk/visu/style_discreet.css 2010-11-12 21:11:21 UTC (rev 115)
@@ -1,290 +0,0 @@
-@font-face { font-family: Liberation; src:url(fonts/liberationsans-regular.ttf); }
-@font-face { font-family: Liberation; font-weight: bold; src:url(fonts/liberationsans-bold.ttf); }
-
-body
-{
- color: white;
- font-family: Liberation;
- font-size: 5.5mm;
- overflow: hidden;
- margin:0;
- background: #1d1d1d url(images/body_bg.png) repeat-x;
-}
-
-h1
-{
- font-size: 2em;
- margin-left: 15px;
-}
-
-body hr
-{
- clear:both;
- color: #81664b;
- background-color: #81664b;
- height: 1px;
- border:none;
- padding:0px;
- margin:0.1em;
-}
-
-#pages hr {
- border: 0; height: 30px; margin: 0 .1em;
- background: transparent url(images/hr_bg.png) 50% repeat-x;
- clear: both;
-}
-
-
-body br
-{
- clear:both;
-}
-
-div#top {
- margin-top: 8px;
-}
-
-.nav_path
-{
- color: #81664b;
- margin-left: 15px;
-}
-.nav_path a
-{
- color: white;
- text-decoration:none;
-}
-
-.footer,
-.footer *
-{
- color: #000000;
- font-size: 0.9em;
- vertical-align: middle;
-}
-
-.widget
-{
- float:left;
- width:48%;
- margin: .2em;
- padding: 0.3em;
- /* border:yellow 1px solid; */
- border-color: #020202;
- border-style: solid;
- border-width: 2px 0px 0px 2px;
- -moz-border-radius: 8px;
- -webkit-border-radius: 8px;
- border-radius: 8px;
- min-height: 2em;
- background-color: #101010;
-}
-
-.text > div,
-.link > a {
- float:left;
- text-align:left;
- padding-left: 1em;
-}
-
-.widget .label,
-.widget.info .actor,
-.text > div,
-.link > a {
- line-height: 2em;
-}
-
-.widget .label
-{
- float:left;
- width:49%;
-/* color:red; */
-/* padding-right:0.25em; */
- text-align:left;
- padding-left: 1em;
-/* border:blue 1px solid; */
-}
-.widget .actor
-{
- float:left;
- margin-left:1em;
- text-align:left;
-}
-.widget .actor div
-{
- float:left;
- white-space: pre-wrap;
-}
-
-
-.green.switchPressed div, .green.switchUnpressed div{
- background: transparent url(images/dot_green.png) no-repeat center center;
- color: white !important;
-}
-.red.switchPressed div, .red.switchUnpressed div{
- background: transparent url(images/dot_red.png) no-repeat center center;
- color: white !important;
-}
-
-
-.red
-{
- color:#f44;
- font-weight:bold;
-}
-
-.green
-{
- color:#4f4;
-}
-
-.blue
-{
- color:#44f;
-}
-
-.purple
-{
- color:#f4f;
-}
-
-.link a
-{
- color: #81664b;
- width: 49%;
-}
-
-.page
-{
- float:left;
- width: 900px;
- overflow: auto;
- position: relative;
-}
-
-.switchPressed, .switchUnpressed {
- border-style: solid;
- -moz-border-radius: 12px;
- -webkit-border-radius: 12px;
- border-radius: 12px;
- padding: 1px;
- background: url(images/button_bg.png) #171717 repeat-x;
-}
-
-.switchUnpressed
-{
- border-width: 1px 2px 2px 1px;
- border-color: #282828 #010101 #010101 #282828;
- margin-top: 0px;
- background-color: #3A3A3A;
- background-position: center +2px;
-}
-.switchUnpressed div, .switchPressed div
-{
- padding: 5px;
- width: 5em;
- float: left;
- background: transparent;
- text-align: center;
- cursor: pointer;
-}
-
-.switchPressed
-{
- border-width: 2px 1px 1px 2px;
- border-color: #010101 #282828 #282828 #010101;
- margin-top: 1px;
- background-position: center -2px;
-}
-
-.switchUnpressed div {
- margin-left: -1px;
-}
-
-.switchPressed div {
- margin-top: -1px;
-}
-
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }
-.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; }
-.ui-widget-content a { color: #333333; }
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
-.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-
-.dim .actor
-{
- width: 3em;
-}
-.widget .ui-slider
-{
- width: 30%;
- float: left;
- margin-left: 10px;
- margin-left: 1em;
- margin-top: 0.5em;
- border-color: #010101 #282828 #282828 #010101;
- background: url(images/gradient.png) #a7a7a7 repeat-y;
-}
-
-.widget .ui-slider-handle
-{
- border-style: solid;
- -moz-border-radius: 12px;
- -webkit-border-radius: 12px;
- border-radius: 12px;
- padding: 1px;
- background: url(images/button_bg.png) #171717 repeat-x;
- border-width: 1px 2px 2px 1px;
- border-color: #282828 #010101 #010101 #282828;
-}
-/* Clearfix */
-.clearfix:after {
- content: ".";
- display: block;
- clear: both;
- visibility: hidden;
- line-height: 0;
- height: 0;
-}
-
-.clearfix {
- display: inline-block;
-}
-
-html[xmlns] .clearfix {
- display: block;
-}
-
-*:first-child+html .clearfix {
- min-height: 0;
-}
-
-* html .clearfix {
- height: 1%;
-}
-
-* html>body .clearfix {
- display: inline-block;
- width: 100%;
-}
-
-* html .clearfix {
- /* Hides from IE-mac \*/
- height: 1%;
- /* End hide from IE-mac */
-}
Deleted: CometVisu/trunk/visu/style_orange.css
===================================================================
--- CometVisu/trunk/visu/style_orange.css 2010-11-12 20:59:33 UTC (rev 114)
+++ CometVisu/trunk/visu/style_orange.css 2010-11-12 21:11:21 UTC (rev 115)
@@ -1,253 +0,0 @@
-body
-{
- background-color: black;
- color: white;
- font-family: Verdana, Helvetica, sans-serif;
- font-family: 'URW Gothic L','Century Gothic','Apple Gothic',Arial,sans-serif;
- font-size: 6mm;
- overflow: hidden;
- margin:0;
-}
-
-h1
-{
- font-size: 2em;
-}
-
-body hr
-{
- clear:both;
- color: #ff8000;
- background-color: #ff8000;
- height: 1px;
- border:none;
- padding:0px;
- margin:0.1em;
-}
-
-body br
-{
- clear:both;
-}
-
-.nav_path
-{
- color: #ff8000;
-}
-.nav_path a
-{
- color: white;
- text-decoration:none;
-}
-
-.footer,
-.footer *
-{
- color: #ff8000;
- font-size: 0.9em;
- vertical-align: middle;
-}
-
-.widget
-{
- float:left;
- width:48%;
- margin:0.10em;
- padding:0.1em;
- /* border:yellow 1px solid; */
- border: 1px solid #444;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- min-height: 2em;
-}
-
-.widget .label
-{
- float:left;
- width:49%;
-/* color:red; */
-/* padding-right:0.25em; */
- text-align:right;
-/* border:blue 1px solid; */
-}
-.widget .actor
-{
- float:left;
- margin-left:1em;
- /*width:49%;*/
- text-align:left;
-/* color:green; */
-/* border:blue 1px solid; */
-}
-.widget .actor div
-{
- float:left;
- white-space: pre-wrap;
-}
-
-.red
-{
- color:#f44;
- font-weight:bold;
-}
-
-.green
-{
- color:#4f4;
-}
-
-.blue
-{
- color:#44f;
-}
-
-.purple
-{
- color:#f4f;
-}
-
-.link a
-{
- color: #ff8000;
- text-align: right;
- width: 49%;
-}
-
-.page
-{
- float:left;
- width: 900px;
- overflow: auto;
- position: relative;
-}
-
-.switchUnpressed
-{
- border-style: solid;
- border-width: 1px;
- border-color: #666 #444 #444 #666;
- -moz-border-radius: 7px;
- -webkit-border-radius: 7px;
- border-radius: 7px;
- padding: 1px;
-}
-.switchUnpressed div
-{
- border-style: solid;
- border-width: 1px;
- border-color: #fff #666 #666 #fff;
- padding: 5px;
- width: 5em;
- float: left;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-.switchPressed
-{
- border-top: 1px solid #666;
- border-left: 1px solid #666;
- border-right: 1px solid #ccc;
- border-bottom: 1px solid #ccc;
-}
-.switchPressed
-{
- border-style: solid;
- border-width: 1px;
- border-color: #666 #fff #fff #666;
- -moz-border-radius: 7px;
- -webkit-border-radius: 7px;
- border-radius: 7px;
- padding: 1px;
-}
-.switchPressed div
-{
- border-style: solid;
- border-width: 1px;
- border-color: #444 #666 #666 #444;
- padding: 5px;
- width: 5em;
- float: left;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }
-.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; }
-.ui-widget-content a { color: #333333; }
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
-.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-
-.dim .actor
-{
- width: 3em;
-}
-.widget .ui-slider
-{
- width: 30%;
- float: left;
- margin-left: 10px;
- margin-left: 1em;
- margin-top: 0.2em;
- border-color: #666 #fff #fff #666;
-}
-
-.widget .ui-slider-handle
-{
- border-color: #fff #666 #666 #fff;
-}
-/* Clearfix */
-.clearfix:after {
- content: ".";
- display: block;
- clear: both;
- visibility: hidden;
- line-height: 0;
- height: 0;
-}
-
-.clearfix {
- display: inline-block;
-}
-
-html[xmlns] .clearfix {
- display: block;
-}
-
-*:first-child+html .clearfix {
- min-height: 0;
-}
-
-* html .clearfix {
- height: 1%;
-}
-
-* html>body .clearfix {
- display: inline-block;
- width: 100%;
-}
-
-* html .clearfix {
- /* Hides from IE-mac \*/
- height: 1%;
- /* End hide from IE-mac */
-}
Deleted: CometVisu/trunk/visu/style_orange_mobile.css
===================================================================
--- CometVisu/trunk/visu/style_orange_mobile.css 2010-11-12 20:59:33 UTC (rev 114)
+++ CometVisu/trunk/visu/style_orange_mobile.css 2010-11-12 21:11:21 UTC (rev 115)
@@ -1,12 +0,0 @@
-.widget
-{
- width:98%;
-}
-
-#bottom {
- display: none;
-}
-
-.page {
- overflow: visible;
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-12 23:54:01
|
Revision: 116
http://openautomation.svn.sourceforge.net/openautomation/?rev=116&view=rev
Author: mayerch
Date: 2010-11-12 23:53:55 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
Added dynamic change of stylesheet dependend on the pages-design-attribute
Modified Paths:
--------------
CometVisu/trunk/visu/index.html
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2010-11-12 21:11:21 UTC (rev 115)
+++ CometVisu/trunk/visu/index.html 2010-11-12 23:53:55 UTC (rev 116)
@@ -5,8 +5,6 @@
<head>
<title>CometVisu-Client</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <link rel="stylesheet" type="text/css" href="designs/discreet/basic.css" />
- <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="designs/pure/mobile.css" type="text/css" />
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/jquery-ui.js" type="text/javascript"></script>
<script src="lib/scrollable.js" type="text/javascript"></script>
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-12 21:11:21 UTC (rev 115)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-12 23:53:55 UTC (rev 116)
@@ -161,6 +161,10 @@
{
// erst mal den Cache für AJAX-Requests wieder aktivieren
$.ajaxSetup({cache: true});
+
+ var design = $( 'pages', xml ).attr('design');
+ $( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + design + '/basic.css" />' );
+ $( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + design + '/mobile.css" media="only screen and (max-device-width: 480px)" />' );
// adapt width for pages to show
handleResize();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-14 17:08:14
|
Revision: 124
http://openautomation.svn.sourceforge.net/openautomation/?rev=124&view=rev
Author: mayerch
Date: 2010-11-14 16:41:45 +0000 (Sun, 14 Nov 2010)
Log Message:
-----------
Fixed design change to work under edit mode as well
Modified Paths:
--------------
CometVisu/trunk/visu/edit_config.html
CometVisu/trunk/visu/lib/visudesign_custom.js
Modified: CometVisu/trunk/visu/edit_config.html
===================================================================
--- CometVisu/trunk/visu/edit_config.html 2010-11-14 16:16:00 UTC (rev 123)
+++ CometVisu/trunk/visu/edit_config.html 2010-11-14 16:41:45 UTC (rev 124)
@@ -5,7 +5,7 @@
<head>
<title>Visu - Editor-Modus</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <link rel="stylesheet" type="text/css" href="style_discreet.css" />
+<!-- <link rel="stylesheet" type="text/css" href="style_discreet.css" /> -->
<link rel="stylesheet" type="text/css" href="edit/style_edit.css" />
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/jquery-ui.js" type="text/javascript"></script>
Modified: CometVisu/trunk/visu/lib/visudesign_custom.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_custom.js 2010-11-14 16:16:00 UTC (rev 123)
+++ CometVisu/trunk/visu/lib/visudesign_custom.js 2010-11-14 16:41:45 UTC (rev 124)
@@ -46,7 +46,7 @@
ret_val.addClass( 'switch' );
var label = '<div class="label">' + page.textContent + '</div>';
var actor = '<div class="actor switchUnpressed">';
- var value = $('link').attr('href').split('/')[1];
+ var value = $('link[href*="designs"]').attr('href').split('/')[1];
actor += '<div class="value">' + value + '</div>';
actor += '</div>';
ret_val.append( label ).append( $(actor).data( {
@@ -68,7 +68,7 @@
var oldDesign = $('.value',this).text();
var newDesign = designs[ (designs.indexOf(oldDesign) + 1) % designs.length ];
$('.value',this).text(newDesign);
- $('link').each(function(){
+ $('link[href*="designs"]').each(function(){
this.href = this.href.replace( oldDesign, newDesign );
});
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-14 17:08:20
|
Revision: 122
http://openautomation.svn.sourceforge.net/openautomation/?rev=122&view=rev
Author: mayerch
Date: 2010-11-14 16:10:20 +0000 (Sun, 14 Nov 2010)
Log Message:
-----------
Add new custom widget to toggle beween designs and insert it into the demo config
Modified Paths:
--------------
CometVisu/trunk/visu/lib/visudesign_custom.js
CometVisu/trunk/visu/visu_config.xml
Modified: CometVisu/trunk/visu/lib/visudesign_custom.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_custom.js 2010-11-14 12:55:07 UTC (rev 121)
+++ CometVisu/trunk/visu/lib/visudesign_custom.js 2010-11-14 16:10:20 UTC (rev 122)
@@ -34,3 +34,41 @@
});
****************************************
*/
+
+/**
+ * This is a custom function that extends the available widgets.
+ * It's purpose is to change the design of the visu during runtime
+ * to demonstrate all available
+ */
+VisuDesign_Custom.prototype.addCreator("designtoggle", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'switch' );
+ var label = '<div class="label">' + page.textContent + '</div>';
+ var actor = '<div class="actor switchUnpressed">';
+ var value = $('link').attr('href').split('/')[1];
+ actor += '<div class="value">' + value + '</div>';
+ actor += '</div>';
+ ret_val.append( label ).append( $(actor).data( {
+ 'mapping' : $(page).attr('mapping'),
+ 'style' : $(page).attr('style'),
+ 'value' : value,
+ 'type' : 'toggle'
+ } ).bind('click',designToggleAction) );
+ return ret_val;
+ },
+ attributes: {
+ },
+ content: "string"
+});
+
+function designToggleAction()
+{
+ var designs = [ 'pure', 'discreet' ];
+ var oldDesign = $('.value',this).text();
+ var newDesign = designs[ (designs.indexOf(oldDesign) + 1) % designs.length ];
+ $('.value',this).text(newDesign);
+ $('link').each(function(){
+ this.href = this.href.replace( oldDesign, newDesign );
+ });
+}
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2010-11-14 12:55:07 UTC (rev 121)
+++ CometVisu/trunk/visu/visu_config.xml 2010-11-14 16:10:20 UTC (rev 122)
@@ -44,6 +44,7 @@
<slide address="12/4/250" datatype="9" min="-18" max="26">Slide</slide>
<info address="12/4/250" datatype="9" style="BluePurpleRed">Slide Info</info>
<info address="12/4/250" datatype="9" style="BluePurpleRed" mapping="Sign">Slide Info</info>
+ <designtoggle>Change design</designtoggle>
<line />
<image src="icon/comet_128_ff8000.png" >Ein Bild</image>
<image src="icon/comet_128_ff8000.png" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-14 17:08:31
|
Revision: 123
http://openautomation.svn.sourceforge.net/openautomation/?rev=123&view=rev
Author: mayerch
Date: 2010-11-14 16:16:00 +0000 (Sun, 14 Nov 2010)
Log Message:
-----------
Added cross links to the footer, i.e. the normal mode links to the edit and vice versa
Modified Paths:
--------------
CometVisu/trunk/visu/edit_config.html
CometVisu/trunk/visu/index.html
Modified: CometVisu/trunk/visu/edit_config.html
===================================================================
--- CometVisu/trunk/visu/edit_config.html 2010-11-14 16:10:20 UTC (rev 122)
+++ CometVisu/trunk/visu/edit_config.html 2010-11-14 16:16:00 UTC (rev 123)
@@ -32,6 +32,7 @@
<div class="footer">
<img src="icon/comet_64_ff8000.png" alt="CometVisu" />
by <a href="http://www.cometvisu.org/">ComeVisu.org</a> - <a href="edit_config.html">Reload</a>
+ - <a href=".">normal Mode</a>
</div>
</div>
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2010-11-14 16:10:20 UTC (rev 122)
+++ CometVisu/trunk/visu/index.html 2010-11-14 16:16:00 UTC (rev 123)
@@ -27,6 +27,7 @@
<div class="footer">
<img src="icon/comet_64_000000.png" alt="CometVisu" />
by <a href="http://www.cometvisu.org/">CometVisu.org</a> - <a href=".">Reload</a>
+ - <a href="edit_config.html">Edit</a>
</div>
</div>
</body>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-26 20:13:19
|
Revision: 165
http://openautomation.svn.sourceforge.net/openautomation/?rev=165&view=rev
Author: mayerch
Date: 2010-11-26 20:13:09 +0000 (Fri, 26 Nov 2010)
Log Message:
-----------
New Feature: Plugins
New Plugin: colorChooser (based on farbtastic)
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config.xml
Added Paths:
-----------
CometVisu/trunk/visu/plugins/
CometVisu/trunk/visu/plugins/colorChooser/
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/CHANGELOG.html
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/LICENSE.txt
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/README.html
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/README.md
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/demo1.html
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/demo2.html
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/farbtastic.css
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/farbtastic.js
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/farbtastic.min.js
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/marker.png
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/mask.png
CometVisu/trunk/visu/plugins/colorChooser/farbtastic/wheel.png
CometVisu/trunk/visu/plugins/colorChooser/structure_plugin.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-26 16:35:47 UTC (rev 164)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-26 20:13:09 UTC (rev 165)
@@ -172,7 +172,13 @@
// adapt width for pages to show
handleResize();
- // start with the mappings
+ // start with the plugins
+ $( 'pages > plugins plugin', xml ).each( function(i){
+ var name = $(this).attr('name');
+ $( 'head' ).append( '<script src="plugins/' + name + '/structure_plugin.js" type="text/javascript"></script>' );
+ } );
+
+ // then the mappings
$( 'pages > mappings mapping', xml ).each( function(i){
var name = $(this).attr('name');
mappings[ name ] = {};
Added: CometVisu/trunk/visu/plugins/colorChooser/farbtastic/CHANGELOG.html
===================================================================
--- CometVisu/trunk/visu/plugins/colorChooser/farbtastic/CHANGELOG.html (rev 0)
+++ CometVisu/trunk/visu/plugins/colorChooser/farbtastic/CHANGELOG.html 2010-11-26 20:13:09 UTC (rev 165)
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head><title>Farbtastic: Changelog</title></head>
+<body>
+ <h1 class="title">Farbtastic: Changelog</h1>
+
+ <h2>1.3u (unofficial) - 2010/2/17</h2>
+ <ul>
+ <li>Updated style to use anonymous function wrapper per http://docs.jquery.com/Plugins/Authoring#Custom_Alias.</li>
+ <li>Now it uses the .offset() method available as of jQuery 1.2.x.</li>
+ <li>Works with JavaScript aggregators and compressors.</li>
+ </ul>
+ <h2>1.2 - 2007/01/08</h2>
+ <ul>
+ <li>Fixed bug with linking multiple fields with the same value.</li>
+ </ul>
+ <h2>1.1 - 2006/10/27</h2>
+ <ul>
+ <li>Work around for the transparent PNGs in Internet Explorer.</li>
+ <li>Better mouse handling code to accomodate CSS-based layouts better.</li>
+ </ul>
+ <h2>1.0 - 2006/07/14</h2>
+ <ul>
+ <li>Initial release.</li>
+ </ul>
+
+ <p>More info on <a href="http://www.acko.net/dev/farbtastic">Acko.net</a>.</p>
+ <p>Created by <a href="http://www.acko.net/">Steven Wittens</a>.</p>
+
+</body>
+</html>
Added: CometVisu/trunk/visu/plugins/colorChooser/farbtastic/LICENSE.txt
===================================================================
--- CometVisu/trunk/visu/plugins/colorChooser/farbtastic/LICENSE.txt (rev 0)
+++ CometVisu/trunk/visu/plugins/colorChooser/farbtastic/LICENSE.txt 2010-11-26 20:13:09 UTC (rev 165)
@@ -0,0 +1,341 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Added: CometVisu/trunk/visu/plugins/colorChooser/farbtastic/README.html
===================================================================
--- CometVisu/trunk/visu/plugins/colorChooser/farbtastic/README.html (rev 0)
+++ CometVisu/trunk/visu/plugins/colorChooser/farbtastic/README.html 2010-11-26 20:13:09 UTC (rev 165)
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head><title>Farbtastic: jQuery color picker plug-in</title></head>
+<body>
+ <h1 class="title">Farbtastic: jQuery color picker plug-in</h1>
+ <div class="content"><p>Farbtastic is a <a href="http://www.jquery.com/">jQuery</a> plug-in that can add one or more color picker widgets into a page. Each widget is then linked to an existing element (e.g. a text field) and will update the element's value when a color is selected.</p>
+
+<p>Farbtastic uses layered transparent PNGs to render a saturation/luminance gradient inside of a hue circle. No Flash or pixel-sized divs are used.</p>
+
+<p>Farbtastic was written by <a href="http://www.acko.net/dev/farbtastic">Steven Wittens</a> and is licensed under the GPL.</p>
+
+<h2>Basic Usage</h2>
+<ol>
+<li>Include farbtastic.js and farbtastic.css in your HTML:<br />
+<div class="codeblock"><code><script type="text/javascript" src="farbtastic.js"></script><br /><link rel="stylesheet" href="farbtastic.css" type="text/css" /></code></div>
+</li>
+<li>Add a placeholder div and a text field to your HTML, and give each an ID:<br />
+<div class="codeblock"><code><form><input type="text" id="color" name="color" value="#123456" /></form><br /><div id="colorpicker"></div></code></div>
+</li>
+<li>Add a ready() handler to the document which initializes the color picker and link it to the text field with the following syntax:<br />
+<div class="codeblock"><code><script type="text/javascript"><br /> $(document).ready(function() {<br /> $('#colorpicker').farbtastic('#color');<br /> });<br /></script></code></div>
+</li>
+</ol>
+<p>See demo1.html and demo2.html for an example (jquery.js is not included!).</p>
+<h2>Styling</h2>
+<p>The color picker is a block-level element and is 195x195 pixels large. You can control the position by styling your placeholder (e.g. floating it).</p>
+<p>Note that the black/white gradients inside wheel.png and mask.png were generated programmatically and cannot be recreated easily in an image editing program.</p>
+<h2>Advanced Usage</h2>
+<h3>jQuery Method</h3>
+<dl>
+<dt>$(...).farbtastic()<br />
+$(...).farbtastic(callback)</dt>
+<dd>This creates color pickers in the selected objects. <code>callback</code> is optional and can be a:</p>
+<ul>
+<li><em>DOM Node</em>, <em>jQuery object</em> or <em>jQuery selector</em>: the color picker will be linked to the selected element(s) by syncing the value (for form elements) and color (all elements).</li>
+<li><em>Function</em>: this function will be called whenever the user chooses a different color.</dd>
+</dl>
+<h3>Object</h3>
+<dl>
+<dt>$.farbtastic(placeholder)<br />
+$.farbtastic(placeholder, callback)<br />
+</dt>
+<dd>Invoking <code>$.farbtastic(placeholder)</code> is the same as using <code>$(placeholder).farbtastic()</code> except that the Farbtastic object is returned instead of the jQuery object. This allows you to use the Farbtastic methods and properties below.</p>
+<p>Note that there is only one Farbtastic object per placeholder. If you call <code>$.farbtastic(placeholder)</code> twice <em>with the same placeholder</em>, you will get the same object back each time.</p>
+<p>The optional <code>callback</code> argument behaves exactly as for the jQuery method.<br />
+</dd>
+</dl>
+</dd>
+</dl>
+<h3>Methods</h3>
+<dl>
+<dt>.linkTo(callback)</dt>
+<dd>Allows you to set a new callback. Any existing callbacks are removed. See above for the meaning of <code>callback</code>.</dd>
+<dt>.setColor(string)</dt>
+<dd>Sets the picker color to the given color in hex representation.</dd>
+<dt>.setColor([h, s, l])</dt>
+<dd>Sets the picker color to the given color in normalized HSL (0..1 scale).</dd>
+</dl>
+<h3>Properties</h3>
+<dl>
+<dt>.linked</dt>
+<dd>The elements (jQuery object) or callback function this picker is linked to.</dd>
+<dt>.color</dt>
+<dd>Current color in hex representation.</dd>
+<dt>.hsl</dt>
+<dd>Current color in normalized HSL.</dd>
+</dl>
+</div>
+</body>
+</html>
\ No newline at end of file
Added: CometVisu/trunk/visu/plugins/colorChooser/farbtastic/README.md
===================================================================
--- CometVisu/trunk/visu/plugins/colorChooser/farbtastic/README.md (rev 0)
+++ CometVisu/trunk/visu/plugins/colorChooser/farbtastic/README.md 2010-11-26 20:13:09 UTC (rev 165)
@@ -0,0 +1,97 @@
+Farbtastic: jQuery color picker plug-in
+=======================================
+Farbtastic is a [jQuery](http://jquery.com/) plug-in that can add one or more color picker widgets into a page. Each widget is then linked to an existing element (e.g. a text field) and will update the element's value when a color is selected.
+
+Farbtastic uses layered transparent PNGs to render a saturation/luminance gradient inside of a hue circle. No Flash or pixel-sized divs are used.
+
+Farbtastic was originally written by [Steven Wittens](http://acko.net/) and is licensed under the GPL.
+
+Basic Usage
+-----------
+1) Include farbtastic.js and farbtastic.css in your HTML:
+
+ <script type="text/javascript" src="farbtastic.js"></script>
+ <link rel="stylesheet" href="farbtastic.css" type="text/css" />
+
+2) Add a placeholder div and a text field to your HTML, and give each an ID:<br />
+
+ <form><input type="text" id="color" name="color" value="#123456" /></form>
+ <div id="colorpicker"></div>
+
+3) Add a ready() handler to the document which initializes the color picker and link it to the text field with the following syntax:<br />
+
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $('#colorpicker').farbtastic('#color');
+ });
+ </script>
+
+See demo1.html and demo2.html for an example.
+
+Styling
+-------
+
+The color picker is a block-level element and is 195x195 pixels large. You can control the position by styling your placeholder (e.g. floating it).
+Note that the black/white gradients inside wheel.png and mask.png were generated programmatically and cannot be recreated easily in an image editing program.
+
+Advanced Usage
+--------------
+
+###jQuery Method
+
+ $(...).farbtastic()
+ $(...).farbtastic(callback)
+
+This creates color pickers in the selected objects. `callback` is optional and can be a:
+
+* _DOM Node_, _jQuery object_ or _jQuery selector_: the color picker will be linked to the selected element(s) by syncing the value (for form elements) and color (all elements).
+* _Function_: this function will be called whenever the user chooses a different color.
+
+### Object
+
+ $.farbtastic(placeholder)
+ $.farbtastic(placeholder, callback)
+
+Invoking `$.farbtastic(placeholder)` is the same as using `$(placeholder).farbtastic()` except that the Farbtastic object is returned instead of the jQuery object. This allows you to use the Farbtastic methods and properties below.
+
+Note that there is only one Farbtastic object per placeholder. If you call `$.farbtastic(placeholder)` twice _with the same placeholder_, you will get the same object back each time.
+
+The optional `callback` argument behaves exactly as for the jQuery method.
+
+### Methods
+
+`.linkTo(callback)` - Allows you to set a new ...
[truncated message content] |
|
From: <ma...@us...> - 2010-11-26 21:21:54
|
Revision: 167
http://openautomation.svn.sourceforge.net/openautomation/?rev=167&view=rev
Author: mayerch
Date: 2010-11-26 21:21:48 +0000 (Fri, 26 Nov 2010)
Log Message:
-----------
Scaling for RGB from byte to percent
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/colorChooser/structure_plugin.js
CometVisu/trunk/visu/visu_config.xml
Modified: CometVisu/trunk/visu/plugins/colorChooser/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/colorChooser/structure_plugin.js 2010-11-26 20:14:18 UTC (rev 166)
+++ CometVisu/trunk/visu/plugins/colorChooser/structure_plugin.js 2010-11-26 21:21:48 UTC (rev 167)
@@ -35,9 +35,9 @@
'type' : 'toggle'
})
.farbtastic( function(color){
- var r = parseInt(color.substring(1, 3), 16);
- var g = parseInt(color.substring(3, 5), 16);
- var b = parseInt(color.substring(5, 7), 16);
+ var r = parseInt(color.substring(1, 3), 16) * 100 / 255;
+ var g = parseInt(color.substring(3, 5), 16) * 100 / 255;
+ var b = parseInt(color.substring(5, 7), 16) * 100 / 255;
var a_r = $(page).attr('address_r');
var a_g = $(page).attr('address_g');
var a_b = $(page).attr('address_b');
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2010-11-26 20:14:18 UTC (rev 166)
+++ CometVisu/trunk/visu/visu_config.xml 2010-11-26 21:21:48 UTC (rev 167)
@@ -49,6 +49,9 @@
<info address="12/4/250" datatype="9" styling="BluePurpleRed" mapping="Sign">Slide Info</info>
<designtoggle>Change design</designtoggle>
<colorChooser address_r="1/2/13" address_g="1/2/14" address_b="1/2/15" datatype="5.001">A colorChooser</colorChooser>
+ <info address="1/2/13" datatype="5.001" >R</info>
+ <info address="1/2/14" datatype="5.001" >G</info>
+ <info address="1/2/15" datatype="5.001" >B</info>
<line />
<image src="icon/comet_128_ff8000.png" >Ein Bild</image>
<image src="icon/comet_128_ff8000.png" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-28 14:57:18
|
Revision: 168
http://openautomation.svn.sourceforge.net/openautomation/?rev=168&view=rev
Author: mayerch
Date: 2010-11-28 14:57:12 +0000 (Sun, 28 Nov 2010)
Log Message:
-----------
Moved the Meta-Information down inside a meta tag to clean the configuration XML a bit more up.
NOTE #1: this means that all existing configuration files have to be changed!
NORE #2: the editor might have to be changed to create the config XML in the new layout (is it's currently broken due to the jQuery 1.4.4 you might not notice that...)
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/visu_config.xml
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-26 21:21:48 UTC (rev 167)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-28 14:57:12 UTC (rev 168)
@@ -173,13 +173,13 @@
handleResize();
// start with the plugins
- $( 'pages > plugins plugin', xml ).each( function(i){
+ $( 'meta > plugins plugin', xml ).each( function(i){
var name = $(this).attr('name');
$( 'head' ).append( '<script src="plugins/' + name + '/structure_plugin.js" type="text/javascript"></script>' );
} );
// then the mappings
- $( 'pages > mappings mapping', xml ).each( function(i){
+ $( 'meta > mappings mapping', xml ).each( function(i){
var name = $(this).attr('name');
mappings[ name ] = {};
$(this).find('entry').each( function(){
@@ -195,7 +195,7 @@
});
// then the stylings
- $( 'pages > stylings styling', xml ).each( function(i){
+ $( 'meta > stylings styling', xml ).each( function(i){
var name = $(this).attr('name');
stylings[ name ] = {};
$(this).find('entry').each( function(){
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2010-11-26 21:21:48 UTC (rev 167)
+++ CometVisu/trunk/visu/visu_config.xml 2010-11-28 14:57:12 UTC (rev 168)
@@ -1,38 +1,40 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<pages design="pure">
- <plugins>
- <plugin name="colorChooser" />
- </plugins>
- <mappings>
- <mapping name="OpenClose">
- <entry value="0">zu</entry>
- <entry value="1">offen</entry>
- </mapping>
- <mapping name="OnOff">
- <entry value="0">Aus</entry>
- <entry value="1">An</entry>
- </mapping>
- <mapping name="Sign">
- <entry range_min="-1e99" range_max="0">Negativ</entry>
- <entry value="0">Null</entry>
- <entry range_min="0" range_max="1e99">Positiv</entry>
- </mapping>
- </mappings>
- <stylings>
- <styling name="RedGreen">
- <entry value="0">red</entry>
- <entry value="1">green</entry>
- </styling>
- <styling name="GreenRed">
- <entry value="0">green</entry>
- <entry value="1">red</entry>
- </styling>
- <styling name="BluePurpleRed">
- <entry range_min="-100" range_max="0" >blue</entry>
- <entry value="0" >purple</entry>
- <entry range_min="0" range_max="100">red</entry>
- </styling>
- </stylings>
+ <meta>
+ <plugins>
+ <plugin name="colorChooser" />
+ </plugins>
+ <mappings>
+ <mapping name="OpenClose">
+ <entry value="0">zu</entry>
+ <entry value="1">offen</entry>
+ </mapping>
+ <mapping name="OnOff">
+ <entry value="0">Aus</entry>
+ <entry value="1">An</entry>
+ </mapping>
+ <mapping name="Sign">
+ <entry range_min="-1e99" range_max="0">Negativ</entry>
+ <entry value="0">Null</entry>
+ <entry range_min="0" range_max="1e99">Positiv</entry>
+ </mapping>
+ </mappings>
+ <stylings>
+ <styling name="RedGreen">
+ <entry value="0">red</entry>
+ <entry value="1">green</entry>
+ </styling>
+ <styling name="GreenRed">
+ <entry value="0">green</entry>
+ <entry value="1">red</entry>
+ </styling>
+ <styling name="BluePurpleRed">
+ <entry range_min="-100" range_max="0" >blue</entry>
+ <entry value="0" >purple</entry>
+ <entry range_min="0" range_max="100">red</entry>
+ </styling>
+ </stylings>
+ </meta>
<page name="Übersicht" flavour="orange">
<text align="center">Willkommen bei der CometVisu!</text>
<toggle address="1/0/2" datatype="1.001" response_address="1/0/2" mapping="OnOff" styling="RedGreen" >Terrase Licht</toggle>
@@ -48,10 +50,10 @@
<info address="12/4/250" datatype="9" styling="BluePurpleRed">Slide Info</info>
<info address="12/4/250" datatype="9" styling="BluePurpleRed" mapping="Sign">Slide Info</info>
<designtoggle>Change design</designtoggle>
- <colorChooser address_r="1/2/13" address_g="1/2/14" address_b="1/2/15" datatype="5.001">A colorChooser</colorChooser>
- <info address="1/2/13" datatype="5.001" >R</info>
- <info address="1/2/14" datatype="5.001" >G</info>
- <info address="1/2/15" datatype="5.001" >B</info>
+ <colorChooser address_r="1/2/59" address_g="1/2/60" address_b="1/2/61" datatype="5.001">A colorChooser</colorChooser>
+ <info address="1/2/59" datatype="5.001" >R</info>
+ <info address="1/2/60" datatype="5.001" >G</info>
+ <info address="1/2/61" datatype="5.001" >B</info>
<line />
<image src="icon/comet_128_ff8000.png" >Ein Bild</image>
<image src="icon/comet_128_ff8000.png" />
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2010-11-26 21:21:48 UTC (rev 167)
+++ CometVisu/trunk/visu/visu_config.xsd 2010-11-28 14:57:12 UTC (rev 168)
@@ -47,14 +47,37 @@
<xsd:element name="pages">
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element ref="mappings" />
- <xsd:element ref="stylings" />
+ <xsd:element ref="meta" />
<xsd:element ref="page" minOccurs="1" />
</xsd:choice>
<xsd:attribute name="design" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
+<xsd:element name="meta">
+ <xsd:complexType>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element ref="plugins" />
+ <xsd:element ref="mappings" />
+ <xsd:element ref="stylings" />
+ </xsd:choice>
+ </xsd:complexType>
+</xsd:element>
+
+<xsd:element name="plugins">
+ <xsd:complexType>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element ref="plugin" />
+ </xsd:choice>
+ </xsd:complexType>
+</xsd:element>
+^
+<xsd:element name="plugin">
+ <xsd:complexType>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+</xsd:element>
+
<xsd:element name="mappings">
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2010-11-28 15:18:33
|
Revision: 169
http://openautomation.svn.sourceforge.net/openautomation/?rev=169&view=rev
Author: netzkind
Date: 2010-11-28 15:18:27 +0000 (Sun, 28 Nov 2010)
Log Message:
-----------
change layout for "loading"-state; fixed discreet-Layout for mobile devices again
Modified Paths:
--------------
CometVisu/trunk/visu/designs/discreet/basic.css
CometVisu/trunk/visu/designs/pure/basic.css
CometVisu/trunk/visu/index.html
Added Paths:
-----------
CometVisu/trunk/visu/designs/discreet/mobile.css
Modified: CometVisu/trunk/visu/designs/discreet/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet/basic.css 2010-11-28 14:57:12 UTC (rev 168)
+++ CometVisu/trunk/visu/designs/discreet/basic.css 2010-11-28 15:18:27 UTC (rev 169)
@@ -288,3 +288,11 @@
height: 1%;
/* End hide from IE-mac */
}
+
+div#top, div#main, div#bottom {
+ display: block !important;
+}
+
+div#loading {
+ display: none !important;
+}
\ No newline at end of file
Added: CometVisu/trunk/visu/designs/discreet/mobile.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet/mobile.css (rev 0)
+++ CometVisu/trunk/visu/designs/discreet/mobile.css 2010-11-28 15:18:27 UTC (rev 169)
@@ -0,0 +1,12 @@
+.widget
+{
+ width:98%;
+}
+
+#bottom {
+ display: none;
+}
+
+.page {
+ overflow: visible;
+}
Modified: CometVisu/trunk/visu/designs/pure/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/pure/basic.css 2010-11-28 14:57:12 UTC (rev 168)
+++ CometVisu/trunk/visu/designs/pure/basic.css 2010-11-28 15:18:27 UTC (rev 169)
@@ -251,3 +251,11 @@
height: 1%;
/* End hide from IE-mac */
}
+
+div#top, div#main, div#bottom {
+ display: block !important;
+}
+
+div#loading {
+ display: none !important;
+}
\ No newline at end of file
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2010-11-28 14:57:12 UTC (rev 168)
+++ CometVisu/trunk/visu/index.html 2010-11-28 15:18:27 UTC (rev 169)
@@ -15,14 +15,14 @@
<script src="lib/templateengine.js" type="text/javascript"></script>
</head>
<body>
- <div id="top">
+ <div id="top" style="display: none;">
<div class="nav_path">-</div>
</div>
- <div id="main" style="width:900px;position:relative; overflow: hidden; ">
+ <div id="main" style="width:900px;position:relative; overflow: hidden;" style="display: none;">
<div id="pages" class="clearfix" style="width:20000em; position:relative;clear:both;"><!-- all pages will be inserted here -->
</div>
</div>
- <div id="bottom">
+ <div id="bottom" style="display: none;">
<hr />
<div class="footer">
<img src="icon/comet_64_000000.png" alt="CometVisu" />
@@ -30,5 +30,8 @@
- <a href="edit_config.html">Edit</a>
</div>
</div>
+ <div id="loading" style="text-align: center; width: 200px; height: 30px; margin: auto;">
+ Loading ...
+ </div>
</body>
</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|