diff --git a/blockly/ini/blocks/get.js b/blockly/ini/blocks/get.js index 03f33e9af2da4654da64f64c79b8712729bb81d3..34d4105b1b013f3850dad8edfcd65308c164acdd 100644 --- a/blockly/ini/blocks/get.js +++ b/blockly/ini/blocks/get.js @@ -184,6 +184,63 @@ Blockly.Blocks['mail'] = { this.setHelpUrl("https://www.w3school.com.cn/php/php_ref_mail.asp"); } }; +Blockly.Blocks['width'] = { + init: function() { + this.appendValueInput("width_value") + .setCheck(null) + .appendField("设置元素宽度为"); + this.setInputsInline(true); + this.setPreviousStatement(true, null); + this.setNextStatement(true, null); + this.setColour(230); + this.setTooltip(""); + this.setHelpUrl(""); + } +}; + +Blockly.Blocks['height'] = { + init: function() { + this.appendValueInput("height_value") + .setCheck(null) + .appendField("设置元素高度为"); + this.setInputsInline(true); + this.setPreviousStatement(true, null); + this.setNextStatement(true, null); + this.setColour(230); + this.setTooltip(""); + this.setHelpUrl(""); + } +}; + +Blockly.Blocks['point'] = { + init: function() { + this.appendValueInput("value") + .setCheck(null) + .appendField("父元素的"); + this.appendDummyInput() + .appendField("%"); + this.setInputsInline(true); + this.setOutput(true, null); + this.setColour(230); + this.setTooltip(""); + this.setHelpUrl(""); + } +}; + +Blockly.Blocks['px'] = { + init: function() { + this.appendValueInput("value") + .setCheck(null) + .appendField("像素 "); + this.appendDummyInput() + .appendField("px"); + this.setInputsInline(true); + this.setOutput(true, null); + this.setColour(230); + this.setTooltip(""); + this.setHelpUrl(""); + } +}; Blockly.Blocks['css'] = { init: function() { diff --git a/blockly/ini/blocks/get.js.js b/blockly/ini/blocks/get.js.js index fece3e8445eb87d4881152acaeee32d69482706d..838b9e9c88e6d9099f7a87ef1189d929e2ddb8bc 100644 --- a/blockly/ini/blocks/get.js.js +++ b/blockly/ini/blocks/get.js.js @@ -228,4 +228,34 @@ Blockly.PHP['shuxing'] = function(block) { var value_value = l.slice(1, l.length - 1); var code = text_name + ':' + value_value + ';
'; return code; +}; + +Blockly.PHP['width'] = function(block) { + var value_width_value = Blockly.PHP.valueToCode(block, 'width_value', Blockly.PHP.ORDER_ATOMIC); + // TODO: Assemble PHP into code variable. + var code = '...;\n'; + return code; +}; + +Blockly.PHP['height'] = function(block) { + var value_height_value = Blockly.PHP.valueToCode(block, 'height_value', Blockly.PHP.ORDER_ATOMIC); + // TODO: Assemble PHP into code variable. + var code = '...;\n'; + return code; +}; + +Blockly.PHP['point'] = function(block) { + var value_value = Blockly.PHP.valueToCode(block, 'value', Blockly.PHP.ORDER_ATOMIC); + // TODO: Assemble PHP into code variable. + var code = '...'; + // TODO: Change ORDER_NONE to the correct strength. + return [code, Blockly.PHP.ORDER_NONE]; +}; + +Blockly.PHP['px'] = function(block) { + var value_value = Blockly.PHP.valueToCode(block, 'value', Blockly.PHP.ORDER_ATOMIC); + // TODO: Assemble PHP into code variable. + var code = '...'; + // TODO: Change ORDER_NONE to the correct strength. + return [code, Blockly.PHP.ORDER_NONE]; }; \ No newline at end of file diff --git a/blockly/ini/workspace/library.xml b/blockly/ini/workspace/library.xml index 319e13fea3abfb68940a699b9955814c76cac1a1..b51ea3e5509ca60722b0cd26ae8109338a4378eb 100644 --- a/blockly/ini/workspace/library.xml +++ b/blockly/ini/workspace/library.xml @@ -1551,4 +1551,182 @@ 230 + + + width + INT + BOTH + + + width_value + LEFT + + + 设置元素宽度为 + + + + + + + + + + + + + + + + + + + + + + + + + + + 230 + + + + + height + INT + BOTH + + + height_value + LEFT + + + 设置元素高度为 + + + + + + + + + + + + + + + + + + + + + + + + + + + 230 + + + + + point + INT + LEFT + + + value + LEFT + + + 父元素的 + + + + + + + + LEFT + + + % + + + + + + + + + + + + + + + + + + + + + + + 230 + + + + + px + INT + LEFT + + + value + LEFT + + + 像素 + + + + + + + + LEFT + + + px + + + + + + + + + + + + + + + + + + + + + + + 230 + + \ No newline at end of file diff --git a/blockly/ini/workspace/toolbox.xml b/blockly/ini/workspace/toolbox.xml index a8144062cff18ea596f2ec4b5d8c8e66570174be..b91d79d54d79752bb435bf84761e1f2ed3aa252a 100644 --- a/blockly/ini/workspace/toolbox.xml +++ b/blockly/ini/workspace/toolbox.xml @@ -401,6 +401,10 @@ …… + + + + diff --git a/ide.html b/ide.html index fdd5df359d0ab526fb448bbed54d831f4d7fc342..13a4f9da52bb2570a760050ed37ac478401fac52 100644 --- a/ide.html +++ b/ide.html @@ -417,6 +417,10 @@ …… + + + + @@ -764,6 +768,63 @@ Blockly.Blocks['mail'] = { this.setHelpUrl("https://www.w3school.com.cn/php/php_ref_mail.asp"); } }; +Blockly.Blocks['width'] = { + init: function() { + this.appendValueInput("width_value") + .setCheck(null) + .appendField("设置元素宽度为"); + this.setInputsInline(true); + this.setPreviousStatement(true, null); + this.setNextStatement(true, null); + this.setColour(230); + this.setTooltip(""); + this.setHelpUrl(""); + } +}; + +Blockly.Blocks['height'] = { + init: function() { + this.appendValueInput("height_value") + .setCheck(null) + .appendField("设置元素高度为"); + this.setInputsInline(true); + this.setPreviousStatement(true, null); + this.setNextStatement(true, null); + this.setColour(230); + this.setTooltip(""); + this.setHelpUrl(""); + } +}; + +Blockly.Blocks['point'] = { + init: function() { + this.appendValueInput("value") + .setCheck(null) + .appendField("父元素的"); + this.appendDummyInput() + .appendField("%"); + this.setInputsInline(true); + this.setOutput(true, null); + this.setColour(230); + this.setTooltip(""); + this.setHelpUrl(""); + } +}; + +Blockly.Blocks['px'] = { + init: function() { + this.appendValueInput("value") + .setCheck(null) + .appendField("像素 "); + this.appendDummyInput() + .appendField("px"); + this.setInputsInline(true); + this.setOutput(true, null); + this.setColour(230); + this.setTooltip(""); + this.setHelpUrl(""); + } +}; Blockly.Blocks['css'] = { init: function() { @@ -1257,6 +1318,36 @@ Blockly.PHP['shuxing'] = function(block) { var value_value = l.slice(1, l.length - 1); var code = text_name + ':' + value_value + ';
'; return code; +}; + +Blockly.PHP['width'] = function(block) { + var value_width_value = Blockly.PHP.valueToCode(block, 'width_value', Blockly.PHP.ORDER_ATOMIC); + // TODO: Assemble PHP into code variable. + var code = '...;\n'; + return code; +}; + +Blockly.PHP['height'] = function(block) { + var value_height_value = Blockly.PHP.valueToCode(block, 'height_value', Blockly.PHP.ORDER_ATOMIC); + // TODO: Assemble PHP into code variable. + var code = '...;\n'; + return code; +}; + +Blockly.PHP['point'] = function(block) { + var value_value = Blockly.PHP.valueToCode(block, 'value', Blockly.PHP.ORDER_ATOMIC); + // TODO: Assemble PHP into code variable. + var code = '...'; + // TODO: Change ORDER_NONE to the correct strength. + return [code, Blockly.PHP.ORDER_NONE]; +}; + +Blockly.PHP['px'] = function(block) { + var value_value = Blockly.PHP.valueToCode(block, 'value', Blockly.PHP.ORDER_ATOMIC); + // TODO: Assemble PHP into code variable. + var code = '...'; + // TODO: Change ORDER_NONE to the correct strength. + return [code, Blockly.PHP.ORDER_NONE]; };