Auto-push
1782
blockly/blockly_compressed.js
Normal file
166
blockly/blocks_compressed.js
Normal file
@ -0,0 +1,166 @@
|
||||
// Do not edit this file; automatically generated by build.py.
|
||||
'use strict';
|
||||
|
||||
|
||||
// Copyright 2012 Google Inc. Apache License 2.0
|
||||
Blockly.Blocks.colour={};Blockly.Blocks.colour.HUE=20;Blockly.Blocks.colour_picker={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",colour:Blockly.Blocks.colour.HUE,helpUrl:Blockly.Msg.COLOUR_PICKER_HELPURL});var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.COLOUR_PICKER_TOOLTIP})}};
|
||||
Blockly.Blocks.colour_random={init:function(){this.jsonInit({message0:Blockly.Msg.COLOUR_RANDOM_TITLE,output:"Colour",colour:Blockly.Blocks.colour.HUE,tooltip:Blockly.Msg.COLOUR_RANDOM_TOOLTIP,helpUrl:Blockly.Msg.COLOUR_RANDOM_HELPURL})}};
|
||||
Blockly.Blocks.colour_rgb={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_RGB_HELPURL);this.setColour(Blockly.Blocks.colour.HUE);this.appendValueInput("RED").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_TITLE).appendField(Blockly.Msg.COLOUR_RGB_RED);this.appendValueInput("GREEN").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_GREEN);this.appendValueInput("BLUE").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_BLUE);
|
||||
this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_RGB_TOOLTIP)}};
|
||||
Blockly.Blocks.colour_blend={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_BLEND_HELPURL);this.setColour(Blockly.Blocks.colour.HUE);this.appendValueInput("COLOUR1").setCheck("Colour").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_TITLE).appendField(Blockly.Msg.COLOUR_BLEND_COLOUR1);this.appendValueInput("COLOUR2").setCheck("Colour").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_COLOUR2);this.appendValueInput("RATIO").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_RATIO);
|
||||
this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_BLEND_TOOLTIP)}};Blockly.Blocks.lists={};Blockly.Blocks.lists.HUE=260;Blockly.Blocks.lists_create_empty={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_CREATE_EMPTY_TITLE,output:"Array",colour:Blockly.Blocks.lists.HUE,tooltip:Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP,helpUrl:Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL})}};
|
||||
Blockly.Blocks.lists_create_with={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setMutator(new Blockly.Mutator(["lists_create_with_item"]));this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),
|
||||
10);this.updateShape_()},decompose:function(a){var b=a.newBlock("lists_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("lists_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;
|
||||
c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+b)},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;){var c=this.getInput("ADD"+b);a.valueConnection_=c&&c.connection.targetConnection;b++;a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||
|
||||
this.appendDummyInput("EMPTY").appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);for(var a=0;a<this.itemCount_;a++)if(!this.getInput("ADD"+a)){var b=this.appendValueInput("ADD"+a);0==a&&b.appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH)}for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
|
||||
Blockly.Blocks.lists_create_with_container={init:function(){this.setColour(Blockly.Blocks.lists.HUE);this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP);this.contextMenu=!1}};
|
||||
Blockly.Blocks.lists_create_with_item={init:function(){this.setColour(Blockly.Blocks.lists.HUE);this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);this.contextMenu=!1}};
|
||||
Blockly.Blocks.lists_repeat={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_REPEAT_TITLE,args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",colour:Blockly.Blocks.lists.HUE,tooltip:Blockly.Msg.LISTS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.LISTS_REPEAT_HELPURL})}};
|
||||
Blockly.Blocks.lists_length={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_LENGTH_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",colour:Blockly.Blocks.lists.HUE,tooltip:Blockly.Msg.LISTS_LENGTH_TOOLTIP,helpUrl:Blockly.Msg.LISTS_LENGTH_HELPURL})}};
|
||||
Blockly.Blocks.lists_isEmpty={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_ISEMPTY_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",colour:Blockly.Blocks.lists.HUE,tooltip:Blockly.Msg.LISTS_ISEMPTY_TOOLTIP,helpUrl:Blockly.Msg.LISTS_ISEMPTY_HELPURL})}};
|
||||
Blockly.Blocks.lists_indexOf={init:function(){var a=[[Blockly.Msg.LISTS_INDEX_OF_FIRST,"FIRST"],[Blockly.Msg.LISTS_INDEX_OF_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_INDEX_OF_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.setOutput(!0,"Number");this.appendValueInput("VALUE").setCheck("Array").appendField(Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST);this.appendValueInput("FIND").appendField(new Blockly.FieldDropdown(a),"END");this.setInputsInline(!0);this.setTooltip(function(){return Blockly.Msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",
|
||||
this.workspace.options.oneBasedIndex?"0":"-1")})}};
|
||||
Blockly.Blocks.lists_getIndex={init:function(){var a=[[Blockly.Msg.LISTS_GET_INDEX_GET,"GET"],[Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[Blockly.Msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[Blockly.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[Blockly.Msg.LISTS_GET_INDEX_LAST,"LAST"],[Blockly.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.setHelpUrl(Blockly.Msg.LISTS_GET_INDEX_HELPURL);
|
||||
this.setColour(Blockly.Blocks.lists.HUE);a=new Blockly.FieldDropdown(a,function(a){this.sourceBlock_.updateStatement_("REMOVE"==a)});this.appendValueInput("VALUE").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST);this.appendDummyInput().appendField(a,"MODE").appendField("","SPACE");this.appendDummyInput("AT");Blockly.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_INDEX_TAIL);this.setInputsInline(!0);this.setOutput(!0);this.updateAt_(!0);
|
||||
var b=this;this.setTooltip(function(){var a=b.getFieldValue("MODE"),e=b.getFieldValue("WHERE"),d="";switch(a+" "+e){case "GET FROM_START":case "GET FROM_END":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case "GET FIRST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case "GET LAST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case "GET RANDOM":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case "GET_REMOVE FROM_START":case "GET_REMOVE FROM_END":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;
|
||||
break;case "GET_REMOVE FIRST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case "GET_REMOVE LAST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case "GET_REMOVE RANDOM":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case "REMOVE FROM_START":case "REMOVE FROM_END":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case "REMOVE FIRST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case "REMOVE LAST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;
|
||||
break;case "REMOVE RANDOM":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}if("FROM_START"==e||"FROM_END"==e)d+=" "+("FROM_START"==e?Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP:Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",b.workspace.options.oneBasedIndex?"#1":"#0");return d})},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("statement",!this.outputConnection);var b=this.getInput("AT").type==Blockly.INPUT_VALUE;a.setAttribute("at",b);return a},domToMutation:function(a){var b=
|
||||
"true"==a.getAttribute("statement");this.updateStatement_(b);a="false"!=a.getAttribute("at");this.updateAt_(a)},updateStatement_:function(a){a!=!this.outputConnection&&(this.unplug(!0,!0),a?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&
|
||||
this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var b=new Blockly.FieldDropdown(this.WHERE_OPTIONS,function(b){var c="FROM_START"==b||"FROM_END"==b;if(c!=a){var d=this.sourceBlock_;d.updateAt_(c);d.setFieldValue(b,"WHERE");return null}});this.getInput("AT").appendField(b,"WHERE");Blockly.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};
|
||||
Blockly.Blocks.lists_setIndex={init:function(){var a=[[Blockly.Msg.LISTS_SET_INDEX_SET,"SET"],[Blockly.Msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[Blockly.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[Blockly.Msg.LISTS_GET_INDEX_LAST,"LAST"],[Blockly.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.setHelpUrl(Blockly.Msg.LISTS_SET_INDEX_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST);
|
||||
this.appendDummyInput().appendField(new Blockly.FieldDropdown(a),"MODE").appendField("","SPACE");this.appendDummyInput("AT");this.appendValueInput("TO").appendField(Blockly.Msg.LISTS_SET_INDEX_INPUT_TO);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.LISTS_SET_INDEX_TOOLTIP);this.updateAt_(!0);var b=this;this.setTooltip(function(){var a=b.getFieldValue("MODE"),e=b.getFieldValue("WHERE"),d="";switch(a+" "+e){case "SET FROM_START":case "SET FROM_END":d=
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case "SET FIRST":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case "SET LAST":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case "SET RANDOM":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case "INSERT FROM_START":case "INSERT FROM_END":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case "INSERT FIRST":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case "INSERT LAST":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;
|
||||
break;case "INSERT RANDOM":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}if("FROM_START"==e||"FROM_END"==e)d+=" "+Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",b.workspace.options.oneBasedIndex?"#1":"#0");return d})},mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT").type==Blockly.INPUT_VALUE;a.setAttribute("at",b);return a},domToMutation:function(a){a="false"!=a.getAttribute("at");this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT");
|
||||
this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var b=new Blockly.FieldDropdown(this.WHERE_OPTIONS,function(b){var c="FROM_START"==b||"FROM_END"==b;if(c!=a){var d=this.sourceBlock_;d.updateAt_(c);d.setFieldValue(b,"WHERE");return null}});this.moveInputBefore("AT","TO");this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL",
|
||||
"TO");this.getInput("AT").appendField(b,"WHERE")}};
|
||||
Blockly.Blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_GET_SUBLIST_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);
|
||||
this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);this.appendDummyInput("AT1");this.appendDummyInput("AT2");Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_SUBLIST_TAIL);this.setInputsInline(!0);this.setOutput(!0,"Array");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT1").type==
|
||||
Blockly.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type==Blockly.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):
|
||||
this.appendDummyInput("AT"+a);var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var d="FROM_START"==c||"FROM_END"==c;if(d!=b){var e=this.sourceBlock_;e.updateAt_(a,d);e.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"));Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};
|
||||
Blockly.Blocks.lists_sort={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_SORT_TITLE,args0:[{type:"field_dropdown",name:"TYPE",options:[[Blockly.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[Blockly.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[Blockly.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[Blockly.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",colour:Blockly.Blocks.lists.HUE,
|
||||
tooltip:Blockly.Msg.LISTS_SORT_TOOLTIP,helpUrl:Blockly.Msg.LISTS_SORT_HELPURL})}};
|
||||
Blockly.Blocks.lists_split={init:function(){var a=this,b=new Blockly.FieldDropdown([[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(b){a.updateType_(b)});this.setHelpUrl(Blockly.Msg.LISTS_SPLIT_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.appendValueInput("INPUT").setCheck("String").appendField(b,"MODE");this.appendValueInput("DELIM").setCheck("String").appendField(Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER);this.setInputsInline(!0);
|
||||
this.setOutput(!0,"Array");this.setTooltip(function(){var b=a.getFieldValue("MODE");if("SPLIT"==b)return Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT;if("JOIN"==b)return Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN;throw"Unknown mode: "+b;})},updateType_:function(a){"SPLIT"==a?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("mode",
|
||||
this.getFieldValue("MODE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("mode"))}};Blockly.Blocks.logic={};Blockly.Blocks.logic.HUE=210;
|
||||
Blockly.Blocks.controls_if={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.appendValueInput("IF0").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);this.appendStatementInput("DO0").appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setMutator(new Blockly.Mutator(["controls_if_elseif","controls_if_else"]));var a=this;this.setTooltip(function(){if(a.elseifCount_||a.elseCount_){if(!a.elseifCount_&&
|
||||
a.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_2;if(a.elseifCount_&&!a.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_3;if(a.elseifCount_&&a.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_4}else return Blockly.Msg.CONTROLS_IF_TOOLTIP_1;return""});this.elseCount_=this.elseifCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var a=document.createElement("mutation");this.elseifCount_&&a.setAttribute("elseif",this.elseifCount_);this.elseCount_&&a.setAttribute("else",
|
||||
1);return a},domToMutation:function(a){this.elseifCount_=parseInt(a.getAttribute("elseif"),10)||0;this.elseCount_=parseInt(a.getAttribute("else"),10)||0;this.updateShape_()},decompose:function(a){var b=a.newBlock("controls_if_if");b.initSvg();for(var c=b.nextConnection,e=1;e<=this.elseifCount_;e++){var d=a.newBlock("controls_if_elseif");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}this.elseCount_&&(a=a.newBlock("controls_if_else"),a.initSvg(),c.connect(a.previousConnection));return b},
|
||||
compose:function(a){var b=a.nextConnection.targetBlock();this.elseCount_=this.elseifCount_=0;a=[null];for(var c=[null],e=null;b;){switch(b.type){case "controls_if_elseif":this.elseifCount_++;a.push(b.valueConnection_);c.push(b.statementConnection_);break;case "controls_if_else":this.elseCount_++;e=b.statementConnection_;break;default:throw"Unknown block type.";}b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateShape_();for(b=1;b<=this.elseifCount_;b++)Blockly.Mutator.reconnect(a[b],this,
|
||||
"IF"+b),Blockly.Mutator.reconnect(c[b],this,"DO"+b);Blockly.Mutator.reconnect(e,this,"ELSE")},saveConnections:function(a){a=a.nextConnection.targetBlock();for(var b=1;a;){switch(a.type){case "controls_if_elseif":var c=this.getInput("IF"+b),e=this.getInput("DO"+b);a.valueConnection_=c&&c.connection.targetConnection;a.statementConnection_=e&&e.connection.targetConnection;b++;break;case "controls_if_else":e=this.getInput("ELSE");a.statementConnection_=e&&e.connection.targetConnection;break;default:throw"Unknown block type.";
|
||||
}a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var a=1;this.getInput("IF"+a);)this.removeInput("IF"+a),this.removeInput("DO"+a),a++;for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+a).appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSE)}};
|
||||
Blockly.Blocks.controls_if_if={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_IF_TITLE_IF);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.CONTROLS_IF_IF_TOOLTIP);this.contextMenu=!1}};
|
||||
Blockly.Blocks.controls_if_elseif={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP);this.contextMenu=!1}};
|
||||
Blockly.Blocks.controls_if_else={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE);this.setPreviousStatement(!0);this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP);this.contextMenu=!1}};
|
||||
Blockly.Blocks.controls_ifelse={init:function(){this.jsonInit({message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],message2:"%{BKY_CONTROLS_IF_MSG_ELSE} %1",args2:[{type:"input_statement",name:"ELSE"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.logic.HUE,tooltip:Blockly.Msg.CONTROLS_IF_TOOLTIP_2,helpUrl:Blockly.Msg.CONTROLS_IF_HELPURL})}};
|
||||
Blockly.Blocks.logic_compare={init:function(){var a=[["=","EQ"],["\u2260","NEQ"],["\u200f<\u200f","LT"],["\u200f\u2264\u200f","LTE"],["\u200f>\u200f","GT"],["\u200f\u2265\u200f","GTE"]],b=[["=","EQ"],["\u2260","NEQ"],["<","LT"],["\u2264","LTE"],[">","GT"],["\u2265","GTE"]],a=this.RTL?a:b;this.setHelpUrl(Blockly.Msg.LOGIC_COMPARE_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.appendValueInput("A");this.appendValueInput("B").appendField(new Blockly.FieldDropdown(a),
|
||||
"OP");this.setInputsInline(!0);var c=this;this.setTooltip(function(){var a=c.getFieldValue("OP");return{EQ:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[a]});this.prevBlocks_=[null,null]},onchange:function(a){var b=this.getInputTargetBlock("A"),c=this.getInputTargetBlock("B");if(b&&c&&!b.outputConnection.checkType_(c.outputConnection)){Blockly.Events.setGroup(a.group);
|
||||
for(a=0;a<this.prevBlocks_.length;a++){var e=this.prevBlocks_[a];if(e===b||e===c)e.unplug(),e.bumpNeighbours_()}Blockly.Events.setGroup(!1)}this.prevBlocks_[0]=b;this.prevBlocks_[1]=c}};
|
||||
Blockly.Blocks.logic_operation={init:function(){var a=[[Blockly.Msg.LOGIC_OPERATION_AND,"AND"],[Blockly.Msg.LOGIC_OPERATION_OR,"OR"]];this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.appendValueInput("A").setCheck("Boolean");this.appendValueInput("B").setCheck("Boolean").appendField(new Blockly.FieldDropdown(a),"OP");this.setInputsInline(!0);var b=this;this.setTooltip(function(){var a=b.getFieldValue("OP");return{AND:Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND,
|
||||
OR:Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR}[a]})}};Blockly.Blocks.logic_negate={init:function(){this.jsonInit({message0:Blockly.Msg.LOGIC_NEGATE_TITLE,args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",colour:Blockly.Blocks.logic.HUE,tooltip:Blockly.Msg.LOGIC_NEGATE_TOOLTIP,helpUrl:Blockly.Msg.LOGIC_NEGATE_HELPURL})}};
|
||||
Blockly.Blocks.logic_boolean={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[[Blockly.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Blockly.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]]}],output:"Boolean",colour:Blockly.Blocks.logic.HUE,tooltip:Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP,helpUrl:Blockly.Msg.LOGIC_BOOLEAN_HELPURL})}};
|
||||
Blockly.Blocks.logic_null={init:function(){this.jsonInit({message0:Blockly.Msg.LOGIC_NULL,output:null,colour:Blockly.Blocks.logic.HUE,tooltip:Blockly.Msg.LOGIC_NULL_TOOLTIP,helpUrl:Blockly.Msg.LOGIC_NULL_HELPURL})}};
|
||||
Blockly.Blocks.logic_ternary={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_TERNARY_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.appendValueInput("IF").setCheck("Boolean").appendField(Blockly.Msg.LOGIC_TERNARY_CONDITION);this.appendValueInput("THEN").appendField(Blockly.Msg.LOGIC_TERNARY_IF_TRUE);this.appendValueInput("ELSE").appendField(Blockly.Msg.LOGIC_TERNARY_IF_FALSE);this.setOutput(!0);this.setTooltip(Blockly.Msg.LOGIC_TERNARY_TOOLTIP);this.prevParentConnection_=null},onchange:function(a){var b=
|
||||
this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),e=this.outputConnection.targetConnection;if((b||c)&&e)for(var d=0;2>d;d++){var f=1==d?b:c;f&&!f.outputConnection.checkType_(e)&&(Blockly.Events.setGroup(a.group),e===this.prevParentConnection_?(this.unplug(),e.getSourceBlock().bumpNeighbours_()):(f.unplug(),f.bumpNeighbours_()),Blockly.Events.setGroup(!1))}this.prevParentConnection_=e}};Blockly.Blocks.loops={};Blockly.Blocks.loops.HUE=120;Blockly.Blocks.controls_repeat_ext={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES",check:"Number"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,tooltip:Blockly.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.CONTROLS_REPEAT_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)}};
|
||||
Blockly.Blocks.controls_repeat={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,tooltip:Blockly.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.CONTROLS_REPEAT_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)}};
|
||||
Blockly.Blocks.controls_whileUntil={init:function(){var a=[[Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]];this.setHelpUrl(Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL);this.setColour(Blockly.Blocks.loops.HUE);this.appendValueInput("BOOL").setCheck("Boolean").appendField(new Blockly.FieldDropdown(a),"MODE");this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO);this.setPreviousStatement(!0);this.setNextStatement(!0);
|
||||
var b=this;this.setTooltip(function(){var a=b.getFieldValue("MODE");return{WHILE:Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[a]})}};
|
||||
Blockly.Blocks.controls_for={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_FOR_TITLE,args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,helpUrl:Blockly.Msg.CONTROLS_FOR_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOR_INPUT_DO);
|
||||
var a=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",a.getFieldValue("VAR"))})},customContextMenu:function(a){if(!this.isCollapsed()){var b={enabled:!0},c=this.getFieldValue("VAR");b.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c);c=goog.dom.createDom("field",null,c);c.setAttribute("name","VAR");c=goog.dom.createDom("block",null,c);c.setAttribute("type","variables_get");b.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(b)}}};
|
||||
Blockly.Blocks.controls_forEach={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_FOREACH_TITLE,args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,helpUrl:Blockly.Msg.CONTROLS_FOREACH_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_DO);var a=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOREACH_TOOLTIP.replace("%1",
|
||||
a.getFieldValue("VAR"))})},customContextMenu:Blockly.Blocks.controls_for.customContextMenu};
|
||||
Blockly.Blocks.controls_flow_statements={init:function(){var a=[[Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];this.setHelpUrl(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL);this.setColour(Blockly.Blocks.loops.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown(a),"FLOW");this.setPreviousStatement(!0);var b=this;this.setTooltip(function(){var a=b.getFieldValue("FLOW");return{BREAK:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,
|
||||
CONTINUE:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[a]})},onchange:function(a){if(this.workspace.isDragging&&!this.workspace.isDragging()){a=!1;var b=this;do{if(-1!=this.LOOP_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);a?(this.setWarningText(null),this.isInFlyout||this.setDisabled(!1)):(this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setDisabled(!0))}},LOOP_TYPES:["controls_repeat","controls_repeat_ext",
|
||||
"controls_forEach","controls_for","controls_whileUntil"]};Blockly.Blocks.math={};Blockly.Blocks.math.HUE=230;Blockly.Blocks.math_number={init:function(){this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.appendDummyInput().appendField(new Blockly.FieldNumber("0"),"NUM");this.setOutput(!0,"Number");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.MATH_NUMBER_TOOLTIP})}};
|
||||
Blockly.Blocks.math_number_minmax={init:function(){this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.appendDummyInput("slider").appendField(new Blockly.FieldSlider("0"),"NUM");this.setOutput(!0,"Number");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.MATH_NUMBER_TOOLTIP})},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("min",this.getInput("slider").fieldRow[0].min_);
|
||||
a.setAttribute("max",this.getInput("slider").fieldRow[0].max_);return a},domToMutation:function(a){var b=a.getAttribute("min");a=a.getAttribute("max");this.getInput("slider").fieldRow[0].setConstraints(b,a)}};
|
||||
Blockly.Blocks.math_arithmetic={init:function(){this.jsonInit({message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[[Blockly.Msg.MATH_ADDITION_SYMBOL,"ADD"],[Blockly.Msg.MATH_SUBTRACTION_SYMBOL,"MINUS"],[Blockly.Msg.MATH_MULTIPLICATION_SYMBOL,"MULTIPLY"],[Blockly.Msg.MATH_DIVISION_SYMBOL,"DIVIDE"],[Blockly.Msg.MATH_POWER_SYMBOL,"POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",colour:Blockly.Blocks.math.HUE,
|
||||
helpUrl:Blockly.Msg.MATH_ARITHMETIC_HELPURL});var a=this;this.setTooltip(function(){var b=a.getFieldValue("OP");return{ADD:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[b]})}};
|
||||
Blockly.Blocks.math_single={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[Blockly.Msg.MATH_SINGLE_OP_ROOT,"ROOT"],[Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE,"ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_SINGLE_HELPURL});var a=this;this.setTooltip(function(){var b=a.getFieldValue("OP");return{ROOT:Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT,
|
||||
ABS:Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS,NEG:Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG,LN:Blockly.Msg.MATH_SINGLE_TOOLTIP_LN,LOG10:Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10,EXP:Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP,POW10:Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10}[b]})}};
|
||||
Blockly.Blocks.math_single_grid={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdowngrid",name:"OP",options:[[Blockly.Msg.MATH_SINGLE_OP_ROOT,"ROOT"],[Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE,"ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_SINGLE_HELPURL});var a=this;this.setTooltip(function(){var b=a.getFieldValue("OP");return{ROOT:Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT,
|
||||
ABS:Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS,NEG:Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG,LN:Blockly.Msg.MATH_SINGLE_TOOLTIP_LN,LOG10:Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10,EXP:Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP,POW10:Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10}[b]})}};
|
||||
Blockly.Blocks.math_single_grid_img={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdowngrid",name:"OP",options:[[{alt:Blockly.Msg.MATH_SINGLE_OP_ROOT,width:32,height:32,src:"../media/sprites.png"},"ROOT"],[{alt:Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE,width:32,height:32,src:"../media/sprites.png"},"ABS"],[{alt:"-",width:32,height:32,src:"../media/sprites.png"},"NEG"],[{alt:"ln",width:32,height:32,src:"../media/sprites.png"},"LN"],[{alt:"log10",width:32,height:32,src:"../media/sprites.png"},
|
||||
"LOG10"],[{alt:"e^",width:32,height:32,src:"../media/sprites.png"},"EXP"],[{alt:"10^",width:32,height:32,src:"../media/sprites.png"},"POW10"]],colour:Blockly.Blocks.math.HUE,params:{columns:4,width:300,itemColour:"white",tooltips:!0,tooltipsXOffset:15,tooltipsYOffset:-10}},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_SINGLE_HELPURL});var a=this;this.setTooltip(function(){var b=a.getFieldValue("OP");return{ROOT:Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT,
|
||||
ABS:Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS,NEG:Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG,LN:Blockly.Msg.MATH_SINGLE_TOOLTIP_LN,LOG10:Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10,EXP:Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP,POW10:Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10}[b]})}};
|
||||
Blockly.Blocks.math_trig={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[Blockly.Msg.MATH_TRIG_SIN,"SIN"],[Blockly.Msg.MATH_TRIG_COS,"COS"],[Blockly.Msg.MATH_TRIG_TAN,"TAN"],[Blockly.Msg.MATH_TRIG_ASIN,"ASIN"],[Blockly.Msg.MATH_TRIG_ACOS,"ACOS"],[Blockly.Msg.MATH_TRIG_ATAN,"ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_TRIG_HELPURL});var a=this;this.setTooltip(function(){var b=
|
||||
a.getFieldValue("OP");return{SIN:Blockly.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Blockly.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Blockly.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN}[b]})}};
|
||||
Blockly.Blocks.math_constant={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["\u03c0","PI"],["e","E"],["\u03c6","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(\u00bd)","SQRT1_2"],["\u221e","INFINITY"]]}],output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_CONSTANT_TOOLTIP,helpUrl:Blockly.Msg.MATH_CONSTANT_HELPURL})}};
|
||||
Blockly.Blocks.math_number_property={init:function(){var a=[[Blockly.Msg.MATH_IS_EVEN,"EVEN"],[Blockly.Msg.MATH_IS_ODD,"ODD"],[Blockly.Msg.MATH_IS_PRIME,"PRIME"],[Blockly.Msg.MATH_IS_WHOLE,"WHOLE"],[Blockly.Msg.MATH_IS_POSITIVE,"POSITIVE"],[Blockly.Msg.MATH_IS_NEGATIVE,"NEGATIVE"],[Blockly.Msg.MATH_IS_DIVISIBLE_BY,"DIVISIBLE_BY"]];this.setColour(Blockly.Blocks.math.HUE);this.appendValueInput("NUMBER_TO_CHECK").setCheck("Number");a=new Blockly.FieldDropdown(a,function(a){this.sourceBlock_.updateShape_("DIVISIBLE_BY"==
|
||||
a)});this.appendDummyInput().appendField(a,"PROPERTY");this.setInputsInline(!0);this.setOutput(!0,"Boolean");this.setTooltip(Blockly.Msg.MATH_IS_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),b="DIVISIBLE_BY"==this.getFieldValue("PROPERTY");a.setAttribute("divisor_input",b);return a},domToMutation:function(a){a="true"==a.getAttribute("divisor_input");this.updateShape_(a)},updateShape_:function(a){var b=this.getInput("DIVISOR");a?b||this.appendValueInput("DIVISOR").setCheck("Number"):
|
||||
b&&this.removeInput("DIVISOR")}};Blockly.Blocks.math_change={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_CHANGE_TITLE,args0:[{type:"field_variable",name:"VAR",variable:Blockly.Msg.MATH_CHANGE_TITLE_ITEM},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.variables.HUE,helpUrl:Blockly.Msg.MATH_CHANGE_HELPURL});var a=this;this.setTooltip(function(){return Blockly.Msg.MATH_CHANGE_TOOLTIP.replace("%1",a.getFieldValue("VAR"))})}};
|
||||
Blockly.Blocks.math_round={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[Blockly.Msg.MATH_ROUND_OPERATOR_ROUND,"ROUND"],[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP,"ROUNDUP"],[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN,"ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_ROUND_TOOLTIP,helpUrl:Blockly.Msg.MATH_ROUND_HELPURL})}};
|
||||
Blockly.Blocks.math_on_list={init:function(){var a=[[Blockly.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"],[Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM,"RANDOM"]],b=this;this.setHelpUrl(Blockly.Msg.MATH_ONLIST_HELPURL);this.setColour(Blockly.Blocks.math.HUE);
|
||||
this.setOutput(!0,"Number");a=new Blockly.FieldDropdown(a,function(a){b.updateType_(a)});this.appendValueInput("LIST").setCheck("Array").appendField(a,"OP");this.setTooltip(function(){var a=b.getFieldValue("OP");return{SUM:Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM,MIN:Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN,MAX:Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX,AVERAGE:Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE,MEDIAN:Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN,MODE:Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE,STD_DEV:Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV,
|
||||
RANDOM:Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM}[a]})},updateType_:function(a){"MODE"==a?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("op",this.getFieldValue("OP"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("op"))}};
|
||||
Blockly.Blocks.math_modulo={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_MODULO_TITLE,args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_MODULO_TOOLTIP,helpUrl:Blockly.Msg.MATH_MODULO_HELPURL})}};
|
||||
Blockly.Blocks.math_constrain={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_CONSTRAIN_TITLE,args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_CONSTRAIN_TOOLTIP,helpUrl:Blockly.Msg.MATH_CONSTRAIN_HELPURL})}};
|
||||
Blockly.Blocks.math_random_int={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_RANDOM_INT_TITLE,args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_RANDOM_INT_TOOLTIP,helpUrl:Blockly.Msg.MATH_RANDOM_INT_HELPURL})}};
|
||||
Blockly.Blocks.math_random_float={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM,output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP,helpUrl:Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL})}};/*
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
Use of this source code is governed by the MIT License.
|
||||
see the license.txt file for details
|
||||
*/
|
||||
Blockly.Blocks.music={};Blockly.Blocks.music.HUE=150;Blockly.Blocks.note_picker={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_note",name:"NOTE",note:"262",colour:Blockly.Blocks.music.HUE}],output:"Number",colour:Blockly.Blocks.music.HUE,helpUrl:Blockly.Msg.NOTE_PICKER_HELPURL});var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.NOTE_PICKER_TOOLTIP})}};Blockly.Blocks.procedures={};Blockly.Blocks.procedures.HUE=290;
|
||||
Blockly.Blocks.procedures_defnoreturn={init:function(){var a=new Blockly.FieldTextInput("",Blockly.Procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT&&
|
||||
this.setCommentText(Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT);this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.arguments_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK",
|
||||
"RETURN")):this.removeInput("STACK",!0),this.hasStatements_=a)},updateParams_:function(){for(var a=!1,b={},c=0;c<this.arguments_.length;c++){if(b["arg_"+this.arguments_[c].toLowerCase()]){a=!0;break}b["arg_"+this.arguments_[c].toLowerCase()]=!0}a?this.setWarningText(Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING):this.setWarningText(null);a="";this.arguments_.length&&(a=Blockly.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", "));Blockly.Events.disable();try{this.setFieldValue(a,"PARAMS")}finally{Blockly.Events.enable()}},
|
||||
mutationToDom:function(a){var b=document.createElement("mutation");a&&b.setAttribute("name",this.getFieldValue("NAME"));for(var c=0;c<this.arguments_.length;c++){var e=document.createElement("arg");e.setAttribute("name",this.arguments_[c]);a&&this.paramIds_&&e.setAttribute("paramId",this.paramIds_[c]);b.appendChild(e)}this.hasStatements_||b.setAttribute("statements","false");return b},domToMutation:function(a){this.arguments_=[];for(var b=0,c;c=a.childNodes[b];b++)"arg"==c.nodeName.toLowerCase()&&
|
||||
this.arguments_.push(c.getAttribute("name"));this.updateParams_();Blockly.Procedures.mutateCallers(this);this.setStatements_("false"!==a.getAttribute("statements"))},decompose:function(a){var b=a.newBlock("procedures_mutatorcontainer");b.initSvg();this.getInput("RETURN")?b.setFieldValue(this.hasStatements_?"TRUE":"FALSE","STATEMENTS"):b.getInput("STATEMENT_INPUT").setVisible(!1);for(var c=b.getInput("STACK").connection,e=0;e<this.arguments_.length;e++){var d=a.newBlock("procedures_mutatorarg");d.initSvg();
|
||||
d.setFieldValue(this.arguments_[e],"NAME");d.oldLocation=e;c.connect(d.previousConnection);c=d.nextConnection}Blockly.Procedures.mutateCallers(this);return b},compose:function(a){this.arguments_=[];this.paramIds_=[];for(var b=a.getInputTargetBlock("STACK");b;)this.arguments_.push(b.getFieldValue("NAME")),this.paramIds_.push(b.id),b=b.nextConnection&&b.nextConnection.targetBlock();this.updateParams_();Blockly.Procedures.mutateCallers(this);a=a.getFieldValue("STATEMENTS");if(null!==a&&(a="TRUE"==a,
|
||||
this.hasStatements_!=a))if(a)this.setStatements_(!0),Blockly.Mutator.reconnect(this.statementConnection_,this,"STACK"),this.statementConnection_=null;else{a=this.getInput("STACK").connection;if(this.statementConnection_=a.targetConnection)a=a.targetBlock(),a.unplug(),a.bumpNeighbours_();this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},renameVar:function(a,b){for(var c=!1,e=0;e<this.arguments_.length;e++)Blockly.Names.equals(a,
|
||||
this.arguments_[e])&&(this.arguments_[e]=b,c=!0);if(c&&(this.updateParams_(),this.mutator.isVisible()))for(var c=this.mutator.workspace_.getAllBlocks(),e=0,d;d=c[e];e++)"procedures_mutatorarg"==d.type&&Blockly.Names.equals(a,d.getFieldValue("NAME"))&&d.setFieldValue(b,"NAME")},customContextMenu:function(a){var b={enabled:!0},c=this.getFieldValue("NAME");b.text=Blockly.Msg.PROCEDURES_CREATE_DO.replace("%1",c);var e=goog.dom.createDom("mutation");e.setAttribute("name",c);for(var d=0;d<this.arguments_.length;d++)c=
|
||||
goog.dom.createDom("arg"),c.setAttribute("name",this.arguments_[d]),e.appendChild(c);e=goog.dom.createDom("block",null,e);e.setAttribute("type",this.callType_);b.callback=Blockly.ContextMenu.callbackFactory(this,e);a.push(b);if(!this.isCollapsed())for(d=0;d<this.arguments_.length;d++)b={enabled:!0},c=this.arguments_[d],b.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c),e=goog.dom.createDom("field",null,c),e.setAttribute("name","VAR"),e=goog.dom.createDom("block",null,e),e.setAttribute("type",
|
||||
"variables_get"),b.callback=Blockly.ContextMenu.callbackFactory(this,e),a.push(b)},callType_:"procedures_callnoreturn"};
|
||||
Blockly.Blocks.procedures_defreturn={init:function(){var a=new Blockly.FieldTextInput("",Blockly.Procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFRETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.appendValueInput("RETURN").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&
|
||||
this.workspace.options.parentWorkspace.options.comments)&&Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT);this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL);this.arguments_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:Blockly.Blocks.procedures_defnoreturn.setStatements_,updateParams_:Blockly.Blocks.procedures_defnoreturn.updateParams_,
|
||||
mutationToDom:Blockly.Blocks.procedures_defnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_defnoreturn.domToMutation,decompose:Blockly.Blocks.procedures_defnoreturn.decompose,compose:Blockly.Blocks.procedures_defnoreturn.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Blockly.Blocks.procedures_defnoreturn.getVars,renameVar:Blockly.Blocks.procedures_defnoreturn.renameVar,customContextMenu:Blockly.Blocks.procedures_defnoreturn.customContextMenu,
|
||||
callType_:"procedures_callreturn"};Blockly.Blocks.procedures_mutatorcontainer={init:function(){this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE);this.appendStatementInput("STACK");this.appendDummyInput("STATEMENT_INPUT").appendField(Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new Blockly.FieldCheckbox("TRUE"),"STATEMENTS");this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP);this.contextMenu=!1}};
|
||||
Blockly.Blocks.procedures_mutatorarg={init:function(){var a=new Blockly.FieldTextInput("x",this.validator_);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORARG_TITLE).appendField(a,"NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP);this.contextMenu=!1;a.onFinishEditing_=this.createNewVar_;a.onFinishEditing_("x")},validator_:function(a){return(a=a.replace(/[\s\xa0]+/g,
|
||||
" ").replace(/^ | $/g,""))||null},createNewVar_:function(a){var b=this.sourceBlock_;b&&b.workspace&&b.workspace.options&&b.workspace.options.parentWorkspace&&b.workspace.options.parentWorkspace.createVariable(a)}};
|
||||
Blockly.Blocks.procedures_callnoreturn={init:function(){this.appendDummyInput("TOPROW").appendField(this.id,"NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.procedures.HUE);this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL);this.arguments_=[];this.quarkConnections_={};this.quarkIds_=null},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(a,b){Blockly.Names.equals(a,this.getProcedureCall())&&(this.setFieldValue(b,
|
||||
"NAME"),this.setTooltip((this.outputConnection?Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP:Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",b)))},setProcedureParameters_:function(a,b){var c=Blockly.Procedures.getDefinition(this.getProcedureCall(),this.workspace),e=c&&c.mutator&&c.mutator.isVisible();e||(this.quarkConnections_={},this.quarkIds_=null);if(b)if(goog.array.equals(this.arguments_,a))this.quarkIds_=b;else{if(b.length!=a.length)throw"Error: paramNames and paramIds must be the same length.";
|
||||
this.setCollapsed(!1);this.quarkIds_||(this.quarkConnections_={},a.join("\n")==this.arguments_.join("\n")?this.quarkIds_=b:this.quarkIds_=[]);c=this.rendered;this.rendered=!1;for(var d=0;d<this.arguments_.length;d++){var f=this.getInput("ARG"+d);f&&(f=f.connection.targetConnection,this.quarkConnections_[this.quarkIds_[d]]=f,e&&f&&-1==b.indexOf(this.quarkIds_[d])&&(f.disconnect(),f.getSourceBlock().bumpNeighbours_()))}this.arguments_=[].concat(a);this.updateShape_();if(this.quarkIds_=b)for(d=0;d<this.arguments_.length;d++)e=
|
||||
this.quarkIds_[d],e in this.quarkConnections_&&(f=this.quarkConnections_[e],Blockly.Mutator.reconnect(f,this,"ARG"+d)||delete this.quarkConnections_[e]);(this.rendered=c)&&this.render()}},updateShape_:function(){for(var a=0;a<this.arguments_.length;a++){var b=this.getField("ARGNAME"+a);if(b){Blockly.Events.disable();try{b.setValue(this.arguments_[a])}finally{Blockly.Events.enable()}}else b=new Blockly.FieldLabel(this.arguments_[a]),this.appendValueInput("ARG"+a).setAlign(Blockly.ALIGN_RIGHT).appendField(b,
|
||||
"ARGNAME"+a).init()}for(;this.getInput("ARG"+a);)this.removeInput("ARG"+a),a++;if(a=this.getInput("TOPROW"))this.arguments_.length?this.getField("WITH")||(a.appendField(Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),a.init()):this.getField("WITH")&&a.removeField("WITH")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("name",this.getProcedureCall());for(var b=0;b<this.arguments_.length;b++){var c=document.createElement("arg");c.setAttribute("name",this.arguments_[b]);
|
||||
a.appendChild(c)}return a},domToMutation:function(a){var b=a.getAttribute("name");this.renameProcedure(this.getProcedureCall(),b);for(var b=[],c=[],e=0,d;d=a.childNodes[e];e++)"arg"==d.nodeName.toLowerCase()&&(b.push(d.getAttribute("name")),c.push(d.getAttribute("paramId")));this.setProcedureParameters_(b,c)},renameVar:function(a,b){for(var c=0;c<this.arguments_.length;c++)Blockly.Names.equals(a,this.arguments_[c])&&(this.arguments_[c]=b,this.getField("ARGNAME"+c).setValue(b))},onchange:function(a){if(this.workspace&&
|
||||
!this.workspace.isFlyout)if(a.type==Blockly.Events.CREATE&&-1!=a.ids.indexOf(this.id)){var b=this.getProcedureCall(),b=Blockly.Procedures.getDefinition(b,this.workspace);!b||b.type==this.defType_&&JSON.stringify(b.arguments_)==JSON.stringify(this.arguments_)||(b=null);if(!b){Blockly.Events.setGroup(a.group);a=goog.dom.createDom("xml");b=goog.dom.createDom("block");b.setAttribute("type",this.defType_);var c=this.getRelativeToSurfaceXY(),e=c.y+2*Blockly.SNAP_RADIUS;b.setAttribute("x",c.x+Blockly.SNAP_RADIUS*
|
||||
(this.RTL?-1:1));b.setAttribute("y",e);c=this.mutationToDom();b.appendChild(c);c=goog.dom.createDom("field");c.setAttribute("name","NAME");c.appendChild(document.createTextNode(this.getProcedureCall()));b.appendChild(c);a.appendChild(b);Blockly.Xml.domToWorkspace(a,this.workspace);Blockly.Events.setGroup(!1)}}else a.type==Blockly.Events.DELETE&&(b=this.getProcedureCall(),b=Blockly.Procedures.getDefinition(b,this.workspace),b||(Blockly.Events.setGroup(a.group),this.dispose(!0,!1),Blockly.Events.setGroup(!1)))},
|
||||
customContextMenu:function(a){var b={enabled:!0};b.text=Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF;var c=this.getProcedureCall(),e=this.workspace;b.callback=function(){var a=Blockly.Procedures.getDefinition(c,e);a&&a.select()};a.push(b)},defType_:"procedures_defnoreturn"};
|
||||
Blockly.Blocks.procedures_callreturn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME");this.setOutput(!0);this.setColour(Blockly.Blocks.procedures.HUE);this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL);this.arguments_=[];this.quarkConnections_={};this.quarkIds_=null},getProcedureCall:Blockly.Blocks.procedures_callnoreturn.getProcedureCall,renameProcedure:Blockly.Blocks.procedures_callnoreturn.renameProcedure,setProcedureParameters_:Blockly.Blocks.procedures_callnoreturn.setProcedureParameters_,
|
||||
updateShape_:Blockly.Blocks.procedures_callnoreturn.updateShape_,mutationToDom:Blockly.Blocks.procedures_callnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_callnoreturn.domToMutation,renameVar:Blockly.Blocks.procedures_callnoreturn.renameVar,onchange:Blockly.Blocks.procedures_callnoreturn.onchange,customContextMenu:Blockly.Blocks.procedures_callnoreturn.customContextMenu,defType_:"procedures_defreturn"};
|
||||
Blockly.Blocks.procedures_ifreturn={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_IFRETURN_HELPURL);this.hasReturnValue_=!0},
|
||||
mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("value",Number(this.hasReturnValue_));return a},domToMutation:function(a){this.hasReturnValue_=1==a.getAttribute("value");this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(a){if(this.workspace.isDragging&&!this.workspace.isDragging()){a=!1;var b=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);
|
||||
a?("procedures_defnoreturn"==b.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=b.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null),this.isInFlyout||this.setDisabled(!1)):(this.setWarningText(Blockly.Msg.PROCEDURES_IFRETURN_WARNING),
|
||||
this.isInFlyout||this.getInheritedDisabled()||this.setDisabled(!0))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]};Blockly.Blocks.texts={};Blockly.Blocks.texts.HUE=160;
|
||||
Blockly.Blocks.text={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_TEXT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.TEXT_TEXT_TOOLTIP})},newQuote_:function(a){return new Blockly.FieldImage(a==this.RTL?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==":
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",12,12,'"')}};
|
||||
Blockly.Blocks.text_join={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_JOIN_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.itemCount_=2;this.updateShape_();this.setOutput(!0,"String");this.setMutator(new Blockly.Mutator(["text_create_join_item"]));this.setTooltip(Blockly.Msg.TEXT_JOIN_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);
|
||||
this.updateShape_()},decompose:function(a){var b=a.newBlock("text_create_join_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("text_create_join_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;
|
||||
c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+b)},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;){var c=this.getInput("ADD"+b);a.valueConnection_=c&&c.connection.targetConnection;b++;a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||
|
||||
this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var a=0;a<this.itemCount_;a++)if(!this.getInput("ADD"+a)){var b=this.appendValueInput("ADD"+a);0==a&&b.appendField(Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH)}for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++},newQuote_:Blockly.Blocks.text.newQuote_};
|
||||
Blockly.Blocks.text_create_join_container={init:function(){this.setColour(Blockly.Blocks.texts.HUE);this.appendDummyInput().appendField(Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN);this.appendStatementInput("STACK");this.setTooltip(Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP);this.contextMenu=!1}};
|
||||
Blockly.Blocks.text_create_join_item={init:function(){this.setColour(Blockly.Blocks.texts.HUE);this.appendDummyInput().appendField(Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP);this.contextMenu=!1}};
|
||||
Blockly.Blocks.text_append={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_APPEND_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendValueInput("TEXT").appendField(Blockly.Msg.TEXT_APPEND_TO).appendField(new Blockly.FieldVariable(Blockly.Msg.TEXT_APPEND_VARIABLE),"VAR").appendField(Blockly.Msg.TEXT_APPEND_APPENDTEXT);this.setPreviousStatement(!0);this.setNextStatement(!0);var a=this;this.setTooltip(function(){return Blockly.Msg.TEXT_APPEND_TOOLTIP.replace("%1",a.getFieldValue("VAR"))})}};
|
||||
Blockly.Blocks.text_length={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_LENGTH_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.Msg.TEXT_LENGTH_TOOLTIP,helpUrl:Blockly.Msg.TEXT_LENGTH_HELPURL})}};
|
||||
Blockly.Blocks.text_isEmpty={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_ISEMPTY_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.Msg.TEXT_ISEMPTY_TOOLTIP,helpUrl:Blockly.Msg.TEXT_ISEMPTY_HELPURL})}};
|
||||
Blockly.Blocks.text_indexOf={init:function(){var a=[[Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST,"FIRST"],[Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.TEXT_INDEXOF_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.setOutput(!0,"Number");this.appendValueInput("VALUE").setCheck("String").appendField(Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT);this.appendValueInput("FIND").setCheck("String").appendField(new Blockly.FieldDropdown(a),"END");Blockly.Msg.TEXT_INDEXOF_TAIL&&this.appendDummyInput().appendField(Blockly.Msg.TEXT_INDEXOF_TAIL);
|
||||
this.setInputsInline(!0);var b=this;this.setTooltip(function(){return Blockly.Msg.TEXT_INDEXOF_TOOLTIP.replace("%1",b.workspace.options.oneBasedIndex?"0":"-1")})}};
|
||||
Blockly.Blocks.text_charAt={init:function(){this.WHERE_OPTIONS=[[Blockly.Msg.TEXT_CHARAT_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_CHARAT_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_CHARAT_FIRST,"FIRST"],[Blockly.Msg.TEXT_CHARAT_LAST,"LAST"],[Blockly.Msg.TEXT_CHARAT_RANDOM,"RANDOM"]];this.setHelpUrl(Blockly.Msg.TEXT_CHARAT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.setOutput(!0,"String");this.appendValueInput("VALUE").setCheck("String").appendField(Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT);this.appendDummyInput("AT");
|
||||
this.setInputsInline(!0);this.updateAt_(!0);var a=this;this.setTooltip(function(){var b=a.getFieldValue("WHERE"),c=Blockly.Msg.TEXT_CHARAT_TOOLTIP;if("FROM_START"==b||"FROM_END"==b)c+=" "+("FROM_START"==b?Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP:Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",a.workspace.options.oneBasedIndex?"#1":"#0");return c})},mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT").type==Blockly.INPUT_VALUE;a.setAttribute("at",b);return a},
|
||||
domToMutation:function(a){a="false"!=a.getAttribute("at");this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");Blockly.Msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_CHARAT_TAIL));var b=new Blockly.FieldDropdown(this.WHERE_OPTIONS,
|
||||
function(b){var c="FROM_START"==b||"FROM_END"==b;if(c!=a){var d=this.sourceBlock_;d.updateAt_(c);d.setFieldValue(b,"WHERE");return null}});this.getInput("AT").appendField(b,"WHERE")}};
|
||||
Blockly.Blocks.text_getSubstring={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);
|
||||
this.appendValueInput("STRING").setCheck("String").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT);this.appendDummyInput("AT1");this.appendDummyInput("AT2");Blockly.Msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_TAIL);this.setInputsInline(!0);this.setOutput(!0,"String");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),
|
||||
b=this.getInput("AT1").type==Blockly.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type==Blockly.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):
|
||||
this.appendDummyInput("AT"+a);2==a&&Blockly.Msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_TAIL));var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var d="FROM_START"==c||"FROM_END"==c;if(d!=b){var e=this.sourceBlock_;e.updateAt_(a,d);e.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&this.moveInputBefore("AT1","AT2")}};
|
||||
Blockly.Blocks.text_changeCase={init:function(){var a=[[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl(Blockly.Msg.TEXT_CHANGECASE_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendValueInput("TEXT").setCheck("String").appendField(new Blockly.FieldDropdown(a),"CASE");this.setOutput(!0,"String");this.setTooltip(Blockly.Msg.TEXT_CHANGECASE_TOOLTIP)}};
|
||||
Blockly.Blocks.text_trim={init:function(){var a=[[Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl(Blockly.Msg.TEXT_TRIM_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendValueInput("TEXT").setCheck("String").appendField(new Blockly.FieldDropdown(a),"MODE");this.setOutput(!0,"String");this.setTooltip(Blockly.Msg.TEXT_TRIM_TOOLTIP)}};
|
||||
Blockly.Blocks.text_print={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.Msg.TEXT_PRINT_TOOLTIP,helpUrl:Blockly.Msg.TEXT_PRINT_HELPURL})}};
|
||||
Blockly.Blocks.text_prompt_ext={init:function(){var a=[[Blockly.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(Blockly.Msg.TEXT_PROMPT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);var b=this,a=new Blockly.FieldDropdown(a,function(a){b.updateType_(a)});this.appendValueInput("TEXT").appendField(a,"TYPE");this.setOutput(!0,"String");this.setTooltip(function(){return"TEXT"==b.getFieldValue("TYPE")?Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT:Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})},
|
||||
updateType_:function(a){this.outputConnection.setCheck("NUMBER"==a?"Number":"String")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("type",this.getFieldValue("TYPE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("type"))}};
|
||||
Blockly.Blocks.text_prompt={init:function(){var a=[[Blockly.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]],b=this;this.setHelpUrl(Blockly.Msg.TEXT_PROMPT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);a=new Blockly.FieldDropdown(a,function(a){b.updateType_(a)});this.appendDummyInput().appendField(a,"TYPE").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");this.setTooltip(function(){return"TEXT"==
|
||||
b.getFieldValue("TYPE")?Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT:Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})},newQuote_:Blockly.Blocks.text.newQuote_,updateType_:Blockly.Blocks.text_prompt_ext.updateType_,mutationToDom:Blockly.Blocks.text_prompt_ext.mutationToDom,domToMutation:Blockly.Blocks.text_prompt_ext.domToMutation};Blockly.Blocks.variables={};Blockly.Blocks.variables.HUE=330;
|
||||
Blockly.Blocks.variables_get={init:function(){this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL);this.setColour(Blockly.Blocks.variables.HUE);this.appendDummyInput().appendField(new Blockly.FieldVariable(Blockly.Msg.VARIABLES_DEFAULT_NAME),"VAR");this.setOutput(!0);this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP);this.contextMenuMsg_=Blockly.Msg.VARIABLES_GET_CREATE_SET},contextMenuType_:"variables_set",customContextMenu:function(a){var b={enabled:!0},c=this.getFieldValue("VAR");b.text=this.contextMenuMsg_.replace("%1",
|
||||
c);c=goog.dom.createDom("field",null,c);c.setAttribute("name","VAR");c=goog.dom.createDom("block",null,c);c.setAttribute("type",this.contextMenuType_);b.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(b)}};
|
||||
Blockly.Blocks.variables_set={init:function(){this.jsonInit({message0:Blockly.Msg.VARIABLES_SET,args0:[{type:"field_variable",name:"VAR",variable:Blockly.Msg.VARIABLES_DEFAULT_NAME},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.variables.HUE,tooltip:Blockly.Msg.VARIABLES_SET_TOOLTIP,helpUrl:Blockly.Msg.VARIABLES_SET_HELPURL});this.contextMenuMsg_=Blockly.Msg.VARIABLES_SET_CREATE_GET},contextMenuType_:"variables_get",customContextMenu:Blockly.Blocks.variables_get.customContextMenu};
|
BIN
blockly/media/1x1.gif
Normal file
After Width: | Height: | Size: 43 B |
BIN
blockly/media/click.mp3
Normal file
BIN
blockly/media/click.ogg
Normal file
BIN
blockly/media/click.wav
Normal file
BIN
blockly/media/delete.mp3
Normal file
BIN
blockly/media/delete.ogg
Normal file
BIN
blockly/media/delete.wav
Normal file
BIN
blockly/media/disconnect.mp3
Normal file
BIN
blockly/media/disconnect.ogg
Normal file
BIN
blockly/media/disconnect.wav
Normal file
BIN
blockly/media/handclosed.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
blockly/media/handdelete.cur
Normal file
After Width: | Height: | Size: 766 B |
BIN
blockly/media/handopen.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
blockly/media/quote0.png
Normal file
After Width: | Height: | Size: 796 B |
BIN
blockly/media/quote1.png
Normal file
After Width: | Height: | Size: 738 B |
BIN
blockly/media/sprites.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
74
blockly/media/sprites.svg
Normal file
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="96px" height="124px">
|
||||
<style type="text/css">
|
||||
#background {
|
||||
fill: none;
|
||||
}
|
||||
.arrows {
|
||||
fill: #000;
|
||||
stroke: none;
|
||||
}
|
||||
.selected>.arrows {
|
||||
fill: #fff;
|
||||
}
|
||||
.checkmark {
|
||||
fill: #000;
|
||||
font-family: sans-serif;
|
||||
font-size: 10pt;
|
||||
text-anchor: middle;
|
||||
}
|
||||
.trash {
|
||||
fill: #888;
|
||||
}
|
||||
.zoom {
|
||||
fill: none;
|
||||
stroke: #888;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
.zoom>.center {
|
||||
fill: #888;
|
||||
stroke-width: 0;
|
||||
}
|
||||
</style>
|
||||
<rect id="background" width="96" height="124" x="0" y="0" />
|
||||
|
||||
<g>
|
||||
<path class="arrows" d="M 13,1.5 13,14.5 1.74,8 z" />
|
||||
<path class="arrows" d="M 17.5,3 30.5,3 24,14.26 z" />
|
||||
<path class="arrows" d="M 35,1.5 35,14.5 46.26,8 z" />
|
||||
</g>
|
||||
<g class="selected" transform="translate(0, 16)">
|
||||
<path class="arrows" d="M 13,1.5 13,14.5 1.74,8 z" />
|
||||
<path class="arrows" d="M 17.5,3 30.5,3 24,14.26 z" />
|
||||
<path class="arrows" d="M 35,1.5 35,14.5 46.26,8 z" />
|
||||
</g>
|
||||
|
||||
<text class="checkmark" x="55.5" y="28">✓</text>
|
||||
|
||||
<g class="trash">
|
||||
<path d="M 2,41 v 6 h 42 v -6 h -10.5 l -3,-3 h -15 l -3,3 z" />
|
||||
<rect width="36" height="20" x="5" y="50" />
|
||||
<rect width="36" height="42" x="5" y="50" rx="4" ry="4" />
|
||||
</g>
|
||||
|
||||
<g class="zoom">
|
||||
<circle r="11.5" cx="16" cy="108" />
|
||||
<circle r="4.3" cx="16" cy="108" class="center" />
|
||||
<path d="m 28,108 h3" />
|
||||
<path d="m 1,108 h3" />
|
||||
<path d="m 16,120 v3" />
|
||||
<path d="m 16,93 v3" />
|
||||
</g>
|
||||
|
||||
<g class="zoom">
|
||||
<circle r="15" cx="48" cy="108" />
|
||||
<path d="m 48,101.6 v12.8" />
|
||||
<path d="m 41.6,108 h12.8" />
|
||||
</g>
|
||||
|
||||
<g class="zoom">
|
||||
<circle r="15" cx="80" cy="108" />
|
||||
<path d="m 73.6,108 h12.8" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
393
blockly/msg/js/en.js
Normal file
@ -0,0 +1,393 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.Msg.en');
|
||||
|
||||
goog.require('Blockly.Msg');
|
||||
|
||||
Blockly.Msg.ADD_COMMENT = "Add Comment";
|
||||
Blockly.Msg.CHANGE_VALUE_TITLE = "Change value:";
|
||||
Blockly.Msg.CLEAN_UP = "Clean up Blocks";
|
||||
Blockly.Msg.COLLAPSE_ALL = "Collapse Blocks";
|
||||
Blockly.Msg.COLLAPSE_BLOCK = "Collapse Block";
|
||||
Blockly.Msg.COLOUR_BLEND_COLOUR1 = "colour 1";
|
||||
Blockly.Msg.COLOUR_BLEND_COLOUR2 = "colour 2";
|
||||
Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/";
|
||||
Blockly.Msg.COLOUR_BLEND_RATIO = "ratio";
|
||||
Blockly.Msg.COLOUR_BLEND_TITLE = "blend";
|
||||
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Blends two colours together with a given ratio (0.0 - 1.0).";
|
||||
Blockly.Msg.COLOUR_PICKER_HELPURL = "https://en.wikipedia.org/wiki/Color";
|
||||
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Choose a colour from the palette.";
|
||||
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com";
|
||||
Blockly.Msg.COLOUR_RANDOM_TITLE = "random colour";
|
||||
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Choose a colour at random.";
|
||||
Blockly.Msg.COLOUR_RGB_BLUE = "blue";
|
||||
Blockly.Msg.COLOUR_RGB_GREEN = "green";
|
||||
Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html";
|
||||
Blockly.Msg.COLOUR_RGB_RED = "red";
|
||||
Blockly.Msg.COLOUR_RGB_TITLE = "colour with";
|
||||
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "break out of loop";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "continue with next iteration of loop";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Break out of the containing loop.";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Skip the rest of this loop, and continue with the next iteration.";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Warning: This block may only be used within a loop.";
|
||||
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://github.com/google/blockly/wiki/Loops#for-each";
|
||||
Blockly.Msg.CONTROLS_FOREACH_TITLE = "for each item %1 in list %2";
|
||||
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "For each item in a list, set the variable '%1' to the item, and then do some statements.";
|
||||
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with";
|
||||
Blockly.Msg.CONTROLS_FOR_TITLE = "count with %1 from %2 to %3 by %4";
|
||||
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.";
|
||||
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "Add a condition to the if block.";
|
||||
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "Add a final, catch-all condition to the if block.";
|
||||
Blockly.Msg.CONTROLS_IF_HELPURL = "https://github.com/google/blockly/wiki/IfElse";
|
||||
Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "Add, remove, or reorder sections to reconfigure this if block.";
|
||||
Blockly.Msg.CONTROLS_IF_MSG_ELSE = "else";
|
||||
Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "else if";
|
||||
Blockly.Msg.CONTROLS_IF_MSG_IF = "if";
|
||||
Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "If a value is true, then do some statements.";
|
||||
Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "If a value is true, then do the first block of statements. Otherwise, do the second block of statements.";
|
||||
Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.";
|
||||
Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.";
|
||||
Blockly.Msg.CONTROLS_REPEAT_HELPURL = "https://en.wikipedia.org/wiki/For_loop";
|
||||
Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "do";
|
||||
Blockly.Msg.CONTROLS_REPEAT_TITLE = "repeat %1 times";
|
||||
Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "Do some statements several times.";
|
||||
Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "https://github.com/google/blockly/wiki/Loops#repeat";
|
||||
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "repeat until";
|
||||
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "repeat while";
|
||||
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "While a value is false, then do some statements.";
|
||||
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "While a value is true, then do some statements.";
|
||||
Blockly.Msg.DELETE_ALL_BLOCKS = "Delete all %1 blocks?";
|
||||
Blockly.Msg.DELETE_BLOCK = "Delete Block";
|
||||
Blockly.Msg.DELETE_VARIABLE = "Delete the '%1' variable";
|
||||
Blockly.Msg.DELETE_VARIABLE_CONFIRMATION = "Delete %1 uses of the '%2' variable?";
|
||||
Blockly.Msg.DELETE_X_BLOCKS = "Delete %1 Blocks";
|
||||
Blockly.Msg.DISABLE_BLOCK = "Disable Block";
|
||||
Blockly.Msg.DUPLICATE_BLOCK = "Duplicate";
|
||||
Blockly.Msg.ENABLE_BLOCK = "Enable Block";
|
||||
Blockly.Msg.EXPAND_ALL = "Expand Blocks";
|
||||
Blockly.Msg.EXPAND_BLOCK = "Expand Block";
|
||||
Blockly.Msg.EXTERNAL_INPUTS = "External Inputs";
|
||||
Blockly.Msg.HELP = "Help";
|
||||
Blockly.Msg.INLINE_INPUTS = "Inline Inputs";
|
||||
Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
|
||||
Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "create empty list";
|
||||
Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Returns a list, of length 0, containing no data records";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "list";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Add, remove, or reorder sections to reconfigure this list block.";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "create list with";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "Add an item to the list.";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Create a list with any number of items.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_FIRST = "first";
|
||||
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# from end";
|
||||
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#";
|
||||
Blockly.Msg.LISTS_GET_INDEX_GET = "get";
|
||||
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "get and remove";
|
||||
Blockly.Msg.LISTS_GET_INDEX_LAST = "last";
|
||||
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "random";
|
||||
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "remove";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TAIL = "";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Returns the first item in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM = "Returns the item at the specified position in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Returns the last item in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Returns a random item in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Removes and returns the first item in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM = "Removes and returns the item at the specified position in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Removes and returns the last item in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Removes and returns a random item in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Removes the first item in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM = "Removes the item at the specified position in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Removes the last item in a list.";
|
||||
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Removes a random item in a list.";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "to # from end";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "to #";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "to last";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "get sub-list from first";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "get sub-list from # from end";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "get sub-list from #";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = "";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Creates a copy of the specified portion of a list.";
|
||||
Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP = "%1 is the last item.";
|
||||
Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP = "%1 is the first item.";
|
||||
Blockly.Msg.LISTS_INDEX_OF_FIRST = "find first occurrence of item";
|
||||
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";
|
||||
Blockly.Msg.LISTS_INDEX_OF_LAST = "find last occurrence of item";
|
||||
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.";
|
||||
Blockly.Msg.LISTS_INLIST = "in list";
|
||||
Blockly.Msg.LISTS_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#is-empty";
|
||||
Blockly.Msg.LISTS_ISEMPTY_TITLE = "%1 is empty";
|
||||
Blockly.Msg.LISTS_ISEMPTY_TOOLTIP = "Returns true if the list is empty.";
|
||||
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Lists#length-of";
|
||||
Blockly.Msg.LISTS_LENGTH_TITLE = "length of %1";
|
||||
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Returns the length of a list.";
|
||||
Blockly.Msg.LISTS_REPEAT_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with";
|
||||
Blockly.Msg.LISTS_REPEAT_TITLE = "create list with item %1 repeated %2 times";
|
||||
Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Creates a list consisting of the given value repeated the specified number of times.";
|
||||
Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://github.com/google/blockly/wiki/Lists#in-list--set";
|
||||
Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "as";
|
||||
Blockly.Msg.LISTS_SET_INDEX_INSERT = "insert at";
|
||||
Blockly.Msg.LISTS_SET_INDEX_SET = "set";
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Inserts the item at the start of a list.";
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM = "Inserts the item at the specified position in a list.";
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Append the item to the end of a list.";
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Inserts the item randomly in a list.";
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Sets the first item in a list.";
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM = "Sets the item at the specified position in a list.";
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Sets the last item in a list.";
|
||||
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Sets a random item in a list.";
|
||||
Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
|
||||
Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending";
|
||||
Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending";
|
||||
Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3";
|
||||
Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list.";
|
||||
Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case";
|
||||
Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric";
|
||||
Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic";
|
||||
Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";
|
||||
Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text";
|
||||
Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list";
|
||||
Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = "Join a list of texts into one text, separated by a delimiter.";
|
||||
Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = "Split text into a list of texts, breaking at each delimiter.";
|
||||
Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "with delimiter";
|
||||
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "false";
|
||||
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "https://github.com/google/blockly/wiki/Logic#values";
|
||||
Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Returns either true or false.";
|
||||
Blockly.Msg.LOGIC_BOOLEAN_TRUE = "true";
|
||||
Blockly.Msg.LOGIC_COMPARE_HELPURL = "https://en.wikipedia.org/wiki/Inequality_(mathematics)";
|
||||
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Return true if both inputs equal each other.";
|
||||
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Return true if the first input is greater than the second input.";
|
||||
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Return true if the first input is greater than or equal to the second input.";
|
||||
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Return true if the first input is smaller than the second input.";
|
||||
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Return true if the first input is smaller than or equal to the second input.";
|
||||
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Return true if both inputs are not equal to each other.";
|
||||
Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not";
|
||||
Blockly.Msg.LOGIC_NEGATE_TITLE = "not %1";
|
||||
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Returns true if the input is false. Returns false if the input is true.";
|
||||
Blockly.Msg.LOGIC_NULL = "null";
|
||||
Blockly.Msg.LOGIC_NULL_HELPURL = "https://en.wikipedia.org/wiki/Nullable_type";
|
||||
Blockly.Msg.LOGIC_NULL_TOOLTIP = "Returns null.";
|
||||
Blockly.Msg.LOGIC_OPERATION_AND = "and";
|
||||
Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations";
|
||||
Blockly.Msg.LOGIC_OPERATION_OR = "or";
|
||||
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Return true if both inputs are true.";
|
||||
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Return true if at least one of the inputs is true.";
|
||||
Blockly.Msg.LOGIC_TERNARY_CONDITION = "test";
|
||||
Blockly.Msg.LOGIC_TERNARY_HELPURL = "https://en.wikipedia.org/wiki/%3F:";
|
||||
Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "if false";
|
||||
Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "if true";
|
||||
Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.";
|
||||
Blockly.Msg.MATH_ADDITION_SYMBOL = "+";
|
||||
Blockly.Msg.MATH_ARITHMETIC_HELPURL = "https://en.wikipedia.org/wiki/Arithmetic";
|
||||
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "Return the sum of the two numbers.";
|
||||
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "Return the quotient of the two numbers.";
|
||||
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "Return the difference of the two numbers.";
|
||||
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "Return the product of the two numbers.";
|
||||
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Return the first number raised to the power of the second number.";
|
||||
Blockly.Msg.MATH_CHANGE_HELPURL = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter";
|
||||
Blockly.Msg.MATH_CHANGE_TITLE = "change %1 by %2";
|
||||
Blockly.Msg.MATH_CHANGE_TOOLTIP = "Add a number to variable '%1'.";
|
||||
Blockly.Msg.MATH_CONSTANT_HELPURL = "https://en.wikipedia.org/wiki/Mathematical_constant";
|
||||
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).";
|
||||
Blockly.Msg.MATH_CONSTRAIN_HELPURL = "https://en.wikipedia.org/wiki/Clamping_%28graphics%29";
|
||||
Blockly.Msg.MATH_CONSTRAIN_TITLE = "constrain %1 low %2 high %3";
|
||||
Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Constrain a number to be between the specified limits (inclusive).";
|
||||
Blockly.Msg.MATH_DIVISION_SYMBOL = "÷";
|
||||
Blockly.Msg.MATH_IS_DIVISIBLE_BY = "is divisible by";
|
||||
Blockly.Msg.MATH_IS_EVEN = "is even";
|
||||
Blockly.Msg.MATH_IS_NEGATIVE = "is negative";
|
||||
Blockly.Msg.MATH_IS_ODD = "is odd";
|
||||
Blockly.Msg.MATH_IS_POSITIVE = "is positive";
|
||||
Blockly.Msg.MATH_IS_PRIME = "is prime";
|
||||
Blockly.Msg.MATH_IS_TOOLTIP = "Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.";
|
||||
Blockly.Msg.MATH_IS_WHOLE = "is whole";
|
||||
Blockly.Msg.MATH_MODULO_HELPURL = "https://en.wikipedia.org/wiki/Modulo_operation";
|
||||
Blockly.Msg.MATH_MODULO_TITLE = "remainder of %1 ÷ %2";
|
||||
Blockly.Msg.MATH_MODULO_TOOLTIP = "Return the remainder from dividing the two numbers.";
|
||||
Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "×";
|
||||
Blockly.Msg.MATH_NUMBER_HELPURL = "https://en.wikipedia.org/wiki/Number";
|
||||
Blockly.Msg.MATH_NUMBER_TOOLTIP = "A number.";
|
||||
Blockly.Msg.MATH_ONLIST_HELPURL = "";
|
||||
Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "average of list";
|
||||
Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "max of list";
|
||||
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "median of list";
|
||||
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "min of list";
|
||||
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "modes of list";
|
||||
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "random item of list";
|
||||
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "standard deviation of list";
|
||||
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "sum of list";
|
||||
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Return the average (arithmetic mean) of the numeric values in the list.";
|
||||
Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Return the largest number in the list.";
|
||||
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Return the median number in the list.";
|
||||
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Return the smallest number in the list.";
|
||||
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Return a list of the most common item(s) in the list.";
|
||||
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Return a random element from the list.";
|
||||
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Return the standard deviation of the list.";
|
||||
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Return the sum of all the numbers in the list.";
|
||||
Blockly.Msg.MATH_POWER_SYMBOL = "^";
|
||||
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "https://en.wikipedia.org/wiki/Random_number_generation";
|
||||
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "random fraction";
|
||||
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).";
|
||||
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "https://en.wikipedia.org/wiki/Random_number_generation";
|
||||
Blockly.Msg.MATH_RANDOM_INT_TITLE = "random integer from %1 to %2";
|
||||
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Return a random integer between the two specified limits, inclusive.";
|
||||
Blockly.Msg.MATH_ROUND_HELPURL = "https://en.wikipedia.org/wiki/Rounding";
|
||||
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "round";
|
||||
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "round down";
|
||||
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "round up";
|
||||
Blockly.Msg.MATH_ROUND_TOOLTIP = "Round a number up or down.";
|
||||
Blockly.Msg.MATH_SINGLE_HELPURL = "https://en.wikipedia.org/wiki/Square_root";
|
||||
Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "absolute";
|
||||
Blockly.Msg.MATH_SINGLE_OP_ROOT = "square root";
|
||||
Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Return the absolute value of a number.";
|
||||
Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Return e to the power of a number.";
|
||||
Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Return the natural logarithm of a number.";
|
||||
Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Return the base 10 logarithm of a number.";
|
||||
Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Return the negation of a number.";
|
||||
Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Return 10 to the power of a number.";
|
||||
Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Return the square root of a number.";
|
||||
Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-";
|
||||
Blockly.Msg.MATH_TRIG_ACOS = "acos";
|
||||
Blockly.Msg.MATH_TRIG_ASIN = "asin";
|
||||
Blockly.Msg.MATH_TRIG_ATAN = "atan";
|
||||
Blockly.Msg.MATH_TRIG_COS = "cos";
|
||||
Blockly.Msg.MATH_TRIG_HELPURL = "https://en.wikipedia.org/wiki/Trigonometric_functions";
|
||||
Blockly.Msg.MATH_TRIG_SIN = "sin";
|
||||
Blockly.Msg.MATH_TRIG_TAN = "tan";
|
||||
Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Return the arccosine of a number.";
|
||||
Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Return the arcsine of a number.";
|
||||
Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Return the arctangent of a number.";
|
||||
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Return the cosine of a degree (not radian).";
|
||||
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Return the sine of a degree (not radian).";
|
||||
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Return the tangent of a degree (not radian).";
|
||||
Blockly.Msg.NEW_VARIABLE = "Create variable...";
|
||||
Blockly.Msg.NEW_VARIABLE_TITLE = "New variable name:";
|
||||
Blockly.Msg.NOTE_PICKER_HELPURL = "https://en.wikipedia.org/wiki/Piano_key_frequencies";
|
||||
Blockly.Msg.NOTE_PICKER_TOOLTIP = "Choose a note from the piano.";
|
||||
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = "";
|
||||
Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "allow statements";
|
||||
Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "with:";
|
||||
Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
|
||||
Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Run the user-defined function '%1'.";
|
||||
Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
|
||||
Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Run the user-defined function '%1' and use its output.";
|
||||
Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "with:";
|
||||
Blockly.Msg.PROCEDURES_CREATE_DO = "Create '%1'";
|
||||
Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "Describe this function...";
|
||||
Blockly.Msg.PROCEDURES_DEFNORETURN_DO = "";
|
||||
Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
|
||||
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "do something";
|
||||
Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "to";
|
||||
Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Creates a function with no output.";
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "return";
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Creates a function with an output.";
|
||||
Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Warning: This function has duplicate parameters.";
|
||||
Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Highlight function definition";
|
||||
Blockly.Msg.PROCEDURES_IFRETURN_HELPURL = "http://c2.com/cgi/wiki?GuardClause";
|
||||
Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "If a value is true, then return a second value.";
|
||||
Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Warning: This block may be used only within a function definition.";
|
||||
Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "input name:";
|
||||
Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function.";
|
||||
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "inputs";
|
||||
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function.";
|
||||
Blockly.Msg.REDO = "Redo";
|
||||
Blockly.Msg.REMOVE_COMMENT = "Remove Comment";
|
||||
Blockly.Msg.RENAME_VARIABLE = "Rename variable...";
|
||||
Blockly.Msg.RENAME_VARIABLE_TITLE = "Rename all '%1' variables to:";
|
||||
Blockly.Msg.TEXT_APPEND_APPENDTEXT = "append text";
|
||||
Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification";
|
||||
Blockly.Msg.TEXT_APPEND_TO = "to";
|
||||
Blockly.Msg.TEXT_APPEND_TOOLTIP = "Append some text to variable '%1'.";
|
||||
Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case";
|
||||
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "to lower case";
|
||||
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "to Title Case";
|
||||
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "to UPPER CASE";
|
||||
Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Return a copy of the text in a different case.";
|
||||
Blockly.Msg.TEXT_CHARAT_FIRST = "get first letter";
|
||||
Blockly.Msg.TEXT_CHARAT_FROM_END = "get letter # from end";
|
||||
Blockly.Msg.TEXT_CHARAT_FROM_START = "get letter #";
|
||||
Blockly.Msg.TEXT_CHARAT_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-text";
|
||||
Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "in text";
|
||||
Blockly.Msg.TEXT_CHARAT_LAST = "get last letter";
|
||||
Blockly.Msg.TEXT_CHARAT_RANDOM = "get random letter";
|
||||
Blockly.Msg.TEXT_CHARAT_TAIL = "";
|
||||
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Returns the letter at the specified position.";
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Add an item to the text.";
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "join";
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Add, remove, or reorder sections to reconfigure this text block.";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "to letter # from end";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "to letter #";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "to last letter";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "in text";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "get substring from first letter";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "get substring from letter # from end";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "get substring from letter #";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = "";
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Returns a specified portion of the text.";
|
||||
Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text";
|
||||
Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "in text";
|
||||
Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "find first occurrence of text";
|
||||
Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "find last occurrence of text";
|
||||
Blockly.Msg.TEXT_INDEXOF_TAIL = "";
|
||||
Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.";
|
||||
Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text";
|
||||
Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 is empty";
|
||||
Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Returns true if the provided text is empty.";
|
||||
Blockly.Msg.TEXT_JOIN_HELPURL = "https://github.com/google/blockly/wiki/Text#text-creation";
|
||||
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "create text with";
|
||||
Blockly.Msg.TEXT_JOIN_TOOLTIP = "Create a piece of text by joining together any number of items.";
|
||||
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification";
|
||||
Blockly.Msg.TEXT_LENGTH_TITLE = "length of %1";
|
||||
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Returns the number of letters (including spaces) in the provided text.";
|
||||
Blockly.Msg.TEXT_PRINT_HELPURL = "https://github.com/google/blockly/wiki/Text#printing-text";
|
||||
Blockly.Msg.TEXT_PRINT_TITLE = "print %1";
|
||||
Blockly.Msg.TEXT_PRINT_TOOLTIP = "Print the specified text, number or other value.";
|
||||
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";
|
||||
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Prompt for user for a number.";
|
||||
Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Prompt for user for some text.";
|
||||
Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "prompt for number with message";
|
||||
Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "prompt for text with message";
|
||||
Blockly.Msg.TEXT_TEXT_HELPURL = "https://en.wikipedia.org/wiki/String_(computer_science)";
|
||||
Blockly.Msg.TEXT_TEXT_TOOLTIP = "A letter, word, or line of text.";
|
||||
Blockly.Msg.TEXT_TRIM_HELPURL = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";
|
||||
Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "trim spaces from both sides of";
|
||||
Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "trim spaces from left side of";
|
||||
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "trim spaces from right side of";
|
||||
Blockly.Msg.TEXT_TRIM_TOOLTIP = "Return a copy of the text with spaces removed from one or both ends.";
|
||||
Blockly.Msg.TODAY = "Today";
|
||||
Blockly.Msg.UNDO = "Undo";
|
||||
Blockly.Msg.VARIABLES_DEFAULT_NAME = "item";
|
||||
Blockly.Msg.VARIABLES_GET_CREATE_SET = "Create 'set %1'";
|
||||
Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get";
|
||||
Blockly.Msg.VARIABLES_GET_TOOLTIP = "Returns the value of this variable.";
|
||||
Blockly.Msg.VARIABLES_SET = "set %1 to %2";
|
||||
Blockly.Msg.VARIABLES_SET_CREATE_GET = "Create 'get %1'";
|
||||
Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set";
|
||||
Blockly.Msg.VARIABLES_SET_TOOLTIP = "Sets this variable to be equal to the input.";
|
||||
Blockly.Msg.VARIABLE_ALREADY_EXISTS = "A variable named '%1' already exists.";
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
|
||||
Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
|
||||
Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
Blockly.Msg.CONTROLS_IF_MSG_THEN = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
Blockly.Msg.MATH_CHANGE_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_DO = Blockly.Msg.PROCEDURES_DEFNORETURN_DO;
|
||||
Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF;
|
||||
Blockly.Msg.LISTS_GET_INDEX_HELPURL = Blockly.Msg.LISTS_INDEX_OF_HELPURL;
|
||||
Blockly.Msg.CONTROLS_FOREACH_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
Blockly.Msg.CONTROLS_FOR_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT;
|
373
blockly/msg/json/en.json
Normal file
@ -0,0 +1,373 @@
|
||||
{
|
||||
"@metadata": {
|
||||
"author": "Ellen Spertus <ellen.spertus@gmail.com>",
|
||||
"lastupdated": "2017-02-22 16:47:17.855793",
|
||||
"locale": "en",
|
||||
"messagedocumentation" : "qqq"
|
||||
},
|
||||
"VARIABLES_DEFAULT_NAME": "item",
|
||||
"TODAY": "Today",
|
||||
"DUPLICATE_BLOCK": "Duplicate",
|
||||
"ADD_COMMENT": "Add Comment",
|
||||
"REMOVE_COMMENT": "Remove Comment",
|
||||
"EXTERNAL_INPUTS": "External Inputs",
|
||||
"INLINE_INPUTS": "Inline Inputs",
|
||||
"DELETE_BLOCK": "Delete Block",
|
||||
"DELETE_X_BLOCKS": "Delete %1 Blocks",
|
||||
"DELETE_ALL_BLOCKS": "Delete all %1 blocks?",
|
||||
"CLEAN_UP": "Clean up Blocks",
|
||||
"COLLAPSE_BLOCK": "Collapse Block",
|
||||
"COLLAPSE_ALL": "Collapse Blocks",
|
||||
"EXPAND_BLOCK": "Expand Block",
|
||||
"EXPAND_ALL": "Expand Blocks",
|
||||
"DISABLE_BLOCK": "Disable Block",
|
||||
"ENABLE_BLOCK": "Enable Block",
|
||||
"HELP": "Help",
|
||||
"UNDO": "Undo",
|
||||
"REDO": "Redo",
|
||||
"CHANGE_VALUE_TITLE": "Change value:",
|
||||
"RENAME_VARIABLE": "Rename variable...",
|
||||
"RENAME_VARIABLE_TITLE": "Rename all '%1' variables to:",
|
||||
"NEW_VARIABLE": "Create variable...",
|
||||
"NEW_VARIABLE_TITLE": "New variable name:",
|
||||
"VARIABLE_ALREADY_EXISTS": "A variable named '%1' already exists.",
|
||||
"DELETE_VARIABLE_CONFIRMATION": "Delete %1 uses of the '%2' variable?",
|
||||
"DELETE_VARIABLE": "Delete the '%1' variable",
|
||||
"COLOUR_PICKER_HELPURL": "https://en.wikipedia.org/wiki/Color",
|
||||
"COLOUR_PICKER_TOOLTIP": "Choose a colour from the palette.",
|
||||
"COLOUR_RANDOM_HELPURL": "http://randomcolour.com",
|
||||
"COLOUR_RANDOM_TITLE": "random colour",
|
||||
"COLOUR_RANDOM_TOOLTIP": "Choose a colour at random.",
|
||||
"COLOUR_RGB_HELPURL": "http://www.december.com/html/spec/colorper.html",
|
||||
"COLOUR_RGB_TITLE": "colour with",
|
||||
"COLOUR_RGB_RED": "red",
|
||||
"COLOUR_RGB_GREEN": "green",
|
||||
"COLOUR_RGB_BLUE": "blue",
|
||||
"COLOUR_RGB_TOOLTIP": "Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.",
|
||||
"COLOUR_BLEND_HELPURL": "http://meyerweb.com/eric/tools/color-blend/",
|
||||
"COLOUR_BLEND_TITLE": "blend",
|
||||
"COLOUR_BLEND_COLOUR1": "colour 1",
|
||||
"COLOUR_BLEND_COLOUR2": "colour 2",
|
||||
"COLOUR_BLEND_RATIO": "ratio",
|
||||
"COLOUR_BLEND_TOOLTIP": "Blends two colours together with a given ratio (0.0 - 1.0).",
|
||||
"CONTROLS_REPEAT_HELPURL": "https://en.wikipedia.org/wiki/For_loop",
|
||||
"CONTROLS_REPEAT_TITLE": "repeat %1 times",
|
||||
"CONTROLS_REPEAT_INPUT_DO": "do",
|
||||
"CONTROLS_REPEAT_TOOLTIP": "Do some statements several times.",
|
||||
"CONTROLS_WHILEUNTIL_HELPURL": "https://github.com/google/blockly/wiki/Loops#repeat",
|
||||
"CONTROLS_WHILEUNTIL_OPERATOR_WHILE": "repeat while",
|
||||
"CONTROLS_WHILEUNTIL_OPERATOR_UNTIL": "repeat until",
|
||||
"CONTROLS_WHILEUNTIL_TOOLTIP_WHILE": "While a value is true, then do some statements.",
|
||||
"CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL": "While a value is false, then do some statements.",
|
||||
"CONTROLS_FOR_HELPURL": "https://github.com/google/blockly/wiki/Loops#count-with",
|
||||
"CONTROLS_FOR_TOOLTIP": "Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.",
|
||||
"CONTROLS_FOR_TITLE": "count with %1 from %2 to %3 by %4",
|
||||
"CONTROLS_FOREACH_HELPURL": "https://github.com/google/blockly/wiki/Loops#for-each",
|
||||
"CONTROLS_FOREACH_TITLE": "for each item %1 in list %2",
|
||||
"CONTROLS_FOREACH_TOOLTIP": "For each item in a list, set the variable '%1' to the item, and then do some statements.",
|
||||
"CONTROLS_FLOW_STATEMENTS_HELPURL": "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks",
|
||||
"CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK": "break out of loop",
|
||||
"CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE": "continue with next iteration of loop",
|
||||
"CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK": "Break out of the containing loop.",
|
||||
"CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE": "Skip the rest of this loop, and continue with the next iteration.",
|
||||
"CONTROLS_FLOW_STATEMENTS_WARNING": "Warning: This block may only be used within a loop.",
|
||||
"CONTROLS_IF_HELPURL": "https://github.com/google/blockly/wiki/IfElse",
|
||||
"CONTROLS_IF_TOOLTIP_1": "If a value is true, then do some statements.",
|
||||
"CONTROLS_IF_TOOLTIP_2": "If a value is true, then do the first block of statements. Otherwise, do the second block of statements.",
|
||||
"CONTROLS_IF_TOOLTIP_3": "If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.",
|
||||
"CONTROLS_IF_TOOLTIP_4": "If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.",
|
||||
"CONTROLS_IF_MSG_IF": "if",
|
||||
"CONTROLS_IF_MSG_ELSEIF": "else if",
|
||||
"CONTROLS_IF_MSG_ELSE": "else",
|
||||
"CONTROLS_IF_IF_TOOLTIP": "Add, remove, or reorder sections to reconfigure this if block.",
|
||||
"CONTROLS_IF_ELSEIF_TOOLTIP": "Add a condition to the if block.",
|
||||
"CONTROLS_IF_ELSE_TOOLTIP": "Add a final, catch-all condition to the if block.",
|
||||
"LOGIC_COMPARE_HELPURL": "https://en.wikipedia.org/wiki/Inequality_(mathematics)",
|
||||
"LOGIC_COMPARE_TOOLTIP_EQ": "Return true if both inputs equal each other.",
|
||||
"LOGIC_COMPARE_TOOLTIP_NEQ": "Return true if both inputs are not equal to each other.",
|
||||
"LOGIC_COMPARE_TOOLTIP_LT": "Return true if the first input is smaller than the second input.",
|
||||
"LOGIC_COMPARE_TOOLTIP_LTE": "Return true if the first input is smaller than or equal to the second input.",
|
||||
"LOGIC_COMPARE_TOOLTIP_GT": "Return true if the first input is greater than the second input.",
|
||||
"LOGIC_COMPARE_TOOLTIP_GTE": "Return true if the first input is greater than or equal to the second input.",
|
||||
"LOGIC_OPERATION_HELPURL": "https://github.com/google/blockly/wiki/Logic#logical-operations",
|
||||
"LOGIC_OPERATION_TOOLTIP_AND": "Return true if both inputs are true.",
|
||||
"LOGIC_OPERATION_AND": "and",
|
||||
"LOGIC_OPERATION_TOOLTIP_OR": "Return true if at least one of the inputs is true.",
|
||||
"LOGIC_OPERATION_OR": "or",
|
||||
"LOGIC_NEGATE_HELPURL": "https://github.com/google/blockly/wiki/Logic#not",
|
||||
"LOGIC_NEGATE_TITLE": "not %1",
|
||||
"LOGIC_NEGATE_TOOLTIP": "Returns true if the input is false. Returns false if the input is true.",
|
||||
"LOGIC_BOOLEAN_HELPURL": "https://github.com/google/blockly/wiki/Logic#values",
|
||||
"LOGIC_BOOLEAN_TRUE": "true",
|
||||
"LOGIC_BOOLEAN_FALSE": "false",
|
||||
"LOGIC_BOOLEAN_TOOLTIP": "Returns either true or false.",
|
||||
"LOGIC_NULL_HELPURL": "https://en.wikipedia.org/wiki/Nullable_type",
|
||||
"LOGIC_NULL": "null",
|
||||
"LOGIC_NULL_TOOLTIP": "Returns null.",
|
||||
"LOGIC_TERNARY_HELPURL": "https://en.wikipedia.org/wiki/%3F:",
|
||||
"LOGIC_TERNARY_CONDITION": "test",
|
||||
"LOGIC_TERNARY_IF_TRUE": "if true",
|
||||
"LOGIC_TERNARY_IF_FALSE": "if false",
|
||||
"LOGIC_TERNARY_TOOLTIP": "Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.",
|
||||
"MATH_NUMBER_HELPURL": "https://en.wikipedia.org/wiki/Number",
|
||||
"MATH_NUMBER_TOOLTIP": "A number.",
|
||||
"MATH_ADDITION_SYMBOL": "+",
|
||||
"MATH_SUBTRACTION_SYMBOL": "-",
|
||||
"MATH_DIVISION_SYMBOL": "÷",
|
||||
"MATH_MULTIPLICATION_SYMBOL": "×",
|
||||
"MATH_POWER_SYMBOL": "^",
|
||||
"MATH_TRIG_SIN": "sin",
|
||||
"MATH_TRIG_COS": "cos",
|
||||
"MATH_TRIG_TAN": "tan",
|
||||
"MATH_TRIG_ASIN": "asin",
|
||||
"MATH_TRIG_ACOS": "acos",
|
||||
"MATH_TRIG_ATAN": "atan",
|
||||
"MATH_ARITHMETIC_HELPURL": "https://en.wikipedia.org/wiki/Arithmetic",
|
||||
"MATH_ARITHMETIC_TOOLTIP_ADD": "Return the sum of the two numbers.",
|
||||
"MATH_ARITHMETIC_TOOLTIP_MINUS": "Return the difference of the two numbers.",
|
||||
"MATH_ARITHMETIC_TOOLTIP_MULTIPLY": "Return the product of the two numbers.",
|
||||
"MATH_ARITHMETIC_TOOLTIP_DIVIDE": "Return the quotient of the two numbers.",
|
||||
"MATH_ARITHMETIC_TOOLTIP_POWER": "Return the first number raised to the power of the second number.",
|
||||
"MATH_SINGLE_HELPURL": "https://en.wikipedia.org/wiki/Square_root",
|
||||
"MATH_SINGLE_OP_ROOT": "square root",
|
||||
"MATH_SINGLE_TOOLTIP_ROOT": "Return the square root of a number.",
|
||||
"MATH_SINGLE_OP_ABSOLUTE": "absolute",
|
||||
"MATH_SINGLE_TOOLTIP_ABS": "Return the absolute value of a number.",
|
||||
"MATH_SINGLE_TOOLTIP_NEG": "Return the negation of a number.",
|
||||
"MATH_SINGLE_TOOLTIP_LN": "Return the natural logarithm of a number.",
|
||||
"MATH_SINGLE_TOOLTIP_LOG10": "Return the base 10 logarithm of a number.",
|
||||
"MATH_SINGLE_TOOLTIP_EXP": "Return e to the power of a number.",
|
||||
"MATH_SINGLE_TOOLTIP_POW10": "Return 10 to the power of a number.",
|
||||
"MATH_TRIG_HELPURL": "https://en.wikipedia.org/wiki/Trigonometric_functions",
|
||||
"MATH_TRIG_TOOLTIP_SIN": "Return the sine of a degree (not radian).",
|
||||
"MATH_TRIG_TOOLTIP_COS": "Return the cosine of a degree (not radian).",
|
||||
"MATH_TRIG_TOOLTIP_TAN": "Return the tangent of a degree (not radian).",
|
||||
"MATH_TRIG_TOOLTIP_ASIN": "Return the arcsine of a number.",
|
||||
"MATH_TRIG_TOOLTIP_ACOS": "Return the arccosine of a number.",
|
||||
"MATH_TRIG_TOOLTIP_ATAN": "Return the arctangent of a number.",
|
||||
"MATH_CONSTANT_HELPURL": "https://en.wikipedia.org/wiki/Mathematical_constant",
|
||||
"MATH_CONSTANT_TOOLTIP": "Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).",
|
||||
"MATH_IS_EVEN": "is even",
|
||||
"MATH_IS_ODD": "is odd",
|
||||
"MATH_IS_PRIME": "is prime",
|
||||
"MATH_IS_WHOLE": "is whole",
|
||||
"MATH_IS_POSITIVE": "is positive",
|
||||
"MATH_IS_NEGATIVE": "is negative",
|
||||
"MATH_IS_DIVISIBLE_BY": "is divisible by",
|
||||
"MATH_IS_TOOLTIP": "Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.",
|
||||
"MATH_CHANGE_HELPURL": "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter",
|
||||
"MATH_CHANGE_TITLE": "change %1 by %2",
|
||||
"MATH_CHANGE_TOOLTIP": "Add a number to variable '%1'.",
|
||||
"MATH_ROUND_HELPURL": "https://en.wikipedia.org/wiki/Rounding",
|
||||
"MATH_ROUND_TOOLTIP": "Round a number up or down.",
|
||||
"MATH_ROUND_OPERATOR_ROUND": "round",
|
||||
"MATH_ROUND_OPERATOR_ROUNDUP": "round up",
|
||||
"MATH_ROUND_OPERATOR_ROUNDDOWN": "round down",
|
||||
"MATH_ONLIST_HELPURL": "",
|
||||
"MATH_ONLIST_OPERATOR_SUM": "sum of list",
|
||||
"MATH_ONLIST_TOOLTIP_SUM": "Return the sum of all the numbers in the list.",
|
||||
"MATH_ONLIST_OPERATOR_MIN": "min of list",
|
||||
"MATH_ONLIST_TOOLTIP_MIN": "Return the smallest number in the list.",
|
||||
"MATH_ONLIST_OPERATOR_MAX": "max of list",
|
||||
"MATH_ONLIST_TOOLTIP_MAX": "Return the largest number in the list.",
|
||||
"MATH_ONLIST_OPERATOR_AVERAGE": "average of list",
|
||||
"MATH_ONLIST_TOOLTIP_AVERAGE": "Return the average (arithmetic mean) of the numeric values in the list.",
|
||||
"MATH_ONLIST_OPERATOR_MEDIAN": "median of list",
|
||||
"MATH_ONLIST_TOOLTIP_MEDIAN": "Return the median number in the list.",
|
||||
"MATH_ONLIST_OPERATOR_MODE": "modes of list",
|
||||
"MATH_ONLIST_TOOLTIP_MODE": "Return a list of the most common item(s) in the list.",
|
||||
"MATH_ONLIST_OPERATOR_STD_DEV": "standard deviation of list",
|
||||
"MATH_ONLIST_TOOLTIP_STD_DEV": "Return the standard deviation of the list.",
|
||||
"MATH_ONLIST_OPERATOR_RANDOM": "random item of list",
|
||||
"MATH_ONLIST_TOOLTIP_RANDOM": "Return a random element from the list.",
|
||||
"MATH_MODULO_HELPURL": "https://en.wikipedia.org/wiki/Modulo_operation",
|
||||
"MATH_MODULO_TITLE": "remainder of %1 ÷ %2",
|
||||
"MATH_MODULO_TOOLTIP": "Return the remainder from dividing the two numbers.",
|
||||
"MATH_CONSTRAIN_HELPURL": "https://en.wikipedia.org/wiki/Clamping_%28graphics%29",
|
||||
"MATH_CONSTRAIN_TITLE": "constrain %1 low %2 high %3",
|
||||
"MATH_CONSTRAIN_TOOLTIP": "Constrain a number to be between the specified limits (inclusive).",
|
||||
"MATH_RANDOM_INT_HELPURL": "https://en.wikipedia.org/wiki/Random_number_generation",
|
||||
"MATH_RANDOM_INT_TITLE": "random integer from %1 to %2",
|
||||
"MATH_RANDOM_INT_TOOLTIP": "Return a random integer between the two specified limits, inclusive.",
|
||||
"MATH_RANDOM_FLOAT_HELPURL": "https://en.wikipedia.org/wiki/Random_number_generation",
|
||||
"MATH_RANDOM_FLOAT_TITLE_RANDOM": "random fraction",
|
||||
"MATH_RANDOM_FLOAT_TOOLTIP": "Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).",
|
||||
"NOTE_PICKER_HELPURL": "https://en.wikipedia.org/wiki/Piano_key_frequencies",
|
||||
"NOTE_PICKER_TOOLTIP": "Choose a note from the piano.",
|
||||
"TEXT_TEXT_HELPURL": "https://en.wikipedia.org/wiki/String_(computer_science)",
|
||||
"TEXT_TEXT_TOOLTIP": "A letter, word, or line of text.",
|
||||
"TEXT_JOIN_HELPURL": "https://github.com/google/blockly/wiki/Text#text-creation",
|
||||
"TEXT_JOIN_TITLE_CREATEWITH": "create text with",
|
||||
"TEXT_JOIN_TOOLTIP": "Create a piece of text by joining together any number of items.",
|
||||
"TEXT_CREATE_JOIN_TITLE_JOIN": "join",
|
||||
"TEXT_CREATE_JOIN_TOOLTIP": "Add, remove, or reorder sections to reconfigure this text block.",
|
||||
"TEXT_CREATE_JOIN_ITEM_TOOLTIP": "Add an item to the text.",
|
||||
"TEXT_APPEND_HELPURL": "https://github.com/google/blockly/wiki/Text#text-modification",
|
||||
"TEXT_APPEND_TO": "to",
|
||||
"TEXT_APPEND_APPENDTEXT": "append text",
|
||||
"TEXT_APPEND_TOOLTIP": "Append some text to variable '%1'.",
|
||||
"TEXT_LENGTH_HELPURL": "https://github.com/google/blockly/wiki/Text#text-modification",
|
||||
"TEXT_LENGTH_TITLE": "length of %1",
|
||||
"TEXT_LENGTH_TOOLTIP": "Returns the number of letters (including spaces) in the provided text.",
|
||||
"TEXT_ISEMPTY_HELPURL": "https://github.com/google/blockly/wiki/Text#checking-for-empty-text",
|
||||
"TEXT_ISEMPTY_TITLE": "%1 is empty",
|
||||
"TEXT_ISEMPTY_TOOLTIP": "Returns true if the provided text is empty.",
|
||||
"TEXT_INDEXOF_HELPURL": "https://github.com/google/blockly/wiki/Text#finding-text",
|
||||
"TEXT_INDEXOF_TOOLTIP": "Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.",
|
||||
"TEXT_INDEXOF_INPUT_INTEXT": "in text",
|
||||
"TEXT_INDEXOF_OPERATOR_FIRST": "find first occurrence of text",
|
||||
"TEXT_INDEXOF_OPERATOR_LAST": "find last occurrence of text",
|
||||
"TEXT_INDEXOF_TAIL": "",
|
||||
"TEXT_CHARAT_HELPURL": "https://github.com/google/blockly/wiki/Text#extracting-text",
|
||||
"TEXT_CHARAT_INPUT_INTEXT": "in text",
|
||||
"TEXT_CHARAT_FROM_START": "get letter #",
|
||||
"TEXT_CHARAT_FROM_END": "get letter # from end",
|
||||
"TEXT_CHARAT_FIRST": "get first letter",
|
||||
"TEXT_CHARAT_LAST": "get last letter",
|
||||
"TEXT_CHARAT_RANDOM": "get random letter",
|
||||
"TEXT_CHARAT_TAIL": "",
|
||||
"TEXT_CHARAT_TOOLTIP": "Returns the letter at the specified position.",
|
||||
"TEXT_GET_SUBSTRING_TOOLTIP": "Returns a specified portion of the text.",
|
||||
"TEXT_GET_SUBSTRING_HELPURL": "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text",
|
||||
"TEXT_GET_SUBSTRING_INPUT_IN_TEXT": "in text",
|
||||
"TEXT_GET_SUBSTRING_START_FROM_START": "get substring from letter #",
|
||||
"TEXT_GET_SUBSTRING_START_FROM_END": "get substring from letter # from end",
|
||||
"TEXT_GET_SUBSTRING_START_FIRST": "get substring from first letter",
|
||||
"TEXT_GET_SUBSTRING_END_FROM_START": "to letter #",
|
||||
"TEXT_GET_SUBSTRING_END_FROM_END": "to letter # from end",
|
||||
"TEXT_GET_SUBSTRING_END_LAST": "to last letter",
|
||||
"TEXT_GET_SUBSTRING_TAIL": "",
|
||||
"TEXT_CHANGECASE_HELPURL": "https://github.com/google/blockly/wiki/Text#adjusting-text-case",
|
||||
"TEXT_CHANGECASE_TOOLTIP": "Return a copy of the text in a different case.",
|
||||
"TEXT_CHANGECASE_OPERATOR_UPPERCASE": "to UPPER CASE",
|
||||
"TEXT_CHANGECASE_OPERATOR_LOWERCASE": "to lower case",
|
||||
"TEXT_CHANGECASE_OPERATOR_TITLECASE": "to Title Case",
|
||||
"TEXT_TRIM_HELPURL": "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces",
|
||||
"TEXT_TRIM_TOOLTIP": "Return a copy of the text with spaces removed from one or both ends.",
|
||||
"TEXT_TRIM_OPERATOR_BOTH": "trim spaces from both sides of",
|
||||
"TEXT_TRIM_OPERATOR_LEFT": "trim spaces from left side of",
|
||||
"TEXT_TRIM_OPERATOR_RIGHT": "trim spaces from right side of",
|
||||
"TEXT_PRINT_HELPURL": "https://github.com/google/blockly/wiki/Text#printing-text",
|
||||
"TEXT_PRINT_TITLE": "print %1",
|
||||
"TEXT_PRINT_TOOLTIP": "Print the specified text, number or other value.",
|
||||
"TEXT_PROMPT_HELPURL": "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user",
|
||||
"TEXT_PROMPT_TYPE_TEXT": "prompt for text with message",
|
||||
"TEXT_PROMPT_TYPE_NUMBER": "prompt for number with message",
|
||||
"TEXT_PROMPT_TOOLTIP_NUMBER": "Prompt for user for a number.",
|
||||
"TEXT_PROMPT_TOOLTIP_TEXT": "Prompt for user for some text.",
|
||||
"LISTS_CREATE_EMPTY_HELPURL": "https://github.com/google/blockly/wiki/Lists#create-empty-list",
|
||||
"LISTS_CREATE_EMPTY_TITLE": "create empty list",
|
||||
"LISTS_CREATE_EMPTY_TOOLTIP": "Returns a list, of length 0, containing no data records",
|
||||
"LISTS_CREATE_WITH_HELPURL": "https://github.com/google/blockly/wiki/Lists#create-list-with",
|
||||
"LISTS_CREATE_WITH_TOOLTIP": "Create a list with any number of items.",
|
||||
"LISTS_CREATE_WITH_INPUT_WITH": "create list with",
|
||||
"LISTS_CREATE_WITH_CONTAINER_TITLE_ADD": "list",
|
||||
"LISTS_CREATE_WITH_CONTAINER_TOOLTIP": "Add, remove, or reorder sections to reconfigure this list block.",
|
||||
"LISTS_CREATE_WITH_ITEM_TOOLTIP": "Add an item to the list.",
|
||||
"LISTS_REPEAT_HELPURL": "https://github.com/google/blockly/wiki/Lists#create-list-with",
|
||||
"LISTS_REPEAT_TOOLTIP": "Creates a list consisting of the given value repeated the specified number of times.",
|
||||
"LISTS_REPEAT_TITLE": "create list with item %1 repeated %2 times",
|
||||
"LISTS_LENGTH_HELPURL": "https://github.com/google/blockly/wiki/Lists#length-of",
|
||||
"LISTS_LENGTH_TITLE": "length of %1",
|
||||
"LISTS_LENGTH_TOOLTIP": "Returns the length of a list.",
|
||||
"LISTS_ISEMPTY_HELPURL": "https://github.com/google/blockly/wiki/Lists#is-empty",
|
||||
"LISTS_ISEMPTY_TITLE": "%1 is empty",
|
||||
"LISTS_ISEMPTY_TOOLTIP": "Returns true if the list is empty.",
|
||||
"LISTS_INLIST": "in list",
|
||||
"LISTS_INDEX_OF_HELPURL": "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list",
|
||||
"LISTS_INDEX_OF_FIRST": "find first occurrence of item",
|
||||
"LISTS_INDEX_OF_LAST": "find last occurrence of item",
|
||||
"LISTS_INDEX_OF_TOOLTIP": "Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.",
|
||||
"LISTS_GET_INDEX_GET": "get",
|
||||
"LISTS_GET_INDEX_GET_REMOVE": "get and remove",
|
||||
"LISTS_GET_INDEX_REMOVE": "remove",
|
||||
"LISTS_GET_INDEX_FROM_START": "#",
|
||||
"LISTS_GET_INDEX_FROM_END": "# from end",
|
||||
"LISTS_GET_INDEX_FIRST": "first",
|
||||
"LISTS_GET_INDEX_LAST": "last",
|
||||
"LISTS_GET_INDEX_RANDOM": "random",
|
||||
"LISTS_GET_INDEX_TAIL": "",
|
||||
"LISTS_INDEX_FROM_START_TOOLTIP": "%1 is the first item.",
|
||||
"LISTS_INDEX_FROM_END_TOOLTIP": "%1 is the last item.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_GET_FROM": "Returns the item at the specified position in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_GET_FIRST": "Returns the first item in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_GET_LAST": "Returns the last item in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_GET_RANDOM": "Returns a random item in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM": "Removes and returns the item at the specified position in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST": "Removes and returns the first item in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST": "Removes and returns the last item in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM": "Removes and returns a random item in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM": "Removes the item at the specified position in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST": "Removes the first item in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST": "Removes the last item in a list.",
|
||||
"LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM": "Removes a random item in a list.",
|
||||
"LISTS_SET_INDEX_HELPURL": "https://github.com/google/blockly/wiki/Lists#in-list--set",
|
||||
"LISTS_SET_INDEX_SET": "set",
|
||||
"LISTS_SET_INDEX_INSERT": "insert at",
|
||||
"LISTS_SET_INDEX_INPUT_TO": "as",
|
||||
"LISTS_SET_INDEX_TOOLTIP_SET_FROM": "Sets the item at the specified position in a list.",
|
||||
"LISTS_SET_INDEX_TOOLTIP_SET_FIRST": "Sets the first item in a list.",
|
||||
"LISTS_SET_INDEX_TOOLTIP_SET_LAST": "Sets the last item in a list.",
|
||||
"LISTS_SET_INDEX_TOOLTIP_SET_RANDOM": "Sets a random item in a list.",
|
||||
"LISTS_SET_INDEX_TOOLTIP_INSERT_FROM": "Inserts the item at the specified position in a list.",
|
||||
"LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST": "Inserts the item at the start of a list.",
|
||||
"LISTS_SET_INDEX_TOOLTIP_INSERT_LAST": "Append the item to the end of a list.",
|
||||
"LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM": "Inserts the item randomly in a list.",
|
||||
"LISTS_GET_SUBLIST_HELPURL": "https://github.com/google/blockly/wiki/Lists#getting-a-sublist",
|
||||
"LISTS_GET_SUBLIST_START_FROM_START": "get sub-list from #",
|
||||
"LISTS_GET_SUBLIST_START_FROM_END": "get sub-list from # from end",
|
||||
"LISTS_GET_SUBLIST_START_FIRST": "get sub-list from first",
|
||||
"LISTS_GET_SUBLIST_END_FROM_START": "to #",
|
||||
"LISTS_GET_SUBLIST_END_FROM_END": "to # from end",
|
||||
"LISTS_GET_SUBLIST_END_LAST": "to last",
|
||||
"LISTS_GET_SUBLIST_TAIL": "",
|
||||
"LISTS_GET_SUBLIST_TOOLTIP": "Creates a copy of the specified portion of a list.",
|
||||
"LISTS_SORT_HELPURL": "https://github.com/google/blockly/wiki/Lists#sorting-a-list",
|
||||
"LISTS_SORT_TITLE": "sort %1 %2 %3",
|
||||
"LISTS_SORT_TOOLTIP": "Sort a copy of a list.",
|
||||
"LISTS_SORT_ORDER_ASCENDING": "ascending",
|
||||
"LISTS_SORT_ORDER_DESCENDING": "descending",
|
||||
"LISTS_SORT_TYPE_NUMERIC": "numeric",
|
||||
"LISTS_SORT_TYPE_TEXT": "alphabetic",
|
||||
"LISTS_SORT_TYPE_IGNORECASE": "alphabetic, ignore case",
|
||||
"LISTS_SPLIT_HELPURL": "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists",
|
||||
"LISTS_SPLIT_LIST_FROM_TEXT": "make list from text",
|
||||
"LISTS_SPLIT_TEXT_FROM_LIST": "make text from list",
|
||||
"LISTS_SPLIT_WITH_DELIMITER": "with delimiter",
|
||||
"LISTS_SPLIT_TOOLTIP_SPLIT": "Split text into a list of texts, breaking at each delimiter.",
|
||||
"LISTS_SPLIT_TOOLTIP_JOIN": "Join a list of texts into one text, separated by a delimiter.",
|
||||
"ORDINAL_NUMBER_SUFFIX": "",
|
||||
"VARIABLES_GET_HELPURL": "https://github.com/google/blockly/wiki/Variables#get",
|
||||
"VARIABLES_GET_TOOLTIP": "Returns the value of this variable.",
|
||||
"VARIABLES_GET_CREATE_SET": "Create 'set %1'",
|
||||
"VARIABLES_SET_HELPURL": "https://github.com/google/blockly/wiki/Variables#set",
|
||||
"VARIABLES_SET": "set %1 to %2",
|
||||
"VARIABLES_SET_TOOLTIP": "Sets this variable to be equal to the input.",
|
||||
"VARIABLES_SET_CREATE_GET": "Create 'get %1'",
|
||||
"PROCEDURES_DEFNORETURN_HELPURL": "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29",
|
||||
"PROCEDURES_DEFNORETURN_TITLE": "to",
|
||||
"PROCEDURES_DEFNORETURN_PROCEDURE": "do something",
|
||||
"PROCEDURES_BEFORE_PARAMS": "with:",
|
||||
"PROCEDURES_CALL_BEFORE_PARAMS": "with:",
|
||||
"PROCEDURES_DEFNORETURN_DO": "",
|
||||
"PROCEDURES_DEFNORETURN_TOOLTIP": "Creates a function with no output.",
|
||||
"PROCEDURES_DEFNORETURN_COMMENT": "Describe this function...",
|
||||
"PROCEDURES_DEFRETURN_HELPURL": "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29",
|
||||
"PROCEDURES_DEFRETURN_RETURN": "return",
|
||||
"PROCEDURES_DEFRETURN_TOOLTIP": "Creates a function with an output.",
|
||||
"PROCEDURES_ALLOW_STATEMENTS": "allow statements",
|
||||
"PROCEDURES_DEF_DUPLICATE_WARNING": "Warning: This function has duplicate parameters.",
|
||||
"PROCEDURES_CALLNORETURN_HELPURL": "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29",
|
||||
"PROCEDURES_CALLNORETURN_TOOLTIP": "Run the user-defined function '%1'.",
|
||||
"PROCEDURES_CALLRETURN_HELPURL": "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29",
|
||||
"PROCEDURES_CALLRETURN_TOOLTIP": "Run the user-defined function '%1' and use its output.",
|
||||
"PROCEDURES_MUTATORCONTAINER_TITLE": "inputs",
|
||||
"PROCEDURES_MUTATORCONTAINER_TOOLTIP": "Add, remove, or reorder inputs to this function.",
|
||||
"PROCEDURES_MUTATORARG_TITLE": "input name:",
|
||||
"PROCEDURES_MUTATORARG_TOOLTIP": "Add an input to the function.",
|
||||
"PROCEDURES_HIGHLIGHT_DEF": "Highlight function definition",
|
||||
"PROCEDURES_CREATE_DO": "Create '%1'",
|
||||
"PROCEDURES_IFRETURN_TOOLTIP": "If a value is true, then return a second value.",
|
||||
"PROCEDURES_IFRETURN_HELPURL": "http://c2.com/cgi/wiki?GuardClause",
|
||||
"PROCEDURES_IFRETURN_WARNING": "Warning: This block may be used only within a function definition."
|
||||
}
|
1119
blockly/msg/messages.js
Normal file
31
bluebird.min.js
vendored
Normal file
58
controller.html
Normal file
@ -0,0 +1,58 @@
|
||||
<!doctype html>
|
||||
<html lang="en" data-manifest="" data-framework="typescript">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<style type="text/css">
|
||||
@import "/cdn/semantic.css";
|
||||
</style>
|
||||
<style>
|
||||
#logs {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 1rem;
|
||||
width: 100%;
|
||||
height: 6rem;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#iframe {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 7rem;
|
||||
width: 100%;
|
||||
height: calc(100% - 7rem);
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function sendMessage(action) {
|
||||
var logs = document.getElementById("logs");
|
||||
logs.innerText += action + "\n";
|
||||
document.getElementById("iframe").contentWindow.postMessage({
|
||||
type: "pxteditor",
|
||||
id: "xxxxxxxxx",
|
||||
action: action
|
||||
}, "*")
|
||||
}
|
||||
|
||||
</script>
|
||||
<body>
|
||||
<div id="buttons" class="ui buttons">
|
||||
<button class="ui button" onclick="sendMessage('switchblocks')">switch to blocks</button>
|
||||
<button class="ui button" onclick="sendMessage('switchjavascript')">switch to javascript</button>
|
||||
<button class="ui button" onclick="sendMessage('startsimulator')">start sim</button>
|
||||
<button class="ui button" onclick="sendMessage('restartsimulator')">reset sim</button>
|
||||
<button class="ui button" onclick="sendMessage('stopsimulator')">stop sim</button>
|
||||
<button class="ui button" onclick="sendMessage('newproject')">newproject</button>
|
||||
</div>
|
||||
<pre id="logs" class="ui"></pre>
|
||||
<iframe id="iframe" src="http://localhost:3232/index.html?editorlayout=ide" />
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
355
custom.css
Normal file
@ -0,0 +1,355 @@
|
||||
html {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.rtl #fileNameInput {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#settings .popup {
|
||||
width: 25rem;
|
||||
}
|
||||
|
||||
#root.inverted {
|
||||
background: #1B1C1D;
|
||||
}
|
||||
|
||||
.rtl .ui.menu .ui.dropdown .menu > .item,
|
||||
.rtl .ui.modal {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.ui.dropdown,
|
||||
.ui.buttons {
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
|
||||
.searchdialog .cards {
|
||||
max-height: 20rem;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
margin-top:0.5rem;
|
||||
}
|
||||
|
||||
.ui.card > .content > a.header {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.ui.top.attached.label .link.icon {
|
||||
position: absolute;
|
||||
top: 9px;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
#content .ui.button > .icon-and-text {
|
||||
margin-right: 4px;
|
||||
margin-left: -2px;
|
||||
}
|
||||
|
||||
.rtl #content .ui.button > .icon-and-text {
|
||||
margin-left: 4px;
|
||||
margin-right: -2px;
|
||||
}
|
||||
|
||||
.ui.button.icon.clear {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
border: 0 !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.rtl .ui.menu .ui.dropdown .menu > .item .icon:not(.dropdown) {
|
||||
margin: 0.0em 0.0em 0.0em 0.75em
|
||||
}
|
||||
|
||||
.ui.logs {
|
||||
font-family: monospace;
|
||||
font-size:0.8em;
|
||||
max-height: 13em;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
margin-bottom: 1em;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.ui.log {
|
||||
clear:both;
|
||||
border-left-width: 2px;
|
||||
border-left-style: solid;
|
||||
border-top-left-radius: 2px;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
|
||||
.ui.log {
|
||||
border-left-color:#ccc;
|
||||
}
|
||||
.ui.log.blue {
|
||||
border-left-color:#0AaCbE;
|
||||
}
|
||||
.ui.log.yellow {
|
||||
border-left-color:#cFb41A;
|
||||
}
|
||||
.ui.log.green {
|
||||
border-left-color:#AACF83;
|
||||
}
|
||||
.ui.log.red {
|
||||
border-left-color:#FF3A54;
|
||||
}
|
||||
.ui.log.black {
|
||||
border-left-color:#202020;
|
||||
}
|
||||
|
||||
.ui.log.gauge, .ui.log.counter {
|
||||
color:white;
|
||||
border-radius: 4px;
|
||||
margin-left:0.1em;
|
||||
margin-right:0.2em;
|
||||
padding-left:0.25em;
|
||||
padding-right:0.25em;
|
||||
}
|
||||
|
||||
.ui.log.counter {
|
||||
background:grey;
|
||||
}
|
||||
|
||||
.ui.log.gauge.blue {
|
||||
background:#0AaCbE;
|
||||
}
|
||||
.ui.log.gauge.yellow {
|
||||
background:#cFb41A;
|
||||
}
|
||||
.ui.log.gauge.green {
|
||||
background:#AACF83;
|
||||
}
|
||||
.ui.log.gauge.red {
|
||||
background:#FF3A54;
|
||||
}
|
||||
.ui.log.gauge.black {
|
||||
background:#000;
|
||||
}
|
||||
|
||||
svg.ui.trend {
|
||||
width: 8em;
|
||||
height: 1.5em;
|
||||
margin-top: 0.1em;
|
||||
float: right;
|
||||
vertical-align: middle;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
svg.ui.trend polyline {
|
||||
stroke: #000;
|
||||
stroke-width: 1px;
|
||||
stroke-linejoin: round;
|
||||
fill:none;
|
||||
}
|
||||
|
||||
svg.ui.trend.blue polyline {
|
||||
stroke:#0AaCbE;
|
||||
}
|
||||
svg.ui.trend.yellow polyline {
|
||||
stroke:#cFb41A;
|
||||
}
|
||||
svg.ui.trend.green polyline {
|
||||
stroke:#AACF83;
|
||||
}
|
||||
svg.ui.trend.red polyline {
|
||||
stroke:#FF3A54;
|
||||
}
|
||||
svg.ui.trend.black polyline {
|
||||
stroke:#000;
|
||||
}
|
||||
|
||||
.grayscale {
|
||||
-moz-filter: grayscale(1);
|
||||
-webkit-filter: grayscale(1);
|
||||
filter: grayscale(1);
|
||||
}
|
||||
|
||||
.sepia {
|
||||
-webkit-filter: sepia(1);
|
||||
filter: sepia(1);
|
||||
}
|
||||
|
||||
.blur {
|
||||
-moz-filter: blur(1);
|
||||
-webkit-filter: blur(1);
|
||||
filter: blur(1);
|
||||
}
|
||||
|
||||
.highlight {
|
||||
border-bottom: 2px solid #FFC107;
|
||||
}
|
||||
|
||||
.ui.hideempty:empty {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
#root .debuggerview h4 {
|
||||
margin: 0.9em 0 0 0;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size:16px;
|
||||
}
|
||||
|
||||
.top-margin {
|
||||
margin-top:0.5em !important;
|
||||
}
|
||||
|
||||
.flash {
|
||||
animation: flash-animation 0.4s alternate infinite;
|
||||
-webkit-animation: flash-animation 0.4s alternate infinite;
|
||||
}
|
||||
|
||||
@keyframes flash-animation {
|
||||
from { opacity: 1; }
|
||||
to { opacity: 0.4; }
|
||||
}
|
||||
|
||||
.cloudflash {
|
||||
animation: cloud-flash-animation 0.8s alternate infinite;
|
||||
-webkit-animation: cloud-flash-animation 0.8s alternate infinite;
|
||||
}
|
||||
|
||||
@keyframes cloud-flash-animation {
|
||||
from { opacity: 1; }
|
||||
to { opacity: 0.8; }
|
||||
}
|
||||
|
||||
.ui.fluid.button.half{
|
||||
width:50% !important;
|
||||
}
|
||||
.ui.fluid.button.sixty{
|
||||
width:60% !important;
|
||||
}
|
||||
|
||||
/*******************************
|
||||
Blockly
|
||||
Add Blockly CSS here that you don't want overriden in themes
|
||||
*******************************/
|
||||
|
||||
#blocksEditor {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#blocksEditor > div.loading {
|
||||
background:#fff;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.blocklyMainBackground {
|
||||
stroke:none !important;
|
||||
}
|
||||
|
||||
.rtl text.blocklyText {
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
/* This ensures built-in blockly toolbox icons are hidden */
|
||||
span.blocklyTreeIcon {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
/* This is to ensure the leds inside showLeds fill the entire checkbox */
|
||||
text.blocklyCheckbox {
|
||||
fill: #ff3030 !important;
|
||||
text-shadow: 0px 0px 6px #f00;
|
||||
font-size: 17pt !important;
|
||||
}
|
||||
|
||||
.blocklyPreview {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
-webkit-transform: translate(-50%,-50%);
|
||||
-ms-transform: translate(-50%,-50%);
|
||||
transform: translate(-50%,-50%);
|
||||
width: calc(100% - 1em);
|
||||
max-height: calc(100% - 1em);
|
||||
}
|
||||
|
||||
body.blocklyMinimalBody {
|
||||
min-width: initial;
|
||||
overflow: initial;
|
||||
}
|
||||
|
||||
@supports (-ms-accelerator:true) {
|
||||
.rtl .blocklyPreview {
|
||||
right:50%;
|
||||
left:auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix for context menu scroll issue */
|
||||
div.blocklyWidgetDiv {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
/*******************************
|
||||
Monaco Editor
|
||||
Add Monaco Editor CSS here that you don't want override in themes
|
||||
*******************************/
|
||||
#monacoEditor {
|
||||
direction:ltr;
|
||||
}
|
||||
|
||||
/* Monaco Editor Errors */
|
||||
.monaco-editor .error-view-zone {
|
||||
font-family: Monaco, Menlo, "Ubuntu Mono", Consolas, source-code-pro, monospace;
|
||||
width: initial !important;
|
||||
}
|
||||
.monaco-editor.vs-dark .error-view-zone {
|
||||
color:white;
|
||||
}
|
||||
.monaco-editor .error-view-zone .marker-widget {
|
||||
border-radius: 2px !important;
|
||||
padding-left: 10px !important;
|
||||
padding-right: 20px !important;
|
||||
}
|
||||
|
||||
/* Fix for monaco editor Signature bug in Safari */
|
||||
.monaco-editor .parameter-hints-widget {
|
||||
flex-direction: row !important;
|
||||
}
|
||||
|
||||
.line-numbers {
|
||||
display:none;
|
||||
}
|
||||
|
||||
.monacoToolboxDiv {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
overflow-x: visible;
|
||||
overflow-y: auto;
|
||||
vertical-align: top;
|
||||
}
|
||||
.monacoToolboxDiv.hide {
|
||||
display: none;
|
||||
}
|
||||
.monaco-editor-hover {
|
||||
z-index:1000;
|
||||
}
|
||||
|
||||
#monacoEditorInner {
|
||||
position: relative !important;
|
||||
display: inline-block;
|
||||
}
|
79
docfiles/abuse.html
Normal file
@ -0,0 +1,79 @@
|
||||
<div class="ui icon violet message" style='margin: 3em 0'>
|
||||
<i class="user icon"></i>
|
||||
<div class="content">
|
||||
<h3 class="header">
|
||||
User-provided content
|
||||
</h3>
|
||||
<p>
|
||||
The content below is provided by a user, and is not endorsed by Microsoft. If you think it's not appropriate, please
|
||||
<a style='text-decoration:underline' id="abuse" href="#">report abuse</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui small modal" id='abusemodal'>
|
||||
<div class="header">Report abuse</div>
|
||||
<div class="content">
|
||||
<div class="ui form">
|
||||
<div class="field">
|
||||
<label>Why do you find it offensive?</label>
|
||||
<textarea id='abusetext' rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="ui ok button violet">
|
||||
<i class='ui flag icon'></i> Submit
|
||||
</div>
|
||||
<div class="ui cancel button">
|
||||
<i class='ui cancel icon'></i> Cancel
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui small modal" id='abusedone'>
|
||||
<div class="header">Report sent</div>
|
||||
<div class="content">
|
||||
<p>
|
||||
Thank you for helping keep PXT a friendly place!
|
||||
</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="ui ok green button">
|
||||
<i class='ui trophy icon'></i> OK
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var id = "@id@";
|
||||
var now = Math.round(Date.now()/1000);
|
||||
$(".humantime").each(function() {
|
||||
$(this).text(
|
||||
describetime(now, parseInt($(this).data("time")))
|
||||
)
|
||||
})
|
||||
$("#abuse").click(function() {
|
||||
$("#abusemodal")
|
||||
.modal({
|
||||
onApprove: function() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/api/@id@/abusereports',
|
||||
data: JSON.stringify({
|
||||
text: $('#abusetext').val()
|
||||
}),
|
||||
success: function() {
|
||||
$("#abusedone").modal("show");
|
||||
},
|
||||
contentType: "application/json",
|
||||
dataType: 'json'
|
||||
});
|
||||
}
|
||||
})
|
||||
.modal("show");
|
||||
})
|
||||
})
|
||||
</script>
|
31
docfiles/appmeta.html
Normal file
@ -0,0 +1,31 @@
|
||||
<title>@name@</title>
|
||||
<meta name="description" content="@description@" />
|
||||
|
||||
<link rel="manifest" href="/sim/sim.webmanifest">
|
||||
|
||||
<link rel="apple-touch-icon" href="@appLogo@">
|
||||
<link rel="icon" href="@appLogo@">
|
||||
<link rel="shortcut icon" href="@appLogo@">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-title" content="@name@">
|
||||
<meta name="application-name" content="@name@">
|
||||
<meta name="msapplication-TileColor" content="@accentColor@">
|
||||
<meta name="msapplication-TileImage" content="@appLogo@">
|
||||
<meta name="msapplication-config" content="/static/icons/browserconfig.xml">
|
||||
<meta name="theme-color" content="@accentColor@">
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:site" content="@ptwitter@" />
|
||||
<meta name="twitter:title" content="@name@" />
|
||||
<meta name="twitter:description" content="@description@" />
|
||||
<meta name="twitter:image" content="@cardLogo@" />
|
||||
|
||||
<meta property="og:title" content="@name@" />
|
||||
<meta property="og:site_name" content="@name@" />
|
||||
<meta property="og:description" content="@description@" />
|
||||
<meta property="og:image" content="@cardLogo@" />
|
||||
|
||||
<link rel="apple-touch-icon" href="@appLogo@">
|
||||
<link rel="icon" type="image/png" href="@appLogo@">
|
||||
<link rel="shortcut icon" href="@appLogo@">
|
1
docfiles/apptracking.html
Normal file
@ -0,0 +1 @@
|
||||
<!-- @include tracking.html -->
|
30
docfiles/docs.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>@name@</title>
|
||||
<meta name="Description" content="@description@" />
|
||||
|
||||
<!-- @include meta.html -->
|
||||
<!-- @include head.html -->
|
||||
|
||||
</head>
|
||||
|
||||
<body id='root' class='root'>
|
||||
|
||||
<!-- @include header.html -->
|
||||
|
||||
<div id="docs" class="ui main container mainbody">
|
||||
@breadcrumb@
|
||||
@body@
|
||||
@github@
|
||||
</div>
|
||||
|
||||
<!-- @include footer.html -->
|
||||
<!-- @include macros.html -->
|
||||
<!-- @include tracking.html -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
138
docfiles/docs.js
Normal file
@ -0,0 +1,138 @@
|
||||
function describePlural(value, unit) {
|
||||
return value + " " + unit + (value == 1 ? "" : "s")
|
||||
}
|
||||
function describetime(now, other) {
|
||||
var seconds = now - other
|
||||
if (isNaN(seconds)) return ""
|
||||
var timeString
|
||||
if (seconds < 0)
|
||||
return "now"
|
||||
else if (seconds < 10)
|
||||
return "a few seconds ago"
|
||||
else if (seconds < 60)
|
||||
return " " + describePlural(Math.floor(seconds), "second") + " ago"
|
||||
else if (seconds < 2 * 60)
|
||||
return "a minute ago"
|
||||
else if (seconds < 60 * 60)
|
||||
return " " + describePlural(Math.floor(seconds / 60), "minute") + " ago"
|
||||
else if (seconds < 2 * 60 * 60)
|
||||
return "an hour ago";
|
||||
else if (seconds < 60 * 60 * 24)
|
||||
return " " + describePlural(Math.floor(seconds / 60 / 60), "hour") + " ago"
|
||||
else if (seconds < 60 * 60 * 24 * 30)
|
||||
return " " + describePlural(Math.floor(seconds / 60 / 60 / 24), "day") + " ago"
|
||||
else if (seconds < 60 * 60 * 24 * 365)
|
||||
return " " + describePlural(Math.floor(seconds / 60 / 60 / 24 / 30), "month") + " ago"
|
||||
else
|
||||
return " " + describePlural(Math.floor(seconds / 60 / 60 / 24 / 365), "year") + " ago"
|
||||
}
|
||||
|
||||
function isIE() {
|
||||
return /trident/i.test(navigator.userAgent);
|
||||
}
|
||||
|
||||
function dirAuto($el) {
|
||||
if ($el) {
|
||||
if (!isIE())
|
||||
$el.attr('dir', 'auto');
|
||||
else {
|
||||
var dir = /^[\s\.;:(+0-9]*[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/i.test($el.text()) ? "rtl" : "ltr";
|
||||
$el.attr('dir', dir);
|
||||
}
|
||||
}
|
||||
return $el;
|
||||
}
|
||||
|
||||
function renderSnippets() {
|
||||
var codeElems = $('code')
|
||||
for (var i = 0; i < codeElems.length; i++) {
|
||||
codeElems[i].className = codeElems[i].className.replace('-ignore', '')
|
||||
}
|
||||
|
||||
var downloadScreenshots = /screenshots=1/i.test(window.location.href);
|
||||
var path = window.location.href.split('/').pop().split(/[?#]/)[0];
|
||||
ksRunnerReady(function() {
|
||||
pxt.runner.renderAsync({
|
||||
snippetClass: 'lang-blocks',
|
||||
signatureClass: 'lang-sig',
|
||||
blocksClass:'lang-block',
|
||||
shuffleClass: 'lang-shuffle',
|
||||
simulatorClass: 'lang-sim',
|
||||
linksClass: 'lang-cards',
|
||||
namespacesClass: 'lang-namespaces',
|
||||
codeCardClass: 'lang-codecard',
|
||||
packageClass: 'lang-package',
|
||||
projectClass: 'lang-project',
|
||||
snippetReplaceParent: true,
|
||||
simulator: true,
|
||||
hex: true,
|
||||
hexName: path,
|
||||
downloadScreenshots: downloadScreenshots
|
||||
}).done();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
renderSnippets();
|
||||
|
||||
// don't show related videos
|
||||
$.fn.embed.settings.sources.youtube.url = '//www.youtube.com/embed/{id}?rel=0'
|
||||
|
||||
//This is an adapted version of the original template code in Semantic UI
|
||||
$.fn.embed.settings.templates.placeholder = function(image, icon) {
|
||||
var html = '';
|
||||
if(icon) {
|
||||
html += '<i class="' + icon + ' icon"></i>';
|
||||
}
|
||||
if(image) {
|
||||
//Remove the timestamp from the YouTube source URL
|
||||
image = image.replace(/\#t=([0-9]+m)?([0-9]+s)?/, "");
|
||||
html += '<img class="placeholder" src="' + image + '">';
|
||||
}
|
||||
return html;
|
||||
};
|
||||
//Again, this is a slightly modified version of the original Semantic UI source to support timestamped YouTube videos
|
||||
$.fn.embed.settings.templates.iframe = function(url, parameters) {
|
||||
var src = url;
|
||||
//The following if statement is all that is different from the original implementation
|
||||
var matches = src.match(/\#t=(([0-9]+)m)?(([0-9]+)s)?/);
|
||||
if (matches) {
|
||||
var minutes = matches[2] != undefined ? parseInt(matches[2]) : 0;
|
||||
var seconds = matches[4] != undefined ? parseInt(matches[4]) : 0;
|
||||
var param = "start=" + (minutes * 60 + seconds).toString();
|
||||
if (parameters) {
|
||||
parameters = param + "&" + parameters;
|
||||
}
|
||||
else {
|
||||
parameters = param;
|
||||
}
|
||||
src = src.replace(/\#t=([0-9]+m)?([0-9]+s)?/, "");
|
||||
}
|
||||
if (parameters) {
|
||||
src += (/\?/.test(url) ? '&' : '?') + parameters;
|
||||
}
|
||||
return ''
|
||||
+ '<iframe src="' + src + '"'
|
||||
+ ' width="100%" height="100%"'
|
||||
+ ' frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'
|
||||
;
|
||||
};
|
||||
|
||||
$('.ui.embed').embed();
|
||||
|
||||
$('.md-video-link').on("click", function () {
|
||||
var name = $(this).data("playerurl") || $(this).data("videosrc");
|
||||
$(this).find("img").remove();
|
||||
$(this).find("svg").remove();
|
||||
var outer = $('<div />', {
|
||||
"class": 'embed-responsive embed-responsive-16by9'
|
||||
});
|
||||
outer.appendTo($(this));
|
||||
$('<iframe>', {
|
||||
class: 'embed-responsive-item',
|
||||
src: name,
|
||||
frameborder: 0,
|
||||
scrolling: 'no'
|
||||
}).appendTo(outer);
|
||||
});
|
||||
});
|
73
docfiles/error.html
Normal file
@ -0,0 +1,73 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Programming Experience Toolkit</title>
|
||||
<meta name="Description" content="Programming Experiences in Blocks and JavaScript for beginners." />
|
||||
|
||||
|
||||
<!-- @include head.html -->
|
||||
|
||||
</head>
|
||||
|
||||
<body id='root' class='root'>
|
||||
|
||||
|
||||
<style>
|
||||
.lead {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.smile {
|
||||
font-size: 200px;
|
||||
line-height: 0.6em;
|
||||
float: left;
|
||||
margin-right: 70px;
|
||||
margin-bottom: 100px;
|
||||
margin-left: 50px;
|
||||
display: none;
|
||||
font-weight: 200;
|
||||
color: #0091ff;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.smile {
|
||||
display: block;
|
||||
}
|
||||
#root .jumbotron {
|
||||
min-height: 20em;
|
||||
margin-bottom: 8em;
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
opacity: 0.5;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="ui main text container mainbody">
|
||||
<div class="ui jumbotron">
|
||||
<div class='smile'>
|
||||
:(
|
||||
</div>
|
||||
|
||||
<h1 dir="auto">Sorry, the page is missing</h1>
|
||||
|
||||
<p dir="auto" class='message'>@-body-@</p>
|
||||
|
||||
<p dir="auto" class='lead'>
|
||||
You can go back to <a href="/">home page</a> or <a href="/contact">contact us</a>.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- @include macros.html -->
|
||||
<!-- @include tracking.html -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
15
docfiles/footer.html
Normal file
@ -0,0 +1,15 @@
|
||||
<div class="ui inverted accent vertical footer segment">
|
||||
<div class="ui center aligned container">
|
||||
<div class="ui horizontal inverted small divided link list">
|
||||
<a class="item" href="https://www.pxt.io/" title="Programming Experience Toolkit">Powered by PXT</a>
|
||||
<a class="item" href="https://www.pxt.io/contact">Contact Us</a>
|
||||
<a class="item" href="https://www.pxt.io/privacy">Privacy & Cookies</a>
|
||||
<a class="item" href="https://www.pxt.io/legal">Terms Of Use</a>
|
||||
<a class="item" href="https://www.pxt.io/trademarks">Trademarks</a>
|
||||
<div class="item">© 2016 Microsoft</div>
|
||||
<!-- we need to force the browser to load this font -->
|
||||
<div style='font-family: Icons; color: #010101;' aria-hidden="true">.</div>
|
||||
</div>
|
||||
<a class="item" href="https://www.microsoft.com/"><img class="ui centered image" src="https://az851932.vo.msecnd.net/pub/pmapoirq" /></a>
|
||||
</div>
|
||||
</div>
|
1
docfiles/fork.css
Normal file
@ -0,0 +1 @@
|
||||
/* To be overridden by fork (branded target) */
|
1
docfiles/fork.js
Normal file
@ -0,0 +1 @@
|
||||
/* To be overridden by fork (branded target) */
|
32
docfiles/head.html
Normal file
@ -0,0 +1,32 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
|
||||
|
||||
<link rel="stylesheet" href="/doccdn/semantic.css" />
|
||||
<link rel="stylesheet" href="/docfiles/style.css" />
|
||||
<link rel="stylesheet" href="/docfiles/vs.css" />
|
||||
<link rel="stylesheet" href="/docfiles/target.css" />
|
||||
<link rel="stylesheet" href="/docfiles/fork.css" />
|
||||
|
||||
<script src="/doccdn/jquery.js"></script>
|
||||
<script src="/doccdn/semantic.js"></script>
|
||||
<script src="/doccdn/lzma/lzma_worker-min.js"></script>
|
||||
|
||||
<script src="/--embed" type="text/javascript"></script>
|
||||
<script src="/docfiles/docs.js" type="text/javascript"></script>
|
||||
<script src="/docfiles/target.js" type="text/javascript"></script>
|
||||
<script src="/docfiles/fork.js" type="text/javascript"></script>
|
||||
|
||||
<style>
|
||||
@targetstyle@
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// patch youtube in semantic
|
||||
if ($ && $.fn && $.fn.embed && $.fn.embed.settings && $.fn.embed.settings.sources && $.fn.embed.settings.sources.youtube) {
|
||||
$.fn.embed.settings.sources.youtube.url = '//www.youtube.com/embed/{id}?rel=0'
|
||||
}
|
||||
$('.ui.embed').embed();
|
||||
})
|
||||
</script>
|
9
docfiles/header.html
Normal file
@ -0,0 +1,9 @@
|
||||
<div class="ui fixed accent inverted menu">
|
||||
<div class="ui container">
|
||||
<a href="/" class="header item">
|
||||
@targetlogo@
|
||||
</a>
|
||||
<!-- Menu -->
|
||||
@menu@
|
||||
</div>
|
||||
</div>
|
BIN
docfiles/logo.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
95
docfiles/macros.html
Normal file
@ -0,0 +1,95 @@
|
||||
<aside id=button class=box>
|
||||
<a class="ui primary button" href="@ARGS@">@BODY@</a>
|
||||
</aside>
|
||||
|
||||
<aside id=vimeo>
|
||||
<div class="ui two column stackable grid container">
|
||||
<div class="column">
|
||||
<div class="ui embed mdvid" data-source="vimeo" data-id="@ARGS@" data-placeholder="/thumbnail/1024/vimeo/@ARGS@" data-icon="video play">
|
||||
</div>
|
||||
</div></div>
|
||||
</aside>
|
||||
|
||||
<aside id=youtube>
|
||||
<div class="ui grid">
|
||||
<div class="ten wide column">
|
||||
<div class="ui embed mdvid" data-source="youtube" data-id="@ARGS@" data-placeholder="https://img.youtube.com/vi/@ARGS@/maxresdefault.jpg">
|
||||
</div>
|
||||
</div></div>
|
||||
</aside>
|
||||
|
||||
<aside id=section>
|
||||
<!-- section @ARGS@ -->
|
||||
</aside>
|
||||
|
||||
<aside id=hide class=box>
|
||||
<div style='display:none'>
|
||||
@BODY@
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<aside id=avatar class=box>
|
||||
<div class='avatar @ARGS@'>
|
||||
<div class='avatar-image'></div>
|
||||
<div class='ui compact message'>
|
||||
@BODY@
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<aside id=hint class=box>
|
||||
<div class="ui info message">
|
||||
<div class="content">
|
||||
@BODY@
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- wrapped around ordinary content -->
|
||||
<aside id=main-container class=box>
|
||||
<div class="ui text">
|
||||
@BODY@
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- used for 'column' box - they are collected and wrapped in 'column-container' -->
|
||||
<aside id=column class=aside>
|
||||
<div class='column'>
|
||||
@BODY@
|
||||
</div>
|
||||
</aside>
|
||||
<aside id=column-container class=box>
|
||||
<div class="ui three column stackable grid text">
|
||||
@BODY@
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
|
||||
<!-- Menu on the top of the page -->
|
||||
<aside id=item class=menu>
|
||||
<a class="item" href="@LINK@">@NAME@</a>
|
||||
</aside>
|
||||
|
||||
<aside id=divider class=menu>
|
||||
<div class="divider"></div>
|
||||
</aside>
|
||||
|
||||
<aside id=top-dropdown class=menu>
|
||||
<div class="ui simple dropdown item" title="@TITLE@">
|
||||
@NAME@
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
@ITEMS@
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<aside id=inner-dropdown class=menu>
|
||||
<div class="item" title="@TITLE@">
|
||||
<i class="dropdown icon"></i> @NAME@
|
||||
<div class="menu">
|
||||
@ITEMS@
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
21
docfiles/meta.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!-- This file is typically overriden by the target, with own Twitter
|
||||
account etc. Most data is taken from the theme file though.
|
||||
-->
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:site" content="@twitter@" />
|
||||
<meta name="twitter:title" content="@name@" />
|
||||
<meta name="twitter:description" content="@description@" />
|
||||
<meta name="twitter:image" content="@cardLogo@" />
|
||||
|
||||
<meta property="og:title" content="@name@" />
|
||||
<meta property="og:site_name" content="PXT" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:description" content="@description@" />
|
||||
<meta property="fb:app_id" content="" />
|
||||
<meta property="og:image" content="@cardLogo@" />
|
||||
|
||||
<link rel="apple-touch-icon" href="@appLogo@">
|
||||
<link rel="icon" type="image/png" href="@appLogo@">
|
||||
<link rel="shortcut icon" href="@appLogo@">
|
||||
<meta name="theme-color" content="@accentColor@">
|
74
docfiles/script.html
Normal file
@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>@name@</title>
|
||||
<meta name="Description" content="@description@" />
|
||||
|
||||
<!-- @include meta.html -->
|
||||
<!-- @include head.html -->
|
||||
|
||||
<link rel="alternate" type="application/json+oembed" href="@oembedurl@&format=json" />
|
||||
<link rel="alternate" type="text/xml+oembed" href="@oembedurl@&format=xml" />
|
||||
</head>
|
||||
|
||||
<body id='root' class='root'>
|
||||
|
||||
|
||||
<!-- @include header.html -->
|
||||
<!-- @include macros.html -->
|
||||
<aside id=main-container class=box>
|
||||
@BODY@
|
||||
</aside>
|
||||
|
||||
|
||||
|
||||
<div class="ui main container mainbody">
|
||||
|
||||
@breadcrumb@
|
||||
|
||||
<!-- @include abuse.html -->
|
||||
<h1 class="ui header">
|
||||
<div class="ui content">
|
||||
@title@ <a href="/@versionsuff@#pub:@id@" class="ui primary button">Edit</a>
|
||||
<div class='sub header humantime' data-time="@time@">@humantime@</span>
|
||||
</div>
|
||||
</h1>
|
||||
<p class="ui content description">
|
||||
@description@
|
||||
</p>
|
||||
|
||||
<div class="ui container">
|
||||
<div style="position:relative;height:0;padding-bottom:70%;overflow:hidden;">
|
||||
<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;" src="/@versionsuff@#sandbox:@id@" sandbox="allow-popups allow-scripts allow-same-origin"
|
||||
frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@body@
|
||||
|
||||
<div class="ui container segment">
|
||||
<h4 class="description">Edit in <a href="https://code.visualstudio.com/">Visual Studio Code</a></h4>
|
||||
<pre style="white-space: pre-wrap;">
|
||||
# open a shell and run these commands
|
||||
pxt extract @id@
|
||||
cd @dirname@
|
||||
code .</pre>
|
||||
<p class="ui description">Do you need help installing the tools?
|
||||
<a href="@theme_embedUrl@/code">Follow these instructions!</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const script = @JSON@;
|
||||
// do something with it
|
||||
</script>
|
||||
|
||||
<!-- @include footer.html -->
|
||||
<!-- @include tracking.html -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
100
docfiles/stream.html
Normal file
@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Stream: @name@</title>
|
||||
<meta name="Description" content="Live data stream" />
|
||||
|
||||
|
||||
<!-- @include meta.html -->
|
||||
<!-- @include head.html -->
|
||||
|
||||
</head>
|
||||
|
||||
<body id='root' class='root'>
|
||||
|
||||
|
||||
<!-- @include header.html -->
|
||||
<!-- @include macros.html -->
|
||||
|
||||
<aside id=main-container class=box>
|
||||
<div style='display:none' class="ui text container segment">
|
||||
@BODY@
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
|
||||
<div class="ui main container mainbody">
|
||||
|
||||
@breadcrumb@
|
||||
|
||||
<!-- @include abuse.html -->
|
||||
|
||||
<div class="ui container stackable grid">
|
||||
<div class="ui six wide column">
|
||||
<div class="ui card">
|
||||
<!-- <div class="image"><img src="..."></div> -->
|
||||
<div class="content">
|
||||
<div class="header">Stream: @title@</div>
|
||||
<div class="meta">
|
||||
<span class='humantime' data-time="@time@">@humantime@</span>
|
||||
<span class='right floated'>/@id@</span>
|
||||
</div>
|
||||
<div class="description">
|
||||
Live data powered by
|
||||
<img src="https://az851932.vo.msecnd.net/pub/hjlxsmaf" class="ui fluid image" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="extra content">
|
||||
|
||||
<div class="ui two buttons">
|
||||
<a href="/api/@id@/data?start=-24h" class="ui button">JSON</a>
|
||||
<a href="/api/@id@/data.csv?start=-24h" class="ui green button">CSV</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui card ten wide column">
|
||||
<h2>Streaming data in Excel 2016</h2>
|
||||
<p>The data stored in this stream can easily be imported into an Excel 2016 spreadsheet using
|
||||
<a href="https://support.office.com/en-us/article/Get-Transform-in-Excel-2016-881c63c6-37c5-4ca2-b616-59e18d75b4de">Get & Transform</a>.
|
||||
</p>
|
||||
<div class="ui segment">
|
||||
<p>Create a <b>Blank Workbook</b> in Excel 2016</p>
|
||||
</div>
|
||||
<div class="ui segment">
|
||||
<p>Click on <b>Data</b> » <b>New Query</b> » <b>From Other Sources</b> » <b>From Web</b>.
|
||||
</p>
|
||||
<img class="ui large centered image" src="https://az851932.vo.msecnd.net/pub/tipefycm" />
|
||||
</div>
|
||||
<div class="ui segment">
|
||||
<p>Enter the following URL and click on <b>Connect</b>.</p>
|
||||
<div class="ui fluid labeled input">
|
||||
<div class="ui label">URL</div>
|
||||
<input type="text" value="@apiroot@@id@/data.csv?start=-24h" readonly="" />
|
||||
</div>
|
||||
<img class="ui medium centered image" src="https://az851932.vo.msecnd.net/pub/jgyhkunq" />
|
||||
</div>
|
||||
<div class="ui segment">
|
||||
<p>Select <b>Anonymous</b> and click <b>Connect</b>.</p>
|
||||
<img class="ui medium centered image" src="https://az851932.vo.msecnd.net/pub/vvrkgcai" />
|
||||
</div>
|
||||
<div class="ui segment">
|
||||
<p>Click on <b>Close & Load</b>.</p>
|
||||
<img class="ui medium centered image" src="https://az851932.vo.msecnd.net/pub/lgwswrzo" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@body@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- @include footer.html -->
|
||||
<!-- @include tracking.html -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
160
docfiles/style.css
Normal file
@ -0,0 +1,160 @@
|
||||
body#root {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
div.listing
|
||||
{
|
||||
color:Black;
|
||||
border-style:none;
|
||||
margin: 0px 0px 0px 0px;
|
||||
font-size: 11pt;
|
||||
font-family: Consolas, "Andale Mono WT" , "Andale Mono" , "Lucida Console" , "Lucida Sans Typewriter" , "DejaVu Sans Mono" , "Bitstream Vera Sans Mono" , "Liberation Mono" , "Nimbus Mono L" , Monaco, "Courier New" , Courier, monospace;
|
||||
padding: 5px 5px 5px 5px;
|
||||
background: #f8f8f8;
|
||||
clear: both;
|
||||
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
div.listing A:link
|
||||
{
|
||||
color:#000020;
|
||||
text-decoration: none;
|
||||
}
|
||||
div.listing A:visited
|
||||
{
|
||||
color:#000020;
|
||||
text-decoration: none;
|
||||
}
|
||||
div.listing A:active
|
||||
{
|
||||
color:#000080;
|
||||
text-decoration: none;
|
||||
}
|
||||
div.listing A:hover
|
||||
{
|
||||
color:#000080;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.mainbody {
|
||||
margin-top: 6em;
|
||||
margin-bottom: 3em;
|
||||
}
|
||||
|
||||
.prodname {
|
||||
font-weight: normal;
|
||||
font-size: 1.8em;
|
||||
margin-left: 0.5em;
|
||||
color: #ff7d00;
|
||||
}
|
||||
|
||||
#root .editor-image {
|
||||
margin: 2em auto;
|
||||
display: block;
|
||||
max-width: 80%;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 16px;
|
||||
overflow: auto;
|
||||
font-size: 85%;
|
||||
line-height: 1.45;
|
||||
background-color: #f7f7f7;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
code {
|
||||
padding: 0;
|
||||
padding-top: 0.2em;
|
||||
padding-bottom: 0.2em;
|
||||
margin: 0;
|
||||
font-size: 85%;
|
||||
background-color: rgba(0,0,0,0.04);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
code:before, code:after {
|
||||
letter-spacing: -0.2em;
|
||||
content: "\00a0";
|
||||
}
|
||||
|
||||
.ui[class*="5:3"].embed {
|
||||
padding-bottom: 83%;
|
||||
background:transparent !important;
|
||||
}
|
||||
|
||||
code {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
code.lang-config, code.lang-package { display: none;}
|
||||
code.lang-blocks::before,
|
||||
code.lang-sig::before,
|
||||
code.lang-block::before,
|
||||
code.lang-shuffle::before,
|
||||
code.lang-sim::before,
|
||||
code.lang-cards::before,
|
||||
code.lang-namespaces::before,
|
||||
code.lang-codecard::before
|
||||
{
|
||||
content:"...";
|
||||
position: absolute;
|
||||
top:calc(50% - 0.5em);
|
||||
left:calc(50% - 5em);
|
||||
}
|
||||
code.lang-blocks,
|
||||
code.lang-sig,
|
||||
code.lang-block,
|
||||
code.lang-shuffle,
|
||||
code.lang-sim,
|
||||
code.lang-cards,
|
||||
code.lang-namespaces,
|
||||
code.lang-codecard
|
||||
{
|
||||
color:transparent;
|
||||
}
|
||||
|
||||
code.lang-typescript {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
/* Limit width of text so that it's readable
|
||||
*/
|
||||
|
||||
.ui.text p,
|
||||
.ui.text li {
|
||||
max-width: 45em;
|
||||
}
|
||||
|
||||
/* wrap cards header */
|
||||
.ui.card > .content > .header {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
|
||||
svg {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.blocklyText {
|
||||
font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace !important;
|
||||
}
|
||||
|
||||
.blocklyCheckbox,
|
||||
.blocklyLed {
|
||||
fill: #ff3030 !important;
|
||||
text-shadow: 0px 0px 6px #f00;
|
||||
font-size: 17pt !important;
|
||||
}
|
||||
|
||||
.ui.card .blocklyPreview {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: calc(100% - 1em);
|
||||
max-height: calc(100% - 1em);
|
||||
}
|
1
docfiles/target.css
Normal file
@ -0,0 +1 @@
|
||||
/* To be overridden by target */
|
1
docfiles/target.js
Normal file
@ -0,0 +1 @@
|
||||
/* To be overridden by target */
|
26
docfiles/tracking.html
Normal file
@ -0,0 +1,26 @@
|
||||
<script type="text/javascript">
|
||||
var appInsights=window.appInsights||function(config){
|
||||
function i(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s="AuthenticatedUserContext",h="start",c="stop",l="Track",a=l+"Event",v=l+"Page",y=u.createElement(o),r,f;y.src=config.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js";u.getElementsByTagName(o)[0].parentNode.appendChild(y);try{t.cookie=u.cookie}catch(p){}for(t.queue=[],t.version="1.0",r=["Event","Exception","Metric","PageView","Trace","Dependency"];r.length;)i("track"+r.pop());return i("set"+s),i("clear"+s),i(h+a),i(c+a),i(h+v),i(c+v),i("flush"),config.disableExceptionTracking||(r="onerror",i("_"+r),f=e[r],e[r]=function(config,i,u,e,o){var s=f&&f(config,i,u,e,o);return s!==!0&&t["_"+r](config,i,u,e,o),s}),t
|
||||
}({
|
||||
instrumentationKey:"9801ed01-c40f-46ec-aa40-2a1742a9e71c",
|
||||
disableAjaxTracking: true,
|
||||
overridePageViewDuration: false,
|
||||
disableExceptionTracking: true,
|
||||
isCookieUseDisabled: true,
|
||||
isStorageUseDisabled: true
|
||||
});
|
||||
window.appInsights=appInsights;
|
||||
appInsights.queue.push(function () {
|
||||
appInsights.context.addTelemetryInitializer(function (envelope) {
|
||||
if (typeof pxtConfig === "undefined") return;
|
||||
var telemetryItem = envelope.data.baseData;
|
||||
telemetryItem.properties = telemetryItem.properties || {};
|
||||
telemetryItem.properties["target"] = pxtConfig.targetId;
|
||||
telemetryItem.properties["version"] = pxtConfig.targetVersion;
|
||||
telemetryItem.properties["stage"] = (pxtConfig.relprefix || "/--").replace(/[^a-z]/ig, '')
|
||||
if (typeof window !== "undefined" && window.location && /[?&]electron=1/i.test(window.location.href))
|
||||
telemetryItem.properties["electron"] = 1;
|
||||
});
|
||||
});
|
||||
appInsights.trackPageView();
|
||||
</script>
|
68
docfiles/vs.css
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
|
||||
Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>
|
||||
|
||||
*/
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
background: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote,
|
||||
.hljs-variable {
|
||||
color: #008000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-built_in,
|
||||
.hljs-name,
|
||||
.hljs-tag {
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-title,
|
||||
.hljs-section,
|
||||
.hljs-attribute,
|
||||
.hljs-literal,
|
||||
.hljs-template-tag,
|
||||
.hljs-template-variable,
|
||||
.hljs-type,
|
||||
.hljs-addition {
|
||||
color: #a31515;
|
||||
}
|
||||
|
||||
.hljs-deletion,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-meta {
|
||||
color: #2b91af;
|
||||
}
|
||||
|
||||
.hljs-doctag {
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.hljs-attr {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-link {
|
||||
color: #00b0e8;
|
||||
}
|
||||
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
136
docs.html
Normal file
@ -0,0 +1,136 @@
|
||||
<!doctype html>
|
||||
<html lang="@locale@" data-framework="typescript">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
#content {
|
||||
margin-bottom: 3rem !important;
|
||||
margin-top: 0.5rem !important;
|
||||
}
|
||||
|
||||
svg {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.blocklyText {
|
||||
font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace !important;
|
||||
}
|
||||
|
||||
.blocklyCheckbox,
|
||||
.blocklyLed {
|
||||
fill: #ff3030 !important;
|
||||
text-shadow: 0px 0px 6px #f00;
|
||||
font-size: 17pt !important;
|
||||
}
|
||||
|
||||
.ui.card .blocklyPreview {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: calc(100% - 1em);
|
||||
max-height: calc(100% - 1em);
|
||||
}
|
||||
|
||||
code {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
code.lang-config, code.lang-package { display:none; }
|
||||
|
||||
code.lang-blocks::before,
|
||||
code.lang-sig::before,
|
||||
code.lang-block::before,
|
||||
code.lang-shuffle::before,
|
||||
code.lang-sim::before,
|
||||
code.lang-cards::before,
|
||||
code.lang-namespaces::before,
|
||||
code.lang-codecard::before {
|
||||
content: "...";
|
||||
position: absolute;
|
||||
top: calc(50% - 0.5em);
|
||||
left: calc(50% - 5em);
|
||||
}
|
||||
|
||||
code.lang-blocks,
|
||||
code.lang-sig,
|
||||
code.lang-block,
|
||||
code.lang-shuffle,
|
||||
code.lang-sim,
|
||||
code.lang-cards,
|
||||
code.lang-namespaces,
|
||||
code.lang-codecard {
|
||||
color: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body id="docs">
|
||||
<style type="text/css">
|
||||
@import "/pxt-calliope/highlight.js/styles/vs.css";
|
||||
@import "/pxt-calliope/semantic.css";
|
||||
@import "/pxt-calliope/icons.css";
|
||||
</style>
|
||||
<div id='loading' class="ui active inverted dimmer">
|
||||
<div class="ui large loader"></div>
|
||||
</div>
|
||||
<div id="content" class="ui container">
|
||||
<i class="spinner loading icon"></i>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// This line gets patched up by the cloud
|
||||
var pxtConfig = {
|
||||
"relprefix": "/pxt-calliope/",
|
||||
"workerjs": "/pxt-calliope/worker.js",
|
||||
"tdworkerjs": "/pxt-calliope/tdworker.js",
|
||||
"monacoworkerjs": "/pxt-calliope/monacoworker.js",
|
||||
"pxtVersion": "1.0.20",
|
||||
"pxtRelId": "",
|
||||
"pxtCdnUrl": "/pxt-calliope/",
|
||||
"targetVersion": "0.0.0",
|
||||
"targetRelId": "",
|
||||
"targetCdnUrl": "/pxt-calliope/",
|
||||
"targetUrl": "",
|
||||
"simUrl": "/pxt-calliope/simulator.html",
|
||||
"partsUrl": "/pxt-calliope/siminstructions.html",
|
||||
"runUrl": "/pxt-calliope/run.html",
|
||||
"docsUrl": "/pxt-calliope/docs.html",
|
||||
"isStatic": true
|
||||
};
|
||||
</script>
|
||||
<!-- @include apptracking.html -->
|
||||
<script type="text/javascript" src="/pxt-calliope/jquery.js"></script>
|
||||
<script type="text/javascript" src="/pxt-calliope/embed.js"></script>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
var loading = document.getElementById('loading');
|
||||
var content = document.getElementById('content');
|
||||
ksRunnerReady(function() {
|
||||
pxt.docs.requireMarked = function() { return marked; }
|
||||
pxt.docs.requireHighlightJs = function() { return hljs; }
|
||||
var projectid = /projectid=([^&?]+)/i.exec(window.location.href);
|
||||
var code = /code=([^&?]+)/i.exec(window.location.href);
|
||||
var md = /md=([^&?]+)/i.exec(window.location.href);
|
||||
var markdown = code ? "```blocks\n" + decodeURIComponent(code[1]) + "```" : md ? decodeURIComponent(md[1]) : undefined;
|
||||
if (markdown) {
|
||||
console.log('rendering code:')
|
||||
console.log(markdown);
|
||||
pxt.runner.renderMarkdownAsync(content, markdown).done(function() {
|
||||
$(loading).hide();
|
||||
$(content).show();
|
||||
});
|
||||
} else if (projectid) {
|
||||
pxt.runner.renderProjectAsync(content, projectid[1]).done(function() {
|
||||
$(loading).hide();
|
||||
$(content).show();
|
||||
});
|
||||
}
|
||||
else
|
||||
pxt.runner.startDocsServer(loading, content);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
195
docs/about.html
Normal file
3
docs/beta-ref.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"appref": "v"
|
||||
}
|
200
docs/blocks.html
Normal file
203
docs/blocks/logic.html
Normal file
252
docs/blocks/logic/boolean.html
Normal file
211
docs/blocks/logic/if.html
Normal file
201
docs/blocks/loops.html
Normal file
208
docs/blocks/loops/for.html
Normal file
204
docs/blocks/loops/repeat.html
Normal file
213
docs/blocks/loops/while.html
Normal file
213
docs/blocks/math.html
Normal file
206
docs/blocks/variables.html
Normal file
217
docs/blocks/variables/assign.html
Normal file
219
docs/blocks/variables/change-var.html
Normal file
253
docs/blocks/variables/var.html
Normal file
277
docs/browsers.html
Normal file
202
docs/browsers/linux.html
Normal file
202
docs/browsers/mac.html
Normal file
264
docs/browsers/technical.html
Normal file
203
docs/browsers/windows.html
Normal file
199
docs/docs.html
Normal file
BIN
docs/favicon.ico
Normal file
After Width: | Height: | Size: 15 KiB |
3
docs/index-ref.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"appref": "v0.8.30"
|
||||
}
|