|
From: <j-...@us...> - 2012-08-31 18:46:42
|
Revision: 994
http://openautomation.svn.sourceforge.net/openautomation/?rev=994&view=rev
Author: j-n-k
Date: 2012-08-31 18:46:36 +0000 (Fri, 31 Aug 2012)
Log Message:
-----------
Added optional title to diagram-plugins:
attribute title="foo" sets the popup-title to "foo" instead of the content
of the label-element
(important for configs where label-elements are not used and/or were
replaced by text-widgets)
if title is ommitted the label-element content is used or the title is empty
if no label element exists (i.e. existings config can be used without any
changes)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-08-29 13:50:29 UTC (rev 993)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-08-31 18:46:36 UTC (rev 994)
@@ -43,6 +43,7 @@
* - width, height: optional, width and height of "inline"-diagram
* - previewlabels: optional, show labels on "inline"-diagram
* - popup: optional, make diagram clickable and open popup
+ * - title: optional, diagram title (overrides label-content)
*
* functions:
* - createDiagram(page, path, oldType)
@@ -130,7 +131,11 @@
diagram.data("series", $p.attr("series") || "day");
diagram.data("period", $p.attr("period") || 1);
diagram.data("datasource", $p.attr("datasource") || "AVERAGE");
- diagram.data("label", $('.label', ret_val).text() || '');
+ if ($p.attr("title")) {
+ diagram.data("label", $p.attr("title"));
+ } else {
+ diagram.data("label", $('.label', ret_val).text() || '');
+ }
diagram.data("refresh", $p.attr("refresh"));
diagram.data("gridcolor", $p.attr("gridcolor") || "");
@@ -213,7 +218,8 @@
linecolor: {type: "string", required: false},
colspan: {type: "numeric", required: false},
rowspan: {type: "numeric", required: false},
- gridcolor: {type: "string", required: false}
+ gridcolor: {type: "string", required: false},
+ title: {type: "string", required: false}
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -240,6 +246,7 @@
tooltip: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
width: {type: "string", required: false},
height: {type: "string", required: false},
+ title: {type: "string", required: false}
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -268,6 +275,7 @@
height: {type: "string", required: false},
previewlabels: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
popup: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
+ title: {type: "string", required: false}
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -329,7 +337,12 @@
bDiagram.data("series", $p.attr("series") || "day");
bDiagram.data("period", $p.attr("period") || 1);
bDiagram.data("datasource", $p.attr("datasource") || "AVERAGE");
- bDiagram.data("label", $('.label', ret_val).text() || '');
+ if ($p.attr("title")) {
+ bDiagram.data("label", $p.attr("title"));
+ } else {
+ bDiagram.data("label", $('.label', ret_val).text() || '');
+ }
+
bDiagram.data("refresh", $p.attr("refresh"));
bDiagram.data("gridcolor", $p.attr("gridcolor") || "");
@@ -402,7 +415,8 @@
yaxismax: {type: "numeric", required: false},
format: { type: 'format', required: false },
mapping: { type: 'mapping', required: false },
- styling: { type: 'styling', required: false }
+ styling: { type: 'styling', required: false },
+ title: {type: "string", required: false}
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|