iobroker.javascript 7.0.10 → 7.1.1
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.
- package/README.md +5 -5
- package/admin/asset-manifest.json +9 -9
- package/admin/google-blockly/blockly-9.3.3.tgz +0 -0
- package/admin/google-blockly/blockly_compressed.js +1704 -1469
- package/admin/google-blockly/blocks_compressed.js +218 -164
- package/admin/google-blockly/javascript_compressed.js +328 -100
- package/admin/google-blockly/msg/js/de.js +70 -64
- package/admin/google-blockly/msg/js/en.js +20 -14
- package/admin/google-blockly/msg/js/es.js +45 -39
- package/admin/google-blockly/msg/js/fr.js +65 -59
- package/admin/google-blockly/msg/js/it.js +25 -19
- package/admin/google-blockly/msg/js/nl.js +61 -55
- package/admin/google-blockly/msg/js/pl.js +52 -46
- package/admin/google-blockly/msg/js/pt.js +36 -30
- package/admin/google-blockly/msg/js/ru.js +47 -41
- package/admin/google-blockly/msg/js/uk.js +17 -13
- package/admin/google-blockly/msg/js/zh-cn.js +92 -86
- package/admin/google-blockly/own/blocks_action.js +4 -4
- package/admin/google-blockly/own/blocks_number.js +4 -3
- package/admin/google-blockly/own/blocks_procedures.js +106 -75
- package/admin/google-blockly/own/blocks_sendto.js +2 -2
- package/admin/google-blockly/own/blocks_switch.js +8 -19
- package/admin/google-blockly/own/blocks_system.js +171 -113
- package/admin/google-blockly/own/blocks_text.js +1 -1
- package/admin/google-blockly/own/blocks_time.js +2 -1
- package/admin/google-blockly/own/blocks_timeout.js +31 -27
- package/admin/google-blockly/own/blocks_trigger.js +62 -44
- package/admin/google-blockly/own/blocks_words.js +3 -3
- package/admin/google-blockly/own/field_cron.js +138 -189
- package/admin/google-blockly/own/field_oid.js +167 -249
- package/admin/google-blockly/own/field_script.js +124 -170
- package/admin/static/js/472.d73f9bde.chunk.js +3 -0
- package/admin/static/js/472.d73f9bde.chunk.js.map +1 -0
- package/admin/static/js/{512.6503862a.chunk.js → 512.e71b2bc3.chunk.js} +3 -3
- package/admin/static/js/512.e71b2bc3.chunk.js.map +1 -0
- package/admin/static/js/98.ecb7402b.chunk.js +2 -0
- package/admin/static/js/98.ecb7402b.chunk.js.map +1 -0
- package/admin/static/js/{main.d5dc2784.js → main.b8836dea.js} +2 -2
- package/admin/static/js/main.b8836dea.js.map +1 -0
- package/admin/tab.html +1 -1
- package/io-package.json +26 -26
- package/main.js +9 -10
- package/package.json +4 -4
- package/admin/blockly-9.0.1.tgz +0 -0
- package/admin/static/js/472.dae7221e.chunk.js +0 -3
- package/admin/static/js/472.dae7221e.chunk.js.map +0 -1
- package/admin/static/js/512.6503862a.chunk.js.map +0 -1
- package/admin/static/js/98.eee0c52f.chunk.js +0 -2
- package/admin/static/js/98.eee0c52f.chunk.js.map +0 -1
- package/admin/static/js/main.d5dc2784.js.map +0 -1
- /package/admin/static/js/{472.dae7221e.chunk.js.LICENSE.txt → 472.d73f9bde.chunk.js.LICENSE.txt} +0 -0
- /package/admin/static/js/{512.6503862a.chunk.js.LICENSE.txt → 512.e71b2bc3.chunk.js.LICENSE.txt} +0 -0
|
@@ -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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
-
|
|
174
|
-
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
Blockly.FieldCRON.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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);
|