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') {
@@ -35,16 +11,16 @@ if (typeof goog !== 'undefined') {
35
11
  }
36
12
 
37
13
  Blockly.b64EncodeUnicode = function(text) {
38
- return btoa(encodeURIComponent(text).replace(/%([0-9A-F]{2})/g, function(match, p) {
39
- return String.fromCharCode(parseInt(p, 16))
14
+ return btoa(encodeURIComponent(text).replace(/%([0-9A-F]{2})/g, function (match, p) {
15
+ return String.fromCharCode(parseInt(p, 16));
40
16
  }));
41
17
  };
42
18
 
43
19
  // Decoding base64 ⇢ UTF8
44
20
  Blockly.b64DecodeUnicode = function(text) {
45
21
  try {
46
- return decodeURIComponent(Array.prototype.map.call(atob(text), function(s) {
47
- return '%' + ('00' + s.charCodeAt(0).toString(16)).slice(-2)
22
+ return decodeURIComponent(Array.prototype.map.call(atob(text), function (s) {
23
+ return '%' + ('00' + s.charCodeAt(0).toString(16)).slice(-2);
48
24
  }).join(''));
49
25
  } catch (e) {
50
26
  // old style
@@ -52,158 +28,136 @@ Blockly.b64DecodeUnicode = function(text) {
52
28
  }
53
29
  };
54
30
 
55
- /**
56
- * Class for an editable text field.
57
- * @param {string} text The initial content of the field.
58
- * @param {Function=} opt_validator An optional function that is called
59
- * to validate any constraints on what the user entered. Takes the new
60
- * text as an argument and returns either the accepted text, a replacement
61
- * text, or null to abort the change.
62
- * @extends {Blockly.Field}
63
- * @constructor
64
- */
65
- Blockly.FieldScript = function(text) {
66
- Blockly.FieldScript.superClass_.constructor.call(this, text);
67
- };
68
- if (typeof goog !== 'undefined') {
69
- goog.inherits(Blockly.FieldScript, Blockly.Field);
70
- } else {
71
- Blockly.utils.object.inherits(Blockly.FieldScript, Blockly.Field);
72
- }
73
- /**
74
- * Point size of text. Should match blocklyText's font-size in CSS.
75
- */
76
- Blockly.FieldScript.FONTSIZE = 11;
77
-
78
- /**
79
- * Mouse cursor style when over the hotspot that initiates the editor.
80
- */
81
- Blockly.FieldScript.prototype.CURSOR = 'pointer';
82
-
83
- /**
84
- * Allow browser to spellcheck this field.
85
- * @private
86
- */
87
- Blockly.FieldScript.prototype.spellcheck_ = false;
88
-
89
- /**
90
- * Close the input widget if this input is being deleted.
91
- */
92
- Blockly.FieldScript.prototype.dispose = function() {
93
- Blockly.WidgetDiv.hideIfOwner(this);
94
- Blockly.FieldScript.superClass_.dispose.call(this);
95
- };
31
+ class FieldScript extends Blockly.Field {
32
+ constructor(value, type) {
33
+ super(value);
96
34
 
97
- /**
98
- * Set the text in this field.
99
- * @param {?string} text New text.
100
- * @override
101
- */
102
- Blockly.FieldScript.prototype.setValue = function (text) {
103
- if (text === null) {
104
- return; // No change if null.
35
+ this.FONTSIZE = 11;
36
+ this.CURSOR = 'pointer';
37
+ this.spellcheck_ = false;
105
38
  }
106
39
 
107
- Blockly.Field.prototype.setValue.call(this, text);
108
- };
109
-
110
- /**
111
- * Show the inline free-text editor on top of the text.
112
- * @param {boolean=} opt_quietInput True if editor should be created without
113
- * focus. Defaults to false.
114
- * @private
115
- */
116
- Blockly.FieldScript.prototype.showEditor_ = function(opt_quietInput) {
117
- this.workspace_ = this.sourceBlock_.workspace;
118
- const that = this;
119
- const base64 = that.getValue();
120
- let args = null;
121
- let isReturn = false;
122
- if (this.sourceBlock_ && this.sourceBlock_.arguments_) {
123
- args = this.sourceBlock_.arguments_;
124
- }
125
- if (this.sourceBlock_.getProcedureDef) {
126
- const options = this.sourceBlock_.getProcedureDef();
127
- isReturn = options[2];
40
+ dispose() {
41
+ Blockly.WidgetDiv.hideIfOwner(this);
42
+ super.dispose();
128
43
  }
129
44
 
130
- window.main.showScriptDialog(Blockly.b64DecodeUnicode(base64 || ''), args, isReturn, function (newScript) {
131
- newScript !== undefined && newScript !== null && that.setValue(Blockly.b64EncodeUnicode(newScript));
132
- });
133
- };
134
-
135
- /**
136
- * Draws the border with the correct width.
137
- * Saves the computed width in a property.
138
- * @private
139
- */
140
- Blockly.FieldScript.prototype.render_ = function() {
141
- // the implementation is taken from field.js => Blockly.Field.prototype.updateSize_
142
- const constants = this.getConstants();
143
- const xOffset = this.borderRect_ ? this.getConstants().FIELD_BORDER_RECT_X_PADDING : 0;
144
- const totalWidth = xOffset * 2 + 12;
145
- let totalHeight = constants.FIELD_TEXT_HEIGHT;
146
-
147
- if (this.borderRect_) {
148
- totalHeight = Math.max(totalHeight, constants.FIELD_BORDER_RECT_HEIGHT);
45
+ /**
46
+ * Set the text in this field.
47
+ * @param {?string} text New text.
48
+ * @override
49
+ */
50
+ setValue(text) {
51
+ if (text === null) {
52
+ return; // No change if null.
53
+ }
54
+
55
+ super.setValue(text);
149
56
  }
150
57
 
151
- this.size_.height = totalHeight;
152
- this.size_.width = totalWidth;
58
+ /**
59
+ * Show the inline free-text editor on top of the text.
60
+ * @param {boolean=} opt_quietInput True if editor should be created without
61
+ * focus. Defaults to false.
62
+ * @private
63
+ */
64
+ showEditor_(opt_quietInput) {
65
+ this.workspace_ = this.sourceBlock_.workspace;
66
+ const that = this;
67
+ const base64 = that.getValue();
68
+ let args = null;
69
+ let isReturn = false;
70
+
71
+ if (this.sourceBlock_ && this.sourceBlock_.arguments_) {
72
+ args = this.sourceBlock_.arguments_;
73
+ }
74
+ if (this.sourceBlock_.getProcedureDef) {
75
+ const options = this.sourceBlock_.getProcedureDef();
76
+ isReturn = options[2];
77
+ }
78
+
79
+ window.main.showScriptDialog(Blockly.b64DecodeUnicode(base64 || ''), args, isReturn, function (newScript) {
80
+ newScript !== undefined && newScript !== null && that.setValue(Blockly.b64EncodeUnicode(newScript));
81
+ });
82
+ }
153
83
 
154
- this.positionTextElement_(xOffset, 12);
155
- this.positionBorderRect_();
156
- this.textElement_.textContent = '...';
157
- };
84
+ /**
85
+ * Draws the border with the correct width.
86
+ * Saves the computed width in a property.
87
+ * @private
88
+ */
89
+ render_() {
90
+ // the implementation is taken from field.js => Blockly.Field.prototype.updateSize_
91
+ const constants = this.getConstants();
92
+ const xOffset = this.borderRect_ ? this.getConstants().FIELD_BORDER_RECT_X_PADDING : 0;
93
+ const totalWidth = xOffset * 2 + 12;
94
+ let totalHeight = constants.FIELD_TEXT_HEIGHT;
95
+
96
+ if (this.borderRect_) {
97
+ totalHeight = Math.max(totalHeight, constants.FIELD_BORDER_RECT_HEIGHT);
98
+ }
99
+
100
+ this.size_.height = totalHeight;
101
+ this.size_.width = totalWidth;
102
+
103
+ this.positionTextElement_(xOffset, 12);
104
+ this.positionBorderRect_();
105
+ this.textElement_.textContent = '...';
106
+ }
158
107
 
159
- /**
160
- * Update the text node of this field to display the current text.
161
- * @private
162
- */
163
- Blockly.FieldScript.prototype.updateTextNode_ = function() {
164
- const width = (Blockly.BlockSvg.SEP_SPACE_X || 5) * 3;
165
- if (!this.textElement_) {
166
- // Not rendered yet.
167
- return;
108
+ /**
109
+ * Update the text node of this field to display the current text.
110
+ * @private
111
+ */
112
+ updateTextNode_() {
113
+ const width = (Blockly.BlockSvg.SEP_SPACE_X || 5) * 3;
114
+ if (!this.textElement_) {
115
+ // Not rendered yet.
116
+ return;
117
+ }
118
+ // Empty the text element.
119
+ goog.dom.removeChildren(/** @type {!Element} */ (this.textElement_));
120
+
121
+ const textNode = document.createTextNode('...');
122
+ this.textElement_.appendChild(textNode);
123
+
124
+ // Cached width is obsolete. Clear it.
125
+ this.size_.width = width;
168
126
  }
169
- // Empty the text element.
170
- goog.dom.removeChildren(/** @type {!Element} */ (this.textElement_));
171
127
 
172
- const textNode = document.createTextNode('...');
173
- this.textElement_.appendChild(textNode);
128
+ /**
129
+ * Close the editor, save the results, and dispose of the editable
130
+ * text field's elements.
131
+ * @return {!Function} Closure to call on destruction of the WidgetDiv.
132
+ * @private
133
+ */
134
+ /*widgetDispose_() {
135
+ const thisField = this;
136
+ return function() {
137
+ const htmlInput = Blockly.FieldScript.htmlInput_;
138
+
139
+ // Save the edit (if it validates).
140
+ const text = htmlInput.value;
141
+ thisField.setValue(text);
142
+ thisField.sourceBlock_.rendered && thisField.sourceBlock_.render();
143
+ Blockly.unbindEvent_(htmlInput.onKeyDownWrapper_);
144
+ Blockly.unbindEvent_(htmlInput.onKeyUpWrapper_);
145
+ Blockly.unbindEvent_(htmlInput.onKeyPressWrapper_);
146
+
147
+ thisField.workspace_.removeChangeListener(
148
+ htmlInput.onWorkspaceChangeWrapper_);
149
+
150
+ Blockly.FieldScript.htmlInput_ = null;
151
+
152
+ // Delete style properties.
153
+ const style = Blockly.WidgetDiv.DIV.style;
154
+ style.width = 'auto';
155
+ style.height = 'auto';
156
+ style.fontSize = '';
157
+ };
158
+ }*/
159
+ }
174
160
 
175
- // Cached width is obsolete. Clear it.
176
- this.size_.width = width;
177
- };
161
+ Blockly.FieldScript = FieldScript;
178
162
 
179
- /**
180
- * Close the editor, save the results, and dispose of the editable
181
- * text field's elements.
182
- * @return {!Function} Closure to call on destruction of the WidgetDiv.
183
- * @private
184
- */
185
- /*Blockly.FieldScript.prototype.widgetDispose_ = function() {
186
- const thisField = this;
187
- return function() {
188
- const htmlInput = Blockly.FieldScript.htmlInput_;
189
-
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.FieldScript.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
- };*/
163
+ // Blockly.fieldRegistry.register('field_script', FieldScript);