iobroker.ebus 3.2.4 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/.eslintrc.json +34 -34
  2. package/.releaseconfig.json +3 -0
  3. package/LICENSE +20 -20
  4. package/README.md +147 -130
  5. package/admin/index_m.html +419 -419
  6. package/admin/style.css +18 -18
  7. package/admin/words.js +27 -27
  8. package/io-package.json +218 -192
  9. package/lib/support_tools.js +370 -370
  10. package/lib/tools.js +99 -99
  11. package/main.js +1232 -1232
  12. package/package.json +13 -11
  13. package/widgets/ebus/lib/js/flot/jquery.canvaswrapper.js +549 -549
  14. package/widgets/ebus/lib/js/flot/jquery.colorhelpers.js +199 -199
  15. package/widgets/ebus/lib/js/flot/jquery.flot.axislabels.js +212 -212
  16. package/widgets/ebus/lib/js/flot/jquery.flot.browser.js +98 -98
  17. package/widgets/ebus/lib/js/flot/jquery.flot.categories.js +202 -202
  18. package/widgets/ebus/lib/js/flot/jquery.flot.composeImages.js +330 -330
  19. package/widgets/ebus/lib/js/flot/jquery.flot.crosshair.js +202 -202
  20. package/widgets/ebus/lib/js/flot/jquery.flot.drawSeries.js +662 -662
  21. package/widgets/ebus/lib/js/flot/jquery.flot.errorbars.js +375 -375
  22. package/widgets/ebus/lib/js/flot/jquery.flot.fillbetween.js +254 -254
  23. package/widgets/ebus/lib/js/flot/jquery.flot.flatdata.js +47 -47
  24. package/widgets/ebus/lib/js/flot/jquery.flot.hover.js +361 -361
  25. package/widgets/ebus/lib/js/flot/jquery.flot.image.js +249 -249
  26. package/widgets/ebus/lib/js/flot/jquery.flot.js +2953 -2953
  27. package/widgets/ebus/lib/js/flot/jquery.flot.legend.js +437 -437
  28. package/widgets/ebus/lib/js/flot/jquery.flot.logaxis.js +298 -298
  29. package/widgets/ebus/lib/js/flot/jquery.flot.navigate.js +834 -834
  30. package/widgets/ebus/lib/js/flot/jquery.flot.pie.js +794 -794
  31. package/widgets/ebus/lib/js/flot/jquery.flot.resize.js +60 -60
  32. package/widgets/ebus/lib/js/flot/jquery.flot.saturated.js +43 -43
  33. package/widgets/ebus/lib/js/flot/jquery.flot.selection.js +527 -527
  34. package/widgets/ebus/lib/js/flot/jquery.flot.stack.js +220 -220
  35. package/widgets/ebus/lib/js/flot/jquery.flot.symbol.js +98 -98
  36. package/widgets/ebus/lib/js/flot/jquery.flot.threshold.js +143 -143
  37. package/widgets/ebus/lib/js/flot/jquery.flot.time.js +586 -586
  38. package/widgets/ebus/lib/js/flot/jquery.flot.touch.js +320 -320
  39. package/widgets/ebus/lib/js/flot/jquery.flot.touchNavigate.js +360 -360
  40. package/widgets/ebus/lib/js/flot/jquery.flot.uiConstants.js +10 -10
  41. package/widgets/ebus/lib/js/flot/jquery.js +9473 -9473
  42. package/widgets/ebus/lib/js/lib/globalize.culture.en-US.js +33 -33
  43. package/widgets/ebus/lib/js/lib/globalize.js +1601 -1601
  44. package/widgets/ebus/lib/js/lib/jquery.event.drag.js +145 -145
  45. package/widgets/ebus/lib/js/lib/jquery.mousewheel.js +86 -86
  46. package/widgets/ebus.html +2395 -2395
  47. package/readme.txt +0 -297
@@ -1,202 +1,202 @@
1
- /* Flot plugin for showing crosshairs when the mouse hovers over the plot.
2
-
3
- Copyright (c) 2007-2014 IOLA and Ole Laursen.
4
- Licensed under the MIT license.
5
-
6
- The plugin supports these options:
7
-
8
- crosshair: {
9
- mode: null or "x" or "y" or "xy"
10
- color: color
11
- lineWidth: number
12
- }
13
-
14
- Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical
15
- crosshair that lets you trace the values on the x axis, "y" enables a
16
- horizontal crosshair and "xy" enables them both. "color" is the color of the
17
- crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
18
- the drawn lines (default is 1).
19
-
20
- The plugin also adds four public methods:
21
-
22
- - setCrosshair( pos )
23
-
24
- Set the position of the crosshair. Note that this is cleared if the user
25
- moves the mouse. "pos" is in coordinates of the plot and should be on the
26
- form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
27
- axes), which is coincidentally the same format as what you get from a
28
- "plothover" event. If "pos" is null, the crosshair is cleared.
29
-
30
- - clearCrosshair()
31
-
32
- Clear the crosshair.
33
-
34
- - lockCrosshair(pos)
35
-
36
- Cause the crosshair to lock to the current location, no longer updating if
37
- the user moves the mouse. Optionally supply a position (passed on to
38
- setCrosshair()) to move it to.
39
-
40
- Example usage:
41
-
42
- var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
43
- $("#graph").bind( "plothover", function ( evt, position, item ) {
44
- if ( item ) {
45
- // Lock the crosshair to the data point being hovered
46
- myFlot.lockCrosshair({
47
- x: item.datapoint[ 0 ],
48
- y: item.datapoint[ 1 ]
49
- });
50
- } else {
51
- // Return normal crosshair operation
52
- myFlot.unlockCrosshair();
53
- }
54
- });
55
-
56
- - unlockCrosshair()
57
-
58
- Free the crosshair to move again after locking it.
59
- */
60
-
61
- (function ($) {
62
- var options = {
63
- crosshair: {
64
- mode: null, // one of null, "x", "y" or "xy",
65
- color: "rgba(170, 0, 0, 0.80)",
66
- lineWidth: 1
67
- }
68
- };
69
-
70
- function init(plot) {
71
- // position of crosshair in pixels
72
- var crosshair = {x: -1, y: -1, locked: false, highlighted: false};
73
-
74
- plot.setCrosshair = function setCrosshair(pos) {
75
- if (!pos) {
76
- crosshair.x = -1;
77
- } else {
78
- var o = plot.p2c(pos);
79
- crosshair.x = Math.max(0, Math.min(o.left, plot.width()));
80
- crosshair.y = Math.max(0, Math.min(o.top, plot.height()));
81
- }
82
-
83
- plot.triggerRedrawOverlay();
84
- };
85
-
86
- plot.clearCrosshair = plot.setCrosshair; // passes null for pos
87
-
88
- plot.lockCrosshair = function lockCrosshair(pos) {
89
- if (pos) {
90
- plot.setCrosshair(pos);
91
- }
92
-
93
- crosshair.locked = true;
94
- };
95
-
96
- plot.unlockCrosshair = function unlockCrosshair() {
97
- crosshair.locked = false;
98
- crosshair.rect = null;
99
- };
100
-
101
- function onMouseOut(e) {
102
- if (crosshair.locked) {
103
- return;
104
- }
105
-
106
- if (crosshair.x !== -1) {
107
- crosshair.x = -1;
108
- plot.triggerRedrawOverlay();
109
- }
110
- }
111
-
112
- function onMouseMove(e) {
113
- var offset = plot.offset();
114
- if (crosshair.locked) {
115
- var mouseX = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
116
- var mouseY = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
117
-
118
- if ((mouseX > crosshair.x - 4) && (mouseX < crosshair.x + 4) && (mouseY > crosshair.y - 4) && (mouseY < crosshair.y + 4)) {
119
- if (!crosshair.highlighted) {
120
- crosshair.highlighted = true;
121
- plot.triggerRedrawOverlay();
122
- }
123
- } else {
124
- if (crosshair.highlighted) {
125
- crosshair.highlighted = false;
126
- plot.triggerRedrawOverlay();
127
- }
128
- }
129
- return;
130
- }
131
-
132
- if (plot.getSelection && plot.getSelection()) {
133
- crosshair.x = -1; // hide the crosshair while selecting
134
- return;
135
- }
136
-
137
- crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
138
- crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
139
- plot.triggerRedrawOverlay();
140
- }
141
-
142
- plot.hooks.bindEvents.push(function (plot, eventHolder) {
143
- if (!plot.getOptions().crosshair.mode) {
144
- return;
145
- }
146
-
147
- eventHolder.mouseout(onMouseOut);
148
- eventHolder.mousemove(onMouseMove);
149
- });
150
-
151
- plot.hooks.drawOverlay.push(function (plot, ctx) {
152
- var c = plot.getOptions().crosshair;
153
- if (!c.mode) {
154
- return;
155
- }
156
-
157
- var plotOffset = plot.getPlotOffset();
158
-
159
- ctx.save();
160
- ctx.translate(plotOffset.left, plotOffset.top);
161
-
162
- if (crosshair.x !== -1) {
163
- var adj = plot.getOptions().crosshair.lineWidth % 2 ? 0.5 : 0;
164
-
165
- ctx.strokeStyle = c.color;
166
- ctx.lineWidth = c.lineWidth;
167
- ctx.lineJoin = "round";
168
-
169
- ctx.beginPath();
170
- if (c.mode.indexOf("x") !== -1) {
171
- var drawX = Math.floor(crosshair.x) + adj;
172
- ctx.moveTo(drawX, 0);
173
- ctx.lineTo(drawX, plot.height());
174
- }
175
- if (c.mode.indexOf("y") !== -1) {
176
- var drawY = Math.floor(crosshair.y) + adj;
177
- ctx.moveTo(0, drawY);
178
- ctx.lineTo(plot.width(), drawY);
179
- }
180
- if (crosshair.locked) {
181
- if (crosshair.highlighted) ctx.fillStyle = 'orange';
182
- else ctx.fillStyle = c.color;
183
- ctx.fillRect(Math.floor(crosshair.x) + adj - 4, Math.floor(crosshair.y) + adj - 4, 8, 8);
184
- }
185
- ctx.stroke();
186
- }
187
- ctx.restore();
188
- });
189
-
190
- plot.hooks.shutdown.push(function (plot, eventHolder) {
191
- eventHolder.unbind("mouseout", onMouseOut);
192
- eventHolder.unbind("mousemove", onMouseMove);
193
- });
194
- }
195
-
196
- $.plot.plugins.push({
197
- init: init,
198
- options: options,
199
- name: 'crosshair',
200
- version: '1.0'
201
- });
202
- })(jQuery);
1
+ /* Flot plugin for showing crosshairs when the mouse hovers over the plot.
2
+
3
+ Copyright (c) 2007-2014 IOLA and Ole Laursen.
4
+ Licensed under the MIT license.
5
+
6
+ The plugin supports these options:
7
+
8
+ crosshair: {
9
+ mode: null or "x" or "y" or "xy"
10
+ color: color
11
+ lineWidth: number
12
+ }
13
+
14
+ Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical
15
+ crosshair that lets you trace the values on the x axis, "y" enables a
16
+ horizontal crosshair and "xy" enables them both. "color" is the color of the
17
+ crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
18
+ the drawn lines (default is 1).
19
+
20
+ The plugin also adds four public methods:
21
+
22
+ - setCrosshair( pos )
23
+
24
+ Set the position of the crosshair. Note that this is cleared if the user
25
+ moves the mouse. "pos" is in coordinates of the plot and should be on the
26
+ form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
27
+ axes), which is coincidentally the same format as what you get from a
28
+ "plothover" event. If "pos" is null, the crosshair is cleared.
29
+
30
+ - clearCrosshair()
31
+
32
+ Clear the crosshair.
33
+
34
+ - lockCrosshair(pos)
35
+
36
+ Cause the crosshair to lock to the current location, no longer updating if
37
+ the user moves the mouse. Optionally supply a position (passed on to
38
+ setCrosshair()) to move it to.
39
+
40
+ Example usage:
41
+
42
+ var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
43
+ $("#graph").bind( "plothover", function ( evt, position, item ) {
44
+ if ( item ) {
45
+ // Lock the crosshair to the data point being hovered
46
+ myFlot.lockCrosshair({
47
+ x: item.datapoint[ 0 ],
48
+ y: item.datapoint[ 1 ]
49
+ });
50
+ } else {
51
+ // Return normal crosshair operation
52
+ myFlot.unlockCrosshair();
53
+ }
54
+ });
55
+
56
+ - unlockCrosshair()
57
+
58
+ Free the crosshair to move again after locking it.
59
+ */
60
+
61
+ (function ($) {
62
+ var options = {
63
+ crosshair: {
64
+ mode: null, // one of null, "x", "y" or "xy",
65
+ color: "rgba(170, 0, 0, 0.80)",
66
+ lineWidth: 1
67
+ }
68
+ };
69
+
70
+ function init(plot) {
71
+ // position of crosshair in pixels
72
+ var crosshair = {x: -1, y: -1, locked: false, highlighted: false};
73
+
74
+ plot.setCrosshair = function setCrosshair(pos) {
75
+ if (!pos) {
76
+ crosshair.x = -1;
77
+ } else {
78
+ var o = plot.p2c(pos);
79
+ crosshair.x = Math.max(0, Math.min(o.left, plot.width()));
80
+ crosshair.y = Math.max(0, Math.min(o.top, plot.height()));
81
+ }
82
+
83
+ plot.triggerRedrawOverlay();
84
+ };
85
+
86
+ plot.clearCrosshair = plot.setCrosshair; // passes null for pos
87
+
88
+ plot.lockCrosshair = function lockCrosshair(pos) {
89
+ if (pos) {
90
+ plot.setCrosshair(pos);
91
+ }
92
+
93
+ crosshair.locked = true;
94
+ };
95
+
96
+ plot.unlockCrosshair = function unlockCrosshair() {
97
+ crosshair.locked = false;
98
+ crosshair.rect = null;
99
+ };
100
+
101
+ function onMouseOut(e) {
102
+ if (crosshair.locked) {
103
+ return;
104
+ }
105
+
106
+ if (crosshair.x !== -1) {
107
+ crosshair.x = -1;
108
+ plot.triggerRedrawOverlay();
109
+ }
110
+ }
111
+
112
+ function onMouseMove(e) {
113
+ var offset = plot.offset();
114
+ if (crosshair.locked) {
115
+ var mouseX = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
116
+ var mouseY = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
117
+
118
+ if ((mouseX > crosshair.x - 4) && (mouseX < crosshair.x + 4) && (mouseY > crosshair.y - 4) && (mouseY < crosshair.y + 4)) {
119
+ if (!crosshair.highlighted) {
120
+ crosshair.highlighted = true;
121
+ plot.triggerRedrawOverlay();
122
+ }
123
+ } else {
124
+ if (crosshair.highlighted) {
125
+ crosshair.highlighted = false;
126
+ plot.triggerRedrawOverlay();
127
+ }
128
+ }
129
+ return;
130
+ }
131
+
132
+ if (plot.getSelection && plot.getSelection()) {
133
+ crosshair.x = -1; // hide the crosshair while selecting
134
+ return;
135
+ }
136
+
137
+ crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
138
+ crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
139
+ plot.triggerRedrawOverlay();
140
+ }
141
+
142
+ plot.hooks.bindEvents.push(function (plot, eventHolder) {
143
+ if (!plot.getOptions().crosshair.mode) {
144
+ return;
145
+ }
146
+
147
+ eventHolder.mouseout(onMouseOut);
148
+ eventHolder.mousemove(onMouseMove);
149
+ });
150
+
151
+ plot.hooks.drawOverlay.push(function (plot, ctx) {
152
+ var c = plot.getOptions().crosshair;
153
+ if (!c.mode) {
154
+ return;
155
+ }
156
+
157
+ var plotOffset = plot.getPlotOffset();
158
+
159
+ ctx.save();
160
+ ctx.translate(plotOffset.left, plotOffset.top);
161
+
162
+ if (crosshair.x !== -1) {
163
+ var adj = plot.getOptions().crosshair.lineWidth % 2 ? 0.5 : 0;
164
+
165
+ ctx.strokeStyle = c.color;
166
+ ctx.lineWidth = c.lineWidth;
167
+ ctx.lineJoin = "round";
168
+
169
+ ctx.beginPath();
170
+ if (c.mode.indexOf("x") !== -1) {
171
+ var drawX = Math.floor(crosshair.x) + adj;
172
+ ctx.moveTo(drawX, 0);
173
+ ctx.lineTo(drawX, plot.height());
174
+ }
175
+ if (c.mode.indexOf("y") !== -1) {
176
+ var drawY = Math.floor(crosshair.y) + adj;
177
+ ctx.moveTo(0, drawY);
178
+ ctx.lineTo(plot.width(), drawY);
179
+ }
180
+ if (crosshair.locked) {
181
+ if (crosshair.highlighted) ctx.fillStyle = 'orange';
182
+ else ctx.fillStyle = c.color;
183
+ ctx.fillRect(Math.floor(crosshair.x) + adj - 4, Math.floor(crosshair.y) + adj - 4, 8, 8);
184
+ }
185
+ ctx.stroke();
186
+ }
187
+ ctx.restore();
188
+ });
189
+
190
+ plot.hooks.shutdown.push(function (plot, eventHolder) {
191
+ eventHolder.unbind("mouseout", onMouseOut);
192
+ eventHolder.unbind("mousemove", onMouseMove);
193
+ });
194
+ }
195
+
196
+ $.plot.plugins.push({
197
+ init: init,
198
+ options: options,
199
+ name: 'crosshair',
200
+ version: '1.0'
201
+ });
202
+ })(jQuery);