iobroker.javascript 7.0.7 → 7.0.10
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 +6 -12
- package/admin/asset-manifest.json +7 -7
- package/admin/google-blockly/blockly_compressed.js +1469 -1704
- package/admin/google-blockly/blocks_compressed.js +164 -218
- package/admin/google-blockly/javascript_compressed.js +100 -328
- package/admin/google-blockly/msg/js/de.js +64 -70
- package/admin/google-blockly/msg/js/en.js +14 -20
- package/admin/google-blockly/msg/js/es.js +39 -45
- package/admin/google-blockly/msg/js/fr.js +59 -65
- package/admin/google-blockly/msg/js/it.js +19 -25
- package/admin/google-blockly/msg/js/nl.js +55 -61
- package/admin/google-blockly/msg/js/pl.js +46 -52
- package/admin/google-blockly/msg/js/pt.js +30 -36
- package/admin/google-blockly/msg/js/ru.js +41 -47
- package/admin/google-blockly/msg/js/uk.js +13 -17
- package/admin/google-blockly/msg/js/zh-cn.js +86 -92
- package/admin/google-blockly/own/blocks_action.js +4 -4
- package/admin/google-blockly/own/blocks_logic.js +2 -2
- package/admin/google-blockly/own/blocks_procedures.js +63 -62
- package/admin/google-blockly/own/blocks_sendto.js +62 -60
- package/admin/google-blockly/own/blocks_switch.js +40 -29
- package/admin/google-blockly/own/blocks_system.js +109 -170
- package/admin/google-blockly/own/blocks_time.js +35 -35
- package/admin/google-blockly/own/blocks_timeout.js +42 -42
- package/admin/google-blockly/own/blocks_trigger.js +51 -68
- package/admin/google-blockly/own/blocks_words.js +12 -8
- package/admin/google-blockly/own/field_cron.js +189 -139
- package/admin/google-blockly/own/field_oid.js +250 -170
- package/admin/google-blockly/own/field_script.js +168 -122
- package/admin/static/js/{565.643198c0.chunk.js → 569.e2b427a7.chunk.js} +2 -2
- package/admin/static/js/569.e2b427a7.chunk.js.map +1 -0
- package/admin/static/js/759.7f25ba6c.chunk.js.map +1 -1
- package/admin/static/js/98.eee0c52f.chunk.js +2 -0
- package/admin/static/js/98.eee0c52f.chunk.js.map +1 -0
- package/admin/static/js/{main.d86fb9de.js → main.d5dc2784.js} +2 -2
- package/admin/static/js/{main.d86fb9de.js.map → main.d5dc2784.js.map} +1 -1
- package/admin/tab.html +1 -1
- package/io-package.json +27 -27
- package/package.json +1 -1
- package/admin/static/js/565.643198c0.chunk.js.map +0 -1
- package/admin/static/js/98.f78be4fc.chunk.js +0 -2
- package/admin/static/js/98.f78be4fc.chunk.js.map +0 -1
|
@@ -1,3 +1,27 @@
|
|
|
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
|
+
*/
|
|
1
25
|
'use strict';
|
|
2
26
|
|
|
3
27
|
if (typeof goog !== 'undefined') {
|
|
@@ -10,150 +34,176 @@ if (typeof goog !== 'undefined') {
|
|
|
10
34
|
goog.require('goog.userAgent');
|
|
11
35
|
}
|
|
12
36
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
}
|
|
22
55
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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.
|
|
26
88
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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);
|
|
36
105
|
}
|
|
37
|
-
|
|
38
|
-
|
|
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();
|
|
39
126
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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');
|
|
52
145
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
this.resizeEditor_();
|
|
73
|
-
Blockly.svgResize(this.sourceBlock_.workspace);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Check to see if the contents of the editor validates.
|
|
78
|
-
* Style the editor accordingly.
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
validate_() {
|
|
82
|
-
goog.asserts.assertObject(Blockly.FieldCRON.htmlInput_);
|
|
83
|
-
|
|
84
|
-
var htmlInput = Blockly.FieldCRON.htmlInput_;
|
|
85
|
-
|
|
86
|
-
if (htmlInput.value) {
|
|
87
|
-
Blockly.addClass_(htmlInput, 'blocklyInvalidInput');
|
|
88
|
-
} else {
|
|
89
|
-
Blockly.removeClass_(htmlInput, 'blocklyInvalidInput');
|
|
90
|
-
}
|
|
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;
|
|
91
164
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var bBox = this.fieldGroup_.getBBox();
|
|
100
|
-
div.style.width = bBox.width * this.workspace_.scale + 'px';
|
|
101
|
-
div.style.height = bBox.height * this.workspace_.scale + 'px';
|
|
102
|
-
var xy = this.getAbsoluteXY_();
|
|
103
|
-
// In RTL mode block fields and LTR input fields the left edge moves,
|
|
104
|
-
// whereas the right edge is fixed. Reposition the editor.
|
|
105
|
-
if (this.sourceBlock_.RTL) {
|
|
106
|
-
var borderBBox = this.getScaledBBox_();
|
|
107
|
-
xy.x += borderBBox.width;
|
|
108
|
-
xy.x -= div.offsetWidth;
|
|
109
|
-
}
|
|
110
|
-
// Shift by a few pixels to line up exactly.
|
|
111
|
-
xy.y += 1;
|
|
112
|
-
if (goog.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) {
|
|
113
|
-
// Firefox mis-reports the location of the border by a pixel
|
|
114
|
-
// once the WidgetDiv is moved into position.
|
|
115
|
-
xy.x -= 1;
|
|
116
|
-
xy.y -= 1;
|
|
117
|
-
}
|
|
118
|
-
if (goog.userAgent.WEBKIT) {
|
|
119
|
-
xy.y -= 3;
|
|
120
|
-
}
|
|
121
|
-
div.style.left = xy.x + 'px';
|
|
122
|
-
div.style.top = xy.y + 'px';
|
|
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;
|
|
123
172
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
* Close the editor, save the results, and dispose of the editable
|
|
127
|
-
* text field's elements.
|
|
128
|
-
* @return {!Function} Closure to call on destruction of the WidgetDiv.
|
|
129
|
-
* @private
|
|
130
|
-
*/
|
|
131
|
-
widgetDispose_() {
|
|
132
|
-
var thisField = this;
|
|
133
|
-
return function() {
|
|
134
|
-
var htmlInput = Blockly.FieldCRON.htmlInput_;
|
|
135
|
-
// Save the edit (if it validates).
|
|
136
|
-
var text = htmlInput.value;
|
|
137
|
-
thisField.setValue(text);
|
|
138
|
-
thisField.sourceBlock_.rendered && thisField.sourceBlock_.render();
|
|
139
|
-
Blockly.unbindEvent_(htmlInput.onKeyDownWrapper_);
|
|
140
|
-
Blockly.unbindEvent_(htmlInput.onKeyUpWrapper_);
|
|
141
|
-
Blockly.unbindEvent_(htmlInput.onKeyPressWrapper_);
|
|
142
|
-
|
|
143
|
-
thisField.workspace_.removeChangeListener(
|
|
144
|
-
htmlInput.onWorkspaceChangeWrapper_);
|
|
145
|
-
|
|
146
|
-
Blockly.FieldCRON.htmlInput_ = null;
|
|
147
|
-
|
|
148
|
-
// Delete style properties.
|
|
149
|
-
var style = Blockly.WidgetDiv.DIV.style;
|
|
150
|
-
style.width = 'auto';
|
|
151
|
-
style.height = 'auto';
|
|
152
|
-
style.fontSize = '';
|
|
153
|
-
};
|
|
173
|
+
if (goog.userAgent.WEBKIT) {
|
|
174
|
+
xy.y -= 3;
|
|
154
175
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
+
};
|