iobroker.javascript 7.0.7 → 7.0.8

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 (41) hide show
  1. package/README.md +2 -1
  2. package/admin/asset-manifest.json +5 -5
  3. package/admin/google-blockly/blockly_compressed.js +1469 -1704
  4. package/admin/google-blockly/blocks_compressed.js +164 -218
  5. package/admin/google-blockly/javascript_compressed.js +100 -328
  6. package/admin/google-blockly/msg/js/de.js +64 -70
  7. package/admin/google-blockly/msg/js/en.js +14 -20
  8. package/admin/google-blockly/msg/js/es.js +39 -45
  9. package/admin/google-blockly/msg/js/fr.js +59 -65
  10. package/admin/google-blockly/msg/js/it.js +19 -25
  11. package/admin/google-blockly/msg/js/nl.js +55 -61
  12. package/admin/google-blockly/msg/js/pl.js +46 -52
  13. package/admin/google-blockly/msg/js/pt.js +30 -36
  14. package/admin/google-blockly/msg/js/ru.js +41 -47
  15. package/admin/google-blockly/msg/js/uk.js +13 -17
  16. package/admin/google-blockly/msg/js/zh-cn.js +86 -92
  17. package/admin/google-blockly/own/blocks_action.js +4 -4
  18. package/admin/google-blockly/own/blocks_other.js +103 -0
  19. package/admin/google-blockly/own/blocks_procedures.js +63 -62
  20. package/admin/google-blockly/own/blocks_sendto.js +62 -60
  21. package/admin/google-blockly/own/blocks_switch.js +40 -29
  22. package/admin/google-blockly/own/blocks_system.js +113 -170
  23. package/admin/google-blockly/own/blocks_time.js +35 -35
  24. package/admin/google-blockly/own/blocks_timeout.js +42 -42
  25. package/admin/google-blockly/own/blocks_trigger.js +51 -68
  26. package/admin/google-blockly/own/blocks_words.js +8 -9
  27. package/admin/google-blockly/own/field_cron.js +189 -139
  28. package/admin/google-blockly/own/field_oid.js +250 -170
  29. package/admin/google-blockly/own/field_script.js +168 -122
  30. package/admin/static/js/98.bf3dfa2b.chunk.js +2 -0
  31. package/admin/static/js/98.bf3dfa2b.chunk.js.map +1 -0
  32. package/admin/static/js/{main.d86fb9de.js → main.d9e7d255.js} +2 -2
  33. package/admin/static/js/{main.d86fb9de.js.map → main.d9e7d255.js.map} +1 -1
  34. package/admin/tab.html +1 -1
  35. package/io-package.json +14 -14
  36. package/package.json +1 -1
  37. package/admin/google-blockly/own/blocks_logic.js +0 -64
  38. package/admin/google-blockly/own/blocks_number.js +0 -25
  39. package/admin/google-blockly/own/blocks_text.js +0 -23
  40. package/admin/static/js/98.f78be4fc.chunk.js +0 -2
  41. package/admin/static/js/98.f78be4fc.chunk.js.map +0 -1
@@ -2,9 +2,20 @@
2
2
  // I really tried to get the license conditions from authors, but no luck :(
3
3
  // Many thanks to Florian Pechwitz <florian.Pechwitz@itizzimo.com> for the code
4
4
 
5
+ Blockly.System.blocks['logic_switch_case'] =
6
+ '<block type="logic_switch_case">'
7
+ + ' <value name="CONDITION">'
8
+ + ' </value>'
9
+ + ' <value name="CASECONDITION0">'
10
+ + ' </value>'
11
+ + ' <value name="CASE0">'
12
+ + ' </value>'
13
+ + ' <mutation with_statement="false" items="parameter1"></mutation>'
14
+ + '</block>';
15
+
5
16
  Blockly.Blocks['logic_switch_case'] = {
6
17
  init: function() {
7
- this.setColour("%{BKY_LOGIC_HUE}");
18
+ this.setColour(Blockly.Constants.Logic.HUE);
8
19
  this.setPreviousStatement(true);
9
20
  this.setNextStatement(true);
10
21
  this.appendValueInput('CONDITION')
@@ -24,7 +35,7 @@ Blockly.Blocks['logic_switch_case'] = {
24
35
  return null;
25
36
  }
26
37
 
27
- var container = document.createElement('mutation');
38
+ const container = document.createElement('mutation');
28
39
 
29
40
  if (this.caseCount_) {
30
41
  container.setAttribute('case', this.caseCount_);
@@ -40,7 +51,7 @@ Blockly.Blocks['logic_switch_case'] = {
40
51
  this.caseCount_ = parseInt(xmlElement.getAttribute('case'), 10);
41
52
  this.defaultCount_ = parseInt(xmlElement.getAttribute('default'), 10);
42
53
 
43
- for (var x = 1; x <= this.caseCount_; x++) {
54
+ for (let x = 1; x <= this.caseCount_; x++) {
44
55
  this.appendValueInput('CASECONDITION' + x)
45
56
  .appendField(Blockly.Translate('logic_switch_case_of'));
46
57
  this.appendStatementInput('CASE' + x)
@@ -54,20 +65,20 @@ Blockly.Blocks['logic_switch_case'] = {
54
65
  },
55
66
 
56
67
  decompose: function(workspace) {
57
- var containerBlock = workspace.newBlock('control_case');//Blockly.Block.obtain(workspace, 'control_case');
68
+ const containerBlock = workspace.newBlock('control_case');//Blockly.Block.obtain(workspace, 'control_case');
58
69
  containerBlock.initSvg();
59
70
 
60
- var connection = containerBlock.getInput('STACK').connection;
71
+ let connection = containerBlock.getInput('STACK').connection;
61
72
 
62
- for (var x = 1; x <= this.caseCount_; x++) {
63
- var caseBlock = workspace.newBlock('case_incaseof');//Blockly.Block.obtain(workspace, 'case_incaseof');
73
+ for (let x = 1; x <= this.caseCount_; x++) {
74
+ const caseBlock = workspace.newBlock('case_incaseof');//Blockly.Block.obtain(workspace, 'case_incaseof');
64
75
  caseBlock.initSvg();
65
76
  connection.connect(caseBlock.previousConnection);
66
77
  connection = caseBlock.nextConnection;
67
78
  }
68
79
 
69
80
  if (this.defaultCount_) {
70
- var defaultBlock = workspace.newBlock('case_default');//Blockly.Block.obtain(workspace, 'case_default');
81
+ const defaultBlock = workspace.newBlock('case_default');//Blockly.Block.obtain(workspace, 'case_default');
71
82
  defaultBlock.initSvg();
72
83
  connection.connect(defaultBlock.previousConnection);
73
84
  }
@@ -83,23 +94,23 @@ Blockly.Blocks['logic_switch_case'] = {
83
94
 
84
95
  this.defaultCount_ = 0;
85
96
 
86
- for (var x = this.caseCount_; x > 0; x--) {
97
+ for (let x = this.caseCount_; x > 0; x--) {
87
98
  this.removeInput('CASECONDITION' + x);
88
99
  this.removeInput('CASE' + x);
89
100
  }
90
101
 
91
102
  this.caseCount_ = 0;
92
103
 
93
- var caseBlock = containerBlock.getInputTargetBlock('STACK');
104
+ let caseBlock = containerBlock.getInputTargetBlock('STACK');
94
105
 
95
106
  while (caseBlock) {
96
107
  switch(caseBlock.type) {
97
108
  case 'case_incaseof':
98
109
  this.caseCount_++;
99
- var caseconditionInput = this.appendValueInput('CASECONDITION' + this.caseCount_)
110
+ const caseconditionInput = this.appendValueInput('CASECONDITION' + this.caseCount_)
100
111
  .appendField(Blockly.Translate('logic_switch_case_of'));
101
112
 
102
- var caseInput = this.appendStatementInput('CASE' + this.caseCount_)
113
+ const caseInput = this.appendStatementInput('CASE' + this.caseCount_)
103
114
  .appendField(Blockly.Translate('logic_switch_do'));
104
115
 
105
116
  if (caseBlock.valueConnection_) {
@@ -113,7 +124,7 @@ Blockly.Blocks['logic_switch_case'] = {
113
124
 
114
125
  case 'case_default':
115
126
  this.defaultCount_++;
116
- var defaultInput = this.appendStatementInput('ONDEFAULT')
127
+ const defaultInput = this.appendStatementInput('ONDEFAULT')
117
128
  .appendField('default');
118
129
 
119
130
  if (caseBlock.statementConnection_) {
@@ -130,19 +141,19 @@ Blockly.Blocks['logic_switch_case'] = {
130
141
  },
131
142
 
132
143
  saveConnections: function(containerBlock) {
133
- var caseBlock = containerBlock.getInputTargetBlock('STACK');
134
- var x = 1;
144
+ let caseBlock = containerBlock.getInputTargetBlock('STACK');
145
+ let x = 1;
135
146
  while (caseBlock) {
136
147
  switch (caseBlock.type) {
137
148
  case'case_incaseof':
138
- var caseconditionInput = this.getInput('CASECONDITION' + x);
139
- var caseInput = this.getInput('CASE' + x);
149
+ const caseconditionInput = this.getInput('CASECONDITION' + x);
150
+ const caseInput = this.getInput('CASE' + x);
140
151
  caseBlock.valueConnection_ = caseconditionInput && caseconditionInput.connection.targetConnection;
141
152
  caseBlock.statementConnection_ = caseInput && caseInput.connection.targetConnection;
142
153
  x++;
143
154
  break;
144
155
  case'case_default':
145
- var defaultInput = this.getInput('ONDEFAULT');
156
+ const defaultInput = this.getInput('ONDEFAULT');
146
157
  caseBlock.satementConnection_ = defaultInput && defaultInput.connection.targetConnection;
147
158
  break;
148
159
  default:
@@ -156,7 +167,7 @@ Blockly.Blocks['logic_switch_case'] = {
156
167
 
157
168
  Blockly.Blocks['control_case'] = {
158
169
  init: function() {
159
- this.setColour("%{BKY_LOGIC_HUE}");
170
+ this.setColour(180);
160
171
  this.appendDummyInput()
161
172
  .appendField(Blockly.Translate('logic_switch_case_is'));
162
173
  this.appendStatementInput('STACK');
@@ -167,7 +178,7 @@ Blockly.Blocks['control_case'] = {
167
178
 
168
179
  Blockly.Blocks['case_incaseof'] = {
169
180
  init: function() {
170
- this.setColour("%{BKY_LOGIC_HUE}");
181
+ this.setColour(180);
171
182
  this.appendDummyInput()
172
183
  .appendField(Blockly.Translate('logic_switch_case_of'));
173
184
  this.setPreviousStatement(true);
@@ -179,7 +190,7 @@ Blockly.Blocks['case_incaseof'] = {
179
190
 
180
191
  Blockly.Blocks['case_default'] = {
181
192
  init: function() {
182
- this.setColour("%{BKY_LOGIC_HUE}");
193
+ this.setColour(180);
183
194
  this.appendDummyInput()
184
195
  .appendField('default');
185
196
  this.setPreviousStatement(true);
@@ -190,21 +201,21 @@ Blockly.Blocks['case_default'] = {
190
201
  };
191
202
 
192
203
  Blockly.JavaScript['logic_switch_case'] = function (block) {
193
- var code = '';
194
- var do_n;
195
- var case_n;
196
- var switchVariable = Blockly.JavaScript.valueToCode(block, 'CONDITION', Blockly.JavaScript.ORDER_NONE) || null;
204
+ let code = '';
205
+ let do_n;
206
+ let case_n;
207
+ const switchVariable = Blockly.JavaScript.valueToCode(block, 'CONDITION', Blockly.JavaScript.ORDER_NONE) || null;
197
208
 
198
209
  if (switchVariable){
199
- var pattern = /^\(?([._$\d\w"?: \(\)])*\)?$/g;
210
+ const pattern = /^\(?([._$\d\w"?: \(\)])*\)?$/g;
200
211
 
201
212
  if (pattern.test(switchVariable)) { // Check to see if the switch is a kind of variable type
202
213
  code = '\nswitch (' + switchVariable + ') {\n';
203
- var case_0 = Blockly.JavaScript.valueToCode(block, 'CASECONDITION0', Blockly.JavaScript.ORDER_NONE) || null;
204
- var do_0 = Blockly.JavaScript.statementToCode(block, 'CASE0');
214
+ const case_0 = Blockly.JavaScript.valueToCode(block, 'CASECONDITION0', Blockly.JavaScript.ORDER_NONE) || null;
215
+ const do_0 = Blockly.JavaScript.statementToCode(block, 'CASE0');
205
216
  code += '\tcase ' + case_0 + ':\n' + do_0 + '\n\t\tbreak;\n';
206
217
 
207
- for (var n = 1; n <= block.caseCount_; n++) {
218
+ for (let n = 1; n <= block.caseCount_; n++) {
208
219
  case_n = Blockly.JavaScript.valueToCode(block, 'CASECONDITION' + n,
209
220
  Blockly.JavaScript.ORDER_NONE) || null;
210
221