iobroker.javascript 7.0.8 → 7.1.0

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 (48) hide show
  1. package/README.md +5 -11
  2. package/admin/asset-manifest.json +7 -7
  3. package/admin/google-blockly/blockly-9.3.3.tgz +0 -0
  4. package/admin/google-blockly/blockly_compressed.js +1704 -1469
  5. package/admin/google-blockly/blocks_compressed.js +218 -164
  6. package/admin/google-blockly/javascript_compressed.js +328 -100
  7. package/admin/google-blockly/msg/js/de.js +70 -64
  8. package/admin/google-blockly/msg/js/en.js +20 -14
  9. package/admin/google-blockly/msg/js/es.js +45 -39
  10. package/admin/google-blockly/msg/js/fr.js +65 -59
  11. package/admin/google-blockly/msg/js/it.js +25 -19
  12. package/admin/google-blockly/msg/js/nl.js +61 -55
  13. package/admin/google-blockly/msg/js/pl.js +52 -46
  14. package/admin/google-blockly/msg/js/pt.js +36 -30
  15. package/admin/google-blockly/msg/js/ru.js +47 -41
  16. package/admin/google-blockly/msg/js/uk.js +17 -13
  17. package/admin/google-blockly/msg/js/zh-cn.js +92 -86
  18. package/admin/google-blockly/own/blocks_action.js +4 -4
  19. package/admin/google-blockly/own/blocks_logic.js +64 -0
  20. package/admin/google-blockly/own/blocks_number.js +26 -0
  21. package/admin/google-blockly/own/blocks_procedures.js +106 -75
  22. package/admin/google-blockly/own/blocks_sendto.js +2 -2
  23. package/admin/google-blockly/own/blocks_switch.js +8 -19
  24. package/admin/google-blockly/own/blocks_system.js +171 -117
  25. package/admin/google-blockly/own/blocks_text.js +23 -0
  26. package/admin/google-blockly/own/blocks_time.js +2 -1
  27. package/admin/google-blockly/own/blocks_timeout.js +31 -27
  28. package/admin/google-blockly/own/blocks_trigger.js +62 -44
  29. package/admin/google-blockly/own/blocks_words.js +20 -15
  30. package/admin/google-blockly/own/field_cron.js +138 -189
  31. package/admin/google-blockly/own/field_oid.js +167 -249
  32. package/admin/google-blockly/own/field_script.js +124 -170
  33. package/admin/static/js/{565.643198c0.chunk.js → 569.e2b427a7.chunk.js} +2 -2
  34. package/admin/static/js/569.e2b427a7.chunk.js.map +1 -0
  35. package/admin/static/js/759.7f25ba6c.chunk.js.map +1 -1
  36. package/admin/static/js/98.7af6b699.chunk.js +2 -0
  37. package/admin/static/js/98.7af6b699.chunk.js.map +1 -0
  38. package/admin/static/js/{main.d9e7d255.js → main.bf8794f5.js} +2 -2
  39. package/admin/static/js/{main.d9e7d255.js.map → main.bf8794f5.js.map} +1 -1
  40. package/admin/tab.html +1 -1
  41. package/io-package.json +14 -14
  42. package/main.js +9 -10
  43. package/package.json +1 -1
  44. package/admin/blockly-9.0.1.tgz +0 -0
  45. package/admin/google-blockly/own/blocks_other.js +0 -103
  46. package/admin/static/js/565.643198c0.chunk.js.map +0 -1
  47. package/admin/static/js/98.bf3dfa2b.chunk.js +0 -2
  48. package/admin/static/js/98.bf3dfa2b.chunk.js.map +0 -1
@@ -1,27 +1,3 @@
1
- /**
2
- * @license
3
- * Visual Blocks Editor
4
- *
5
- * Copyright 2012 Google Inc.
6
- * https://developers.google.com/blockly/
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- */
20
-
21
- /**
22
- * @fileoverview Text input field.
23
- * @author fraser@google.com (Neil Fraser)
24
- */
25
1
  'use strict';
26
2
 
27
3
  if (typeof goog !== 'undefined') {
@@ -34,176 +10,149 @@ if (typeof goog !== 'undefined') {
34
10
  goog.require('goog.userAgent');
35
11
  }
36
12
 
37
- /**
38
- * Class for an editable text field.
39
- * @param {string} text The initial content of the field.
40
- * @param {Function=} opt_validator An optional function that is called
41
- * to validate any constraints on what the user entered. Takes the new
42
- * text as an argument and returns either the accepted text, a replacement
43
- * text, or null to abort the change.
44
- * @extends {Blockly.Field}
45
- * @constructor
46
- */
47
- Blockly.FieldCRON = function(text) {
48
- Blockly.FieldCRON.superClass_.constructor.call(this, text);
49
- };
50
- if (typeof goog !== 'undefined') {
51
- goog.inherits(Blockly.FieldCRON, Blockly.Field);
52
- } else {
53
- Blockly.utils.object.inherits(Blockly.FieldCRON, Blockly.Field);
54
- }
13
+ class FieldCRON extends Blockly.Field {
14
+ constructor(value, type) {
15
+ super(value);
16
+
17
+ this.FONTSIZE = 11;
18
+ this.CURSOR = 'pointer';
19
+ this.spellcheck_ = false;
20
+ }
55
21
 
56
- /**
57
- * Point size of text. Should match blocklyText's font-size in CSS.
58
- */
59
- Blockly.FieldCRON.FONTSIZE = 11;
60
-
61
- /**
62
- * Mouse cursor style when over the hotspot that initiates the editor.
63
- */
64
- Blockly.FieldCRON.prototype.CURSOR = 'pointer';
65
-
66
- /**
67
- * Allow browser to spellcheck this field.
68
- * @private
69
- */
70
- Blockly.FieldCRON.prototype.spellcheck_ = false;
71
-
72
- /**
73
- * Close the input widget if this input is being deleted.
74
- */
75
- Blockly.FieldCRON.prototype.dispose = function() {
76
- Blockly.WidgetDiv.hideIfOwner(this);
77
- Blockly.FieldCRON.superClass_.dispose.call(this);
78
- };
79
-
80
- /**
81
- * Set the text in this field.
82
- * @param {?string} text New text.
83
- * @override
84
- */
85
- Blockly.FieldCRON.prototype.setValue = function(text) {
86
- if (text === null) {
87
- return; // No change if null.
22
+ dispose() {
23
+ Blockly.WidgetDiv.hideIfOwner(this);
24
+ super.dispose();
88
25
  }
89
-
90
- Blockly.Field.prototype.setValue.call(this, text);
91
- };
92
-
93
- /**
94
- * Show the inline free-text editor on top of the text.
95
- * @param {boolean=} opt_quietInput True if editor should be created without
96
- * focus. Defaults to false.
97
- * @private
98
- */
99
- Blockly.FieldCRON.prototype.showEditor_ = function(opt_quietInput) {
100
- this.workspace_ = this.sourceBlock_.workspace;
101
- const that = this;
102
- main.cronDialog(that.getValue(), function (newId) {
103
- if (newId !== undefined && newId !== null) {
104
- that.setValue(newId);
26
+
27
+ /**
28
+ * Set the text in this field.
29
+ * @param {?string} text New text.
30
+ * @override
31
+ */
32
+ setValue(text) {
33
+ if (text === null) {
34
+ return; // No change if null.
105
35
  }
106
- });
107
- };
108
-
109
- /**
110
- * Handle a change to the editor.
111
- * @param {!Event} e Keyboard event.
112
- * @private
113
- */
114
- Blockly.FieldCRON.prototype.onHtmlInputChange_ = function(e) {
115
- const htmlInput = Blockly.FieldCRON.htmlInput_;
116
- // Update source block.
117
- const text = htmlInput.value;
118
- if (text !== htmlInput.oldValue_) {
119
- htmlInput.oldValue_ = text;
120
- this.setValue(text);
121
- this.validate_();
122
- } else if (goog.userAgent.WEBKIT) {
123
- // Cursor key. Render the source block to show the caret moving.
124
- // Chrome only (version 26, OS X).
125
- this.sourceBlock_.render();
36
+
37
+ super.setValue(text);
126
38
  }
127
- this.resizeEditor_();
128
- Blockly.svgResize(this.sourceBlock_.workspace);
129
- };
130
-
131
- /**
132
- * Check to see if the contents of the editor validates.
133
- * Style the editor accordingly.
134
- * @private
135
- */
136
- Blockly.FieldCRON.prototype.validate_ = function() {
137
- goog.asserts.assertObject(Blockly.FieldCRON.htmlInput_);
138
-
139
- const htmlInput = Blockly.FieldCRON.htmlInput_;
140
-
141
- if (htmlInput.value) {
142
- Blockly.addClass_(htmlInput, 'blocklyInvalidInput');
143
- } else {
144
- Blockly.removeClass_(htmlInput, 'blocklyInvalidInput');
39
+
40
+ /**
41
+ * Show the inline free-text editor on top of the text.
42
+ * @param {boolean=} opt_quietInput True if editor should be created without
43
+ * focus. Defaults to false.
44
+ * @private
45
+ */
46
+ showEditor_(opt_quietInput) {
47
+ this.workspace_ = this.sourceBlock_.workspace;
48
+ window.main.cronDialog(this.getValue(), (newId) => {
49
+ if (newId !== undefined && newId !== null) this.setValue(newId);
50
+ });
145
51
  }
146
- };
147
-
148
- /**
149
- * Resize the editor and the underlying block to fit the text.
150
- * @private
151
- */
152
- Blockly.FieldCRON.prototype.resizeEditor_ = function() {
153
- const div = Blockly.WidgetDiv.DIV;
154
- const bBox = this.fieldGroup_.getBBox();
155
- div.style.width = bBox.width * this.workspace_.scale + 'px';
156
- div.style.height = bBox.height * this.workspace_.scale + 'px';
157
- const xy = this.getAbsoluteXY_();
158
- // In RTL mode block fields and LTR input fields the left edge moves,
159
- // whereas the right edge is fixed. Reposition the editor.
160
- if (this.sourceBlock_.RTL) {
161
- const borderBBox = this.getScaledBBox_();
162
- xy.x += borderBBox.width;
163
- xy.x -= div.offsetWidth;
52
+
53
+ /**
54
+ * Handle a change to the editor.
55
+ * @param {!Event} e Keyboard event.
56
+ * @private
57
+ */
58
+ onHtmlInputChange_(e) {
59
+ const htmlInput = this.htmlInput_;
60
+ // Update source block.
61
+ const text = htmlInput.value;
62
+ if (text !== htmlInput.oldValue_) {
63
+ htmlInput.oldValue_ = text;
64
+ this.setValue(text);
65
+ this.validate_();
66
+ } else if (goog.userAgent.WEBKIT) {
67
+ // Cursor key. Render the source block to show the caret moving.
68
+ // Chrome only (version 26, OS X).
69
+ this.sourceBlock_.render();
70
+ }
71
+ this.resizeEditor_();
72
+ Blockly.svgResize(this.sourceBlock_.workspace);
164
73
  }
165
- // Shift by a few pixels to line up exactly.
166
- xy.y += 1;
167
- if (goog.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) {
168
- // Firefox mis-reports the location of the border by a pixel
169
- // once the WidgetDiv is moved into position.
170
- xy.x -= 1;
171
- xy.y -= 1;
74
+
75
+ /**
76
+ * Check to see if the contents of the editor validates.
77
+ * Style the editor accordingly.
78
+ * @private
79
+ */
80
+ validate_() {
81
+ goog.asserts.assertObject(Blockly.FieldCRON.htmlInput_);
82
+
83
+ const htmlInput = Blockly.FieldCRON.htmlInput_;
84
+
85
+ if (htmlInput.value) {
86
+ Blockly.addClass_(htmlInput, 'blocklyInvalidInput');
87
+ } else {
88
+ Blockly.removeClass_(htmlInput, 'blocklyInvalidInput');
89
+ }
172
90
  }
173
- if (goog.userAgent.WEBKIT) {
174
- xy.y -= 3;
91
+
92
+ /**
93
+ * Resize the editor and the underlying block to fit the text.
94
+ * @private
95
+ */
96
+ resizeEditor_() {
97
+ const div = Blockly.WidgetDiv.DIV;
98
+ const bBox = this.fieldGroup_.getBBox();
99
+ div.style.width = bBox.width * this.workspace_.scale + 'px';
100
+ div.style.height = bBox.height * this.workspace_.scale + 'px';
101
+ const xy = this.getAbsoluteXY_();
102
+ // In RTL mode block fields and LTR input fields the left edge moves,
103
+ // whereas the right edge is fixed. Reposition the editor.
104
+ if (this.sourceBlock_.RTL) {
105
+ const borderBBox = this.getScaledBBox_();
106
+ xy.x += borderBBox.width;
107
+ xy.x -= div.offsetWidth;
108
+ }
109
+ // Shift by a few pixels to line up exactly.
110
+ xy.y += 1;
111
+ if (goog.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) {
112
+ // Firefox mis-reports the location of the border by a pixel
113
+ // once the WidgetDiv is moved into position.
114
+ xy.x -= 1;
115
+ xy.y -= 1;
116
+ }
117
+ if (goog.userAgent.WEBKIT) {
118
+ xy.y -= 3;
119
+ }
120
+ div.style.left = xy.x + 'px';
121
+ div.style.top = xy.y + 'px';
175
122
  }
176
- div.style.left = xy.x + 'px';
177
- div.style.top = xy.y + 'px';
178
- };
179
-
180
- /**
181
- * Close the editor, save the results, and dispose of the editable
182
- * text field's elements.
183
- * @return {!Function} Closure to call on destruction of the WidgetDiv.
184
- * @private
185
- */
186
- Blockly.FieldCRON.prototype.widgetDispose_ = function() {
187
- const thisField = this;
188
- return function() {
189
- const htmlInput = Blockly.FieldCRON.htmlInput_;
190
- // Save the edit (if it validates).
191
- const text = htmlInput.value;
192
- thisField.setValue(text);
193
- thisField.sourceBlock_.rendered && thisField.sourceBlock_.render();
194
- Blockly.unbindEvent_(htmlInput.onKeyDownWrapper_);
195
- Blockly.unbindEvent_(htmlInput.onKeyUpWrapper_);
196
- Blockly.unbindEvent_(htmlInput.onKeyPressWrapper_);
197
-
198
- thisField.workspace_.removeChangeListener(
199
- htmlInput.onWorkspaceChangeWrapper_);
200
-
201
- Blockly.FieldCRON.htmlInput_ = null;
202
-
203
- // Delete style properties.
204
- const style = Blockly.WidgetDiv.DIV.style;
205
- style.width = 'auto';
206
- style.height = 'auto';
207
- style.fontSize = '';
208
- };
209
- };
123
+
124
+ /**
125
+ * Close the editor, save the results, and dispose of the editable
126
+ * text field's elements.
127
+ * @return {!Function} Closure to call on destruction of the WidgetDiv.
128
+ * @private
129
+ */
130
+ widgetDispose_() {
131
+ const thisField = this;
132
+ return function() {
133
+ const htmlInput = Blockly.FieldCRON.htmlInput_;
134
+ // Save the edit (if it validates).
135
+ const text = htmlInput.value;
136
+ thisField.setValue(text);
137
+ thisField.sourceBlock_.rendered && thisField.sourceBlock_.render();
138
+ Blockly.unbindEvent_(htmlInput.onKeyDownWrapper_);
139
+ Blockly.unbindEvent_(htmlInput.onKeyUpWrapper_);
140
+ Blockly.unbindEvent_(htmlInput.onKeyPressWrapper_);
141
+
142
+ thisField.workspace_.removeChangeListener(
143
+ htmlInput.onWorkspaceChangeWrapper_);
144
+
145
+ Blockly.FieldCRON.htmlInput_ = null;
146
+
147
+ // Delete style properties.
148
+ const style = Blockly.WidgetDiv.DIV.style;
149
+ style.width = 'auto';
150
+ style.height = 'auto';
151
+ style.fontSize = '';
152
+ };
153
+ }
154
+ }
155
+
156
+ Blockly.FieldCRON = FieldCRON;
157
+
158
+ // Blockly.fieldRegistry.register('field_cron', FieldCRON);