iobroker.javascript 8.5.0 → 8.5.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.
Files changed (36) hide show
  1. package/README.md +5 -10
  2. package/admin/asset-manifest.json +7 -7
  3. package/admin/google-blockly/own/blocks_action.js +29 -30
  4. package/admin/google-blockly/own/blocks_convert.js +6 -7
  5. package/admin/google-blockly/own/blocks_logic.js +16 -16
  6. package/admin/google-blockly/own/blocks_number.js +2 -2
  7. package/admin/google-blockly/own/blocks_object.js +14 -15
  8. package/admin/google-blockly/own/blocks_procedures.js +10 -10
  9. package/admin/google-blockly/own/blocks_sendto.js +104 -119
  10. package/admin/google-blockly/own/blocks_switch.js +8 -8
  11. package/admin/google-blockly/own/blocks_system.js +66 -67
  12. package/admin/google-blockly/own/blocks_text.js +2 -2
  13. package/admin/google-blockly/own/blocks_time.js +36 -37
  14. package/admin/google-blockly/own/blocks_timeout.js +20 -21
  15. package/admin/google-blockly/own/blocks_trigger.js +67 -68
  16. package/admin/google-blockly/own/field_cron.js +0 -1
  17. package/admin/google-blockly/own/field_oid.js +0 -1
  18. package/admin/google-blockly/own/field_script.js +4 -9
  19. package/admin/static/js/373.50668df1.chunk.js +2 -0
  20. package/admin/static/js/373.50668df1.chunk.js.map +1 -0
  21. package/admin/static/js/373.bf884cc8.chunk.js +2 -0
  22. package/admin/static/js/373.bf884cc8.chunk.js.map +1 -0
  23. package/admin/static/js/{974.3b53607f.chunk.js → 974.5c28e487.chunk.js} +3 -3
  24. package/admin/static/js/{974.3b53607f.chunk.js.map → 974.5c28e487.chunk.js.map} +1 -1
  25. package/admin/static/js/{main.63c641fd.js → main.524b166f.js} +2 -2
  26. package/admin/static/js/{main.63c641fd.js.map → main.524b166f.js.map} +1 -1
  27. package/admin/static/js/main.720010c8.js +2 -0
  28. package/admin/static/js/main.720010c8.js.map +1 -0
  29. package/admin/static/js/{main.d6499dc8.js → main.c18bdbeb.js} +2 -2
  30. package/admin/static/js/{main.d6499dc8.js.map → main.c18bdbeb.js.map} +1 -1
  31. package/admin/tab.html +1 -1
  32. package/io-package.json +14 -14
  33. package/package.json +1 -1
  34. package/admin/static/js/373.242b04f6.chunk.js +0 -2
  35. package/admin/static/js/373.242b04f6.chunk.js.map +0 -1
  36. /package/admin/static/js/{974.3b53607f.chunk.js.LICENSE.txt → 974.5c28e487.chunk.js.LICENSE.txt} +0 -0
@@ -2,7 +2,6 @@
2
2
 
3
3
  if (typeof goog !== 'undefined') {
4
4
  goog.provide('Blockly.JavaScript.Trigger');
5
-
6
5
  goog.require('Blockly.JavaScript');
7
6
  }
8
7
 
@@ -37,7 +36,7 @@ Blockly.Blocks['on_ext_oid_container'] = {
37
36
  * Mutator block for container.
38
37
  * @this Blockly.Block
39
38
  */
40
- init: function() {
39
+ init: function () {
41
40
  this.setColour(Blockly.Trigger.HUE);
42
41
 
43
42
  this.appendDummyInput()
@@ -54,7 +53,7 @@ Blockly.Blocks['on_ext_oid'] = {
54
53
  * Mutator block for add items.
55
54
  * @this Blockly.Block
56
55
  */
57
- init: function() {
56
+ init: function () {
58
57
  this.setColour(Blockly.Trigger.HUE);
59
58
 
60
59
  this.appendDummyInput('OID')
@@ -70,7 +69,7 @@ Blockly.Blocks['on_ext_oid'] = {
70
69
  };
71
70
 
72
71
  Blockly.Blocks['on_ext'] = {
73
- init: function() {
72
+ init: function () {
74
73
  this.itemCount_ = 1;
75
74
  this.setMutator(new Blockly.icons.MutatorIcon(['on_ext_oid'], this));
76
75
 
@@ -160,7 +159,7 @@ Blockly.Blocks['on_ext'] = {
160
159
  * @param {!Blockly.Block} containerBlock Root block in mutator.
161
160
  * @this Blockly.Block
162
161
  */
163
- saveConnections: function(containerBlock) {
162
+ saveConnections: function (containerBlock) {
164
163
  let itemBlock = containerBlock.getInputTargetBlock('STACK');
165
164
  let i = 0;
166
165
 
@@ -177,7 +176,7 @@ Blockly.Blocks['on_ext'] = {
177
176
  * @private
178
177
  * @this Blockly.Block
179
178
  */
180
- updateShape_: function() {
179
+ updateShape_: function () {
181
180
  let conditionValue = undefined;
182
181
  if (this.getInput('CONDITION')) {
183
182
  conditionValue = this.getFieldValue('CONDITION');
@@ -248,7 +247,7 @@ Blockly.Blocks['on_ext'] = {
248
247
  [Blockly.Translate('on_lt'), 'lt'],
249
248
  [Blockly.Translate('on_le'), 'le'],
250
249
  [Blockly.Translate('on_true'), 'true'],
251
- [Blockly.Translate('on_false'), 'false']
250
+ [Blockly.Translate('on_false'), 'false'],
252
251
  ]), 'CONDITION');
253
252
  if (conditionValue) {
254
253
  this.setFieldValue(conditionValue, 'CONDITION'); // restore previous value
@@ -259,7 +258,7 @@ Blockly.Blocks['on_ext'] = {
259
258
  .appendField(new Blockly.FieldDropdown([
260
259
  [Blockly.Translate('on_ack_any'), ''],
261
260
  [Blockly.Translate('on_ack_true'), 'true'],
262
- [Blockly.Translate('on_ack_false'), 'false']
261
+ [Blockly.Translate('on_ack_false'), 'false'],
263
262
  ]), 'ACK_CONDITION');
264
263
  if (conditionAckValue) {
265
264
  this.setFieldValue(conditionAckValue, 'ACK_CONDITION'); // restore previous value
@@ -278,7 +277,7 @@ Blockly.Blocks['on_ext'] = {
278
277
  * @param {!Blockly.Events.Abstract} e Change event.
279
278
  * @this Blockly.Block
280
279
  */
281
- onchange: function(e) {
280
+ onchange: function (e) {
282
281
  let legal = true;
283
282
 
284
283
  // Is the block nested in a trigger?
@@ -297,7 +296,7 @@ Blockly.Blocks['on_ext'] = {
297
296
  }
298
297
  },
299
298
  };
300
- Blockly.JavaScript.forBlock['on_ext'] = function(block) {
299
+ Blockly.JavaScript.forBlock['on_ext'] = function (block) {
301
300
  const dropdown_condition = block.getFieldValue('CONDITION');
302
301
  const ack_condition = block.getFieldValue('ACK_CONDITION');
303
302
  const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT');
@@ -339,7 +338,7 @@ Blockly.Trigger.blocks['on'] =
339
338
  '</block>';
340
339
 
341
340
  Blockly.Blocks['on'] = {
342
- init: function() {
341
+ init: function () {
343
342
  this.appendDummyInput()
344
343
  .appendField(Blockly.Translate('on'));
345
344
 
@@ -355,7 +354,7 @@ Blockly.Blocks['on'] = {
355
354
  [Blockly.Translate('on_lt'), 'lt'],
356
355
  [Blockly.Translate('on_le'), 'le'],
357
356
  [Blockly.Translate('on_true'), 'true'],
358
- [Blockly.Translate('on_false'), 'false']
357
+ [Blockly.Translate('on_false'), 'false'],
359
358
  ]), 'CONDITION');
360
359
 
361
360
  this.appendDummyInput('ACK_CONDITION')
@@ -363,7 +362,7 @@ Blockly.Blocks['on'] = {
363
362
  .appendField(new Blockly.FieldDropdown([
364
363
  [Blockly.Translate('on_ack_any'), ''],
365
364
  [Blockly.Translate('on_ack_true'), 'true'],
366
- [Blockly.Translate('on_ack_false'), 'false']
365
+ [Blockly.Translate('on_ack_false'), 'false'],
367
366
  ]), 'ACK_CONDITION');
368
367
 
369
368
  this.appendStatementInput('STATEMENT')
@@ -382,7 +381,7 @@ Blockly.Blocks['on'] = {
382
381
  * @param {!Blockly.Events.Abstract} e Change event.
383
382
  * @this Blockly.Block
384
383
  */
385
- onchange: function(e) {
384
+ onchange: function (e) {
386
385
  let legal = true;
387
386
 
388
387
  // Is the block nested in a trigger?
@@ -401,7 +400,7 @@ Blockly.Blocks['on'] = {
401
400
  }
402
401
  }
403
402
  };
404
- Blockly.JavaScript.forBlock['on'] = function(block) {
403
+ Blockly.JavaScript.forBlock['on'] = function (block) {
405
404
  const value_objectid = block.getFieldValue('OID');
406
405
  const dropdown_condition = block.getFieldValue('CONDITION');
407
406
  const ack_condition = block.getFieldValue('ACK_CONDITION');
@@ -438,7 +437,7 @@ Blockly.Blocks['on_source'] = {
438
437
  * Block for conditionally returning a value from a procedure.
439
438
  * @this Blockly.Block
440
439
  */
441
- init: function() {
440
+ init: function () {
442
441
  this.appendDummyInput()
443
442
  .appendField('↪');
444
443
 
@@ -466,7 +465,7 @@ Blockly.Blocks['on_source'] = {
466
465
  [Blockly.Translate('on_source_oldstate_ack'), 'oldState.ack'],
467
466
  [Blockly.Translate('on_source_oldstate_lc'), 'oldState.lc'],
468
467
  [Blockly.Translate('on_source_oldstate_c'), 'oldState.c'],
469
- [Blockly.Translate('on_source_oldstate_user'), 'oldState.user']
468
+ [Blockly.Translate('on_source_oldstate_user'), 'oldState.user'],
470
469
  ]), 'ATTR');
471
470
 
472
471
  this.setInputsInline(true);
@@ -481,7 +480,7 @@ Blockly.Blocks['on_source'] = {
481
480
  * @param {!Blockly.Events.Abstract} e Change event.
482
481
  * @this Blockly.Block
483
482
  */
484
- onchange: function(e) {
483
+ onchange: function (e) {
485
484
  let legal = false;
486
485
  // Is the block nested in a trigger?
487
486
  let block = this;
@@ -506,7 +505,7 @@ Blockly.Blocks['on_source'] = {
506
505
  */
507
506
  FUNCTION_TYPES: ['on', 'on_ext'],
508
507
  };
509
- Blockly.JavaScript.forBlock['on_source'] = function(block) {
508
+ Blockly.JavaScript.forBlock['on_source'] = function (block) {
510
509
  let attr = block.getFieldValue('ATTR');
511
510
  const parts = attr.split('.');
512
511
 
@@ -529,7 +528,7 @@ Blockly.Blocks['on_ack_value'] = {
529
528
  * Block for conditionally returning a value from a procedure.
530
529
  * @this Blockly.Block
531
530
  */
532
- init: function() {
531
+ init: function () {
533
532
  this.appendDummyInput()
534
533
  .appendField('↪ ' + Blockly.Translate('on_ack_value'));
535
534
 
@@ -546,7 +545,7 @@ Blockly.Blocks['on_ack_value'] = {
546
545
  * @param {!Blockly.Events.Abstract} e Change event.
547
546
  * @this Blockly.Block
548
547
  */
549
- onchange: function(e) {
548
+ onchange: function (e) {
550
549
  let legal = false;
551
550
  // Is the block nested in a trigger?
552
551
  let block = this;
@@ -571,7 +570,7 @@ Blockly.Blocks['on_ack_value'] = {
571
570
  */
572
571
  FUNCTION_TYPES: ['on', 'on_ext'],
573
572
  };
574
- Blockly.JavaScript.forBlock['on_ack_value'] = function(block) {
573
+ Blockly.JavaScript.forBlock['on_ack_value'] = function (block) {
575
574
  return 'if (obj.id && obj?.state && !obj.state.ack) {\n' +
576
575
  Blockly.JavaScript.prefixLines(`await setStateAsync(obj.id, { val: obj.state.val, ack: true });`, Blockly.JavaScript.INDENT) + '\n' +
577
576
  `}\n`;
@@ -584,7 +583,7 @@ Blockly.Trigger.blocks['schedule'] =
584
583
  '</block>';
585
584
 
586
585
  Blockly.Blocks['schedule'] = {
587
- init: function() {
586
+ init: function () {
588
587
  this.appendDummyInput()
589
588
  .appendField(Blockly.Translate('schedule'));
590
589
 
@@ -607,7 +606,7 @@ Blockly.Blocks['schedule'] = {
607
606
  * @param {!Blockly.Events.Abstract} e Change event.
608
607
  * @this Blockly.Block
609
608
  */
610
- onchange: function(e) {
609
+ onchange: function (e) {
611
610
  let legal = true;
612
611
 
613
612
  // Is the block nested in a trigger?
@@ -626,7 +625,7 @@ Blockly.Blocks['schedule'] = {
626
625
  }
627
626
  },
628
627
  };
629
- Blockly.JavaScript.forBlock['schedule'] = function(block) {
628
+ Blockly.JavaScript.forBlock['schedule'] = function (block) {
630
629
  let schedule = block.getFieldValue('SCHEDULE');
631
630
  const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT');
632
631
 
@@ -648,7 +647,7 @@ Blockly.Trigger.blocks['schedule_by_id'] =
648
647
  '</block>';
649
648
 
650
649
  Blockly.Blocks['schedule_by_id'] = {
651
- init: function() {
650
+ init: function () {
652
651
  this.appendDummyInput()
653
652
  .appendField(Blockly.Translate('schedule_by_id'));
654
653
 
@@ -674,7 +673,7 @@ Blockly.Blocks['schedule_by_id'] = {
674
673
  this.setHelpUrl(getHelp('schedule_by_id_help'));
675
674
  },
676
675
  };
677
- Blockly.JavaScript.forBlock['schedule_by_id'] = function(block) {
676
+ Blockly.JavaScript.forBlock['schedule_by_id'] = function (block) {
678
677
  const value_objectid = block.getFieldValue('OID');
679
678
  const ack_condition = block.getFieldValue('ACK_CONDITION');
680
679
  const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT');
@@ -692,26 +691,26 @@ Blockly.Trigger.blocks['astro'] =
692
691
  '</block>';
693
692
 
694
693
  Blockly.Blocks['astro'] = {
695
- init: function() {
694
+ init: function () {
696
695
  this.appendDummyInput()
697
696
  .appendField(Blockly.Translate('astro'));
698
697
 
699
698
  this.appendDummyInput("TYPE")
700
699
  .appendField(new Blockly.FieldDropdown([
701
- [Blockly.Translate('astro_sunriseText'), 'sunrise'],
702
- [Blockly.Translate('astro_sunriseEndText'), 'sunriseEnd'],
703
- [Blockly.Translate('astro_goldenHourEndText'), 'goldenHourEnd'],
704
- [Blockly.Translate('astro_solarNoonText'), 'solarNoon'],
705
- [Blockly.Translate('astro_goldenHourText'), 'goldenHour'],
706
- [Blockly.Translate('astro_sunsetStartText'), 'sunsetStart'],
707
- [Blockly.Translate('astro_sunsetText'), 'sunset'],
708
- [Blockly.Translate('astro_duskText'), 'dusk'],
709
- [Blockly.Translate('astro_nauticalDuskText'), 'nauticalDusk'],
710
- [Blockly.Translate('astro_nightText'), 'night'],
711
- [Blockly.Translate('astro_nightEndText'), 'nightEnd'],
712
- [Blockly.Translate('astro_nauticalDawnText'), 'nauticalDawn'],
713
- [Blockly.Translate('astro_dawnText'), 'dawn'],
714
- [Blockly.Translate('astro_nadirText'), 'nadir'],
700
+ [Blockly.Translate('astro_sunriseText'), 'sunrise'],
701
+ [Blockly.Translate('astro_sunriseEndText'), 'sunriseEnd'],
702
+ [Blockly.Translate('astro_goldenHourEndText'), 'goldenHourEnd'],
703
+ [Blockly.Translate('astro_solarNoonText'), 'solarNoon'],
704
+ [Blockly.Translate('astro_goldenHourText'), 'goldenHour'],
705
+ [Blockly.Translate('astro_sunsetStartText'), 'sunsetStart'],
706
+ [Blockly.Translate('astro_sunsetText'), 'sunset'],
707
+ [Blockly.Translate('astro_duskText'), 'dusk'],
708
+ [Blockly.Translate('astro_nauticalDuskText'), 'nauticalDusk'],
709
+ [Blockly.Translate('astro_nightText'), 'night'],
710
+ [Blockly.Translate('astro_nightEndText'), 'nightEnd'],
711
+ [Blockly.Translate('astro_nauticalDawnText'), 'nauticalDawn'],
712
+ [Blockly.Translate('astro_dawnText'), 'dawn'],
713
+ [Blockly.Translate('astro_nadirText'), 'nadir'],
715
714
  ]), 'TYPE');
716
715
 
717
716
  this.appendDummyInput()
@@ -739,7 +738,7 @@ Blockly.Blocks['astro'] = {
739
738
  * @param {!Blockly.Events.Abstract} e Change event.
740
739
  * @this Blockly.Block
741
740
  */
742
- onchange: function(e) {
741
+ onchange: function (e) {
743
742
  let legal = true;
744
743
 
745
744
  // Is the block nested in a trigger?
@@ -758,7 +757,7 @@ Blockly.Blocks['astro'] = {
758
757
  }
759
758
  },
760
759
  };
761
- Blockly.JavaScript.forBlock['astro'] = function(block) {
760
+ Blockly.JavaScript.forBlock['astro'] = function (block) {
762
761
  const astrotype = block.getFieldValue('TYPE');
763
762
  const offset = parseInt(block.getFieldValue('OFFSET'), 10);
764
763
  const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT');
@@ -783,7 +782,7 @@ Blockly.Trigger.blocks['schedule_create'] =
783
782
  * @param {!Blockly.Block} block Block to disambiguate.
784
783
  * @return {string} Non-colliding name.
785
784
  */
786
- Blockly.Trigger.findLegalName = function(name, block) {
785
+ Blockly.Trigger.findLegalName = function (name, block) {
787
786
  if (block.isInFlyout) {
788
787
  // Flyouts can have multiple procedures called 'do something'.
789
788
  return name;
@@ -810,7 +809,7 @@ Blockly.Trigger.findLegalName = function(name, block) {
810
809
  * @return {boolean} True if the name is legal.
811
810
  * @private
812
811
  */
813
- Blockly.Trigger.isLegalName_ = function(name, workspace, opt_exclude) {
812
+ Blockly.Trigger.isLegalName_ = function (name, workspace, opt_exclude) {
814
813
  if (name === 'schedule') {
815
814
  return false;
816
815
  }
@@ -843,7 +842,7 @@ Blockly.Trigger.rename = function (name) {
843
842
  };
844
843
 
845
844
  Blockly.Blocks['schedule_create'] = {
846
- init: function() {
845
+ init: function () {
847
846
  const nameField = new Blockly.FieldTextInput(
848
847
  Blockly.Trigger.findLegalName('schedule', this),
849
848
  Blockly.Trigger.rename);
@@ -919,7 +918,7 @@ Blockly.Trigger.blocks['schedule_clear'] =
919
918
  '</block>';
920
919
 
921
920
  Blockly.Blocks['schedule_clear'] = {
922
- init: function() {
921
+ init: function () {
923
922
  this.appendDummyInput('NAME')
924
923
  .appendField(Blockly.Translate('schedule_clear'))
925
924
  .appendField(new Blockly.FieldDropdown(function () {
@@ -935,7 +934,7 @@ Blockly.Blocks['schedule_clear'] = {
935
934
  },
936
935
  };
937
936
 
938
- Blockly.JavaScript.forBlock['schedule_clear'] = function(block) {
937
+ Blockly.JavaScript.forBlock['schedule_clear'] = function (block) {
939
938
  const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME'));
940
939
  return `(() => { if (${name}) { clearSchedule(${name}); ${name} = null; }})();\n`;
941
940
  };
@@ -948,7 +947,7 @@ Blockly.Trigger.blocks['field_cron'] =
948
947
 
949
948
  Blockly.Blocks['field_cron'] = {
950
949
  // Checkbox.
951
- init: function() {
950
+ init: function () {
952
951
  this.appendDummyInput()
953
952
  .appendField(Blockly.Translate('field_cron_CRON'));
954
953
 
@@ -962,7 +961,7 @@ Blockly.Blocks['field_cron'] = {
962
961
  },
963
962
  };
964
963
 
965
- Blockly.JavaScript.forBlock['field_cron'] = function(block) {
964
+ Blockly.JavaScript.forBlock['field_cron'] = function (block) {
966
965
  const cron = block.getFieldValue('CRON');
967
966
 
968
967
  return [`'${cron}'`, Blockly.JavaScript.ORDER_ATOMIC];
@@ -1003,7 +1002,7 @@ Blockly.Trigger.blocks['cron_builder'] =
1003
1002
 
1004
1003
  Blockly.Blocks['cron_builder'] = {
1005
1004
  // Checkbox.
1006
- init: function() {
1005
+ init: function () {
1007
1006
  this.appendDummyInput()
1008
1007
  .appendField(Blockly.Translate('cron_builder_CRON'));
1009
1008
 
@@ -1112,7 +1111,7 @@ Blockly.Blocks['cron_builder'] = {
1112
1111
  this.setInputsInline(this.as_line_);
1113
1112
  this.updateShape_(this.seconds_);
1114
1113
  },
1115
- updateShape_: function(withSeconds) {
1114
+ updateShape_: function (withSeconds) {
1116
1115
  this.seconds_ = withSeconds;
1117
1116
  // Add or remove a statement Input.
1118
1117
  const inputExists = this.getInput('SECONDS');
@@ -1139,7 +1138,7 @@ Blockly.Blocks['cron_builder'] = {
1139
1138
  },
1140
1139
  };
1141
1140
 
1142
- Blockly.JavaScript.forBlock['cron_builder'] = function(block) {
1141
+ Blockly.JavaScript.forBlock['cron_builder'] = function (block) {
1143
1142
  const dow = Blockly.JavaScript.valueToCode(block, 'DOW', Blockly.JavaScript.ORDER_ATOMIC);
1144
1143
  const months = Blockly.JavaScript.valueToCode(block, 'MONTHS', Blockly.JavaScript.ORDER_ATOMIC);
1145
1144
  const days = Blockly.JavaScript.valueToCode(block, 'DAYS', Blockly.JavaScript.ORDER_ATOMIC);
@@ -1167,7 +1166,7 @@ Blockly.Trigger.blocks['onMessage'] =
1167
1166
  '</block>';
1168
1167
 
1169
1168
  Blockly.Blocks['onMessage'] = {
1170
- init: function() {
1169
+ init: function () {
1171
1170
  this.appendDummyInput('NAME')
1172
1171
  .appendField(Blockly.Translate('onMessage'));
1173
1172
 
@@ -1191,7 +1190,7 @@ Blockly.Blocks['onMessage'] = {
1191
1190
  * @param {!Blockly.Events.Abstract} e Change event.
1192
1191
  * @this Blockly.Block
1193
1192
  */
1194
- onchange: function(e) {
1193
+ onchange: function (e) {
1195
1194
  let legal = true;
1196
1195
 
1197
1196
  // Is the block nested in a trigger?
@@ -1238,7 +1237,7 @@ Blockly.Trigger.blocks['onFile'] =
1238
1237
  '</block>';
1239
1238
 
1240
1239
  Blockly.Blocks['onFile'] = {
1241
- init: function() {
1240
+ init: function () {
1242
1241
  this.appendValueInput('OID')
1243
1242
  .appendField('📁 ' + Blockly.Translate('onFile'))
1244
1243
  .setCheck(null);
@@ -1267,7 +1266,7 @@ Blockly.Blocks['onFile'] = {
1267
1266
  * @param {!Blockly.Events.Abstract} e Change event.
1268
1267
  * @this Blockly.Block
1269
1268
  */
1270
- onchange: function(e) {
1269
+ onchange: function (e) {
1271
1270
  let legal = true;
1272
1271
 
1273
1272
  // Is the block nested in a trigger?
@@ -1321,7 +1320,7 @@ Blockly.Blocks['onFile_data'] = {
1321
1320
  * Block for conditionally returning a value from a procedure.
1322
1321
  * @this Blockly.Block
1323
1322
  */
1324
- init: function() {
1323
+ init: function () {
1325
1324
  this.appendDummyInput()
1326
1325
  .appendField('📁');
1327
1326
 
@@ -1347,7 +1346,7 @@ Blockly.Blocks['onFile_data'] = {
1347
1346
  * @param {!Blockly.Events.Abstract} e Change event.
1348
1347
  * @this Blockly.Block
1349
1348
  */
1350
- onchange: function(e) {
1349
+ onchange: function (e) {
1351
1350
  let legal = false;
1352
1351
  // Is the block nested in a trigger?
1353
1352
  let block = this;
@@ -1372,7 +1371,7 @@ Blockly.Blocks['onFile_data'] = {
1372
1371
  */
1373
1372
  FUNCTION_TYPES: ['onFile'],
1374
1373
  };
1375
- Blockly.JavaScript.forBlock['onFile_data'] = function(block) {
1374
+ Blockly.JavaScript.forBlock['onFile_data'] = function (block) {
1376
1375
  const attr = block.getFieldValue('ATTR');
1377
1376
 
1378
1377
  if (attr === 'TEMP_FILE_PATH') {
@@ -1398,7 +1397,7 @@ Blockly.Trigger.blocks['offFile'] =
1398
1397
  '</block>';
1399
1398
 
1400
1399
  Blockly.Blocks['offFile'] = {
1401
- init: function() {
1400
+ init: function () {
1402
1401
  this.appendValueInput('OID')
1403
1402
  .appendField('📁 ' + Blockly.Translate('offFile'))
1404
1403
  .setCheck(null);
@@ -1440,7 +1439,7 @@ Blockly.Trigger.blocks['onLog'] =
1440
1439
  '</block>';
1441
1440
 
1442
1441
  Blockly.Blocks['onLog'] = {
1443
- init: function() {
1442
+ init: function () {
1444
1443
  this.appendDummyInput('TEXT')
1445
1444
  .appendField('💬 ' + Blockly.Translate('onLog'));
1446
1445
 
@@ -1451,7 +1450,7 @@ Blockly.Blocks['onLog'] = {
1451
1450
  [Blockly.Translate('loglevel_warn'), 'warn'],
1452
1451
  [Blockly.Translate('loglevel_info'), 'info'],
1453
1452
  [Blockly.Translate('loglevel_debug'), 'debug'],
1454
- [Blockly.Translate('loglevel_all'), '*'],
1453
+ [Blockly.Translate('loglevel_all'), '*'],
1455
1454
  ]), 'Severity');
1456
1455
 
1457
1456
  this.appendStatementInput('STATEMENT')
@@ -1470,7 +1469,7 @@ Blockly.Blocks['onLog'] = {
1470
1469
  * @param {!Blockly.Events.Abstract} e Change event.
1471
1470
  * @this Blockly.Block
1472
1471
  */
1473
- onchange: function(e) {
1472
+ onchange: function (e) {
1474
1473
  let legal = true;
1475
1474
 
1476
1475
  // Is the block nested in a trigger?
@@ -1510,7 +1509,7 @@ Blockly.Blocks['onLog_data'] = {
1510
1509
  * Block for conditionally returning a value from a procedure.
1511
1510
  * @this Blockly.Block
1512
1511
  */
1513
- init: function() {
1512
+ init: function () {
1514
1513
  this.appendDummyInput()
1515
1514
  .appendField('💬 ');
1516
1515
 
@@ -1534,7 +1533,7 @@ Blockly.Blocks['onLog_data'] = {
1534
1533
  * @param {!Blockly.Events.Abstract} e Change event.
1535
1534
  * @this Blockly.Block
1536
1535
  */
1537
- onchange: function(e) {
1536
+ onchange: function (e) {
1538
1537
  let legal = false;
1539
1538
  // Is the block nested in a trigger?
1540
1539
  let block = this;
@@ -1559,7 +1558,7 @@ Blockly.Blocks['onLog_data'] = {
1559
1558
  */
1560
1559
  FUNCTION_TYPES: ['onLog'],
1561
1560
  };
1562
- Blockly.JavaScript.forBlock['onLog_data'] = function(block) {
1561
+ Blockly.JavaScript.forBlock['onLog_data'] = function (block) {
1563
1562
  const attr = block.getFieldValue('ATTR');
1564
1563
 
1565
1564
  return [attr, Blockly.JavaScript.ORDER_ATOMIC];
@@ -2,7 +2,6 @@
2
2
 
3
3
  if (typeof goog !== 'undefined') {
4
4
  goog.provide('Blockly.FieldCRON');
5
-
6
5
  goog.require('Blockly.Field');
7
6
  goog.require('Blockly.Msg');
8
7
  goog.require('goog.asserts');
@@ -2,7 +2,6 @@
2
2
 
3
3
  if (typeof goog !== 'undefined') {
4
4
  goog.provide('Blockly.FieldOID');
5
-
6
5
  goog.require('Blockly.Field');
7
6
  goog.require('Blockly.Msg');
8
7
  goog.require('goog.asserts');
@@ -2,7 +2,6 @@
2
2
 
3
3
  if (typeof goog !== 'undefined') {
4
4
  goog.provide('Blockly.FieldScript');
5
-
6
5
  goog.require('Blockly.Field');
7
6
  goog.require('Blockly.Msg');
8
7
  goog.require('goog.asserts');
@@ -10,18 +9,14 @@ if (typeof goog !== 'undefined') {
10
9
  goog.require('goog.userAgent');
11
10
  }
12
11
 
13
- Blockly.b64EncodeUnicode = function(text) {
14
- return btoa(encodeURIComponent(text).replace(/%([0-9A-F]{2})/g, function (match, p) {
15
- return String.fromCharCode(parseInt(p, 16));
16
- }));
12
+ Blockly.b64EncodeUnicode = function (text) {
13
+ return btoa(encodeURIComponent(text).replace(/%([0-9A-F]{2})/g, (match, p) => String.fromCharCode(parseInt(p, 16))));
17
14
  };
18
15
 
19
16
  // Decoding base64 ⇢ UTF8
20
- Blockly.b64DecodeUnicode = function(text) {
17
+ Blockly.b64DecodeUnicode = function (text) {
21
18
  try {
22
- return decodeURIComponent(Array.prototype.map.call(atob(text), function (s) {
23
- return '%' + ('00' + s.charCodeAt(0).toString(16)).slice(-2);
24
- }).join(''));
19
+ return decodeURIComponent(Array.prototype.map.call(atob(text), (s) => '%' + ('00' + s.charCodeAt(0).toString(16)).slice(-2)).join(''));
25
20
  } catch (e) {
26
21
  // old style
27
22
  return atob(text || '');