diff --git a/src/public/google-blockly/own/blocks_timeout.js b/src/public/google-blockly/own/blocks_timeout.js index 058530ce..1183c226 100644 --- a/src/public/google-blockly/own/blocks_timeout.js +++ b/src/public/google-blockly/own/blocks_timeout.js @@ -170,7 +170,7 @@ Blockly.Blocks['timeouts_settimeout'] = { }; Blockly.JavaScript.forBlock['timeouts_settimeout'] = function(block) { - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); const unit = block.getFieldValue('UNIT'); let delay = block.getFieldValue('DELAY'); @@ -234,7 +234,7 @@ Blockly.Blocks['timeouts_settimeout_variable'] = { Blockly.JavaScript.forBlock['timeouts_settimeout_variable'] = function(block) { const delay = Blockly.JavaScript.valueToCode(block, 'DELAY_MS', Blockly.JavaScript.ORDER_ATOMIC); - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT'); return `${name} = setTimeout(async () => {\n` + @@ -292,7 +292,7 @@ Blockly.Blocks['timeouts_cleartimeout'] = { }; Blockly.JavaScript.forBlock['timeouts_cleartimeout'] = function(block) { - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); return `(() => { if (${name}) { clearTimeout(${name}); ${name} = null; }})();\n`; }; @@ -319,7 +319,7 @@ Blockly.Blocks['timeouts_gettimeout'] = { }; Blockly.JavaScript.forBlock['timeouts_gettimeout'] = function(block) { - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); return [name, Blockly.JavaScript.ORDER_ATOMIC]; }; @@ -370,7 +370,7 @@ Blockly.Blocks['timeouts_setinterval'] = { }; Blockly.JavaScript.forBlock['timeouts_setinterval'] = function(block) { - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); const unit = block.getFieldValue('UNIT'); let delay = block.getFieldValue('INTERVAL'); @@ -435,7 +435,7 @@ Blockly.Blocks['timeouts_setinterval_variable'] = { Blockly.JavaScript.forBlock['timeouts_setinterval_variable'] = function(block) { const delay = Blockly.JavaScript.valueToCode(block, 'INTERVAL_MS', Blockly.JavaScript.ORDER_ATOMIC); - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT'); return `${name} = setInterval(async () => {\n` + @@ -492,7 +492,7 @@ Blockly.Blocks['timeouts_clearinterval'] = { }; Blockly.JavaScript.forBlock['timeouts_clearinterval'] = function(block) { - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); return `(() => { if (${name}) { clearInterval(${name}); ${name} = null; }})();\n`; }; @@ -520,7 +520,7 @@ Blockly.Blocks['timeouts_getinterval'] = { }; Blockly.JavaScript.forBlock['timeouts_getinterval'] = function(block) { - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); return [name, Blockly.JavaScript.ORDER_ATOMIC]; }; diff --git a/src/public/google-blockly/own/blocks_trigger.js b/src/public/google-blockly/own/blocks_trigger.js index 22e45c0f..43d0814d 100644 --- a/src/public/google-blockly/own/blocks_trigger.js +++ b/src/public/google-blockly/own/blocks_trigger.js @@ -878,7 +878,7 @@ Blockly.Blocks['schedule_create'] = { }; Blockly.JavaScript.forBlock['schedule_create'] = function (block) { - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); const schedule = Blockly.JavaScript.valueToCode(block, 'SCHEDULE', Blockly.JavaScript.ORDER_ATOMIC); const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT'); @@ -936,7 +936,7 @@ Blockly.Blocks['schedule_clear'] = { }; Blockly.JavaScript.forBlock['schedule_clear'] = function(block) { - const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME')); + const name = Blockly.JavaScript.nameDB_.safeName(block.getFieldValue('NAME')); return `(() => { if (${name}) { clearSchedule(${name}); ${name} = null; }})();\n`; }; diff --git a/src/public/google-blockly/own/field_cron.js b/src/public/google-blockly/own/field_cron.js index a256d077..3bbd5d6e 100644 --- a/src/public/google-blockly/own/field_cron.js +++ b/src/public/google-blockly/own/field_cron.js @@ -95,7 +95,7 @@ class FieldCRON extends Blockly.Field { * @private */ resizeEditor_() { - const div = Blockly.WidgetDiv.DIV; + const div = Blockly.WidgetDiv.getDiv(); const bBox = this.fieldGroup_.getBBox(); div.style.width = bBox.width * this.workspace_.scale + 'px'; div.style.height = bBox.height * this.workspace_.scale + 'px'; @@ -109,7 +109,7 @@ class FieldCRON extends Blockly.Field { } // Shift by a few pixels to line up exactly. xy.y += 1; - if (goog.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) { + if (goog.userAgent.GECKO && Blockly.WidgetDiv.getDiv().style.top) { // Firefox mis-reports the location of the border by a pixel // once the WidgetDiv is moved into position. xy.x -= 1; @@ -146,7 +146,7 @@ class FieldCRON extends Blockly.Field { Blockly.FieldCRON.htmlInput_ = null; // Delete style properties. - const style = Blockly.WidgetDiv.DIV.style; + const style = Blockly.WidgetDiv.getDiv().style; style.width = 'auto'; style.height = 'auto'; style.fontSize = ''; diff --git a/src/public/google-blockly/own/field_oid.js b/src/public/google-blockly/own/field_oid.js index 286bbd67..0129cca9 100644 --- a/src/public/google-blockly/own/field_oid.js +++ b/src/public/google-blockly/own/field_oid.js @@ -157,7 +157,7 @@ class FieldOID extends Blockly.Field { * @private */ resizeEditor_() { - const div = Blockly.WidgetDiv.DIV; + const div = Blockly.WidgetDiv.getDiv(); const bBox = this.fieldGroup_.getBBox(); div.style.width = bBox.width * this.workspace_.scale + 'px'; div.style.height = bBox.height * this.workspace_.scale + 'px'; @@ -171,7 +171,7 @@ class FieldOID extends Blockly.Field { } // Shift by a few pixels to line up exactly. xy.y += 1; - if (goog.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) { + if (goog.userAgent.GECKO && Blockly.WidgetDiv.getDiv().style.top) { // Firefox mis-reports the location of the border by a pixel // once the WidgetDiv is moved into position. xy.x -= 1; @@ -207,7 +207,7 @@ class FieldOID extends Blockly.Field { this.htmlInput_ = null; // Delete style properties. - const style = Blockly.WidgetDiv.DIV.style; + const style = Blockly.WidgetDiv.getDiv().style; style.width = 'auto'; style.height = 'auto'; style.fontSize = ''; diff --git a/src/public/google-blockly/own/field_script.js b/src/public/google-blockly/own/field_script.js index 45dc5119..c01a78ac 100644 --- a/src/public/google-blockly/own/field_script.js +++ b/src/public/google-blockly/own/field_script.js @@ -151,7 +151,7 @@ class FieldScript extends Blockly.Field { Blockly.FieldScript.htmlInput_ = null; // Delete style properties. - const style = Blockly.WidgetDiv.DIV.style; + const style = Blockly.WidgetDiv.getDiv().style; style.width = 'auto'; style.height = 'auto'; style.fontSize = '';