|
From: <ma...@us...> - 2012-12-09 22:00:21
|
Revision: 1198
http://openautomation.svn.sourceforge.net/openautomation/?rev=1198&view=rev
Author: mayerch
Date: 2012-12-09 22:00:14 +0000 (Sun, 09 Dec 2012)
Log Message:
-----------
- little bug fixes
- add (inital) ability to switch the flow-o-matic flow via the bus
Modified Paths:
--------------
CometVisu/trunk/visu/lib/cometvisu-client.js
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/lib/cometvisu-client.js
===================================================================
--- CometVisu/trunk/visu/lib/cometvisu-client.js 2012-12-09 18:43:51 UTC (rev 1197)
+++ CometVisu/trunk/visu/lib/cometvisu-client.js 2012-12-09 22:00:14 UTC (rev 1198)
@@ -79,7 +79,7 @@
return;
}
- if( !this.doRestart )
+ if( json && !this.doRestart )
{
this.lastIndex = json.i;
var data = json.d;
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-12-09 18:43:51 UTC (rev 1197)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-12-09 22:00:14 UTC (rev 1198)
@@ -49,23 +49,14 @@
var defaultColumns = 12;
var minColumnWidth = 150;
var enableColumnAdjustment = false;
-if (backend == undefined) {
- var backend = "cgi";
-}
+var backend = 'cgi-bin'; // default path to backend
if ($.getUrlVar("backend")) {
backend = $.getUrlVar("backend");
}
-var backendConfig = {
- baseUrl : '/cgi-bin/',
-};
-
-function initBackendClient(backend) {
- if (backend.toLowerCase() == 'oh') {
- backendConfig.baseUrl = '/cv/';
- }
-
- visu = new CometVisu(backendConfig.baseUrl);
+function initBackendClient() {
+ backend = '/' + backend + '/';
+ visu = new CometVisu( backend );
visu.update = function(json) { // overload the handler
for (key in json) {
$.event.trigger('_' + key, json[key]);
@@ -326,7 +317,7 @@
if ($('pages', xml).attr("backend")) {
backend = $('pages', xml).attr("backend");
}
- initBackendClient(backend);
+ initBackendClient();
scrollSpeed = $('pages', xml).attr("scroll_speed");
if ($('pages', xml).attr('enable_column_adjustment') == "true") {
@@ -644,8 +635,7 @@
var length = 0.0;
$(this)
.find('path')
- .each(
- function() {
+ .each( function() {
var path = this;
if (path.className.animVal.split(' ')
.indexOf('pipe-o-matic_clone') > 0)
@@ -705,7 +695,21 @@
}
length += path.getTotalLength();
});
- });
+ if( this.attributes.getNamedItem('data-cometvisu-active') )
+ {
+ activeValues = this.attributes.getNamedItem('data-cometvisu-active').value;
+ $( activeValues.split(' ') ).each( function() {
+ $('body').bind( '_' + this, function( e, data, passedElement ){
+ if( data == '01' )
+ //pipe_group.classList.add('flow_active');
+ pipe_group.setAttribute('class', pipe_group.getAttribute('class').replace(' flow_active','') + ' flow_active' );
+ else
+ pipe_group.setAttribute('class', pipe_group.getAttribute('class').replace(' flow_active','') );
+ //pipe_group.classList.remove('flow_active');
+ } );
+ } );
+ }
+ });
// Flow-O-Matic: add CSS
// helper for multiple bowser support
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-12-09 18:43:51 UTC (rev 1197)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-12-09 22:00:14 UTC (rev 1198)
@@ -431,7 +431,7 @@
var idx = num;
$.ajax({
- url: backendConfig.baseUrl+"rrdfetch?rrd=" + src + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
+ url: 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.
|