mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
@@ -160,7 +160,6 @@
|
||||
"jsdoc/check-param-names": ["off", {"checkDestructured": false}],
|
||||
// Allow any text in the license tag. Other checks are not relevant.
|
||||
"jsdoc/check-values": ["off"]
|
||||
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@@ -29,9 +29,9 @@ All submissions, including submissions by project members, require review. We
|
||||
use Github pull requests for this purpose.
|
||||
|
||||
### Browser compatibility
|
||||
We care strongly about making Blockly work on all browsers. As of 2022 we
|
||||
We care strongly about making Blockly work on all browsers. As of 2022 we
|
||||
support Edge, Chrome, Safari, and Firefox. We will not accept changes that only
|
||||
work on a subset of those browsers. You can check [caniuse.com](https://caniuse.com/)
|
||||
work on a subset of those browsers. You can check [caniuse.com](https://caniuse.com/)
|
||||
for compatibility information.
|
||||
|
||||
### The small print
|
||||
|
||||
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@@ -22,7 +22,7 @@ updates:
|
||||
- "PR: chore"
|
||||
- "PR: dependencies"
|
||||
- package-ecosystem: "github-actions" # See documentation for possible values
|
||||
directory: "/"
|
||||
directory: "/"
|
||||
target-branch: "develop"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
|
||||
7
.github/release-please.yml
vendored
7
.github/release-please.yml
vendored
@@ -1,7 +0,0 @@
|
||||
primaryBranch: develop
|
||||
releaseType: node
|
||||
packageName: blockly
|
||||
manifest: true
|
||||
manifestConfig: release-please-config.json
|
||||
manifestFile: .release-please-manifest.json
|
||||
handleGHRelease: true
|
||||
2
.github/workflows/appengine_deploy.yml
vendored
2
.github/workflows/appengine_deploy.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
path: _deploy/
|
||||
|
||||
- name: Deploy to App Engine
|
||||
uses: google-github-actions/deploy-appengine@v0.8.0
|
||||
uses: google-github-actions/deploy-appengine@v0.8.2
|
||||
# For parameters see:
|
||||
# https://github.com/google-github-actions/deploy-appengine#inputs
|
||||
with:
|
||||
|
||||
12
.github/workflows/conventional-label.yml
vendored
Normal file
12
.github/workflows/conventional-label.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [ opened, edited ]
|
||||
name: conventional-release-labels
|
||||
jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: bcoe/conventional-release-labels@v1
|
||||
with:
|
||||
type_labels: '{"feat": "PR: feature", "fix": "PR: fix", "breaking": "breaking change", "chore": "PR: chore", "docs": "PR: docs", "refactor": "PR: refactor"}'
|
||||
ignored_types: '[]'
|
||||
4
.github/workflows/tag_module_cleanup.yml
vendored
4
.github/workflows/tag_module_cleanup.yml
vendored
@@ -5,14 +5,14 @@ name: Tag module cleanup
|
||||
|
||||
# Trigger on pull requests against goog_module branch only
|
||||
# Uses pull_request_target to get write permissions so that it can write labels.
|
||||
on:
|
||||
on:
|
||||
pull_request_target:
|
||||
branches:
|
||||
- goog_module
|
||||
|
||||
jobs:
|
||||
tag-module-cleanup:
|
||||
|
||||
|
||||
# Add the type: cleanup label
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
4
.github/workflows/update_metadata.yml
vendored
4
.github/workflows/update_metadata.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
permissions:
|
||||
contents: write # for peter-evans/create-pull-request to create branch
|
||||
pull-requests: write # for peter-evans/create-pull-request to create a PR
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check Out Blockly
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
run: source ./tests/scripts/update_metadata.sh
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@171dd555b9ab6b18fa02519fdfacbb8bf671e1b4
|
||||
uses: peter-evans/create-pull-request@b4d51739f96fca8047ad065eccef63442d8e99f7
|
||||
with:
|
||||
commit-message: Update build artifact sizes in check_metadata.sh
|
||||
delete-branch: true
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
".": "8.0.0"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -150,8 +150,7 @@ const PROCEDURE_DEF_COMMON = {
|
||||
this.argumentVarModels_.push(variable);
|
||||
} else {
|
||||
console.log(
|
||||
'Failed to create a variable with name ' + varName +
|
||||
', ignoring.');
|
||||
`Failed to create a variable named "${varName}", ignoring.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,230 +0,0 @@
|
||||
// Do not edit this file; automatically generated.
|
||||
|
||||
/* eslint-disable */
|
||||
;(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) { // AMD
|
||||
define(["./blockly_compressed.js"], factory);
|
||||
} else if (typeof exports === 'object') { // Node.js
|
||||
module.exports = factory(require("./blockly_compressed.js"));
|
||||
} else { // Browser
|
||||
var factoryExports = factory(root.Blockly);
|
||||
root.Blockly.libraryBlocks = factoryExports;
|
||||
}
|
||||
}(this, function(__parent__) {
|
||||
var $=__parent__.__namespace__;
|
||||
var module$exports$Blockly$libraryBlocks$variablesDynamic={},module$contents$Blockly$libraryBlocks$variablesDynamic_ContextMenu=$.module$build$src$core$contextmenu,module$contents$Blockly$libraryBlocks$variablesDynamic_Extensions=$.module$build$src$core$extensions,module$contents$Blockly$libraryBlocks$variablesDynamic_Variables=$.module$build$src$core$variables,module$contents$Blockly$libraryBlocks$variablesDynamic_xml=$.module$build$src$core$utils$xml,module$contents$Blockly$libraryBlocks$variablesDynamic_BlockDefinition=
|
||||
Object,module$contents$Blockly$libraryBlocks$variablesDynamic_Msg=$.module$build$src$core$msg.Msg,module$contents$Blockly$libraryBlocks$variablesDynamic_createBlockDefinitionsFromJsonArray=$.module$build$src$core$common.createBlockDefinitionsFromJsonArray,module$contents$Blockly$libraryBlocks$variablesDynamic_defineBlocks=$.module$build$src$core$common.defineBlocks;
|
||||
module$exports$Blockly$libraryBlocks$variablesDynamic.blocks=module$contents$Blockly$libraryBlocks$variablesDynamic_createBlockDefinitionsFromJsonArray([{type:"variables_get_dynamic",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_dynamic_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableDynamicSetterGetter"]},{type:"variables_set_dynamic",message0:"%{BKY_VARIABLES_SET}",
|
||||
args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_dynamic_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableDynamicSetterGetter"]}]);
|
||||
var module$contents$Blockly$libraryBlocks$variablesDynamic_CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getFieldValue("VAR");var c=this.workspace.getVariableById(b).type;if("variables_get_dynamic"===this.type){b="variables_set_dynamic";var d=module$contents$Blockly$libraryBlocks$variablesDynamic_Msg.VARIABLES_GET_CREATE_SET}else b="variables_get_dynamic",d=module$contents$Blockly$libraryBlocks$variablesDynamic_Msg.VARIABLES_SET_CREATE_GET;
|
||||
var e={enabled:0<this.workspace.remainingCapacity()};const f=this.getField("VAR").getText();e.text=d.replace("%1",f);d=$.module$build$src$core$utils$xml.createElement("field");d.setAttribute("name","VAR");d.setAttribute("variabletype",c);d.appendChild($.module$build$src$core$utils$xml.createTextNode(f));c=$.module$build$src$core$utils$xml.createElement("block");c.setAttribute("type",b);c.appendChild(d);e.callback=$.module$build$src$core$contextmenu.callbackFactory(this,c);a.push(e)}else if("variables_get_dynamic"===
|
||||
this.type||"variables_get_reporter_dynamic"===this.type)b={text:module$contents$Blockly$libraryBlocks$variablesDynamic_Msg.RENAME_VARIABLE,enabled:!0,callback:module$contents$Blockly$libraryBlocks$variablesDynamic_renameOptionCallbackFactory(this)},e=this.getField("VAR").getText(),e={text:module$contents$Blockly$libraryBlocks$variablesDynamic_Msg.DELETE_VARIABLE.replace("%1",e),enabled:!0,callback:module$contents$Blockly$libraryBlocks$variablesDynamic_deleteOptionCallbackFactory(this)},a.unshift(b),
|
||||
a.unshift(e)},onchange:function(a){a=this.getFieldValue("VAR");a=$.module$build$src$core$variables.getVariable(this.workspace,a);"variables_get_dynamic"===this.type?this.outputConnection.setCheck(a.type):this.getInput("VALUE").connection.setCheck(a.type)}},module$contents$Blockly$libraryBlocks$variablesDynamic_renameOptionCallbackFactory=function(a){return function(){const b=a.workspace,c=a.getField("VAR").getVariable();$.module$build$src$core$variables.renameVariable(b,c)}},module$contents$Blockly$libraryBlocks$variablesDynamic_deleteOptionCallbackFactory=
|
||||
function(a){return function(){const b=a.workspace,c=a.getField("VAR").getVariable();b.deleteVariableById(c.getId());b.refreshToolboxSelection()}};$.module$build$src$core$extensions.registerMixin("contextMenu_variableDynamicSetterGetter",module$contents$Blockly$libraryBlocks$variablesDynamic_CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);module$contents$Blockly$libraryBlocks$variablesDynamic_defineBlocks(module$exports$Blockly$libraryBlocks$variablesDynamic.blocks);var module$exports$Blockly$libraryBlocks$variables={},module$contents$Blockly$libraryBlocks$variables_ContextMenu=$.module$build$src$core$contextmenu,module$contents$Blockly$libraryBlocks$variables_Extensions=$.module$build$src$core$extensions,module$contents$Blockly$libraryBlocks$variables_Variables=$.module$build$src$core$variables,module$contents$Blockly$libraryBlocks$variables_xmlUtils=$.module$build$src$core$utils$xml,module$contents$Blockly$libraryBlocks$variables_BlockDefinition=Object,module$contents$Blockly$libraryBlocks$variables_Msg=
|
||||
$.module$build$src$core$msg.Msg,module$contents$Blockly$libraryBlocks$variables_createBlockDefinitionsFromJsonArray=$.module$build$src$core$common.createBlockDefinitionsFromJsonArray,module$contents$Blockly$libraryBlocks$variables_defineBlocks=$.module$build$src$core$common.defineBlocks;
|
||||
module$exports$Blockly$libraryBlocks$variables.blocks=module$contents$Blockly$libraryBlocks$variables_createBlockDefinitionsFromJsonArray([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",
|
||||
name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]);
|
||||
var module$contents$Blockly$libraryBlocks$variables_CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){if("variables_get"===this.type){var b="variables_set";var c=module$contents$Blockly$libraryBlocks$variables_Msg.VARIABLES_GET_CREATE_SET}else b="variables_get",c=module$contents$Blockly$libraryBlocks$variables_Msg.VARIABLES_SET_CREATE_GET;var d={enabled:0<this.workspace.remainingCapacity()},e=this.getField("VAR").getText();d.text=c.replace("%1",e);
|
||||
c=$.module$build$src$core$utils$xml.createElement("field");c.setAttribute("name","VAR");c.appendChild($.module$build$src$core$utils$xml.createTextNode(e));e=$.module$build$src$core$utils$xml.createElement("block");e.setAttribute("type",b);e.appendChild(c);d.callback=$.module$build$src$core$contextmenu.callbackFactory(this,e);a.push(d)}else if("variables_get"===this.type||"variables_get_reporter"===this.type)b={text:module$contents$Blockly$libraryBlocks$variables_Msg.RENAME_VARIABLE,enabled:!0,callback:module$contents$Blockly$libraryBlocks$variables_renameOptionCallbackFactory(this)},
|
||||
d=this.getField("VAR").getText(),d={text:module$contents$Blockly$libraryBlocks$variables_Msg.DELETE_VARIABLE.replace("%1",d),enabled:!0,callback:module$contents$Blockly$libraryBlocks$variables_deleteOptionCallbackFactory(this)},a.unshift(b),a.unshift(d)}},module$contents$Blockly$libraryBlocks$variables_renameOptionCallbackFactory=function(a){return function(){const b=a.workspace,c=a.getField("VAR").getVariable();$.module$build$src$core$variables.renameVariable(b,c)}},module$contents$Blockly$libraryBlocks$variables_deleteOptionCallbackFactory=
|
||||
function(a){return function(){const b=a.workspace,c=a.getField("VAR").getVariable();b.deleteVariableById(c.getId());b.refreshToolboxSelection()}};$.module$build$src$core$extensions.registerMixin("contextMenu_variableSetterGetter",module$contents$Blockly$libraryBlocks$variables_CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);module$contents$Blockly$libraryBlocks$variables_defineBlocks(module$exports$Blockly$libraryBlocks$variables.blocks);var module$exports$Blockly$libraryBlocks$texts={},module$contents$Blockly$libraryBlocks$texts_Extensions=$.module$build$src$core$extensions,module$contents$Blockly$libraryBlocks$texts_Msg=$.module$build$src$core$msg.Msg,module$contents$Blockly$libraryBlocks$texts_xmlUtils=$.module$build$src$core$utils$xml,module$contents$Blockly$libraryBlocks$texts_Align=$.Align$$module$build$src$core$input,module$contents$Blockly$libraryBlocks$texts_BlockDefinition=Object,module$contents$Blockly$libraryBlocks$texts_ConnectionType=
|
||||
$.module$build$src$core$connection_type.ConnectionType,module$contents$Blockly$libraryBlocks$texts_FieldDropdown=$.module$build$src$core$field_dropdown.FieldDropdown,module$contents$Blockly$libraryBlocks$texts_FieldImage=$.FieldImage$$module$build$src$core$field_image,module$contents$Blockly$libraryBlocks$texts_FieldTextInput=$.FieldTextInput$$module$build$src$core$field_textinput,module$contents$Blockly$libraryBlocks$texts_Mutator=$.Mutator$$module$build$src$core$mutator,module$contents$Blockly$libraryBlocks$texts_createBlockDefinitionsFromJsonArray=
|
||||
$.module$build$src$core$common.createBlockDefinitionsFromJsonArray,module$contents$Blockly$libraryBlocks$texts_defineBlocks=$.module$build$src$core$common.defineBlocks;
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks=module$contents$Blockly$libraryBlocks$texts_createBlockDefinitionsFromJsonArray([{type:"text",message0:"%1",args0:[{type:"field_input",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["text_quotes","parent_tooltip_when_inline"]},{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",
|
||||
width:12,height:17,alt:"\u00b6"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"},{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",args0:[{type:"input_dummy"},
|
||||
{type:"input_statement",name:"STACK"}],style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},{type:"input_value",name:"TEXT"}],
|
||||
previousStatement:null,nextStatement:null,style:"text_blocks",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"text_blocks",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"text_blocks",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}",
|
||||
helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",style:"text_blocks",helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}",
|
||||
args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}",inputsInline:!0,mutator:"text_charAt_mutator"}]);
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks.text_getSubstring={init:function(){this.WHERE_OPTIONS_1=[[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],
|
||||
[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]];this.setHelpUrl(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_HELPURL);this.setStyle("text_blocks");this.appendValueInput("STRING").setCheck("String").appendField(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT);this.appendDummyInput("AT1");this.appendDummyInput("AT2");
|
||||
module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_TAIL);this.setInputsInline(!0);this.setOutput(!0,"String");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");var b=this.getInput("AT1").type===
|
||||
$.module$build$src$core$connection_type.ConnectionType.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type===$.module$build$src$core$connection_type.ConnectionType.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){const 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"),module$contents$Blockly$libraryBlocks$texts_Msg.ORDINAL_NUMBER_SUFFIX&&
|
||||
this.appendDummyInput("ORDINAL"+a).appendField(module$contents$Blockly$libraryBlocks$texts_Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+a);2===a&&module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_GET_SUBSTRING_TAIL));const c=new module$contents$Blockly$libraryBlocks$texts_FieldDropdown(this["WHERE_OPTIONS_"+a],function(d){const e="FROM_START"===
|
||||
d||"FROM_END"===d;if(e!==b){const f=this.getSourceBlock();f.updateAt_(a,e);f.setFieldValue(d,"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"))}};
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks.text_changeCase={init:function(){const a=[[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_CHANGECASE_HELPURL);this.setStyle("text_blocks");
|
||||
this.appendValueInput("TEXT").setCheck("String").appendField(new module$contents$Blockly$libraryBlocks$texts_FieldDropdown(a),"CASE");this.setOutput(!0,"String");this.setTooltip(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_CHANGECASE_TOOLTIP)}};
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks.text_trim={init:function(){const a=[[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_TRIM_HELPURL);this.setStyle("text_blocks");this.appendValueInput("TEXT").setCheck("String").appendField(new module$contents$Blockly$libraryBlocks$texts_FieldDropdown(a),
|
||||
"MODE");this.setOutput(!0,"String");this.setTooltip(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_TRIM_TOOLTIP)}};module$exports$Blockly$libraryBlocks$texts.blocks.text_print={init:function(){this.jsonInit({message0:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PRINT_TOOLTIP,helpUrl:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PRINT_HELPURL})}};
|
||||
var module$contents$Blockly$libraryBlocks$texts_TEXT_PROMPT_COMMON={updateType_:function(a){this.outputConnection.setCheck("NUMBER"===a?"Number":"String")},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");a.setAttribute("type",this.getFieldValue("TYPE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("type"))}};
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks.text_prompt_ext=Object.assign({},module$contents$Blockly$libraryBlocks$texts_TEXT_PROMPT_COMMON,{init:function(){var a=[[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_HELPURL);this.setStyle("text_blocks");const b=this;a=new module$contents$Blockly$libraryBlocks$texts_FieldDropdown(a,
|
||||
function(c){b.updateType_(c)});this.appendValueInput("TEXT").appendField(a,"TYPE");this.setOutput(!0,"String");this.setTooltip(function(){return"TEXT"===b.getFieldValue("TYPE")?module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_TOOLTIP_TEXT:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_TOOLTIP_NUMBER})}});
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks.text_prompt=Object.assign({},module$contents$Blockly$libraryBlocks$texts_TEXT_PROMPT_COMMON,{init:function(){this.mixin(module$contents$Blockly$libraryBlocks$texts_QUOTE_IMAGE_MIXIN);var a=[[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];const b=this;this.setHelpUrl(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_HELPURL);
|
||||
this.setStyle("text_blocks");a=new module$contents$Blockly$libraryBlocks$texts_FieldDropdown(a,function(c){b.updateType_(c)});this.appendDummyInput().appendField(a,"TYPE").appendField(this.newQuote_(!0)).appendField(new $.FieldTextInput$$module$build$src$core$field_textinput(""),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");this.setTooltip(function(){return"TEXT"===b.getFieldValue("TYPE")?module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_TOOLTIP_TEXT:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_PROMPT_TOOLTIP_NUMBER})}});
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks.text_count={init:function(){this.jsonInit({message0:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_COUNT_TOOLTIP,helpUrl:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_COUNT_HELPURL})}};
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks.text_replace={init:function(){this.jsonInit({message0:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_REPLACE_TOOLTIP,helpUrl:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_REPLACE_HELPURL})}};
|
||||
module$exports$Blockly$libraryBlocks$texts.blocks.text_reverse={init:function(){this.jsonInit({message0:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_REVERSE_TOOLTIP,helpUrl:module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_REVERSE_HELPURL})}};
|
||||
var module$contents$Blockly$libraryBlocks$texts_QUOTE_IMAGE_MIXIN={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",
|
||||
QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(a){for(let b=0,c;c=this.inputList[b];b++)for(let d=0,e;e=c.fieldRow[d];d++)if(a===e.name){c.insertFieldAt(d,this.newQuote_(!0));c.insertFieldAt(d+2,this.newQuote_(!1));return}console.warn('field named "'+a+'" not found in '+this.toDevString())},newQuote_:function(a){a=this.RTL?!a:a;return new $.FieldImage$$module$build$src$core$field_image(a?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,this.QUOTE_IMAGE_WIDTH,this.QUOTE_IMAGE_HEIGHT,
|
||||
a?"\u201c":"\u201d")}},module$contents$Blockly$libraryBlocks$texts_TEXT_QUOTES_EXTENSION=function(){this.mixin(module$contents$Blockly$libraryBlocks$texts_QUOTE_IMAGE_MIXIN);this.quoteField_("TEXT")},module$contents$Blockly$libraryBlocks$texts_TEXT_JOIN_MUTATOR_MIXIN={mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},
|
||||
saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(a){this.itemCount_=a.itemCount;this.updateShape_()},decompose:function(a){const b=a.newBlock("text_create_join_container");b.initSvg();let c=b.getInput("STACK").connection;for(let d=0;d<this.itemCount_;d++){const e=a.newBlock("text_create_join_item");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)b.isInsertionMarker()||
|
||||
a.push(b.valueConnection_),b=b.getNextBlock();for(b=0;b<this.itemCount_;b++){const 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++)$.Mutator$$module$build$src$core$mutator.reconnect(a[b],this,"ADD"+b)},saveConnections:function(a){a=a.getInputTargetBlock("STACK");let b=0;for(;a;){if(a.isInsertionMarker()){a=a.getNextBlock();continue}const c=this.getInput("ADD"+b);a.valueConnection_=
|
||||
c&&c.connection.targetConnection;a=a.getNextBlock();b++}},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)){const b=this.appendValueInput("ADD"+a).setAlign($.Align$$module$build$src$core$input.RIGHT);0===a&&b.appendField(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_JOIN_TITLE_CREATEWITH)}for(a=
|
||||
this.itemCount_;this.getInput("ADD"+a);a++)this.removeInput("ADD"+a)}},module$contents$Blockly$libraryBlocks$texts_TEXT_JOIN_EXTENSION=function(){this.mixin(module$contents$Blockly$libraryBlocks$texts_QUOTE_IMAGE_MIXIN);this.itemCount_=2;this.updateShape_();this.setMutator(new $.Mutator$$module$build$src$core$mutator(["text_create_join_item"],this))};
|
||||
$.module$build$src$core$extensions.register("text_append_tooltip",$.module$build$src$core$extensions.buildTooltipWithFieldText("%{BKY_TEXT_APPEND_TOOLTIP}","VAR"));
|
||||
var module$contents$Blockly$libraryBlocks$texts_TEXT_INDEXOF_TOOLTIP_EXTENSION=function(){const a=this;this.setTooltip(function(){return module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_INDEXOF_TOOLTIP.replace("%1",a.workspace.options.oneBasedIndex?"0":"-1")})},module$contents$Blockly$libraryBlocks$texts_TEXT_CHARAT_MUTATOR_MIXIN={mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");a.setAttribute("at",!!this.isAt_);return a},domToMutation:function(a){a=
|
||||
"false"!==a.getAttribute("at");this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT",!0);this.removeInput("ORDINAL",!0);a&&(this.appendValueInput("AT").setCheck("Number"),module$contents$Blockly$libraryBlocks$texts_Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(module$contents$Blockly$libraryBlocks$texts_Msg.ORDINAL_NUMBER_SUFFIX));module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_CHARAT_TAIL));
|
||||
this.isAt_=a}},module$contents$Blockly$libraryBlocks$texts_TEXT_CHARAT_EXTENSION=function(){this.getField("WHERE").setValidator(function(b){b="FROM_START"===b||"FROM_END"===b;b!==this.isAt_&&this.getSourceBlock().updateAt_(b)});this.updateAt_(!0);const a=this;this.setTooltip(function(){var b=a.getFieldValue("WHERE");let c=module$contents$Blockly$libraryBlocks$texts_Msg.TEXT_CHARAT_TOOLTIP;("FROM_START"===b||"FROM_END"===b)&&(b="FROM_START"===b?module$contents$Blockly$libraryBlocks$texts_Msg.LISTS_INDEX_FROM_START_TOOLTIP:
|
||||
module$contents$Blockly$libraryBlocks$texts_Msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(c+=" "+b.replace("%1",a.workspace.options.oneBasedIndex?"#1":"#0"));return c})};$.module$build$src$core$extensions.register("text_indexOf_tooltip",module$contents$Blockly$libraryBlocks$texts_TEXT_INDEXOF_TOOLTIP_EXTENSION);$.module$build$src$core$extensions.register("text_quotes",module$contents$Blockly$libraryBlocks$texts_TEXT_QUOTES_EXTENSION);
|
||||
$.module$build$src$core$extensions.registerMutator("text_join_mutator",module$contents$Blockly$libraryBlocks$texts_TEXT_JOIN_MUTATOR_MIXIN,module$contents$Blockly$libraryBlocks$texts_TEXT_JOIN_EXTENSION);$.module$build$src$core$extensions.registerMutator("text_charAt_mutator",module$contents$Blockly$libraryBlocks$texts_TEXT_CHARAT_MUTATOR_MIXIN,module$contents$Blockly$libraryBlocks$texts_TEXT_CHARAT_EXTENSION);module$contents$Blockly$libraryBlocks$texts_defineBlocks(module$exports$Blockly$libraryBlocks$texts.blocks);var module$exports$Blockly$libraryBlocks$procedures={},module$contents$Blockly$libraryBlocks$procedures_ContextMenu=$.module$build$src$core$contextmenu,module$contents$Blockly$libraryBlocks$procedures_Events=$.module$build$src$core$events$events,module$contents$Blockly$libraryBlocks$procedures_Procedures=$.module$build$src$core$procedures,module$contents$Blockly$libraryBlocks$procedures_Variables=$.module$build$src$core$variables,module$contents$Blockly$libraryBlocks$procedures_Xml=$.module$build$src$core$xml,
|
||||
module$contents$Blockly$libraryBlocks$procedures_xmlUtils=$.module$build$src$core$utils$xml,module$contents$Blockly$libraryBlocks$procedures_Align=$.Align$$module$build$src$core$input,module$contents$Blockly$libraryBlocks$procedures_BlockDefinition=Object,module$contents$Blockly$libraryBlocks$procedures_config=$.config$$module$build$src$core$config,module$contents$Blockly$libraryBlocks$procedures_FieldCheckbox=$.FieldCheckbox$$module$build$src$core$field_checkbox,module$contents$Blockly$libraryBlocks$procedures_FieldLabel=
|
||||
$.FieldLabel$$module$build$src$core$field_label,module$contents$Blockly$libraryBlocks$procedures_FieldTextInput=$.FieldTextInput$$module$build$src$core$field_textinput,module$contents$Blockly$libraryBlocks$procedures_Msg=$.module$build$src$core$msg.Msg,module$contents$Blockly$libraryBlocks$procedures_Mutator=$.Mutator$$module$build$src$core$mutator,module$contents$Blockly$libraryBlocks$procedures_Names=$.module$build$src$core$names.Names,module$contents$Blockly$libraryBlocks$procedures_defineBlocks=
|
||||
$.module$build$src$core$common.defineBlocks;module$exports$Blockly$libraryBlocks$procedures.blocks={};
|
||||
var module$contents$Blockly$libraryBlocks$procedures_PROCEDURE_DEF_COMMON={setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=a)},updateParams_:function(){let a="";this.arguments_.length&&(a=module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_BEFORE_PARAMS+
|
||||
" "+this.arguments_.join(", "));$.module$build$src$core$events$events.disable();try{this.setFieldValue(a,"PARAMS")}finally{$.module$build$src$core$events$events.enable()}},mutationToDom:function(a){const b=$.module$build$src$core$utils$xml.createElement("mutation");a&&b.setAttribute("name",this.getFieldValue("NAME"));for(let c=0;c<this.argumentVarModels_.length;c++){const d=$.module$build$src$core$utils$xml.createElement("arg"),e=this.argumentVarModels_[c];d.setAttribute("name",e.name);d.setAttribute("varid",
|
||||
e.getId());a&&this.paramIds_&&d.setAttribute("paramId",this.paramIds_[c]);b.appendChild(d)}this.hasStatements_||b.setAttribute("statements","false");return b},domToMutation:function(a){this.arguments_=[];this.argumentVarModels_=[];for(let c=0,d;d=a.childNodes[c];c++)if("arg"===d.nodeName.toLowerCase()){const e=d.getAttribute("name");var b=d.getAttribute("varid")||d.getAttribute("varId");this.arguments_.push(e);b=$.module$build$src$core$variables.getOrCreateVariablePackage(this.workspace,b,e,"");null!==
|
||||
b?this.argumentVarModels_.push(b):console.log("Failed to create a variable with name "+e+", ignoring.")}this.updateParams_();$.module$build$src$core$procedures.mutateCallers(this);this.setStatements_("false"!==a.getAttribute("statements"))},saveExtraState:function(){if(!this.argumentVarModels_.length&&this.hasStatements_)return null;const a=Object.create(null);if(this.argumentVarModels_.length){a.params=[];for(let b=0;b<this.argumentVarModels_.length;b++)a.params.push({name:this.argumentVarModels_[b].name,
|
||||
id:this.argumentVarModels_[b].getId()})}this.hasStatements_||(a.hasStatements=!1);return a},loadExtraState:function(a){this.arguments_=[];this.argumentVarModels_=[];if(a.params)for(let c=0;c<a.params.length;c++){var b=a.params[c];b=$.module$build$src$core$variables.getOrCreateVariablePackage(this.workspace,b.id,b.name,"");this.arguments_.push(b.name);this.argumentVarModels_.push(b)}this.updateParams_();$.module$build$src$core$procedures.mutateCallers(this);this.setStatements_(!1===a.hasStatements?
|
||||
!1:!0)},decompose:function(a){const b=$.module$build$src$core$utils$xml.createElement("block");b.setAttribute("type","procedures_mutatorcontainer");var c=$.module$build$src$core$utils$xml.createElement("statement");c.setAttribute("name","STACK");b.appendChild(c);for(let e=0;e<this.arguments_.length;e++){const f=$.module$build$src$core$utils$xml.createElement("block");f.setAttribute("type","procedures_mutatorarg");var d=$.module$build$src$core$utils$xml.createElement("field");d.setAttribute("name",
|
||||
"NAME");const g=$.module$build$src$core$utils$xml.createTextNode(this.arguments_[e]);d.appendChild(g);f.appendChild(d);d=$.module$build$src$core$utils$xml.createElement("next");f.appendChild(d);c.appendChild(f);c=d}a=$.module$build$src$core$xml.domToBlock(b,a);"procedures_defreturn"===this.type?a.setFieldValue(this.hasStatements_,"STATEMENTS"):a.removeInput("STATEMENT_INPUT");$.module$build$src$core$procedures.mutateCallers(this);return a},compose:function(a){this.arguments_=[];this.paramIds_=[];
|
||||
this.argumentVarModels_=[];let b=a.getInputTargetBlock("STACK");for(;b&&!b.isInsertionMarker();){var c=b.getFieldValue("NAME");this.arguments_.push(c);c=this.workspace.getVariable(c,"");this.argumentVarModels_.push(c);this.paramIds_.push(b.id);b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateParams_();$.module$build$src$core$procedures.mutateCallers(this);a=a.getFieldValue("STATEMENTS");if(null!==a&&(a="TRUE"===a,this.hasStatements_!==a))if(a)this.setStatements_(!0),$.Mutator$$module$build$src$core$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)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(a,b){var c=this.workspace.getVariableById(a);if(""===c.type){c=c.name;b=this.workspace.getVariableById(b);var d=!1;for(let e=0;e<this.argumentVarModels_.length;e++)this.argumentVarModels_[e].getId()===
|
||||
a&&(this.arguments_[e]=b.name,this.argumentVarModels_[e]=b,d=!0);d&&(this.displayRenamedVar_(c,b.name),$.module$build$src$core$procedures.mutateCallers(this))}},updateVarName:function(a){const b=a.name;let c=!1,d;for(let e=0;e<this.argumentVarModels_.length;e++)this.argumentVarModels_[e].getId()===a.getId()&&(d=this.arguments_[e],this.arguments_[e]=b,c=!0);c&&(this.displayRenamedVar_(d,b),$.module$build$src$core$procedures.mutateCallers(this))},displayRenamedVar_:function(a,b){this.updateParams_();
|
||||
if(this.mutator&&this.mutator.isVisible()){const c=this.mutator.workspace_.getAllBlocks(!1);for(let d=0,e;e=c[d];d++)"procedures_mutatorarg"===e.type&&$.module$build$src$core$names.Names.equals(a,e.getFieldValue("NAME"))&&e.setFieldValue(b,"NAME")}},customContextMenu:function(a){if(!this.isInFlyout){var b={enabled:!0},c=this.getFieldValue("NAME");b.text=module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_CREATE_DO.replace("%1",c);var d=$.module$build$src$core$utils$xml.createElement("mutation");
|
||||
d.setAttribute("name",c);for(c=0;c<this.arguments_.length;c++){var e=$.module$build$src$core$utils$xml.createElement("arg");e.setAttribute("name",this.arguments_[c]);d.appendChild(e)}c=$.module$build$src$core$utils$xml.createElement("block");c.setAttribute("type",this.callType_);c.appendChild(d);b.callback=$.module$build$src$core$contextmenu.callbackFactory(this,c);a.push(b);if(!this.isCollapsed())for(b=0;b<this.argumentVarModels_.length;b++)d={enabled:!0},c=this.argumentVarModels_[b],d.text=module$contents$Blockly$libraryBlocks$procedures_Msg.VARIABLES_SET_CREATE_GET.replace("%1",
|
||||
c.name),c=$.module$build$src$core$variables.generateVariableFieldDom(c),e=$.module$build$src$core$utils$xml.createElement("block"),e.setAttribute("type","variables_get"),e.appendChild(c),d.callback=$.module$build$src$core$contextmenu.callbackFactory(this,e),a.push(d)}}};
|
||||
module$exports$Blockly$libraryBlocks$procedures.blocks.procedures_defnoreturn=Object.assign({},module$contents$Blockly$libraryBlocks$procedures_PROCEDURE_DEF_COMMON,{init:function(){var a=$.module$build$src$core$procedures.findLegalName("",this);a=new $.FieldTextInput$$module$build$src$core$field_textinput(a,$.module$build$src$core$procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(a,
|
||||
"NAME").appendField("","PARAMS");this.setMutator(new $.Mutator$$module$build$src$core$mutator(["procedures_mutatorarg"],this));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFNORETURN_COMMENT);this.setStyle("procedure_blocks");this.setTooltip(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFNORETURN_TOOLTIP);
|
||||
this.setHelpUrl(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFNORETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},callType_:"procedures_callnoreturn"});
|
||||
module$exports$Blockly$libraryBlocks$procedures.blocks.procedures_defreturn=Object.assign({},module$contents$Blockly$libraryBlocks$procedures_PROCEDURE_DEF_COMMON,{init:function(){var a=$.module$build$src$core$procedures.findLegalName("",this);a=new $.FieldTextInput$$module$build$src$core$field_textinput(a,$.module$build$src$core$procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_TITLE).appendField(a,
|
||||
"NAME").appendField("","PARAMS");this.appendValueInput("RETURN").setAlign($.Align$$module$build$src$core$input.RIGHT).appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_RETURN);this.setMutator(new $.Mutator$$module$build$src$core$mutator(["procedures_mutatorarg"],this));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_COMMENT&&
|
||||
this.setCommentText(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_COMMENT);this.setStyle("procedure_blocks");this.setTooltip(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_TOOLTIP);this.setHelpUrl(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,
|
||||
!0]},callType_:"procedures_callreturn"});
|
||||
module$exports$Blockly$libraryBlocks$procedures.blocks.procedures_mutatorcontainer={init:function(){this.appendDummyInput().appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_MUTATORCONTAINER_TITLE);this.appendStatementInput("STACK");this.appendDummyInput("STATEMENT_INPUT").appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new $.FieldCheckbox$$module$build$src$core$field_checkbox("TRUE"),"STATEMENTS");this.setStyle("procedure_blocks");
|
||||
this.setTooltip(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP);this.contextMenu=!1}};
|
||||
module$exports$Blockly$libraryBlocks$procedures.blocks.procedures_mutatorarg={init:function(){const a=new $.FieldTextInput$$module$build$src$core$field_textinput($.module$build$src$core$procedures.DEFAULT_ARG,this.validator_);a.oldShowEditorFn_=a.showEditor_;a.showEditor_=function(){this.createdVariables_=[];this.oldShowEditorFn_()};this.appendDummyInput().appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_MUTATORARG_TITLE).appendField(a,"NAME");this.setPreviousStatement(!0);
|
||||
this.setNextStatement(!0);this.setStyle("procedure_blocks");this.setTooltip(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_MUTATORARG_TOOLTIP);this.contextMenu=!1;a.onFinishEditing_=this.deleteIntermediateVars_;a.createdVariables_=[];a.onFinishEditing_("x")},validator_:function(a){var b=this.getSourceBlock();const c=$.Mutator$$module$build$src$core$mutator.findParentWs(b.workspace);a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"");if(!a)return null;const d=(b.workspace.targetWorkspace||
|
||||
b.workspace).getAllBlocks(!1),e=a.toLowerCase();for(let f=0;f<d.length;f++){if(d[f].id===this.getSourceBlock().id)continue;const g=d[f].getFieldValue("NAME");if(g&&g.toLowerCase()===e)return null}if(b.isInFlyout)return a;(b=c.getVariable(a,""))&&b.name!==a&&c.renameVariableById(b.getId(),a);b||(b=c.createVariable(a,""))&&this.createdVariables_&&this.createdVariables_.push(b);return a},deleteIntermediateVars_:function(a){const b=$.Mutator$$module$build$src$core$mutator.findParentWs(this.getSourceBlock().workspace);
|
||||
if(b)for(let c=0;c<this.createdVariables_.length;c++){const d=this.createdVariables_[c];d.name!==a&&b.deleteVariableById(d.getId())}}};
|
||||
var module$contents$Blockly$libraryBlocks$procedures_PROCEDURE_CALL_COMMON={getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(a,b){$.module$build$src$core$names.Names.equals(a,this.getProcedureCall())&&(this.setFieldValue(b,"NAME"),this.setTooltip((this.outputConnection?module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_CALLRETURN_TOOLTIP:module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",b)))},setProcedureParameters_:function(a,
|
||||
b){var c=$.module$build$src$core$procedures.getDefinition(this.getProcedureCall(),this.workspace),d=c&&c.mutator&&c.mutator.isVisible();d?this.setCollapsed(!1):(this.quarkConnections_={},this.quarkIds_=null);if(a.join("\n")===this.arguments_.join("\n"))this.quarkIds_=b;else{if(b.length!==a.length)throw RangeError("paramNames and paramIds must be the same length.");this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);c=this.rendered;this.rendered=!1;for(let f=0;f<this.arguments_.length;f++){var e=
|
||||
this.getInput("ARG"+f);e&&(e=e.connection.targetConnection,this.quarkConnections_[this.quarkIds_[f]]=e,d&&e&&-1===b.indexOf(this.quarkIds_[f])&&(e.disconnect(),e.getSourceBlock().bumpNeighbours()))}this.arguments_=[].concat(a);this.argumentVarModels_=[];for(a=0;a<this.arguments_.length;a++)d=$.module$build$src$core$variables.getOrCreateVariablePackage(this.workspace,null,this.arguments_[a],""),this.argumentVarModels_.push(d);this.updateShape_();if(this.quarkIds_=b)for(b=0;b<this.arguments_.length;b++)a=
|
||||
this.quarkIds_[b],a in this.quarkConnections_&&($.Mutator$$module$build$src$core$mutator.reconnect(this.quarkConnections_[a],this,"ARG"+b)||delete this.quarkConnections_[a]);(this.rendered=c)&&this.render()}},updateShape_:function(){for(var a=0;a<this.arguments_.length;a++){var b=this.getField("ARGNAME"+a);if(b){$.module$build$src$core$events$events.disable();try{b.setValue(this.arguments_[a])}finally{$.module$build$src$core$events$events.enable()}}else b=new $.FieldLabel$$module$build$src$core$field_label(this.arguments_[a]),
|
||||
this.appendValueInput("ARG"+a).setAlign($.Align$$module$build$src$core$input.RIGHT).appendField(b,"ARGNAME"+a).init()}for(a=this.arguments_.length;this.getInput("ARG"+a);a++)this.removeInput("ARG"+a);if(a=this.getInput("TOPROW"))this.arguments_.length?this.getField("WITH")||(a.appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),a.init()):this.getField("WITH")&&a.removeField("WITH")},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");
|
||||
a.setAttribute("name",this.getProcedureCall());for(let b=0;b<this.arguments_.length;b++){const c=$.module$build$src$core$utils$xml.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);b=[];const c=[];for(let d=0,e;e=a.childNodes[d];d++)"arg"===e.nodeName.toLowerCase()&&(b.push(e.getAttribute("name")),c.push(e.getAttribute("paramId")));this.setProcedureParameters_(b,
|
||||
c)},saveExtraState:function(){const a=Object.create(null);a.name=this.getProcedureCall();this.arguments_.length&&(a.params=this.arguments_);return a},loadExtraState:function(a){this.renameProcedure(this.getProcedureCall(),a.name);if(a=a.params){const b=[];b.length=a.length;b.fill(null);this.setProcedureParameters_(a,b)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},onchange:function(a){if(this.workspace&&!this.workspace.isFlyout&&a.recordUndo)if(a.type===
|
||||
$.module$build$src$core$events$events.BLOCK_CREATE&&-1!==a.ids.indexOf(this.id)){var b=this.getProcedureCall();b=$.module$build$src$core$procedures.getDefinition(b,this.workspace);!b||b.type===this.defType_&&JSON.stringify(b.getVars())===JSON.stringify(this.arguments_)||(b=null);if(!b){$.module$build$src$core$events$events.setGroup(a.group);a=$.module$build$src$core$utils$xml.createElement("xml");b=$.module$build$src$core$utils$xml.createElement("block");b.setAttribute("type",this.defType_);var c=
|
||||
this.getRelativeToSurfaceXY(),d=c.y+2*$.config$$module$build$src$core$config.snapRadius;b.setAttribute("x",c.x+$.config$$module$build$src$core$config.snapRadius*(this.RTL?-1:1));b.setAttribute("y",d);c=this.mutationToDom();b.appendChild(c);c=$.module$build$src$core$utils$xml.createElement("field");c.setAttribute("name","NAME");d=this.getProcedureCall();const e=$.module$build$src$core$procedures.findLegalName(d,this);d!==e&&this.renameProcedure(d,e);c.appendChild($.module$build$src$core$utils$xml.createTextNode(d));
|
||||
b.appendChild(c);a.appendChild(b);$.module$build$src$core$xml.domToWorkspace(a,this.workspace);$.module$build$src$core$events$events.setGroup(!1)}}else a.type===$.module$build$src$core$events$events.BLOCK_DELETE&&a.blockId!=this.id?(b=this.getProcedureCall(),$.module$build$src$core$procedures.getDefinition(b,this.workspace)||($.module$build$src$core$events$events.setGroup(a.group),this.dispose(!0),$.module$build$src$core$events$events.setGroup(!1))):a.type===$.module$build$src$core$events$events.CHANGE&&
|
||||
"disabled"===a.element&&(b=this.getProcedureCall(),(b=$.module$build$src$core$procedures.getDefinition(b,this.workspace))&&b.id===a.blockId&&((b=$.module$build$src$core$events$events.getGroup())&&console.log("Saw an existing group while responding to a definition change"),$.module$build$src$core$events$events.setGroup(a.group),a.newValue?(this.previousEnabledState_=this.isEnabled(),this.setEnabled(!1)):this.setEnabled(this.previousEnabledState_),$.module$build$src$core$events$events.setGroup(b)))},
|
||||
customContextMenu:function(a){if(this.workspace.isMovable()){var b={enabled:!0};b.text=module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_HIGHLIGHT_DEF;var c=this.getProcedureCall(),d=this.workspace;b.callback=function(){const e=$.module$build$src$core$procedures.getDefinition(c,d);e&&(d.centerOnBlock(e.id),e.select())};a.push(b)}}};
|
||||
module$exports$Blockly$libraryBlocks$procedures.blocks.procedures_callnoreturn=Object.assign({},module$contents$Blockly$libraryBlocks$procedures_PROCEDURE_CALL_COMMON,{init:function(){this.appendDummyInput("TOPROW").appendField("","NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setStyle("procedure_blocks");this.setHelpUrl(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_CALLNORETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.quarkConnections_={};
|
||||
this.quarkIds_=null;this.previousEnabledState_=!0},defType_:"procedures_defnoreturn"});
|
||||
module$exports$Blockly$libraryBlocks$procedures.blocks.procedures_callreturn=Object.assign({},module$contents$Blockly$libraryBlocks$procedures_PROCEDURE_CALL_COMMON,{init:function(){this.appendDummyInput("TOPROW").appendField("","NAME");this.setOutput(!0);this.setStyle("procedure_blocks");this.setHelpUrl(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_CALLRETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.quarkConnections_={};this.quarkIds_=null;this.previousEnabledState_=
|
||||
!0},defType_:"procedures_defreturn"});
|
||||
module$exports$Blockly$libraryBlocks$procedures.blocks.procedures_ifreturn={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.CONTROLS_IF_MSG_IF);this.appendValueInput("VALUE").appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_RETURN);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setStyle("procedure_blocks");this.setTooltip(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_IFRETURN_TOOLTIP);
|
||||
this.setHelpUrl(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_IFRETURN_HELPURL);this.hasReturnValue_=!0},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.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(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_RETURN))},
|
||||
onchange:function(a){if(!(this.workspace.isDragging&&this.workspace.isDragging()||a.type!==$.module$build$src$core$events$events.BLOCK_MOVE)){var b=!1,c=this;do{if(-1!==this.FUNCTION_TYPES.indexOf(c.type)){b=!0;break}c=c.getSurroundParent()}while(c);b?("procedures_defnoreturn"===c.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!==
|
||||
c.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(module$contents$Blockly$libraryBlocks$procedures_Msg.PROCEDURES_IFRETURN_WARNING);this.isInFlyout||(c=$.module$build$src$core$events$events.getGroup(),$.module$build$src$core$events$events.setGroup(a.group),this.setEnabled(b),$.module$build$src$core$events$events.setGroup(c))}},
|
||||
FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]};module$contents$Blockly$libraryBlocks$procedures_defineBlocks(module$exports$Blockly$libraryBlocks$procedures.blocks);var module$exports$Blockly$libraryBlocks$math={},module$contents$Blockly$libraryBlocks$math_Extensions=$.module$build$src$core$extensions,module$contents$Blockly$libraryBlocks$math_FieldDropdown=$.module$build$src$core$field_dropdown,module$contents$Blockly$libraryBlocks$math_xmlUtils=$.module$build$src$core$utils$xml,module$contents$Blockly$libraryBlocks$math_BlockDefinition=Object,module$contents$Blockly$libraryBlocks$math_createBlockDefinitionsFromJsonArray=$.module$build$src$core$common.createBlockDefinitionsFromJsonArray,
|
||||
module$contents$Blockly$libraryBlocks$math_defineBlocks=$.module$build$src$core$common.defineBlocks;
|
||||
module$exports$Blockly$libraryBlocks$math.blocks=module$contents$Blockly$libraryBlocks$math_createBlockDefinitionsFromJsonArray([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}",
|
||||
"ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}",
|
||||
"ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}",
|
||||
"ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_constant",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",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",
|
||||
message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},
|
||||
{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],
|
||||
["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}",
|
||||
"MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}","RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],
|
||||
inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",message0:"%{BKY_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",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",
|
||||
args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",
|
||||
name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]);
|
||||
var module$contents$Blockly$libraryBlocks$math_TOOLTIPS_BY_OP={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",
|
||||
POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",
|
||||
RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"};$.module$build$src$core$extensions.register("math_op_tooltip",$.module$build$src$core$extensions.buildTooltipForDropdown("OP",module$contents$Blockly$libraryBlocks$math_TOOLTIPS_BY_OP));
|
||||
var module$contents$Blockly$libraryBlocks$math_IS_DIVISIBLEBY_MUTATOR_MIXIN={mutationToDom:function(){const a=$.module$build$src$core$utils$xml.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){const b=this.getInput("DIVISOR");a?b||this.appendValueInput("DIVISOR").setCheck("Number"):b&&this.removeInput("DIVISOR")}},
|
||||
module$contents$Blockly$libraryBlocks$math_IS_DIVISIBLE_MUTATOR_EXTENSION=function(){this.getField("PROPERTY").setValidator(function(a){a="DIVISIBLE_BY"===a;this.getSourceBlock().updateShape_(a)})};$.module$build$src$core$extensions.registerMutator("math_is_divisibleby_mutator",module$contents$Blockly$libraryBlocks$math_IS_DIVISIBLEBY_MUTATOR_MIXIN,module$contents$Blockly$libraryBlocks$math_IS_DIVISIBLE_MUTATOR_EXTENSION);
|
||||
$.module$build$src$core$extensions.register("math_change_tooltip",$.module$build$src$core$extensions.buildTooltipWithFieldText("%{BKY_MATH_CHANGE_TOOLTIP}","VAR"));
|
||||
var module$contents$Blockly$libraryBlocks$math_LIST_MODES_MUTATOR_MIXIN={updateType_:function(a){"MODE"===a?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");a.setAttribute("op",this.getFieldValue("OP"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("op"))}},module$contents$Blockly$libraryBlocks$math_LIST_MODES_MUTATOR_EXTENSION=function(){this.getField("OP").setValidator(function(a){this.updateType_(a)}.bind(this))};
|
||||
$.module$build$src$core$extensions.registerMutator("math_modes_of_list_mutator",module$contents$Blockly$libraryBlocks$math_LIST_MODES_MUTATOR_MIXIN,module$contents$Blockly$libraryBlocks$math_LIST_MODES_MUTATOR_EXTENSION);module$contents$Blockly$libraryBlocks$math_defineBlocks(module$exports$Blockly$libraryBlocks$math.blocks);var module$exports$Blockly$libraryBlocks$loops={},module$contents$Blockly$libraryBlocks$loops_ContextMenu=$.module$build$src$core$contextmenu,module$contents$Blockly$libraryBlocks$loops_Events=$.module$build$src$core$events$events,module$contents$Blockly$libraryBlocks$loops_Extensions=$.module$build$src$core$extensions,module$contents$Blockly$libraryBlocks$loops_Variables=$.module$build$src$core$variables,module$contents$Blockly$libraryBlocks$loops_xmlUtils=$.module$build$src$core$utils$xml,module$contents$Blockly$libraryBlocks$loops_BlockDefinition=
|
||||
Object,module$contents$Blockly$libraryBlocks$loops_Msg=$.module$build$src$core$msg.Msg,module$contents$Blockly$libraryBlocks$loops_createBlockDefinitionsFromJsonArray=$.module$build$src$core$common.createBlockDefinitionsFromJsonArray,module$contents$Blockly$libraryBlocks$loops_defineBlocks=$.module$build$src$core$common.defineBlocks;
|
||||
module$exports$Blockly$libraryBlocks$loops.blocks=module$contents$Blockly$libraryBlocks$loops_createBlockDefinitionsFromJsonArray([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",
|
||||
message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}",
|
||||
"UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_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"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",
|
||||
name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}",
|
||||
"CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]);var module$contents$Blockly$libraryBlocks$loops_WHILE_UNTIL_TOOLTIPS={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};
|
||||
$.module$build$src$core$extensions.register("controls_whileUntil_tooltip",$.module$build$src$core$extensions.buildTooltipForDropdown("MODE",module$contents$Blockly$libraryBlocks$loops_WHILE_UNTIL_TOOLTIPS));var module$contents$Blockly$libraryBlocks$loops_BREAK_CONTINUE_TOOLTIPS={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};
|
||||
$.module$build$src$core$extensions.register("controls_flow_tooltip",$.module$build$src$core$extensions.buildTooltipForDropdown("FLOW",module$contents$Blockly$libraryBlocks$loops_BREAK_CONTINUE_TOOLTIPS));
|
||||
var module$contents$Blockly$libraryBlocks$loops_CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getField("VAR").getVariable(),c=b.name;if(!this.isCollapsed()&&null!==c){const d={enabled:!0};d.text=module$contents$Blockly$libraryBlocks$loops_Msg.VARIABLES_SET_CREATE_GET.replace("%1",c);b=$.module$build$src$core$variables.generateVariableFieldDom(b);c=$.module$build$src$core$utils$xml.createElement("block");c.setAttribute("type","variables_get");
|
||||
c.appendChild(b);d.callback=$.module$build$src$core$contextmenu.callbackFactory(this,c);a.push(d)}}}};$.module$build$src$core$extensions.registerMixin("contextMenu_newGetVariableBlock",module$contents$Blockly$libraryBlocks$loops_CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);$.module$build$src$core$extensions.register("controls_for_tooltip",$.module$build$src$core$extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR"));
|
||||
$.module$build$src$core$extensions.register("controls_forEach_tooltip",$.module$build$src$core$extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));module$exports$Blockly$libraryBlocks$loops.loopTypes=new Set(["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"]);
|
||||
var module$contents$Blockly$libraryBlocks$loops_CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={getSurroundLoop:function(){let a=this;do{if(module$exports$Blockly$libraryBlocks$loops.loopTypes.has(a.type))return a;a=a.getSurroundParent()}while(a);return null},onchange:function(a){if(this.workspace.isDragging&&!this.workspace.isDragging()&&a.type===$.module$build$src$core$events$events.BLOCK_MOVE){var b=this.getSurroundLoop(this);this.setWarningText(b?null:module$contents$Blockly$libraryBlocks$loops_Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
||||
if(!this.isInFlyout){const c=$.module$build$src$core$events$events.getGroup();$.module$build$src$core$events$events.setGroup(a.group);this.setEnabled(b);$.module$build$src$core$events$events.setGroup(c)}}}};$.module$build$src$core$extensions.registerMixin("controls_flow_in_loop_check",module$contents$Blockly$libraryBlocks$loops_CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);module$contents$Blockly$libraryBlocks$loops_defineBlocks(module$exports$Blockly$libraryBlocks$loops.blocks);var module$exports$Blockly$libraryBlocks$logic={},module$contents$Blockly$libraryBlocks$logic_Events=$.module$build$src$core$events$events,module$contents$Blockly$libraryBlocks$logic_Extensions=$.module$build$src$core$extensions,module$contents$Blockly$libraryBlocks$logic_xmlUtils=$.module$build$src$core$utils$xml,module$contents$Blockly$libraryBlocks$logic_BlockDefinition=Object,module$contents$Blockly$libraryBlocks$logic_Msg=$.module$build$src$core$msg.Msg,module$contents$Blockly$libraryBlocks$logic_Mutator=
|
||||
$.Mutator$$module$build$src$core$mutator,module$contents$Blockly$libraryBlocks$logic_createBlockDefinitionsFromJsonArray=$.module$build$src$core$common.createBlockDefinitionsFromJsonArray,module$contents$Blockly$libraryBlocks$logic_defineBlocks=$.module$build$src$core$common.defineBlocks;
|
||||
module$exports$Blockly$libraryBlocks$logic.blocks=module$contents$Blockly$libraryBlocks$logic_createBlockDefinitionsFromJsonArray([{type:"logic_boolean",message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[["%{BKY_LOGIC_BOOLEAN_TRUE}","TRUE"],["%{BKY_LOGIC_BOOLEAN_FALSE}","FALSE"]]}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_BOOLEAN_TOOLTIP}",helpUrl:"%{BKY_LOGIC_BOOLEAN_HELPURL}"},{type:"controls_if",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"}],previousStatement:null,nextStatement:null,style:"logic_blocks",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,mutator:"controls_if_mutator",extensions:["controls_if_tooltip"]},{type:"controls_ifelse",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,style:"logic_blocks",tooltip:"%{BKYCONTROLS_IF_TOOLTIP_2}",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_if_tooltip"]},{type:"logic_compare",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A"},{type:"field_dropdown",name:"OP",options:[["=","EQ"],["\u2260","NEQ"],["\u200f<","LT"],["\u200f\u2264","LTE"],["\u200f>","GT"],["\u200f\u2265",
|
||||
"GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",
|
||||
extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",
|
||||
name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},
|
||||
{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]);
|
||||
var module$contents$Blockly$libraryBlocks$logic_TOOLTIPS_BY_OP={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};$.module$build$src$core$extensions.register("logic_op_tooltip",$.module$build$src$core$extensions.buildTooltipForDropdown("OP",module$contents$Blockly$libraryBlocks$logic_TOOLTIPS_BY_OP));
|
||||
var module$contents$Blockly$libraryBlocks$logic_CONTROLS_IF_MUTATOR_MIXIN={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const a=$.module$build$src$core$utils$xml.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.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const a=Object.create(null);this.elseifCount_&&(a.elseIfCount=this.elseifCount_);this.elseCount_&&(a.hasElse=!0);return a},loadExtraState:function(a){this.elseifCount_=a.elseIfCount||0;this.elseCount_=a.hasElse?1:0;this.updateShape_()},decompose:function(a){const b=a.newBlock("controls_if_if");b.initSvg();let c=b.nextConnection;for(let d=1;d<=this.elseifCount_;d++){const e=a.newBlock("controls_if_elseif");
|
||||
e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}this.elseCount_&&(a=a.newBlock("controls_if_else"),a.initSvg(),c.connect(a.previousConnection));return b},compose:function(a){a=a.nextConnection.targetBlock();this.elseCount_=this.elseifCount_=0;const b=[null],c=[null];let d=null;for(;a;){if(!a.isInsertionMarker())switch(a.type){case "controls_if_elseif":this.elseifCount_++;b.push(a.valueConnection_);c.push(a.statementConnection_);break;case "controls_if_else":this.elseCount_++;d=a.statementConnection_;
|
||||
break;default:throw TypeError("Unknown block type: "+a.type);}a=a.getNextBlock()}this.updateShape_();this.reconnectChildBlocks_(b,c,d)},saveConnections:function(a){a=a.nextConnection.targetBlock();let b=1;for(;a;){if(!a.isInsertionMarker())switch(a.type){case "controls_if_elseif":var c=this.getInput("IF"+b);const d=this.getInput("DO"+b);a.valueConnection_=c&&c.connection.targetConnection;a.statementConnection_=d&&d.connection.targetConnection;b++;break;case "controls_if_else":c=this.getInput("ELSE");
|
||||
a.statementConnection_=c&&c.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.getNextBlock()}},rebuildShape_:function(){const a=[null],b=[null];let c=null;this.getInput("ELSE")&&(c=this.getInput("ELSE").connection.targetConnection);for(let d=1;this.getInput("IF"+d);d++){const e=this.getInput("IF"+d),f=this.getInput("DO"+d);a.push(e.connection.targetConnection);b.push(f.connection.targetConnection)}this.updateShape_();this.reconnectChildBlocks_(a,b,c)},updateShape_:function(){this.getInput("ELSE")&&
|
||||
this.removeInput("ELSE");for(var a=1;this.getInput("IF"+a);a++)this.removeInput("IF"+a),this.removeInput("DO"+a);for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck("Boolean").appendField(module$contents$Blockly$libraryBlocks$logic_Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+a).appendField(module$contents$Blockly$libraryBlocks$logic_Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(module$contents$Blockly$libraryBlocks$logic_Msg.CONTROLS_IF_MSG_ELSE)},
|
||||
reconnectChildBlocks_:function(a,b,c){for(let d=1;d<=this.elseifCount_;d++)$.Mutator$$module$build$src$core$mutator.reconnect(a[d],this,"IF"+d),$.Mutator$$module$build$src$core$mutator.reconnect(b[d],this,"DO"+d);$.Mutator$$module$build$src$core$mutator.reconnect(c,this,"ELSE")}};$.module$build$src$core$extensions.registerMutator("controls_if_mutator",module$contents$Blockly$libraryBlocks$logic_CONTROLS_IF_MUTATOR_MIXIN,null,["controls_if_elseif","controls_if_else"]);
|
||||
var module$contents$Blockly$libraryBlocks$logic_CONTROLS_IF_TOOLTIP_EXTENSION=function(){this.setTooltip(function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return module$contents$Blockly$libraryBlocks$logic_Msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return module$contents$Blockly$libraryBlocks$logic_Msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return module$contents$Blockly$libraryBlocks$logic_Msg.CONTROLS_IF_TOOLTIP_4}else return module$contents$Blockly$libraryBlocks$logic_Msg.CONTROLS_IF_TOOLTIP_1;
|
||||
return""}.bind(this))};$.module$build$src$core$extensions.register("controls_if_tooltip",module$contents$Blockly$libraryBlocks$logic_CONTROLS_IF_TOOLTIP_EXTENSION);
|
||||
var module$contents$Blockly$libraryBlocks$logic_LOGIC_COMPARE_ONCHANGE_MIXIN={onchange:function(a){this.prevBlocks_||(this.prevBlocks_=[null,null]);var b=this.getInputTargetBlock("A");const c=this.getInputTargetBlock("B");b&&c&&!this.workspace.connectionChecker.doTypeChecks(b.outputConnection,c.outputConnection)&&($.module$build$src$core$events$events.setGroup(a.group),a=this.prevBlocks_[0],a!==b&&(b.unplug(),!a||a.isDisposed()||a.isShadow()||this.getInput("A").connection.connect(a.outputConnection)),
|
||||
b=this.prevBlocks_[1],b!==c&&(c.unplug(),!b||b.isDisposed()||b.isShadow()||this.getInput("B").connection.connect(b.outputConnection)),this.bumpNeighbours(),$.module$build$src$core$events$events.setGroup(!1));this.prevBlocks_[0]=this.getInputTargetBlock("A");this.prevBlocks_[1]=this.getInputTargetBlock("B")}},module$contents$Blockly$libraryBlocks$logic_LOGIC_COMPARE_EXTENSION=function(){this.mixin(module$contents$Blockly$libraryBlocks$logic_LOGIC_COMPARE_ONCHANGE_MIXIN)};
|
||||
$.module$build$src$core$extensions.register("logic_compare",module$contents$Blockly$libraryBlocks$logic_LOGIC_COMPARE_EXTENSION);
|
||||
var module$contents$Blockly$libraryBlocks$logic_LOGIC_TERNARY_ONCHANGE_MIXIN={prevParentConnection_:null,onchange:function(a){const b=this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),d=this.outputConnection.targetConnection;if((b||c)&&d)for(let e=0;2>e;e++){const f=1===e?b:c;f&&!f.workspace.connectionChecker.doTypeChecks(f.outputConnection,d)&&($.module$build$src$core$events$events.setGroup(a.group),d===this.prevParentConnection_?(this.unplug(),d.getSourceBlock().bumpNeighbours()):
|
||||
(f.unplug(),f.bumpNeighbours()),$.module$build$src$core$events$events.setGroup(!1))}this.prevParentConnection_=d}};$.module$build$src$core$extensions.registerMixin("logic_ternary",module$contents$Blockly$libraryBlocks$logic_LOGIC_TERNARY_ONCHANGE_MIXIN);module$contents$Blockly$libraryBlocks$logic_defineBlocks(module$exports$Blockly$libraryBlocks$logic.blocks);var module$exports$Blockly$libraryBlocks$lists={},module$contents$Blockly$libraryBlocks$lists_xmlUtils=$.module$build$src$core$utils$xml,module$contents$Blockly$libraryBlocks$lists_Xml=$.module$build$src$core$xml,module$contents$Blockly$libraryBlocks$lists_Align=$.Align$$module$build$src$core$input,module$contents$Blockly$libraryBlocks$lists_BlockDefinition=Object,module$contents$Blockly$libraryBlocks$lists_ConnectionType=$.module$build$src$core$connection_type.ConnectionType,module$contents$Blockly$libraryBlocks$lists_FieldDropdown=
|
||||
$.module$build$src$core$field_dropdown.FieldDropdown,module$contents$Blockly$libraryBlocks$lists_Msg=$.module$build$src$core$msg.Msg,module$contents$Blockly$libraryBlocks$lists_Mutator=$.Mutator$$module$build$src$core$mutator,module$contents$Blockly$libraryBlocks$lists_createBlockDefinitionsFromJsonArray=$.module$build$src$core$common.createBlockDefinitionsFromJsonArray,module$contents$Blockly$libraryBlocks$lists_defineBlocks=$.module$build$src$core$common.defineBlocks;
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks=module$contents$Blockly$libraryBlocks$lists_createBlockDefinitionsFromJsonArray([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",
|
||||
tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",
|
||||
helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]);
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_create_with={init:function(){this.setHelpUrl(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_CREATE_WITH_HELPURL);this.setStyle("list_blocks");this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setMutator(new $.Mutator$$module$build$src$core$mutator(["lists_create_with_item"],this));this.setTooltip(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");
|
||||
a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(a){this.itemCount_=a.itemCount;this.updateShape_()},decompose:function(a){const b=a.newBlock("lists_create_with_container");b.initSvg();let c=b.getInput("STACK").connection;for(let d=0;d<this.itemCount_;d++){const e=a.newBlock("lists_create_with_item");e.initSvg();c.connect(e.previousConnection);
|
||||
c=e.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)b.isInsertionMarker()||a.push(b.valueConnection_),b=b.getNextBlock();for(b=0;b<this.itemCount_;b++){const 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++)$.Mutator$$module$build$src$core$mutator.reconnect(a[b],this,"ADD"+b)},saveConnections:function(a){a=a.getInputTargetBlock("STACK");
|
||||
let b=0;for(;a;){if(a.isInsertionMarker()){a=a.getNextBlock();continue}const c=this.getInput("ADD"+b);a.valueConnection_=c&&c.connection.targetConnection;a=a.getNextBlock();b++}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_CREATE_EMPTY_TITLE);for(var a=0;a<this.itemCount_;a++)if(!this.getInput("ADD"+a)){const b=this.appendValueInput("ADD"+
|
||||
a).setAlign($.Align$$module$build$src$core$input.RIGHT);0===a&&b.appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_CREATE_WITH_INPUT_WITH)}for(a=this.itemCount_;this.getInput("ADD"+a);a++)this.removeInput("ADD"+a)}};
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_create_with_container={init:function(){this.setStyle("list_blocks");this.appendDummyInput().appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP);this.contextMenu=!1}};
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_create_with_item={init:function(){this.setStyle("list_blocks");this.appendDummyInput().appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);this.contextMenu=!1}};
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_indexOf={init:function(){const a=[[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_INDEX_OF_FIRST,"FIRST"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_INDEX_OF_LAST,"LAST"]];this.setHelpUrl(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_INDEX_OF_HELPURL);this.setStyle("list_blocks");this.setOutput(!0,"Number");this.appendValueInput("VALUE").setCheck("Array").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_INDEX_OF_INPUT_IN_LIST);
|
||||
this.appendValueInput("FIND").appendField(new module$contents$Blockly$libraryBlocks$lists_FieldDropdown(a),"END");this.setInputsInline(!0);const b=this;this.setTooltip(function(){return module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",b.workspace.options.oneBasedIndex?"0":"-1")})}};
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_getIndex={init:function(){var a=[[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_GET,"GET"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_FROM_END,
|
||||
"FROM_END"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_LAST,"LAST"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.setHelpUrl(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_HELPURL);this.setStyle("list_blocks");a=new module$contents$Blockly$libraryBlocks$lists_FieldDropdown(a,function(c){c="REMOVE"===c;this.getSourceBlock().updateStatement_(c)});
|
||||
this.appendValueInput("VALUE").setCheck("Array").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_INPUT_IN_LIST);this.appendDummyInput().appendField(a,"MODE").appendField("","SPACE");this.appendDummyInput("AT");module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TAIL);this.setInputsInline(!0);this.setOutput(!0);this.updateAt_(!0);const b=this;this.setTooltip(function(){const c=
|
||||
b.getFieldValue("MODE"),d=b.getFieldValue("WHERE");let e="";switch(c+" "+d){case "GET FROM_START":case "GET FROM_END":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case "GET FIRST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case "GET LAST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case "GET RANDOM":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;
|
||||
break;case "GET_REMOVE FROM_START":case "GET_REMOVE FROM_END":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case "GET_REMOVE FIRST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case "GET_REMOVE LAST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case "GET_REMOVE RANDOM":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;
|
||||
break;case "REMOVE FROM_START":case "REMOVE FROM_END":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case "REMOVE FIRST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case "REMOVE LAST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case "REMOVE RANDOM":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}if("FROM_START"===d||"FROM_END"===
|
||||
d)e+=" "+("FROM_START"===d?module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_INDEX_FROM_START_TOOLTIP:module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",b.workspace.options.oneBasedIndex?"#1":"#0");return e})},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");a.setAttribute("statement",!this.outputConnection);const b=this.getInput("AT").type===$.module$build$src$core$connection_type.ConnectionType.INPUT_VALUE;
|
||||
a.setAttribute("at",b);return a},domToMutation:function(a){const b="true"===a.getAttribute("statement");this.updateStatement_(b);a="false"!==a.getAttribute("at");this.updateAt_(a)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(a){a.isStatement?this.updateStatement_(!0):"string"===typeof a&&this.domToMutation($.module$build$src$core$xml.textToDom(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"),module$contents$Blockly$libraryBlocks$lists_Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const b=new module$contents$Blockly$libraryBlocks$lists_FieldDropdown(this.WHERE_OPTIONS,
|
||||
function(c){const d="FROM_START"===c||"FROM_END"===c;if(d!==a){const e=this.getSourceBlock();e.updateAt_(d);e.setFieldValue(c,"WHERE");return null}});this.getInput("AT").appendField(b,"WHERE");module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_setIndex={init:function(){const a=[[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_SET,"SET"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_FIRST,
|
||||
"FIRST"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_LAST,"LAST"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.setHelpUrl(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_HELPURL);this.setStyle("list_blocks");this.appendValueInput("LIST").setCheck("Array").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_INPUT_IN_LIST);this.appendDummyInput().appendField(new module$contents$Blockly$libraryBlocks$lists_FieldDropdown(a),
|
||||
"MODE").appendField("","SPACE");this.appendDummyInput("AT");this.appendValueInput("TO").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_INPUT_TO);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP);this.updateAt_(!0);const b=this;this.setTooltip(function(){const c=b.getFieldValue("MODE"),d=b.getFieldValue("WHERE");let e="";switch(c+" "+d){case "SET FROM_START":case "SET FROM_END":e=
|
||||
module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case "SET FIRST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case "SET LAST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case "SET RANDOM":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case "INSERT FROM_START":case "INSERT FROM_END":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;
|
||||
break;case "INSERT FIRST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case "INSERT LAST":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case "INSERT RANDOM":e=module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}if("FROM_START"===d||"FROM_END"===d)e+=" "+module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",b.workspace.options.oneBasedIndex?
|
||||
"#1":"#0");return e})},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation"),b=this.getInput("AT").type===$.module$build$src$core$connection_type.ConnectionType.INPUT_VALUE;a.setAttribute("at",b);return a},domToMutation:function(a){a="false"!==a.getAttribute("at");this.updateAt_(a)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"),
|
||||
module$contents$Blockly$libraryBlocks$lists_Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const b=new module$contents$Blockly$libraryBlocks$lists_FieldDropdown(this.WHERE_OPTIONS,function(c){const d="FROM_START"===c||"FROM_END"===c;if(d!==a){const e=this.getSourceBlock();e.updateAt_(d);e.setFieldValue(c,"WHERE");return null}});this.moveInputBefore("AT","TO");this.getInput("ORDINAL")&&
|
||||
this.moveInputBefore("ORDINAL","TO");this.getInput("AT").appendField(b,"WHERE")}};
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],
|
||||
[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]];this.setHelpUrl(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_HELPURL);this.setStyle("list_blocks");this.appendValueInput("LIST").setCheck("Array").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);this.appendDummyInput("AT1");this.appendDummyInput("AT2");module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_TAIL&&
|
||||
this.appendDummyInput("TAIL").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_TAIL);this.setInputsInline(!0);this.setOutput(!0,"Array");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");var b=this.getInput("AT1").type===$.module$build$src$core$connection_type.ConnectionType.INPUT_VALUE;a.setAttribute("at1",
|
||||
b);b=this.getInput("AT2").type===$.module$build$src$core$connection_type.ConnectionType.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){const b="true"===a.getAttribute("at1");a="true"===a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),module$contents$Blockly$libraryBlocks$lists_Msg.ORDINAL_NUMBER_SUFFIX&&
|
||||
this.appendDummyInput("ORDINAL"+a).appendField(module$contents$Blockly$libraryBlocks$lists_Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+a);const c=new module$contents$Blockly$libraryBlocks$lists_FieldDropdown(this["WHERE_OPTIONS_"+a],function(d){const e="FROM_START"===d||"FROM_END"===d;if(e!==b){const f=this.getSourceBlock();f.updateAt_(a,e);f.setFieldValue(d,"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"));module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],
|
||||
output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}};
|
||||
module$exports$Blockly$libraryBlocks$lists.blocks.lists_split={init:function(){const a=this,b=new module$contents$Blockly$libraryBlocks$lists_FieldDropdown([[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(c){a.updateType_(c)});this.setHelpUrl(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SPLIT_HELPURL);this.setStyle("list_blocks");this.appendValueInput("INPUT").setCheck("String").appendField(b,
|
||||
"MODE");this.appendValueInput("DELIM").setCheck("String").appendField(module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SPLIT_WITH_DELIMITER);this.setInputsInline(!0);this.setOutput(!0,"Array");this.setTooltip(function(){const c=a.getFieldValue("MODE");if("SPLIT"===c)return module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SPLIT_TOOLTIP_SPLIT;if("JOIN"===c)return module$contents$Blockly$libraryBlocks$lists_Msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+c);})},updateType_:function(a){if(this.getFieldValue("MODE")!==
|
||||
a){const b=this.getInput("INPUT").connection;b.setShadowDom(null);const c=b.targetBlock();c&&(b.disconnect(),c.isShadow()?c.dispose():this.bumpNeighbours())}"SPLIT"===a?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const a=$.module$build$src$core$utils$xml.createElement("mutation");a.setAttribute("mode",this.getFieldValue("MODE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("mode"))},
|
||||
saveExtraState:function(){return null},loadExtraState:function(){}};module$contents$Blockly$libraryBlocks$lists_defineBlocks(module$exports$Blockly$libraryBlocks$lists.blocks);var module$exports$Blockly$libraryBlocks$colour={},module$contents$Blockly$libraryBlocks$colour_BlockDefinition=Object,module$contents$Blockly$libraryBlocks$colour_createBlockDefinitionsFromJsonArray=$.module$build$src$core$common.createBlockDefinitionsFromJsonArray,module$contents$Blockly$libraryBlocks$colour_defineBlocks=$.module$build$src$core$common.defineBlocks;
|
||||
module$exports$Blockly$libraryBlocks$colour.blocks=module$contents$Blockly$libraryBlocks$colour_createBlockDefinitionsFromJsonArray([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",
|
||||
style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"},{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"},{type:"colour_blend",
|
||||
message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}]);module$contents$Blockly$libraryBlocks$colour_defineBlocks(module$exports$Blockly$libraryBlocks$colour.blocks);var module$exports$Blockly$libraryBlocks={},module$contents$Blockly$libraryBlocks_BlockDefinition=Object;module$exports$Blockly$libraryBlocks.colour=module$exports$Blockly$libraryBlocks$colour;module$exports$Blockly$libraryBlocks.lists=module$exports$Blockly$libraryBlocks$lists;module$exports$Blockly$libraryBlocks.logic=module$exports$Blockly$libraryBlocks$logic;module$exports$Blockly$libraryBlocks.loops=module$exports$Blockly$libraryBlocks$loops;module$exports$Blockly$libraryBlocks.math=module$exports$Blockly$libraryBlocks$math;
|
||||
module$exports$Blockly$libraryBlocks.procedures=module$exports$Blockly$libraryBlocks$procedures;module$exports$Blockly$libraryBlocks.texts=module$exports$Blockly$libraryBlocks$texts;module$exports$Blockly$libraryBlocks.variables=module$exports$Blockly$libraryBlocks$variables;module$exports$Blockly$libraryBlocks.variablesDynamic=module$exports$Blockly$libraryBlocks$variablesDynamic;
|
||||
module$exports$Blockly$libraryBlocks.blocks=Object.assign({},module$exports$Blockly$libraryBlocks$colour.blocks,module$exports$Blockly$libraryBlocks$lists.blocks,module$exports$Blockly$libraryBlocks$logic.blocks,module$exports$Blockly$libraryBlocks$loops.blocks,module$exports$Blockly$libraryBlocks$math.blocks,module$exports$Blockly$libraryBlocks$procedures.blocks,module$exports$Blockly$libraryBlocks$variables.blocks,module$exports$Blockly$libraryBlocks$variablesDynamic.blocks);
|
||||
module$exports$Blockly$libraryBlocks.__namespace__=$;
|
||||
return module$exports$Blockly$libraryBlocks;
|
||||
}));
|
||||
|
||||
|
||||
//# sourceMappingURL=blocks_compressed.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -23,7 +23,7 @@ var goog = goog || {};
|
||||
/**
|
||||
* Reference to the global object. This is provided as 'root' by the
|
||||
* UMD wrapper, but prefer globalThis if it is defined.
|
||||
*
|
||||
*
|
||||
* https://www.ecma-international.org/ecma-262/9.0/index.html#sec-global-object
|
||||
*
|
||||
* @const
|
||||
|
||||
@@ -31,39 +31,40 @@ import * as svgMath from './utils/svg_math.js';
|
||||
* @alias Blockly.BlockDragSurfaceSvg
|
||||
*/
|
||||
export class BlockDragSurfaceSvg {
|
||||
/** The SVG drag surface. Set once by BlockDragSurfaceSvg.createDom. */
|
||||
private svg_: SVGElement;
|
||||
/**
|
||||
* The root element of the drag surface.
|
||||
*/
|
||||
private svg: SVGElement;
|
||||
|
||||
/**
|
||||
* This is where blocks live while they are being dragged if the drag
|
||||
* surface is enabled.
|
||||
*/
|
||||
private dragGroup_: SVGElement;
|
||||
private dragGroup: SVGElement;
|
||||
|
||||
/**
|
||||
* Cached value for the scale of the drag surface.
|
||||
* Used to set/get the correct translation during and after a drag.
|
||||
*/
|
||||
private scale_ = 1;
|
||||
private scale = 1;
|
||||
|
||||
/**
|
||||
* Cached value for the translation of the drag surface.
|
||||
* This translation is in pixel units, because the scale is applied to the
|
||||
* drag group rather than the top-level SVG.
|
||||
*/
|
||||
private surfaceXY_: Coordinate = new Coordinate(0, 0);
|
||||
private readonly childSurfaceXY_: Coordinate;
|
||||
private surfaceXY = new Coordinate(0, 0);
|
||||
|
||||
/**
|
||||
* Cached value for the translation of the child drag surface in pixel
|
||||
* units. Since the child drag surface tracks the translation of the
|
||||
* workspace this is ultimately the translation of the workspace.
|
||||
*/
|
||||
private readonly childSurfaceXY = new Coordinate(0, 0);
|
||||
|
||||
/** @param container Containing element. */
|
||||
constructor(private readonly container: Element) {
|
||||
/**
|
||||
* Cached value for the translation of the child drag surface in pixel
|
||||
* units. Since the child drag surface tracks the translation of the
|
||||
* workspace this is ultimately the translation of the workspace.
|
||||
*/
|
||||
this.childSurfaceXY_ = new Coordinate(0, 0);
|
||||
|
||||
this.svg_ = dom.createSvgElement(
|
||||
this.svg = dom.createSvgElement(
|
||||
Svg.SVG, {
|
||||
'xmlns': dom.SVG_NS,
|
||||
'xmlns:html': dom.HTML_NS,
|
||||
@@ -72,7 +73,8 @@ export class BlockDragSurfaceSvg {
|
||||
'class': 'blocklyBlockDragSurface',
|
||||
},
|
||||
this.container);
|
||||
this.dragGroup_ = dom.createSvgElement(Svg.G, {}, this.svg_ as SVGElement);
|
||||
|
||||
this.dragGroup = dom.createSvgElement(Svg.G, {}, this.svg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,13 +95,13 @@ export class BlockDragSurfaceSvg {
|
||||
* @param blocks Block or group of blocks to place on the drag surface.
|
||||
*/
|
||||
setBlocksAndShow(blocks: SVGElement) {
|
||||
if (this.dragGroup_.childNodes.length) {
|
||||
if (this.dragGroup.childNodes.length) {
|
||||
throw Error('Already dragging a block.');
|
||||
}
|
||||
// appendChild removes the blocks from the previous parent
|
||||
this.dragGroup_.appendChild(blocks);
|
||||
this.svg_.style.display = 'block';
|
||||
this.surfaceXY_ = new Coordinate(0, 0);
|
||||
this.dragGroup.appendChild(blocks);
|
||||
this.svg.style.display = 'block';
|
||||
this.surfaceXY = new Coordinate(0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,13 +113,13 @@ export class BlockDragSurfaceSvg {
|
||||
* @param scale Scale of the group.
|
||||
*/
|
||||
translateAndScaleGroup(x: number, y: number, scale: number) {
|
||||
this.scale_ = scale;
|
||||
this.scale = scale;
|
||||
// Make sure the svg exists on a pixel boundary so that it is not fuzzy.
|
||||
const roundX = Math.round(x);
|
||||
const roundY = Math.round(y);
|
||||
this.childSurfaceXY_.x = roundX;
|
||||
this.childSurfaceXY_.y = roundY;
|
||||
this.dragGroup_!.setAttribute(
|
||||
this.childSurfaceXY.x = roundX;
|
||||
this.childSurfaceXY.y = roundY;
|
||||
this.dragGroup.setAttribute(
|
||||
'transform',
|
||||
'translate(' + roundX + ',' + roundY + ') scale(' + scale + ')');
|
||||
}
|
||||
@@ -128,13 +130,11 @@ export class BlockDragSurfaceSvg {
|
||||
* @internal
|
||||
*/
|
||||
translateSurfaceInternal_() {
|
||||
let x = this.surfaceXY_!.x;
|
||||
let y = this.surfaceXY_!.y;
|
||||
// Make sure the svg exists on a pixel boundary so that it is not fuzzy.
|
||||
x = Math.round(x);
|
||||
y = Math.round(y);
|
||||
this.svg_.style.display = 'block';
|
||||
dom.setCssTransform(this.svg_, 'translate3d(' + x + 'px, ' + y + 'px, 0)');
|
||||
const x = Math.round(this.surfaceXY.x);
|
||||
const y = Math.round(this.surfaceXY.y);
|
||||
this.svg.style.display = 'block';
|
||||
dom.setCssTransform(this.svg, 'translate3d(' + x + 'px, ' + y + 'px, 0)');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,9 +144,9 @@ export class BlockDragSurfaceSvg {
|
||||
* @param deltaY Vertical offset in pixel units.
|
||||
*/
|
||||
translateBy(deltaX: number, deltaY: number) {
|
||||
const x = this.surfaceXY_.x + deltaX;
|
||||
const y = this.surfaceXY_.y + deltaY;
|
||||
this.surfaceXY_ = new Coordinate(x, y);
|
||||
const x = this.surfaceXY.x + deltaX;
|
||||
const y = this.surfaceXY.y + deltaY;
|
||||
this.surfaceXY = new Coordinate(x, y);
|
||||
this.translateSurfaceInternal_();
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ export class BlockDragSurfaceSvg {
|
||||
* @param y Y translation for the entire surface.
|
||||
*/
|
||||
translateSurface(x: number, y: number) {
|
||||
this.surfaceXY_ = new Coordinate(x * this.scale_, y * this.scale_);
|
||||
this.surfaceXY = new Coordinate(x * this.scale, y * this.scale);
|
||||
this.translateSurfaceInternal_();
|
||||
}
|
||||
|
||||
@@ -171,8 +171,8 @@ export class BlockDragSurfaceSvg {
|
||||
* @returns Current translation of the surface.
|
||||
*/
|
||||
getSurfaceTranslation(): Coordinate {
|
||||
const xy = svgMath.getRelativeXY(this.svg_ as SVGElement);
|
||||
return new Coordinate(xy.x / this.scale_, xy.y / this.scale_);
|
||||
const xy = svgMath.getRelativeXY(this.svg);
|
||||
return new Coordinate(xy.x / this.scale, xy.y / this.scale);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,8 +181,8 @@ export class BlockDragSurfaceSvg {
|
||||
*
|
||||
* @returns Drag surface group element.
|
||||
*/
|
||||
getGroup(): SVGElement|null {
|
||||
return this.dragGroup_;
|
||||
getGroup(): SVGElement {
|
||||
return this.dragGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,8 +190,8 @@ export class BlockDragSurfaceSvg {
|
||||
*
|
||||
* @returns The SVG drag surface.
|
||||
*/
|
||||
getSvgRoot(): SVGElement|null {
|
||||
return this.svg_;
|
||||
getSvgRoot(): SVGElement {
|
||||
return this.svg;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -201,7 +201,7 @@ export class BlockDragSurfaceSvg {
|
||||
* @returns Drag surface block DOM element, or null if no blocks exist.
|
||||
*/
|
||||
getCurrentBlock(): Element|null {
|
||||
return this.dragGroup_.firstChild as Element;
|
||||
return this.dragGroup.firstChild as Element;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,7 +213,7 @@ export class BlockDragSurfaceSvg {
|
||||
*/
|
||||
getWsTranslation(): Coordinate {
|
||||
// Returning a copy so the coordinate can not be changed outside this class.
|
||||
return this.childSurfaceXY_.clone();
|
||||
return this.childSurfaceXY.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,16 +230,16 @@ export class BlockDragSurfaceSvg {
|
||||
const currentBlockElement = this.getCurrentBlock();
|
||||
if (currentBlockElement) {
|
||||
if (opt_newSurface) {
|
||||
// appendChild removes the node from this.dragGroup_
|
||||
// appendChild removes the node from this.dragGroup
|
||||
opt_newSurface.appendChild(currentBlockElement);
|
||||
} else {
|
||||
this.dragGroup_.removeChild(currentBlockElement);
|
||||
this.dragGroup.removeChild(currentBlockElement);
|
||||
}
|
||||
}
|
||||
this.svg_.style.display = 'none';
|
||||
if (this.dragGroup_.childNodes.length) {
|
||||
this.svg.style.display = 'none';
|
||||
if (this.dragGroup.childNodes.length) {
|
||||
throw Error('Drag group was not cleared.');
|
||||
}
|
||||
this.surfaceXY_ = new Coordinate(0, 0);
|
||||
this.surfaceXY = new Coordinate(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -980,8 +980,8 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg,
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the color of the block (and children) to match the current disabled
|
||||
* state.
|
||||
* Updates the colour of the block (and children) to match the current
|
||||
* disabled state.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
@@ -1535,45 +1535,46 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg,
|
||||
}
|
||||
|
||||
/**
|
||||
* Bump unconnected blocks out of alignment. Two blocks which aren't actually
|
||||
* connected should not coincidentally line up on screen.
|
||||
* Bumps unconnected blocks out of alignment.
|
||||
*
|
||||
* Two blocks which aren't actually connected should not coincidentally line
|
||||
* up on screen, because that creates confusion for end-users.
|
||||
*/
|
||||
override bumpNeighbours() {
|
||||
if (this.isDeadOrDying()) {
|
||||
this.getRootBlock().bumpNeighboursInternal();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bumps unconnected blocks out of alignment.
|
||||
*/
|
||||
private bumpNeighboursInternal() {
|
||||
const root = this.getRootBlock();
|
||||
if (this.isDeadOrDying() || this.workspace.isDragging() ||
|
||||
root.isInFlyout) {
|
||||
return;
|
||||
}
|
||||
if (this.workspace.isDragging()) {
|
||||
return;
|
||||
|
||||
function neighbourIsInStack(neighbour: RenderedConnection) {
|
||||
return neighbour.getSourceBlock().getRootBlock() === root;
|
||||
}
|
||||
const rootBlock = this.getRootBlock();
|
||||
if (rootBlock.isInFlyout) {
|
||||
return;
|
||||
}
|
||||
// Don't move blocks around in a flyout.
|
||||
// Loop through every connection on this block.
|
||||
const myConnections = this.getConnections_(false);
|
||||
for (let i = 0, connection; connection = myConnections[i]; i++) {
|
||||
const renderedConn = (connection);
|
||||
// Spider down from this block bumping all sub-blocks.
|
||||
if (renderedConn.isConnected() && renderedConn.isSuperior()) {
|
||||
renderedConn.targetBlock()!.bumpNeighbours();
|
||||
|
||||
for (const conn of this.getConnections_(false)) {
|
||||
if (conn.isSuperior()) {
|
||||
// Recurse down the block stack.
|
||||
conn.targetBlock()?.bumpNeighboursInternal();
|
||||
}
|
||||
|
||||
const neighbours = connection.neighbours(config.snapRadius);
|
||||
for (let j = 0, otherConnection; otherConnection = neighbours[j]; j++) {
|
||||
const renderedOther = otherConnection as RenderedConnection;
|
||||
// If both connections are connected, that's probably fine. But if
|
||||
// either one of them is unconnected, then there could be confusion.
|
||||
if (!renderedConn.isConnected() || !renderedOther.isConnected()) {
|
||||
// Only bump blocks if they are from different tree structures.
|
||||
if (renderedOther.getSourceBlock().getRootBlock() !== rootBlock) {
|
||||
// Always bump the inferior block.
|
||||
if (renderedConn.isSuperior()) {
|
||||
renderedOther.bumpAwayFrom(renderedConn);
|
||||
} else {
|
||||
renderedConn.bumpAwayFrom(renderedOther);
|
||||
}
|
||||
}
|
||||
for (const neighbour of conn.neighbours(config.snapRadius)) {
|
||||
// Don't bump away from things that are in our stack.
|
||||
if (neighbourIsInStack(neighbour)) continue;
|
||||
// If both connections are connected, that's fine.
|
||||
if (conn.isConnected() && neighbour.isConnected()) continue;
|
||||
|
||||
// Always bump the inferior connection.
|
||||
if (conn.isSuperior()) {
|
||||
neighbour.bumpAwayFrom(conn);
|
||||
} else {
|
||||
conn.bumpAwayFrom(neighbour);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ import {Field} from './field.js';
|
||||
import {FieldAngle} from './field_angle.js';
|
||||
import {FieldCheckbox} from './field_checkbox.js';
|
||||
import {FieldColour} from './field_colour.js';
|
||||
import {FieldDropdown} from './field_dropdown.js';
|
||||
import {FieldDropdown, MenuGenerator, MenuGeneratorFunction, MenuOption} from './field_dropdown.js';
|
||||
import {FieldImage} from './field_image.js';
|
||||
import {FieldLabel} from './field_label.js';
|
||||
import {FieldLabelSerializable} from './field_label_serializable.js';
|
||||
@@ -71,7 +71,7 @@ import {FlyoutButton} from './flyout_button.js';
|
||||
import {HorizontalFlyout} from './flyout_horizontal.js';
|
||||
import {FlyoutMetricsManager} from './flyout_metrics_manager.js';
|
||||
import {VerticalFlyout} from './flyout_vertical.js';
|
||||
import {Generator} from './generator.js';
|
||||
import {CodeGenerator} from './generator.js';
|
||||
import {Gesture} from './gesture.js';
|
||||
import {Grid} from './grid.js';
|
||||
import {Icon} from './icon.js';
|
||||
@@ -104,7 +104,6 @@ import {IRegistrable} from './interfaces/i_registrable.js';
|
||||
import {IRegistrableField} from './interfaces/i_registrable_field.js';
|
||||
import {ISelectable} from './interfaces/i_selectable.js';
|
||||
import {ISelectableToolboxItem} from './interfaces/i_selectable_toolbox_item.js';
|
||||
import {ISerializer as SerializerInterface} from './interfaces/i_serializer.js';
|
||||
import {IStyleable} from './interfaces/i_styleable.js';
|
||||
import {IToolbox} from './interfaces/i_toolbox.js';
|
||||
import {IToolboxItem} from './interfaces/i_toolbox_item.js';
|
||||
@@ -134,12 +133,7 @@ import * as thrasos from './renderers/thrasos/thrasos.js';
|
||||
import * as zelos from './renderers/zelos/zelos.js';
|
||||
import {Scrollbar} from './scrollbar.js';
|
||||
import {ScrollbarPair} from './scrollbar_pair.js';
|
||||
import * as serializationBlocks from './serialization/blocks.js';
|
||||
import * as serializationExceptions from './serialization/exceptions.js';
|
||||
import * as serializationPriorities from './serialization/priorities.js';
|
||||
import * as serializationRegistry from './serialization/registry.js';
|
||||
import * as serializationVariables from './serialization/variables.js';
|
||||
import * as serializationWorkspaces from './serialization/workspaces.js';
|
||||
import * as serialization from './serialization.js';
|
||||
import * as ShortcutItems from './shortcut_items.js';
|
||||
import {ShortcutRegistry} from './shortcut_registry.js';
|
||||
import {Theme} from './theme.js';
|
||||
@@ -157,7 +151,6 @@ import {Trashcan} from './trashcan.js';
|
||||
import * as utils from './utils.js';
|
||||
import * as colour from './utils/colour.js';
|
||||
import * as deprecation from './utils/deprecation.js';
|
||||
import * as svgMath from './utils/svg_math.js';
|
||||
import * as toolbox from './utils/toolbox.js';
|
||||
import {VariableMap} from './variable_map.js';
|
||||
import {VariableModel} from './variable_model.js';
|
||||
@@ -574,12 +567,12 @@ WorkspaceCommentSvg.prototype.showContextMenu =
|
||||
return;
|
||||
}
|
||||
const menuOptions = [];
|
||||
|
||||
|
||||
if (this.isDeletable() && this.isMovable()) {
|
||||
menuOptions.push(ContextMenu.commentDuplicateOption(this));
|
||||
menuOptions.push(ContextMenu.commentDeleteOption(this));
|
||||
}
|
||||
|
||||
|
||||
ContextMenu.show(e, menuOptions, this.RTL);
|
||||
};
|
||||
|
||||
@@ -609,6 +602,7 @@ export {Css};
|
||||
export {Events};
|
||||
export {Extensions};
|
||||
export {Procedures};
|
||||
export {Procedures as procedures};
|
||||
export {ShortcutItems};
|
||||
export {Themes};
|
||||
export {Tooltip};
|
||||
@@ -658,7 +652,7 @@ export {Field};
|
||||
export {FieldAngle};
|
||||
export {FieldCheckbox};
|
||||
export {FieldColour};
|
||||
export {FieldDropdown};
|
||||
export {FieldDropdown, MenuGenerator, MenuGeneratorFunction, MenuOption};
|
||||
export {FieldImage};
|
||||
export {FieldLabel};
|
||||
export {FieldLabelSerializable};
|
||||
@@ -669,7 +663,8 @@ export {FieldVariable};
|
||||
export {Flyout};
|
||||
export {FlyoutButton};
|
||||
export {FlyoutMetricsManager};
|
||||
export {Generator};
|
||||
export {CodeGenerator};
|
||||
export {CodeGenerator as Generator}; // Deprecated name, October 2022.
|
||||
export {Gesture};
|
||||
export {Grid};
|
||||
export {HorizontalFlyout};
|
||||
@@ -743,12 +738,4 @@ export {config};
|
||||
export const connectionTypes = ConnectionType;
|
||||
export {inject};
|
||||
export {inputTypes};
|
||||
export namespace serialization {
|
||||
export const blocks = serializationBlocks;
|
||||
export const exceptions = serializationExceptions;
|
||||
export const priorities = serializationPriorities;
|
||||
export const registry = serializationRegistry;
|
||||
export const variables = serializationVariables;
|
||||
export const workspaces = serializationWorkspaces;
|
||||
export type ISerializer = SerializerInterface;
|
||||
}
|
||||
export {serialization};
|
||||
|
||||
324
core/bubble.ts
324
core/bubble.ts
@@ -56,67 +56,68 @@ export class Bubble implements IBubble {
|
||||
static ANCHOR_RADIUS = 8;
|
||||
|
||||
/** Mouse up event data. */
|
||||
private static onMouseUpWrapper_: browserEvents.Data|null = null;
|
||||
private static onMouseUpWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/** Mouse move event data. */
|
||||
private static onMouseMoveWrapper_: browserEvents.Data|null = null;
|
||||
private static onMouseMoveWrapper: browserEvents.Data|null = null;
|
||||
|
||||
workspace_: WorkspaceSvg;
|
||||
content_: SVGElement;
|
||||
shape_: SVGElement;
|
||||
|
||||
/** Flag to stop incremental rendering during construction. */
|
||||
private readonly rendered_: boolean;
|
||||
private readonly rendered: boolean;
|
||||
|
||||
/** The SVG group containing all parts of the bubble. */
|
||||
private bubbleGroup_: SVGGElement|null = null;
|
||||
private bubbleGroup: SVGGElement|null = null;
|
||||
|
||||
/**
|
||||
* The SVG path for the arrow from the bubble to the icon on the block.
|
||||
*/
|
||||
private bubbleArrow_: SVGPathElement|null = null;
|
||||
private bubbleArrow: SVGPathElement|null = null;
|
||||
|
||||
/** The SVG rect for the main body of the bubble. */
|
||||
private bubbleBack_: SVGRectElement|null = null;
|
||||
private bubbleBack: SVGRectElement|null = null;
|
||||
|
||||
/** The SVG group for the resize hash marks on some bubbles. */
|
||||
private resizeGroup_: SVGGElement|null = null;
|
||||
private resizeGroup: SVGGElement|null = null;
|
||||
|
||||
/** Absolute coordinate of anchor point, in workspace coordinates. */
|
||||
private anchorXY_!: Coordinate;
|
||||
private anchorXY!: Coordinate;
|
||||
|
||||
/**
|
||||
* Relative X coordinate of bubble with respect to the anchor's centre,
|
||||
* in workspace units.
|
||||
* In RTL mode the initial value is negated.
|
||||
*/
|
||||
private relativeLeft_ = 0;
|
||||
private relativeLeft = 0;
|
||||
|
||||
/**
|
||||
* Relative Y coordinate of bubble with respect to the anchor's centre, in
|
||||
* workspace units.
|
||||
*/
|
||||
private relativeTop_ = 0;
|
||||
private relativeTop = 0;
|
||||
|
||||
/** Width of bubble, in workspace units. */
|
||||
private width_ = 0;
|
||||
private width = 0;
|
||||
|
||||
/** Height of bubble, in workspace units. */
|
||||
private height_ = 0;
|
||||
private height = 0;
|
||||
|
||||
/** Automatically position and reposition the bubble. */
|
||||
private autoLayout_ = true;
|
||||
private autoLayout = true;
|
||||
|
||||
/** Method to call on resize of bubble. */
|
||||
private resizeCallback_: (() => void)|null = null;
|
||||
private resizeCallback: (() => void)|null = null;
|
||||
|
||||
/** Method to call on move of bubble. */
|
||||
private moveCallback_: (() => void)|null = null;
|
||||
private moveCallback: (() => void)|null = null;
|
||||
|
||||
/** Mouse down on bubbleBack_ event data. */
|
||||
private onMouseDownBubbleWrapper_: browserEvents.Data|null = null;
|
||||
/** Mouse down on bubbleBack event data. */
|
||||
private onMouseDownBubbleWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/** Mouse down on resizeGroup_ event data. */
|
||||
private onMouseDownResizeWrapper_: browserEvents.Data|null = null;
|
||||
/** Mouse down on resizeGroup event data. */
|
||||
private onMouseDownResizeWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/**
|
||||
* Describes whether this bubble has been disposed of (nodes and event
|
||||
@@ -125,7 +126,7 @@ export class Bubble implements IBubble {
|
||||
* @internal
|
||||
*/
|
||||
disposed = false;
|
||||
private arrow_radians_: number;
|
||||
private arrowRadians: number;
|
||||
|
||||
/**
|
||||
* @param workspace The workspace on which to draw the bubble.
|
||||
@@ -139,7 +140,7 @@ export class Bubble implements IBubble {
|
||||
workspace: WorkspaceSvg, content: SVGElement, shape: SVGElement,
|
||||
anchorXY: Coordinate, bubbleWidth: number|null,
|
||||
bubbleHeight: number|null) {
|
||||
this.rendered_ = false;
|
||||
this.rendered = false;
|
||||
this.workspace_ = workspace;
|
||||
this.content_ = content;
|
||||
this.shape_ = shape;
|
||||
@@ -148,11 +149,11 @@ export class Bubble implements IBubble {
|
||||
if (this.workspace_.RTL) {
|
||||
angle = -angle;
|
||||
}
|
||||
this.arrow_radians_ = math.toRadians(angle);
|
||||
this.arrowRadians = math.toRadians(angle);
|
||||
|
||||
const canvas = workspace.getBubbleCanvas();
|
||||
canvas.appendChild(
|
||||
this.createDom_(content, !!(bubbleWidth && bubbleHeight)));
|
||||
this.createDom(content, !!(bubbleWidth && bubbleHeight)));
|
||||
|
||||
this.setAnchorLocation(anchorXY);
|
||||
if (!bubbleWidth || !bubbleHeight) {
|
||||
@@ -163,9 +164,9 @@ export class Bubble implements IBubble {
|
||||
this.setBubbleSize(bubbleWidth, bubbleHeight);
|
||||
|
||||
// Render the bubble.
|
||||
this.positionBubble_();
|
||||
this.renderArrow_();
|
||||
this.rendered_ = true;
|
||||
this.positionBubble();
|
||||
this.renderArrow();
|
||||
this.rendered = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,7 +176,7 @@ export class Bubble implements IBubble {
|
||||
* @param hasResize Add diagonal resize gripper if true.
|
||||
* @returns The bubble's SVG group.
|
||||
*/
|
||||
private createDom_(content: Element, hasResize: boolean): SVGElement {
|
||||
private createDom(content: Element, hasResize: boolean): SVGElement {
|
||||
/* Create the bubble. Here's the markup that will be generated:
|
||||
<g>
|
||||
<g filter="url(#blocklyEmbossFilter837493)">
|
||||
@@ -191,7 +192,7 @@ export class Bubble implements IBubble {
|
||||
[...content goes here...]
|
||||
</g>
|
||||
*/
|
||||
this.bubbleGroup_ = dom.createSvgElement(Svg.G, {});
|
||||
this.bubbleGroup = dom.createSvgElement(Svg.G, {});
|
||||
let filter: {filter?: string} = {
|
||||
'filter': 'url(#' +
|
||||
this.workspace_.getRenderer().getConstants().embossFilterId + ')',
|
||||
@@ -201,9 +202,9 @@ export class Bubble implements IBubble {
|
||||
// https://github.com/google/blockly/issues/99
|
||||
filter = {};
|
||||
}
|
||||
const bubbleEmboss = dom.createSvgElement(Svg.G, filter, this.bubbleGroup_);
|
||||
this.bubbleArrow_ = dom.createSvgElement(Svg.PATH, {}, bubbleEmboss);
|
||||
this.bubbleBack_ = dom.createSvgElement(
|
||||
const bubbleEmboss = dom.createSvgElement(Svg.G, filter, this.bubbleGroup);
|
||||
this.bubbleArrow = dom.createSvgElement(Svg.PATH, {}, bubbleEmboss);
|
||||
this.bubbleBack = dom.createSvgElement(
|
||||
Svg.RECT, {
|
||||
'class': 'blocklyDraggable',
|
||||
'x': 0,
|
||||
@@ -213,17 +214,17 @@ export class Bubble implements IBubble {
|
||||
},
|
||||
bubbleEmboss);
|
||||
if (hasResize) {
|
||||
this.resizeGroup_ = dom.createSvgElement(
|
||||
this.resizeGroup = dom.createSvgElement(
|
||||
Svg.G, {
|
||||
'class': this.workspace_.RTL ? 'blocklyResizeSW' :
|
||||
'blocklyResizeSE',
|
||||
},
|
||||
this.bubbleGroup_);
|
||||
this.bubbleGroup);
|
||||
const resizeSize = 2 * Bubble.BORDER_WIDTH;
|
||||
dom.createSvgElement(
|
||||
Svg.POLYGON,
|
||||
{'points': '0,x x,x x,0'.replace(/x/g, resizeSize.toString())},
|
||||
this.resizeGroup_);
|
||||
this.resizeGroup);
|
||||
dom.createSvgElement(
|
||||
Svg.LINE, {
|
||||
'class': 'blocklyResizeLine',
|
||||
@@ -232,7 +233,7 @@ export class Bubble implements IBubble {
|
||||
'x2': resizeSize - 1,
|
||||
'y2': resizeSize / 3,
|
||||
},
|
||||
this.resizeGroup_);
|
||||
this.resizeGroup);
|
||||
dom.createSvgElement(
|
||||
Svg.LINE, {
|
||||
'class': 'blocklyResizeLine',
|
||||
@@ -241,21 +242,21 @@ export class Bubble implements IBubble {
|
||||
'x2': resizeSize - 1,
|
||||
'y2': resizeSize * 2 / 3,
|
||||
},
|
||||
this.resizeGroup_);
|
||||
this.resizeGroup);
|
||||
} else {
|
||||
this.resizeGroup_ = null;
|
||||
this.resizeGroup = null;
|
||||
}
|
||||
|
||||
if (!this.workspace_.options.readOnly) {
|
||||
this.onMouseDownBubbleWrapper_ = browserEvents.conditionalBind(
|
||||
this.bubbleBack_, 'mousedown', this, this.bubbleMouseDown_);
|
||||
if (this.resizeGroup_) {
|
||||
this.onMouseDownResizeWrapper_ = browserEvents.conditionalBind(
|
||||
this.resizeGroup_, 'mousedown', this, this.resizeMouseDown_);
|
||||
this.onMouseDownBubbleWrapper = browserEvents.conditionalBind(
|
||||
this.bubbleBack, 'mousedown', this, this.bubbleMouseDown);
|
||||
if (this.resizeGroup) {
|
||||
this.onMouseDownResizeWrapper = browserEvents.conditionalBind(
|
||||
this.resizeGroup, 'mousedown', this, this.resizeMouseDown);
|
||||
}
|
||||
}
|
||||
this.bubbleGroup_.appendChild(content);
|
||||
return this.bubbleGroup_;
|
||||
this.bubbleGroup.appendChild(content);
|
||||
return this.bubbleGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,7 +265,7 @@ export class Bubble implements IBubble {
|
||||
* @returns The root SVG node of the bubble's group.
|
||||
*/
|
||||
getSvgRoot(): SVGElement {
|
||||
return this.bubbleGroup_ as SVGElement;
|
||||
return this.bubbleGroup as SVGElement;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,7 +274,7 @@ export class Bubble implements IBubble {
|
||||
* @param id ID of block.
|
||||
*/
|
||||
setSvgId(id: string) {
|
||||
this.bubbleGroup_?.setAttribute('data-block-id', id);
|
||||
this.bubbleGroup?.setAttribute('data-block-id', id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,7 +282,7 @@ export class Bubble implements IBubble {
|
||||
*
|
||||
* @param e Mouse down event.
|
||||
*/
|
||||
private bubbleMouseDown_(e: Event) {
|
||||
private bubbleMouseDown(e: Event) {
|
||||
const gesture = this.workspace_.getGesture(e);
|
||||
if (gesture) {
|
||||
gesture.handleBubbleStart(e, this);
|
||||
@@ -321,9 +322,9 @@ export class Bubble implements IBubble {
|
||||
*
|
||||
* @param e Mouse down event.
|
||||
*/
|
||||
private resizeMouseDown_(e: MouseEvent) {
|
||||
private resizeMouseDown(e: MouseEvent) {
|
||||
this.promote();
|
||||
Bubble.unbindDragEvents_();
|
||||
Bubble.unbindDragEvents();
|
||||
if (browserEvents.isRightButton(e)) {
|
||||
// No right-click.
|
||||
e.stopPropagation();
|
||||
@@ -333,12 +334,12 @@ export class Bubble implements IBubble {
|
||||
this.workspace_.startDrag(
|
||||
e,
|
||||
new Coordinate(
|
||||
this.workspace_.RTL ? -this.width_ : this.width_, this.height_));
|
||||
this.workspace_.RTL ? -this.width : this.width, this.height));
|
||||
|
||||
Bubble.onMouseUpWrapper_ = browserEvents.conditionalBind(
|
||||
document, 'mouseup', this, Bubble.bubbleMouseUp_);
|
||||
Bubble.onMouseMoveWrapper_ = browserEvents.conditionalBind(
|
||||
document, 'mousemove', this, this.resizeMouseMove_);
|
||||
Bubble.onMouseUpWrapper = browserEvents.conditionalBind(
|
||||
document, 'mouseup', this, Bubble.bubbleMouseUp);
|
||||
Bubble.onMouseMoveWrapper = browserEvents.conditionalBind(
|
||||
document, 'mousemove', this, this.resizeMouseMove);
|
||||
this.workspace_.hideChaff();
|
||||
// This event has been handled. No need to bubble up to the document.
|
||||
e.stopPropagation();
|
||||
@@ -349,13 +350,13 @@ export class Bubble implements IBubble {
|
||||
*
|
||||
* @param e Mouse move event.
|
||||
*/
|
||||
private resizeMouseMove_(e: MouseEvent) {
|
||||
this.autoLayout_ = false;
|
||||
private resizeMouseMove(e: MouseEvent) {
|
||||
this.autoLayout = false;
|
||||
const newXY = this.workspace_.moveDrag(e);
|
||||
this.setBubbleSize(this.workspace_.RTL ? -newXY.x : newXY.x, newXY.y);
|
||||
if (this.workspace_.RTL) {
|
||||
// RTL requires the bubble to move its left edge.
|
||||
this.positionBubble_();
|
||||
this.positionBubble();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +366,7 @@ export class Bubble implements IBubble {
|
||||
* @param callback The function to call on resize.
|
||||
*/
|
||||
registerResizeEvent(callback: () => void) {
|
||||
this.resizeCallback_ = callback;
|
||||
this.resizeCallback = callback;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -374,7 +375,7 @@ export class Bubble implements IBubble {
|
||||
* @param callback The function to call on move.
|
||||
*/
|
||||
registerMoveEvent(callback: () => void) {
|
||||
this.moveCallback_ = callback;
|
||||
this.moveCallback = callback;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -384,9 +385,9 @@ export class Bubble implements IBubble {
|
||||
* @internal
|
||||
*/
|
||||
promote(): boolean {
|
||||
const svgGroup = this.bubbleGroup_?.parentNode;
|
||||
if (svgGroup?.lastChild !== this.bubbleGroup_ && this.bubbleGroup_) {
|
||||
svgGroup?.appendChild(this.bubbleGroup_);
|
||||
const svgGroup = this.bubbleGroup?.parentNode;
|
||||
if (svgGroup?.lastChild !== this.bubbleGroup && this.bubbleGroup) {
|
||||
svgGroup?.appendChild(this.bubbleGroup);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -399,29 +400,29 @@ export class Bubble implements IBubble {
|
||||
* @param xy Absolute location.
|
||||
*/
|
||||
setAnchorLocation(xy: Coordinate) {
|
||||
this.anchorXY_ = xy;
|
||||
if (this.rendered_) {
|
||||
this.positionBubble_();
|
||||
this.anchorXY = xy;
|
||||
if (this.rendered) {
|
||||
this.positionBubble();
|
||||
}
|
||||
}
|
||||
|
||||
/** Position the bubble so that it does not fall off-screen. */
|
||||
private layoutBubble_() {
|
||||
private layoutBubble() {
|
||||
// Get the metrics in workspace units.
|
||||
const viewMetrics =
|
||||
this.workspace_.getMetricsManager().getViewMetrics(true);
|
||||
|
||||
const optimalLeft = this.getOptimalRelativeLeft_(viewMetrics);
|
||||
const optimalTop = this.getOptimalRelativeTop_(viewMetrics);
|
||||
const optimalLeft = this.getOptimalRelativeLeft(viewMetrics);
|
||||
const optimalTop = this.getOptimalRelativeTop(viewMetrics);
|
||||
const bbox = (this.shape_ as SVGGraphicsElement).getBBox();
|
||||
|
||||
const topPosition = {
|
||||
x: optimalLeft,
|
||||
y: -this.height_ -
|
||||
y: -this.height -
|
||||
this.workspace_.getRenderer().getConstants().MIN_BLOCK_HEIGHT as
|
||||
number,
|
||||
};
|
||||
const startPosition = {x: -this.width_ - 30, y: optimalTop};
|
||||
const startPosition = {x: -this.width - 30, y: optimalTop};
|
||||
const endPosition = {x: bbox.width, y: optimalTop};
|
||||
const bottomPosition = {x: optimalLeft, y: bbox.height};
|
||||
|
||||
@@ -430,11 +431,11 @@ export class Bubble implements IBubble {
|
||||
const fartherPosition =
|
||||
bbox.width < bbox.height ? bottomPosition : endPosition;
|
||||
|
||||
const topPositionOverlap = this.getOverlap_(topPosition, viewMetrics);
|
||||
const startPositionOverlap = this.getOverlap_(startPosition, viewMetrics);
|
||||
const closerPositionOverlap = this.getOverlap_(closerPosition, viewMetrics);
|
||||
const topPositionOverlap = this.getOverlap(topPosition, viewMetrics);
|
||||
const startPositionOverlap = this.getOverlap(startPosition, viewMetrics);
|
||||
const closerPositionOverlap = this.getOverlap(closerPosition, viewMetrics);
|
||||
const fartherPositionOverlap =
|
||||
this.getOverlap_(fartherPosition, viewMetrics);
|
||||
this.getOverlap(fartherPosition, viewMetrics);
|
||||
|
||||
// Set the position to whichever position shows the most of the bubble,
|
||||
// with tiebreaks going in the order: top > start > close > far.
|
||||
@@ -442,25 +443,25 @@ export class Bubble implements IBubble {
|
||||
topPositionOverlap, startPositionOverlap, closerPositionOverlap,
|
||||
fartherPositionOverlap);
|
||||
if (topPositionOverlap === mostOverlap) {
|
||||
this.relativeLeft_ = topPosition.x;
|
||||
this.relativeTop_ = topPosition.y;
|
||||
this.relativeLeft = topPosition.x;
|
||||
this.relativeTop = topPosition.y;
|
||||
return;
|
||||
}
|
||||
if (startPositionOverlap === mostOverlap) {
|
||||
this.relativeLeft_ = startPosition.x;
|
||||
this.relativeTop_ = startPosition.y;
|
||||
this.relativeLeft = startPosition.x;
|
||||
this.relativeTop = startPosition.y;
|
||||
return;
|
||||
}
|
||||
if (closerPositionOverlap === mostOverlap) {
|
||||
this.relativeLeft_ = closerPosition.x;
|
||||
this.relativeTop_ = closerPosition.y;
|
||||
this.relativeLeft = closerPosition.x;
|
||||
this.relativeTop = closerPosition.y;
|
||||
return;
|
||||
}
|
||||
// TODO: I believe relativeLeft_ should actually be called relativeStart_
|
||||
// and then the math should be fixed to reflect this. (hopefully it'll
|
||||
// make it look simpler)
|
||||
this.relativeLeft_ = fartherPosition.x;
|
||||
this.relativeTop_ = fartherPosition.y;
|
||||
this.relativeLeft = fartherPosition.x;
|
||||
this.relativeTop = fartherPosition.y;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -473,19 +474,19 @@ export class Bubble implements IBubble {
|
||||
* in.
|
||||
* @returns The percentage of the bubble that is visible.
|
||||
*/
|
||||
private getOverlap_(
|
||||
private getOverlap(
|
||||
relativeMin: {x: number, y: number},
|
||||
viewMetrics: ContainerRegion): number {
|
||||
// The position of the top-left corner of the bubble in workspace units.
|
||||
const bubbleMin = {
|
||||
x: this.workspace_.RTL ? this.anchorXY_.x - relativeMin.x - this.width_ :
|
||||
relativeMin.x + this.anchorXY_.x,
|
||||
y: relativeMin.y + this.anchorXY_.y,
|
||||
x: this.workspace_.RTL ? this.anchorXY.x - relativeMin.x - this.width :
|
||||
relativeMin.x + this.anchorXY.x,
|
||||
y: relativeMin.y + this.anchorXY.y,
|
||||
};
|
||||
// The position of the bottom-right corner of the bubble in workspace units.
|
||||
const bubbleMax = {
|
||||
x: bubbleMin.x + this.width_,
|
||||
y: bubbleMin.y + this.height_,
|
||||
x: bubbleMin.x + this.width,
|
||||
y: bubbleMin.y + this.height,
|
||||
};
|
||||
|
||||
// We could adjust these values to account for the scrollbars, but the
|
||||
@@ -507,8 +508,7 @@ export class Bubble implements IBubble {
|
||||
Math.max(bubbleMin.y, workspaceMin.y);
|
||||
return Math.max(
|
||||
0,
|
||||
Math.min(
|
||||
1, overlapWidth * overlapHeight / (this.width_ * this.height_)));
|
||||
Math.min(1, overlapWidth * overlapHeight / (this.width * this.height)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -521,18 +521,18 @@ export class Bubble implements IBubble {
|
||||
* @returns The optimal horizontal position of the top-left corner of the
|
||||
* bubble.
|
||||
*/
|
||||
private getOptimalRelativeLeft_(viewMetrics: ContainerRegion): number {
|
||||
let relativeLeft = -this.width_ / 4;
|
||||
private getOptimalRelativeLeft(viewMetrics: ContainerRegion): number {
|
||||
let relativeLeft = -this.width / 4;
|
||||
|
||||
// No amount of sliding left or right will give us a better overlap.
|
||||
if (this.width_ > viewMetrics.width) {
|
||||
if (this.width > viewMetrics.width) {
|
||||
return relativeLeft;
|
||||
}
|
||||
|
||||
if (this.workspace_.RTL) {
|
||||
// Bubble coordinates are flipped in RTL.
|
||||
const bubbleRight = this.anchorXY_.x - relativeLeft;
|
||||
const bubbleLeft = bubbleRight - this.width_;
|
||||
const bubbleRight = this.anchorXY.x - relativeLeft;
|
||||
const bubbleLeft = bubbleRight - this.width;
|
||||
|
||||
const workspaceRight = viewMetrics.left + viewMetrics.width;
|
||||
const workspaceLeft = viewMetrics.left +
|
||||
@@ -541,14 +541,14 @@ export class Bubble implements IBubble {
|
||||
|
||||
if (bubbleLeft < workspaceLeft) {
|
||||
// Slide the bubble right until it is onscreen.
|
||||
relativeLeft = -(workspaceLeft - this.anchorXY_.x + this.width_);
|
||||
relativeLeft = -(workspaceLeft - this.anchorXY.x + this.width);
|
||||
} else if (bubbleRight > workspaceRight) {
|
||||
// Slide the bubble left until it is onscreen.
|
||||
relativeLeft = -(workspaceRight - this.anchorXY_.x);
|
||||
relativeLeft = -(workspaceRight - this.anchorXY.x);
|
||||
}
|
||||
} else {
|
||||
const bubbleLeft = relativeLeft + this.anchorXY_.x;
|
||||
const bubbleRight = bubbleLeft + this.width_;
|
||||
const bubbleLeft = relativeLeft + this.anchorXY.x;
|
||||
const bubbleRight = bubbleLeft + this.width;
|
||||
|
||||
const workspaceLeft = viewMetrics.left;
|
||||
const workspaceRight = viewMetrics.left + viewMetrics.width -
|
||||
@@ -557,10 +557,10 @@ export class Bubble implements IBubble {
|
||||
|
||||
if (bubbleLeft < workspaceLeft) {
|
||||
// Slide the bubble right until it is onscreen.
|
||||
relativeLeft = workspaceLeft - this.anchorXY_.x;
|
||||
relativeLeft = workspaceLeft - this.anchorXY.x;
|
||||
} else if (bubbleRight > workspaceRight) {
|
||||
// Slide the bubble left until it is onscreen.
|
||||
relativeLeft = workspaceRight - this.anchorXY_.x - this.width_;
|
||||
relativeLeft = workspaceRight - this.anchorXY.x - this.width;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,42 +577,42 @@ export class Bubble implements IBubble {
|
||||
* @returns The optimal vertical position of the top-left corner of the
|
||||
* bubble.
|
||||
*/
|
||||
private getOptimalRelativeTop_(viewMetrics: ContainerRegion): number {
|
||||
let relativeTop = -this.height_ / 4;
|
||||
private getOptimalRelativeTop(viewMetrics: ContainerRegion): number {
|
||||
let relativeTop = -this.height / 4;
|
||||
|
||||
// No amount of sliding up or down will give us a better overlap.
|
||||
if (this.height_ > viewMetrics.height) {
|
||||
if (this.height > viewMetrics.height) {
|
||||
return relativeTop;
|
||||
}
|
||||
|
||||
const bubbleTop = this.anchorXY_.y + relativeTop;
|
||||
const bubbleBottom = bubbleTop + this.height_;
|
||||
const bubbleTop = this.anchorXY.y + relativeTop;
|
||||
const bubbleBottom = bubbleTop + this.height;
|
||||
const workspaceTop = viewMetrics.top;
|
||||
const workspaceBottom = viewMetrics.top +
|
||||
viewMetrics.height - // Thickness in workspace units.
|
||||
Scrollbar.scrollbarThickness / this.workspace_.scale;
|
||||
|
||||
const anchorY = this.anchorXY_.y;
|
||||
const anchorY = this.anchorXY.y;
|
||||
if (bubbleTop < workspaceTop) {
|
||||
// Slide the bubble down until it is onscreen.
|
||||
relativeTop = workspaceTop - anchorY;
|
||||
} else if (bubbleBottom > workspaceBottom) {
|
||||
// Slide the bubble up until it is onscreen.
|
||||
relativeTop = workspaceBottom - anchorY - this.height_;
|
||||
relativeTop = workspaceBottom - anchorY - this.height;
|
||||
}
|
||||
|
||||
return relativeTop;
|
||||
}
|
||||
|
||||
/** Move the bubble to a location relative to the anchor's centre. */
|
||||
private positionBubble_() {
|
||||
let left = this.anchorXY_.x;
|
||||
private positionBubble() {
|
||||
let left = this.anchorXY.x;
|
||||
if (this.workspace_.RTL) {
|
||||
left -= this.relativeLeft_ + this.width_;
|
||||
left -= this.relativeLeft + this.width;
|
||||
} else {
|
||||
left += this.relativeLeft_;
|
||||
left += this.relativeLeft;
|
||||
}
|
||||
const top = this.relativeTop_ + this.anchorXY_.y;
|
||||
const top = this.relativeTop + this.anchorXY.y;
|
||||
this.moveTo(left, top);
|
||||
}
|
||||
|
||||
@@ -624,7 +624,7 @@ export class Bubble implements IBubble {
|
||||
* @internal
|
||||
*/
|
||||
moveTo(x: number, y: number) {
|
||||
this.bubbleGroup_?.setAttribute(
|
||||
this.bubbleGroup?.setAttribute(
|
||||
'transform', 'translate(' + x + ',' + y + ')');
|
||||
}
|
||||
|
||||
@@ -635,8 +635,8 @@ export class Bubble implements IBubble {
|
||||
* @internal
|
||||
*/
|
||||
setDragging(adding: boolean) {
|
||||
if (!adding && this.moveCallback_) {
|
||||
this.moveCallback_();
|
||||
if (!adding && this.moveCallback) {
|
||||
this.moveCallback();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ export class Bubble implements IBubble {
|
||||
* @returns The height and width of the bubble.
|
||||
*/
|
||||
getBubbleSize(): Size {
|
||||
return new Size(this.width_, this.height_);
|
||||
return new Size(this.width, this.height);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -660,46 +660,46 @@ export class Bubble implements IBubble {
|
||||
// Minimum size of a bubble.
|
||||
width = Math.max(width, doubleBorderWidth + 45);
|
||||
height = Math.max(height, doubleBorderWidth + 20);
|
||||
this.width_ = width;
|
||||
this.height_ = height;
|
||||
this.bubbleBack_?.setAttribute('width', width.toString());
|
||||
this.bubbleBack_?.setAttribute('height', height.toString());
|
||||
if (this.resizeGroup_) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.bubbleBack?.setAttribute('width', width.toString());
|
||||
this.bubbleBack?.setAttribute('height', height.toString());
|
||||
if (this.resizeGroup) {
|
||||
if (this.workspace_.RTL) {
|
||||
// Mirror the resize group.
|
||||
const resizeSize = 2 * Bubble.BORDER_WIDTH;
|
||||
this.resizeGroup_.setAttribute(
|
||||
this.resizeGroup.setAttribute(
|
||||
'transform',
|
||||
'translate(' + resizeSize + ',' + (height - doubleBorderWidth) +
|
||||
') scale(-1 1)');
|
||||
} else {
|
||||
this.resizeGroup_.setAttribute(
|
||||
this.resizeGroup.setAttribute(
|
||||
'transform',
|
||||
'translate(' + (width - doubleBorderWidth) + ',' +
|
||||
(height - doubleBorderWidth) + ')');
|
||||
}
|
||||
}
|
||||
if (this.autoLayout_) {
|
||||
this.layoutBubble_();
|
||||
if (this.autoLayout) {
|
||||
this.layoutBubble();
|
||||
}
|
||||
this.positionBubble_();
|
||||
this.renderArrow_();
|
||||
this.positionBubble();
|
||||
this.renderArrow();
|
||||
|
||||
// Allow the contents to resize.
|
||||
if (this.resizeCallback_) {
|
||||
this.resizeCallback_();
|
||||
if (this.resizeCallback) {
|
||||
this.resizeCallback();
|
||||
}
|
||||
}
|
||||
|
||||
/** Draw the arrow between the bubble and the origin. */
|
||||
private renderArrow_() {
|
||||
private renderArrow() {
|
||||
const steps = [];
|
||||
// Find the relative coordinates of the center of the bubble.
|
||||
const relBubbleX = this.width_ / 2;
|
||||
const relBubbleY = this.height_ / 2;
|
||||
const relBubbleX = this.width / 2;
|
||||
const relBubbleY = this.height / 2;
|
||||
// Find the relative coordinates of the center of the anchor.
|
||||
let relAnchorX = -this.relativeLeft_;
|
||||
let relAnchorY = -this.relativeTop_;
|
||||
let relAnchorX = -this.relativeLeft;
|
||||
let relAnchorY = -this.relativeTop;
|
||||
if (relBubbleX === relAnchorX && relBubbleY === relAnchorY) {
|
||||
// Null case. Bubble is directly on top of the anchor.
|
||||
// Short circuit this rather than wade through divide by zeros.
|
||||
@@ -742,7 +742,7 @@ export class Bubble implements IBubble {
|
||||
const baseY2 = relBubbleY - thickness * rightRise;
|
||||
|
||||
// Distortion to curve the arrow.
|
||||
let swirlAngle = angle + this.arrow_radians_;
|
||||
let swirlAngle = angle + this.arrowRadians;
|
||||
if (swirlAngle > Math.PI * 2) {
|
||||
swirlAngle -= Math.PI * 2;
|
||||
}
|
||||
@@ -758,7 +758,7 @@ export class Bubble implements IBubble {
|
||||
',' + (baseY2 + swirlRise) + ' ' + baseX2 + ',' + baseY2);
|
||||
}
|
||||
steps.push('z');
|
||||
this.bubbleArrow_?.setAttribute('d', steps.join(' '));
|
||||
this.bubbleArrow?.setAttribute('d', steps.join(' '));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -767,20 +767,20 @@ export class Bubble implements IBubble {
|
||||
* @param hexColour Hex code of colour.
|
||||
*/
|
||||
setColour(hexColour: string) {
|
||||
this.bubbleBack_?.setAttribute('fill', hexColour);
|
||||
this.bubbleArrow_?.setAttribute('fill', hexColour);
|
||||
this.bubbleBack?.setAttribute('fill', hexColour);
|
||||
this.bubbleArrow?.setAttribute('fill', hexColour);
|
||||
}
|
||||
|
||||
/** Dispose of this bubble. */
|
||||
dispose() {
|
||||
if (this.onMouseDownBubbleWrapper_) {
|
||||
browserEvents.unbind(this.onMouseDownBubbleWrapper_);
|
||||
if (this.onMouseDownBubbleWrapper) {
|
||||
browserEvents.unbind(this.onMouseDownBubbleWrapper);
|
||||
}
|
||||
if (this.onMouseDownResizeWrapper_) {
|
||||
browserEvents.unbind(this.onMouseDownResizeWrapper_);
|
||||
if (this.onMouseDownResizeWrapper) {
|
||||
browserEvents.unbind(this.onMouseDownResizeWrapper);
|
||||
}
|
||||
Bubble.unbindDragEvents_();
|
||||
dom.removeNode(this.bubbleGroup_);
|
||||
Bubble.unbindDragEvents();
|
||||
dom.removeNode(this.bubbleGroup);
|
||||
this.disposed = true;
|
||||
}
|
||||
|
||||
@@ -800,12 +800,12 @@ export class Bubble implements IBubble {
|
||||
this.moveTo(newLoc.x, newLoc.y);
|
||||
}
|
||||
if (this.workspace_.RTL) {
|
||||
this.relativeLeft_ = this.anchorXY_.x - newLoc.x - this.width_;
|
||||
this.relativeLeft = this.anchorXY.x - newLoc.x - this.width;
|
||||
} else {
|
||||
this.relativeLeft_ = newLoc.x - this.anchorXY_.x;
|
||||
this.relativeLeft = newLoc.x - this.anchorXY.x;
|
||||
}
|
||||
this.relativeTop_ = newLoc.y - this.anchorXY_.y;
|
||||
this.renderArrow_();
|
||||
this.relativeTop = newLoc.y - this.anchorXY.y;
|
||||
this.renderArrow();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -817,9 +817,9 @@ export class Bubble implements IBubble {
|
||||
getRelativeToSurfaceXY(): Coordinate {
|
||||
return new Coordinate(
|
||||
this.workspace_.RTL ?
|
||||
-this.relativeLeft_ + this.anchorXY_.x - this.width_ :
|
||||
this.anchorXY_.x + this.relativeLeft_,
|
||||
this.anchorXY_.y + this.relativeTop_);
|
||||
-this.relativeLeft + this.anchorXY.x - this.width :
|
||||
this.anchorXY.x + this.relativeLeft,
|
||||
this.anchorXY.y + this.relativeTop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -831,18 +831,18 @@ export class Bubble implements IBubble {
|
||||
* @internal
|
||||
*/
|
||||
setAutoLayout(enable: boolean) {
|
||||
this.autoLayout_ = enable;
|
||||
this.autoLayout = enable;
|
||||
}
|
||||
|
||||
/** Stop binding to the global mouseup and mousemove events. */
|
||||
private static unbindDragEvents_() {
|
||||
if (Bubble.onMouseUpWrapper_) {
|
||||
browserEvents.unbind(Bubble.onMouseUpWrapper_);
|
||||
Bubble.onMouseUpWrapper_ = null;
|
||||
private static unbindDragEvents() {
|
||||
if (Bubble.onMouseUpWrapper) {
|
||||
browserEvents.unbind(Bubble.onMouseUpWrapper);
|
||||
Bubble.onMouseUpWrapper = null;
|
||||
}
|
||||
if (Bubble.onMouseMoveWrapper_) {
|
||||
browserEvents.unbind(Bubble.onMouseMoveWrapper_);
|
||||
Bubble.onMouseMoveWrapper_ = null;
|
||||
if (Bubble.onMouseMoveWrapper) {
|
||||
browserEvents.unbind(Bubble.onMouseMoveWrapper);
|
||||
Bubble.onMouseMoveWrapper = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -851,9 +851,9 @@ export class Bubble implements IBubble {
|
||||
*
|
||||
* @param _e Mouse up event.
|
||||
*/
|
||||
private static bubbleMouseUp_(_e: MouseEvent) {
|
||||
private static bubbleMouseUp(_e: MouseEvent) {
|
||||
Touch.clearTouchIdentifier();
|
||||
Bubble.unbindDragEvents_();
|
||||
Bubble.unbindDragEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
145
core/comment.ts
145
core/comment.ts
@@ -36,30 +36,30 @@ import {Svg} from './utils/svg.js';
|
||||
* @alias Blockly.Comment
|
||||
*/
|
||||
export class Comment extends Icon {
|
||||
private readonly model_: CommentModel;
|
||||
private readonly model: CommentModel;
|
||||
|
||||
/**
|
||||
* The model's text value at the start of an edit.
|
||||
* Used to tell if an event should be fired at the end of an edit.
|
||||
*/
|
||||
private cachedText_: string|null = '';
|
||||
private cachedText: string|null = '';
|
||||
|
||||
/** Mouse up event data. */
|
||||
private onMouseUpWrapper_: browserEvents.Data|null = null;
|
||||
private onMouseUpWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/** Wheel event data. */
|
||||
private onWheelWrapper_: browserEvents.Data|null = null;
|
||||
private onWheelWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/** Change event data. */
|
||||
private onChangeWrapper_: browserEvents.Data|null = null;
|
||||
private onChangeWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/** Input event data. */
|
||||
private onInputWrapper_: browserEvents.Data|null = null;
|
||||
private onInputWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/**
|
||||
* The SVG element that contains the text edit area, or null if not created.
|
||||
*/
|
||||
private foreignObject_: SVGForeignObjectElement|null = null;
|
||||
private foreignObject: SVGForeignObjectElement|null = null;
|
||||
|
||||
/** The editable text area, or null if not created. */
|
||||
private textarea_: HTMLTextAreaElement|null = null;
|
||||
@@ -72,10 +72,10 @@ export class Comment extends Icon {
|
||||
super(block);
|
||||
|
||||
/** The model for this comment. */
|
||||
this.model_ = block.commentModel;
|
||||
this.model = block.commentModel;
|
||||
// If someone creates the comment directly instead of calling
|
||||
// block.setCommentText we want to make sure the text is non-null;
|
||||
this.model_.text = this.model_.text ?? '';
|
||||
this.model.text = this.model.text ?? '';
|
||||
|
||||
this.createIcon();
|
||||
}
|
||||
@@ -117,7 +117,7 @@ export class Comment extends Icon {
|
||||
*
|
||||
* @returns The top-level node of the editor.
|
||||
*/
|
||||
private createEditor_(): SVGElement {
|
||||
private createEditor(): SVGElement {
|
||||
/* Create the editor. Here's the markup that will be generated in
|
||||
* editable mode:
|
||||
<foreignObject x="8" y="8" width="164" height="164">
|
||||
@@ -130,7 +130,7 @@ export class Comment extends Icon {
|
||||
* For non-editable mode see Warning.textToDom_.
|
||||
*/
|
||||
|
||||
this.foreignObject_ = dom.createSvgElement(
|
||||
this.foreignObject = dom.createSvgElement(
|
||||
Svg.FOREIGNOBJECT,
|
||||
{'x': Bubble.BORDER_WIDTH, 'y': Bubble.BORDER_WIDTH});
|
||||
|
||||
@@ -143,46 +143,46 @@ export class Comment extends Icon {
|
||||
const textarea = this.textarea_;
|
||||
textarea.className = 'blocklyCommentTextarea';
|
||||
textarea.setAttribute('dir', this.getBlock().RTL ? 'RTL' : 'LTR');
|
||||
textarea.value = this.model_.text ?? '';
|
||||
this.resizeTextarea_();
|
||||
textarea.value = this.model.text ?? '';
|
||||
this.resizeTextarea();
|
||||
|
||||
body.appendChild(textarea);
|
||||
this.foreignObject_!.appendChild(body);
|
||||
this.foreignObject!.appendChild(body);
|
||||
|
||||
// Ideally this would be hooked to the focus event for the comment.
|
||||
// However doing so in Firefox swallows the cursor for unknown reasons.
|
||||
// So this is hooked to mouseup instead. No big deal.
|
||||
this.onMouseUpWrapper_ = browserEvents.conditionalBind(
|
||||
textarea, 'mouseup', this, this.startEdit_, true, true);
|
||||
this.onMouseUpWrapper = browserEvents.conditionalBind(
|
||||
textarea, 'mouseup', this, this.startEdit, true, true);
|
||||
// Don't zoom with mousewheel.
|
||||
this.onWheelWrapper_ = browserEvents.conditionalBind(
|
||||
this.onWheelWrapper = browserEvents.conditionalBind(
|
||||
textarea, 'wheel', this, function(e: Event) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
this.onChangeWrapper_ = browserEvents.conditionalBind(
|
||||
this.onChangeWrapper = browserEvents.conditionalBind(
|
||||
textarea, 'change', this,
|
||||
/**
|
||||
* @param _e Unused event parameter.
|
||||
*/
|
||||
function(this: Comment, _e: Event) {
|
||||
if (this.cachedText_ !== this.model_.text) {
|
||||
if (this.cachedText !== this.model.text) {
|
||||
eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))(
|
||||
this.getBlock(), 'comment', null, this.cachedText_,
|
||||
this.model_.text));
|
||||
this.getBlock(), 'comment', null, this.cachedText,
|
||||
this.model.text));
|
||||
}
|
||||
});
|
||||
this.onInputWrapper_ = browserEvents.conditionalBind(
|
||||
this.onInputWrapper = browserEvents.conditionalBind(
|
||||
textarea, 'input', this,
|
||||
/**
|
||||
* @param _e Unused event parameter.
|
||||
*/
|
||||
function(this: Comment, _e: Event) {
|
||||
this.model_.text = textarea.value;
|
||||
this.model.text = textarea.value;
|
||||
});
|
||||
|
||||
setTimeout(textarea.focus.bind(textarea), 0);
|
||||
|
||||
return this.foreignObject_;
|
||||
return this.foreignObject;
|
||||
}
|
||||
|
||||
/** Add or remove editability of the comment. */
|
||||
@@ -190,8 +190,8 @@ export class Comment extends Icon {
|
||||
super.updateEditable();
|
||||
if (this.isVisible()) {
|
||||
// Recreate the bubble with the correct UI.
|
||||
this.disposeBubble_();
|
||||
this.createBubble_();
|
||||
this.disposeBubble();
|
||||
this.createBubble();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,28 +199,31 @@ export class Comment extends Icon {
|
||||
* Callback function triggered when the bubble has resized.
|
||||
* Resize the text area accordingly.
|
||||
*/
|
||||
private onBubbleResize_() {
|
||||
private onBubbleResize() {
|
||||
if (!this.isVisible() || !this.bubble_) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.model_.size = this.bubble_.getBubbleSize();
|
||||
this.resizeTextarea_();
|
||||
this.model.size = this.bubble_.getBubbleSize();
|
||||
this.resizeTextarea();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes the text area to match the size defined on the model (which is
|
||||
* the size of the bubble).
|
||||
*/
|
||||
private resizeTextarea_() {
|
||||
const size = this.model_.size;
|
||||
private resizeTextarea() {
|
||||
if (!this.textarea_ || !this.foreignObject) {
|
||||
return;
|
||||
}
|
||||
const size = this.model.size;
|
||||
const doubleBorderWidth = 2 * Bubble.BORDER_WIDTH;
|
||||
const widthMinusBorder = size.width - doubleBorderWidth;
|
||||
const heightMinusBorder = size.height - doubleBorderWidth;
|
||||
this.foreignObject_!.setAttribute('width', `${widthMinusBorder}`);
|
||||
this.foreignObject_!.setAttribute('height', `${heightMinusBorder}`);
|
||||
this.textarea_!.style.width = widthMinusBorder - 4 + 'px';
|
||||
this.textarea_!.style.height = heightMinusBorder - 4 + 'px';
|
||||
this.foreignObject.setAttribute('width', `${widthMinusBorder}`);
|
||||
this.foreignObject.setAttribute('height', `${heightMinusBorder}`);
|
||||
this.textarea_.style.width = widthMinusBorder - 4 + 'px';
|
||||
this.textarea_.style.height = heightMinusBorder - 4 + 'px';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,44 +237,42 @@ export class Comment extends Icon {
|
||||
}
|
||||
eventUtils.fire(new (eventUtils.get(eventUtils.BUBBLE_OPEN))(
|
||||
this.getBlock(), visible, 'comment'));
|
||||
this.model_.pinned = visible;
|
||||
this.model.pinned = visible;
|
||||
if (visible) {
|
||||
this.createBubble_();
|
||||
this.createBubble();
|
||||
} else {
|
||||
this.disposeBubble_();
|
||||
this.disposeBubble();
|
||||
}
|
||||
}
|
||||
|
||||
/** Show the bubble. Handles deciding if it should be editable or not. */
|
||||
private createBubble_() {
|
||||
private createBubble() {
|
||||
if (!this.getBlock().isEditable()) {
|
||||
this.createNonEditableBubble_();
|
||||
this.createNonEditableBubble();
|
||||
} else {
|
||||
this.createEditableBubble_();
|
||||
this.createEditableBubble();
|
||||
}
|
||||
}
|
||||
|
||||
/** Show an editable bubble. */
|
||||
private createEditableBubble_() {
|
||||
private createEditableBubble() {
|
||||
const block = this.getBlock();
|
||||
this.bubble_ = new Bubble(
|
||||
block.workspace, this.createEditor_(), block.pathObject.svgPath,
|
||||
(this.iconXY_ as Coordinate), this.model_.size.width,
|
||||
this.model_.size.height);
|
||||
block.workspace, this.createEditor(), block.pathObject.svgPath,
|
||||
(this.iconXY_ as Coordinate), this.model.size.width,
|
||||
this.model.size.height);
|
||||
// Expose this comment's block's ID on its top-level SVG group.
|
||||
this.bubble_.setSvgId(block.id);
|
||||
this.bubble_.registerResizeEvent(this.onBubbleResize_.bind(this));
|
||||
this.bubble_.registerResizeEvent(this.onBubbleResize.bind(this));
|
||||
this.applyColour();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a non-editable bubble.
|
||||
*
|
||||
* @suppress {checkTypes} Suppress `this` type mismatch.
|
||||
*/
|
||||
private createNonEditableBubble_() {
|
||||
private createNonEditableBubble() {
|
||||
// TODO (#2917): It would be great if the comment could support line breaks.
|
||||
this.paragraphElement_ = Bubble.textToDom(this.model_.text ?? '');
|
||||
this.paragraphElement_ = Bubble.textToDom(this.model.text ?? '');
|
||||
this.bubble_ = Bubble.createNonEditableBubble(
|
||||
this.paragraphElement_, this.getBlock(), this.iconXY_ as Coordinate);
|
||||
this.applyColour();
|
||||
@@ -279,32 +280,30 @@ export class Comment extends Icon {
|
||||
|
||||
/**
|
||||
* Dispose of the bubble.
|
||||
*
|
||||
* @suppress {checkTypes} Suppress `this` type mismatch.
|
||||
*/
|
||||
private disposeBubble_() {
|
||||
if (this.onMouseUpWrapper_) {
|
||||
browserEvents.unbind(this.onMouseUpWrapper_);
|
||||
this.onMouseUpWrapper_ = null;
|
||||
private disposeBubble() {
|
||||
if (this.onMouseUpWrapper) {
|
||||
browserEvents.unbind(this.onMouseUpWrapper);
|
||||
this.onMouseUpWrapper = null;
|
||||
}
|
||||
if (this.onWheelWrapper_) {
|
||||
browserEvents.unbind(this.onWheelWrapper_);
|
||||
this.onWheelWrapper_ = null;
|
||||
if (this.onWheelWrapper) {
|
||||
browserEvents.unbind(this.onWheelWrapper);
|
||||
this.onWheelWrapper = null;
|
||||
}
|
||||
if (this.onChangeWrapper_) {
|
||||
browserEvents.unbind(this.onChangeWrapper_);
|
||||
this.onChangeWrapper_ = null;
|
||||
if (this.onChangeWrapper) {
|
||||
browserEvents.unbind(this.onChangeWrapper);
|
||||
this.onChangeWrapper = null;
|
||||
}
|
||||
if (this.onInputWrapper_) {
|
||||
browserEvents.unbind(this.onInputWrapper_);
|
||||
this.onInputWrapper_ = null;
|
||||
if (this.onInputWrapper) {
|
||||
browserEvents.unbind(this.onInputWrapper);
|
||||
this.onInputWrapper = null;
|
||||
}
|
||||
if (this.bubble_) {
|
||||
this.bubble_.dispose();
|
||||
this.bubble_ = null;
|
||||
}
|
||||
this.textarea_ = null;
|
||||
this.foreignObject_ = null;
|
||||
this.foreignObject = null;
|
||||
this.paragraphElement_ = null;
|
||||
}
|
||||
|
||||
@@ -316,14 +315,14 @@ export class Comment extends Icon {
|
||||
*
|
||||
* @param _e Mouse up event.
|
||||
*/
|
||||
private startEdit_(_e: Event) {
|
||||
private startEdit(_e: Event) {
|
||||
if (this.bubble_?.promote()) {
|
||||
// Since the act of moving this node within the DOM causes a loss of
|
||||
// focus, we need to reapply the focus.
|
||||
this.textarea_!.focus();
|
||||
}
|
||||
|
||||
this.cachedText_ = this.model_.text;
|
||||
this.cachedText = this.model.text;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -332,7 +331,7 @@ export class Comment extends Icon {
|
||||
* @returns Object with width and height properties.
|
||||
*/
|
||||
getBubbleSize(): Size {
|
||||
return this.model_.size;
|
||||
return this.model.size;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,8 +344,8 @@ export class Comment extends Icon {
|
||||
if (this.bubble_) {
|
||||
this.bubble_.setBubbleSize(width, height);
|
||||
} else {
|
||||
this.model_.size.width = width;
|
||||
this.model_.size.height = height;
|
||||
this.model.size.width = width;
|
||||
this.model.size.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,11 +356,11 @@ export class Comment extends Icon {
|
||||
*/
|
||||
updateText() {
|
||||
if (this.textarea_) {
|
||||
this.textarea_.value = this.model_.text ?? '';
|
||||
this.textarea_.value = this.model.text ?? '';
|
||||
} else if (this.paragraphElement_) {
|
||||
// Non-Editable mode.
|
||||
// TODO (#2917): If 2917 gets added this will probably need to be updated.
|
||||
this.paragraphElement_.firstChild!.textContent = this.model_.text;
|
||||
this.paragraphElement_.firstChild!.textContent = this.model.text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ let content = `
|
||||
}
|
||||
|
||||
.blocklyDropDownContent {
|
||||
max-height: 300px; // @todo: spec for maximum height.
|
||||
max-height: 300px; /* @todo: spec for maximum height. */
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
position: relative;
|
||||
|
||||
@@ -61,9 +61,8 @@ export class BlockDrag extends UiBase {
|
||||
const json = super.toJson() as BlockDragJson;
|
||||
if (this.isStart === undefined) {
|
||||
throw new Error(
|
||||
'Whether this event is the start of a drag is ' +
|
||||
'undefined. Either pass the value to the constructor, or call ' +
|
||||
'fromJson');
|
||||
'Whether this event is the start of a drag is undefined. ' +
|
||||
'Either pass the value to the constructor, or call fromJson');
|
||||
}
|
||||
if (this.blockId === undefined) {
|
||||
throw new Error(
|
||||
|
||||
@@ -61,15 +61,13 @@ export class BubbleOpen extends UiBase {
|
||||
const json = super.toJson() as BubbleOpenJson;
|
||||
if (this.isOpen === undefined) {
|
||||
throw new Error(
|
||||
'Whether this event is for opening the bubble is ' +
|
||||
'undefined. Either pass the value to the constructor, or call ' +
|
||||
'fromJson');
|
||||
'Whether this event is for opening the bubble is undefined. ' +
|
||||
'Either pass the value to the constructor, or call fromJson');
|
||||
}
|
||||
if (!this.bubbleType) {
|
||||
throw new Error(
|
||||
'The type of bubble is undefined. Either pass the ' +
|
||||
'value to the constructor, or call ' +
|
||||
'fromJson');
|
||||
'value to the constructor, or call fromJson');
|
||||
}
|
||||
json['isOpen'] = this.isOpen;
|
||||
json['bubbleType'] = this.bubbleType;
|
||||
|
||||
@@ -797,10 +797,13 @@ export abstract class Field implements IASTNodeLocationSvg,
|
||||
} else if (this.visible_ && this.size_.width === 0) {
|
||||
// If the field is not visible the width will be 0 as well, one of the
|
||||
// problems with the old system.
|
||||
console.warn(
|
||||
'Deprecated use of setting size_.width to 0 to rerender a' +
|
||||
' field. Set field.isDirty_ to true instead.');
|
||||
this.render_();
|
||||
// Don't issue a warning if the field is actually zero width.
|
||||
if (this.size_.width !== 0) {
|
||||
console.warn(
|
||||
'Deprecated use of setting size_.width to 0 to rerender a' +
|
||||
' field. Set field.isDirty_ to true instead.');
|
||||
}
|
||||
}
|
||||
return this.size_;
|
||||
}
|
||||
|
||||
@@ -70,19 +70,36 @@ export class FieldAngle extends FieldTextInput {
|
||||
* otherwise SVG crops off half the border at the edges.
|
||||
*/
|
||||
static readonly RADIUS: number = FieldAngle.HALF - 1;
|
||||
private clockwise_: boolean;
|
||||
private offset_: number;
|
||||
private wrap_: number;
|
||||
private round_: number;
|
||||
|
||||
/**
|
||||
* Whether the angle should increase as the angle picker is moved clockwise
|
||||
* (true) or counterclockwise (false).
|
||||
*/
|
||||
private clockwise_ = FieldAngle.CLOCKWISE;
|
||||
|
||||
/**
|
||||
* The offset of zero degrees (and all other angles).
|
||||
*/
|
||||
private offset_ = FieldAngle.OFFSET;
|
||||
|
||||
/**
|
||||
* The maximum angle to allow before wrapping.
|
||||
*/
|
||||
private wrap_ = FieldAngle.WRAP;
|
||||
|
||||
/**
|
||||
* The amount to round angles to when using a mouse or keyboard nav input.
|
||||
*/
|
||||
private round_ = FieldAngle.ROUND;
|
||||
|
||||
/** The angle picker's SVG element. */
|
||||
private editor_: SVGElement|null = null;
|
||||
private editor_: SVGSVGElement|null = null;
|
||||
|
||||
/** The angle picker's gauge path depending on the value. */
|
||||
gauge_: SVGElement|null = null;
|
||||
gauge_: SVGPathElement|null = null;
|
||||
|
||||
/** The angle picker's line drawn representing the value's angle. */
|
||||
line_: SVGElement|null = null;
|
||||
line_: SVGLineElement|null = null;
|
||||
|
||||
/** The degree symbol for this field. */
|
||||
// AnyDuringMigration because: Type 'null' is not assignable to type
|
||||
@@ -122,35 +139,6 @@ export class FieldAngle extends FieldTextInput {
|
||||
opt_config?: FieldAngleConfig) {
|
||||
super(Field.SKIP_SETUP);
|
||||
|
||||
/**
|
||||
* Should the angle increase as the angle picker is moved clockwise (true)
|
||||
* or counterclockwise (false)
|
||||
*
|
||||
* @see FieldAngle.CLOCKWISE
|
||||
*/
|
||||
this.clockwise_ = FieldAngle.CLOCKWISE;
|
||||
|
||||
/**
|
||||
* The offset of zero degrees (and all other angles).
|
||||
*
|
||||
* @see FieldAngle.OFFSET
|
||||
*/
|
||||
this.offset_ = FieldAngle.OFFSET;
|
||||
|
||||
/**
|
||||
* The maximum angle to allow before wrapping.
|
||||
*
|
||||
* @see FieldAngle.WRAP
|
||||
*/
|
||||
this.wrap_ = FieldAngle.WRAP;
|
||||
|
||||
/**
|
||||
* The amount to round angles to when using a mouse or keyboard nav input.
|
||||
*
|
||||
* @see FieldAngle.ROUND
|
||||
*/
|
||||
this.round_ = FieldAngle.ROUND;
|
||||
|
||||
if (opt_value === Field.SKIP_SETUP) {
|
||||
return;
|
||||
}
|
||||
@@ -223,15 +211,9 @@ export class FieldAngle extends FieldTextInput {
|
||||
super.showEditor_(opt_e, noFocus);
|
||||
|
||||
this.dropdownCreate_();
|
||||
// AnyDuringMigration because: Argument of type 'SVGElement | null' is not
|
||||
// assignable to parameter of type 'Node'.
|
||||
dropDownDiv.getContentDiv().appendChild(this.editor_ as AnyDuringMigration);
|
||||
dropDownDiv.getContentDiv().appendChild(this.editor_!);
|
||||
|
||||
if (this.sourceBlock_ instanceof BlockSvg) {
|
||||
if (!this.sourceBlock_.style.colourTertiary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
dropDownDiv.setColour(
|
||||
this.sourceBlock_.style.colourPrimary,
|
||||
this.sourceBlock_.style.colourTertiary);
|
||||
@@ -435,25 +417,18 @@ export class FieldAngle extends FieldTextInput {
|
||||
throw new UnattachedFieldError();
|
||||
}
|
||||
|
||||
const keyboardEvent = e as KeyboardEvent;
|
||||
let multiplier;
|
||||
// AnyDuringMigration because: Property 'keyCode' does not exist on type
|
||||
// 'Event'.
|
||||
if ((e as AnyDuringMigration).keyCode === KeyCodes.LEFT) {
|
||||
if (keyboardEvent.keyCode === KeyCodes.LEFT) {
|
||||
// decrement (increment in RTL)
|
||||
multiplier = block.RTL ? 1 : -1;
|
||||
// AnyDuringMigration because: Property 'keyCode' does not exist on type
|
||||
// 'Event'.
|
||||
} else if ((e as AnyDuringMigration).keyCode === KeyCodes.RIGHT) {
|
||||
} else if (keyboardEvent.keyCode === KeyCodes.RIGHT) {
|
||||
// increment (decrement in RTL)
|
||||
multiplier = block.RTL ? -1 : 1;
|
||||
// AnyDuringMigration because: Property 'keyCode' does not exist on type
|
||||
// 'Event'.
|
||||
} else if ((e as AnyDuringMigration).keyCode === KeyCodes.DOWN) {
|
||||
} else if (keyboardEvent.keyCode === KeyCodes.DOWN) {
|
||||
// decrement
|
||||
multiplier = -1;
|
||||
// AnyDuringMigration because: Property 'keyCode' does not exist on type
|
||||
// 'Event'.
|
||||
} else if ((e as AnyDuringMigration).keyCode === KeyCodes.UP) {
|
||||
} else if (keyboardEvent.keyCode === KeyCodes.UP) {
|
||||
// increment
|
||||
multiplier = 1;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ import * as parsing from './utils/parsing.js';
|
||||
import type {Sentinel} from './utils/sentinel.js';
|
||||
import * as utilsString from './utils/string.js';
|
||||
import {Svg} from './utils/svg.js';
|
||||
import * as userAgent from './utils/useragent.js';
|
||||
|
||||
|
||||
/**
|
||||
* Class for an editable dropdown field.
|
||||
@@ -44,7 +42,8 @@ export class FieldDropdown extends Field {
|
||||
* height.
|
||||
*/
|
||||
static MAX_MENU_HEIGHT_VH = 0.45;
|
||||
static ARROW_CHAR: AnyDuringMigration;
|
||||
|
||||
static ARROW_CHAR = '▾';
|
||||
|
||||
/** A reference to the currently selected menu item. */
|
||||
private selectedMenuItem_: MenuItem|null = null;
|
||||
@@ -71,14 +70,11 @@ export class FieldDropdown extends Field {
|
||||
|
||||
/** Mouse cursor style when over the hotspot that initiates the editor. */
|
||||
override CURSOR = 'default';
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
protected menuGenerator_!: AnyDuringMigration[][]|
|
||||
((this: FieldDropdown) => AnyDuringMigration[][]);
|
||||
|
||||
protected menuGenerator_?: MenuGenerator;
|
||||
|
||||
/** A cache of the most recently generated options. */
|
||||
// AnyDuringMigration because: Type 'null' is not assignable to type
|
||||
// 'string[][]'.
|
||||
private generatedOptions_: string[][] = null as AnyDuringMigration;
|
||||
private generatedOptions_: MenuOption[]|null = null;
|
||||
|
||||
/**
|
||||
* The prefix field label, of common words set after options are trimmed.
|
||||
@@ -95,7 +91,7 @@ export class FieldDropdown extends Field {
|
||||
override suffixField: string|null = null;
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
private selectedOption_!: Array<string|ImageProperties>;
|
||||
override clickTarget_: AnyDuringMigration;
|
||||
override clickTarget_: SVGElement|null = null;
|
||||
|
||||
/**
|
||||
* @param menuGenerator A non-empty array of options for a dropdown list, or a
|
||||
@@ -114,30 +110,31 @@ export class FieldDropdown extends Field {
|
||||
* @throws {TypeError} If `menuGenerator` options are incorrectly structured.
|
||||
*/
|
||||
constructor(
|
||||
menuGenerator: AnyDuringMigration[][]|Function|Sentinel,
|
||||
opt_validator?: Function, opt_config?: FieldConfig) {
|
||||
menuGenerator: MenuGenerator,
|
||||
opt_validator?: Function,
|
||||
opt_config?: FieldConfig,
|
||||
);
|
||||
constructor(menuGenerator: Sentinel);
|
||||
constructor(
|
||||
menuGenerator: MenuGenerator|Sentinel,
|
||||
opt_validator?: Function,
|
||||
opt_config?: FieldConfig,
|
||||
) {
|
||||
super(Field.SKIP_SETUP);
|
||||
|
||||
// If we pass SKIP_SETUP, don't do *anything* with the menu generator.
|
||||
if (menuGenerator === Field.SKIP_SETUP) {
|
||||
return;
|
||||
}
|
||||
if (!isMenuGenerator(menuGenerator)) return;
|
||||
|
||||
if (Array.isArray(menuGenerator)) {
|
||||
validateOptions(menuGenerator);
|
||||
// Deep copy the option structure so it doesn't change.
|
||||
menuGenerator = JSON.parse(JSON.stringify(menuGenerator));
|
||||
const trimmed = trimOptions(menuGenerator);
|
||||
this.menuGenerator_ = trimmed.options;
|
||||
this.prefixField = trimmed.prefix || null;
|
||||
this.suffixField = trimmed.suffix || null;
|
||||
} else {
|
||||
this.menuGenerator_ = menuGenerator;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of options for a dropdown list,
|
||||
* or a function which generates these options.
|
||||
*/
|
||||
this.menuGenerator_ = menuGenerator as AnyDuringMigration[][] |
|
||||
((this: FieldDropdown) => AnyDuringMigration[][]);
|
||||
|
||||
this.trimOptions_();
|
||||
|
||||
/**
|
||||
* The currently selected option. The field is initialized with the
|
||||
* first option selected.
|
||||
@@ -227,14 +224,9 @@ export class FieldDropdown extends Field {
|
||||
this.getSourceBlock()?.RTL ? FieldDropdown.ARROW_CHAR + ' ' :
|
||||
' ' + FieldDropdown.ARROW_CHAR));
|
||||
if (this.getSourceBlock()?.RTL) {
|
||||
// AnyDuringMigration because: Argument of type 'SVGTSpanElement | null'
|
||||
// is not assignable to parameter of type 'Node'.
|
||||
this.getTextElement().insertBefore(
|
||||
this.arrow_ as AnyDuringMigration, this.textContent_);
|
||||
this.getTextElement().insertBefore(this.arrow_, this.textContent_);
|
||||
} else {
|
||||
// AnyDuringMigration because: Argument of type 'SVGTSpanElement | null'
|
||||
// is not assignable to parameter of type 'Node'.
|
||||
this.getTextElement().appendChild(this.arrow_ as AnyDuringMigration);
|
||||
this.getTextElement().appendChild(this.arrow_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,21 +249,14 @@ export class FieldDropdown extends Field {
|
||||
* @param opt_e Optional mouse event that triggered the field to open, or
|
||||
* undefined if triggered programmatically.
|
||||
*/
|
||||
protected override showEditor_(opt_e?: Event) {
|
||||
protected override showEditor_(opt_e?: MouseEvent) {
|
||||
const block = this.getSourceBlock();
|
||||
if (!block) {
|
||||
throw new UnattachedFieldError();
|
||||
}
|
||||
this.dropdownCreate_();
|
||||
// AnyDuringMigration because: Property 'clientX' does not exist on type
|
||||
// 'Event'.
|
||||
if (opt_e && typeof (opt_e as AnyDuringMigration).clientX === 'number') {
|
||||
// AnyDuringMigration because: Property 'clientY' does not exist on type
|
||||
// 'Event'. AnyDuringMigration because: Property 'clientX' does not exist
|
||||
// on type 'Event'.
|
||||
this.menu_!.openingCoords = new Coordinate(
|
||||
(opt_e as AnyDuringMigration).clientX,
|
||||
(opt_e as AnyDuringMigration).clientY);
|
||||
if (opt_e && typeof opt_e.clientX === 'number') {
|
||||
this.menu_!.openingCoords = new Coordinate(opt_e.clientX, opt_e.clientY);
|
||||
} else {
|
||||
this.menu_!.openingCoords = null;
|
||||
}
|
||||
@@ -288,10 +273,6 @@ export class FieldDropdown extends Field {
|
||||
const borderColour = block.isShadow() ?
|
||||
(block.getParent() as BlockSvg).style.colourTertiary :
|
||||
(this.sourceBlock_ as BlockSvg).style.colourTertiary;
|
||||
if (!borderColour) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
dropDownDiv.setColour(primaryColour, borderColour);
|
||||
}
|
||||
|
||||
@@ -322,15 +303,17 @@ export class FieldDropdown extends Field {
|
||||
const options = this.getOptions(false);
|
||||
this.selectedMenuItem_ = null;
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
let content = options[i][0]; // Human-readable text or image.
|
||||
const value = options[i][1]; // Language-neutral value.
|
||||
if (typeof content === 'object') {
|
||||
// An image, not text.
|
||||
const image = new Image(content['width'], content['height']);
|
||||
image.src = content['src'];
|
||||
image.alt = content['alt'] || '';
|
||||
content = image;
|
||||
}
|
||||
const [label, value] = options[i];
|
||||
const content = (() => {
|
||||
if (typeof label === 'object') {
|
||||
// Convert ImageProperties to an HTMLImageElement.
|
||||
const image = new Image(label['width'], label['height']);
|
||||
image.src = label['src'];
|
||||
image.alt = label['alt'] || '';
|
||||
return image;
|
||||
}
|
||||
return label;
|
||||
})();
|
||||
const menuItem = new MenuItem(content, value);
|
||||
menuItem.setRole(aria.Role.OPTION);
|
||||
menuItem.setRightToLeft(block.RTL);
|
||||
@@ -376,57 +359,6 @@ export class FieldDropdown extends Field {
|
||||
this.setValue(menuItem.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Factor out common words in statically defined options.
|
||||
* Create prefix and/or suffix labels.
|
||||
*/
|
||||
private trimOptions_() {
|
||||
const options = this.menuGenerator_;
|
||||
if (!Array.isArray(options)) {
|
||||
return;
|
||||
}
|
||||
let hasImages = false;
|
||||
|
||||
// Localize label text and image alt text.
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
const label = options[i][0];
|
||||
if (typeof label === 'string') {
|
||||
options[i][0] = parsing.replaceMessageReferences(label);
|
||||
} else {
|
||||
if (label.alt !== null) {
|
||||
options[i][0].alt = parsing.replaceMessageReferences(label.alt);
|
||||
}
|
||||
hasImages = true;
|
||||
}
|
||||
}
|
||||
if (hasImages || options.length < 2) {
|
||||
return; // Do nothing if too few items or at least one label is an image.
|
||||
}
|
||||
const strings = [];
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
strings.push(options[i][0]);
|
||||
}
|
||||
const shortest = utilsString.shortestStringLength(strings);
|
||||
const prefixLength = utilsString.commonWordPrefix(strings, shortest);
|
||||
const suffixLength = utilsString.commonWordSuffix(strings, shortest);
|
||||
if (!prefixLength && !suffixLength) {
|
||||
return;
|
||||
}
|
||||
if (shortest <= prefixLength + suffixLength) {
|
||||
// One or more strings will entirely vanish if we proceed. Abort.
|
||||
return;
|
||||
}
|
||||
if (prefixLength) {
|
||||
this.prefixField = strings[0].substring(0, prefixLength - 1);
|
||||
}
|
||||
if (suffixLength) {
|
||||
this.suffixField = strings[0].substr(1 - suffixLength);
|
||||
}
|
||||
|
||||
this.menuGenerator_ =
|
||||
FieldDropdown.applyTrim_(options, prefixLength, suffixLength);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns True if the option list is generated by a function.
|
||||
* Otherwise false.
|
||||
@@ -444,18 +376,18 @@ export class FieldDropdown extends Field {
|
||||
* (human-readable text or image, language-neutral name).
|
||||
* @throws {TypeError} If generated options are incorrectly structured.
|
||||
*/
|
||||
getOptions(opt_useCache?: boolean): AnyDuringMigration[][] {
|
||||
if (this.isOptionListDynamic()) {
|
||||
if (!this.generatedOptions_ || !opt_useCache) {
|
||||
// AnyDuringMigration because: Property 'call' does not exist on type
|
||||
// 'any[][] | ((this: FieldDropdown) => any[][])'.
|
||||
this.generatedOptions_ =
|
||||
(this.menuGenerator_ as AnyDuringMigration).call(this);
|
||||
validateOptions(this.generatedOptions_);
|
||||
}
|
||||
return this.generatedOptions_;
|
||||
getOptions(opt_useCache?: boolean): MenuOption[] {
|
||||
if (!this.menuGenerator_) {
|
||||
// A subclass improperly skipped setup without defining the menu
|
||||
// generator.
|
||||
throw TypeError('A menu generator was never defined.');
|
||||
}
|
||||
return this.menuGenerator_ as string[][];
|
||||
if (Array.isArray(this.menuGenerator_)) return this.menuGenerator_;
|
||||
if (opt_useCache && this.generatedOptions_) return this.generatedOptions_;
|
||||
|
||||
this.generatedOptions_ = this.menuGenerator_();
|
||||
validateOptions(this.generatedOptions_);
|
||||
return this.generatedOptions_;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -464,17 +396,11 @@ export class FieldDropdown extends Field {
|
||||
* @param opt_newValue The input value.
|
||||
* @returns A valid language-neutral option, or null if invalid.
|
||||
*/
|
||||
protected override doClassValidation_(opt_newValue?: AnyDuringMigration):
|
||||
string|null {
|
||||
let isValueValid = false;
|
||||
protected override doClassValidation_(opt_newValue?: MenuOption[1]): string
|
||||
|null {
|
||||
const options = this.getOptions(true);
|
||||
for (let i = 0, option; option = options[i]; i++) {
|
||||
// Options are tuples of human-readable text and language-neutral values.
|
||||
if (option[1] === opt_newValue) {
|
||||
isValueValid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const isValueValid = options.some((option) => option[1] === opt_newValue);
|
||||
|
||||
if (!isValueValid) {
|
||||
if (this.sourceBlock_) {
|
||||
console.warn(
|
||||
@@ -493,7 +419,7 @@ export class FieldDropdown extends Field {
|
||||
* @param newValue The value to be saved. The default validator guarantees
|
||||
* that this is one of the valid dropdown options.
|
||||
*/
|
||||
protected override doValueUpdate_(newValue: AnyDuringMigration) {
|
||||
protected override doValueUpdate_(newValue: MenuOption[1]) {
|
||||
super.doValueUpdate_(newValue);
|
||||
const options = this.getOptions(true);
|
||||
for (let i = 0, option; option = options[i]; i++) {
|
||||
@@ -510,14 +436,6 @@ export class FieldDropdown extends Field {
|
||||
*/
|
||||
override applyColour() {
|
||||
const style = (this.sourceBlock_ as BlockSvg).style;
|
||||
if (!style.colourSecondary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
if (!style.colourTertiary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
if (this.borderRect_) {
|
||||
this.borderRect_.setAttribute('stroke', style.colourTertiary);
|
||||
if (this.menu_) {
|
||||
@@ -566,14 +484,8 @@ export class FieldDropdown extends Field {
|
||||
this.imageElement_!.style.display = '';
|
||||
this.imageElement_!.setAttributeNS(
|
||||
dom.XLINK_NS, 'xlink:href', imageJson.src);
|
||||
// AnyDuringMigration because: Argument of type 'number' is not assignable
|
||||
// to parameter of type 'string'.
|
||||
this.imageElement_!.setAttribute(
|
||||
'height', imageJson.height as AnyDuringMigration);
|
||||
// AnyDuringMigration because: Argument of type 'number' is not assignable
|
||||
// to parameter of type 'string'.
|
||||
this.imageElement_!.setAttribute(
|
||||
'width', imageJson.width as AnyDuringMigration);
|
||||
this.imageElement_!.setAttribute('height', `${imageJson.height}`);
|
||||
this.imageElement_!.setAttribute('width', `${imageJson.width}`);
|
||||
|
||||
const imageHeight = Number(imageJson.height);
|
||||
const imageWidth = Number(imageJson.width);
|
||||
@@ -709,30 +621,6 @@ export class FieldDropdown extends Field {
|
||||
// override the static fromJson method.
|
||||
return new this(options.options, undefined, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the calculated prefix and suffix lengths to trim all of the options in
|
||||
* the given array.
|
||||
*
|
||||
* @param options Array of option tuples:
|
||||
* (human-readable text or image, language-neutral name).
|
||||
* @param prefixLength The length of the common prefix.
|
||||
* @param suffixLength The length of the common suffix
|
||||
* @returns A new array with all of the option text trimmed.
|
||||
*/
|
||||
static applyTrim_(
|
||||
options: AnyDuringMigration[][], prefixLength: number,
|
||||
suffixLength: number): AnyDuringMigration[][] {
|
||||
const newOptions = [];
|
||||
// Remove the prefix and suffix from the options.
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
let text = options[i][0];
|
||||
const value = options[i][1];
|
||||
text = text.substring(prefixLength, text.length - suffixLength);
|
||||
newOptions[i] = [text, value];
|
||||
}
|
||||
return newOptions;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -752,6 +640,18 @@ export interface ImageProperties {
|
||||
*/
|
||||
export type MenuOption = [string | ImageProperties, string];
|
||||
|
||||
/**
|
||||
* A function that generates an array of menu options for FieldDropdown
|
||||
* or its descendants.
|
||||
*/
|
||||
export type MenuGeneratorFunction = (this: FieldDropdown) => MenuOption[];
|
||||
|
||||
/**
|
||||
* Either an array of menu options or a function that generates an array of
|
||||
* menu options for FieldDropdown or its descendants.
|
||||
*/
|
||||
export type MenuGenerator = MenuOption[]|MenuGeneratorFunction;
|
||||
|
||||
/**
|
||||
* fromJson config for the dropdown field.
|
||||
*/
|
||||
@@ -768,8 +668,81 @@ const IMAGE_Y_OFFSET = 5;
|
||||
/** The total vertical padding above and below an image. */
|
||||
const IMAGE_Y_PADDING: number = IMAGE_Y_OFFSET * 2;
|
||||
|
||||
/** Android can't (in 2014) display "▾", so use "▼" instead. */
|
||||
FieldDropdown.ARROW_CHAR = userAgent.ANDROID ? '▼' : '▾';
|
||||
/**
|
||||
* NOTE: Because Sentinel is an empty class, proving a value is Sentinel does
|
||||
* not resolve in TS that it isn't a MenuGenerator.
|
||||
*/
|
||||
function isMenuGenerator(menuGenerator: MenuGenerator|
|
||||
Sentinel): menuGenerator is MenuGenerator {
|
||||
return menuGenerator !== Field.SKIP_SETUP;
|
||||
}
|
||||
|
||||
/**
|
||||
* Factor out common words in statically defined options.
|
||||
* Create prefix and/or suffix labels.
|
||||
*/
|
||||
function trimOptions(options: MenuOption[]):
|
||||
{options: MenuOption[]; prefix?: string; suffix?: string;} {
|
||||
let hasImages = false;
|
||||
const trimmedOptions = options.map(([label, value]): MenuOption => {
|
||||
if (typeof label === 'string') {
|
||||
return [parsing.replaceMessageReferences(label), value];
|
||||
}
|
||||
|
||||
hasImages = true;
|
||||
// Copy the image properties so they're not influenced by the original.
|
||||
// NOTE: No need to deep copy since image properties are only 1 level deep.
|
||||
const imageLabel = label.alt !== null ?
|
||||
{...label, alt: parsing.replaceMessageReferences(label.alt)} :
|
||||
{...label};
|
||||
return [imageLabel, value];
|
||||
});
|
||||
|
||||
if (hasImages || options.length < 2) return {options: trimmedOptions};
|
||||
|
||||
const stringOptions = trimmedOptions as [string, string][];
|
||||
const stringLabels = stringOptions.map(([label]) => label);
|
||||
|
||||
const shortest = utilsString.shortestStringLength(stringLabels);
|
||||
const prefixLength = utilsString.commonWordPrefix(stringLabels, shortest);
|
||||
const suffixLength = utilsString.commonWordSuffix(stringLabels, shortest);
|
||||
|
||||
if ((!prefixLength && !suffixLength) ||
|
||||
(shortest <= prefixLength + suffixLength)) {
|
||||
// One or more strings will entirely vanish if we proceed. Abort.
|
||||
return {options: stringOptions};
|
||||
}
|
||||
|
||||
const prefix =
|
||||
prefixLength ? stringLabels[0].substring(0, prefixLength - 1) : undefined;
|
||||
const suffix =
|
||||
suffixLength ? stringLabels[0].substr(1 - suffixLength) : undefined;
|
||||
return {
|
||||
options: applyTrim(stringOptions, prefixLength, suffixLength),
|
||||
prefix,
|
||||
suffix,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the calculated prefix and suffix lengths to trim all of the options in
|
||||
* the given array.
|
||||
*
|
||||
* @param options Array of option tuples:
|
||||
* (human-readable text or image, language-neutral name).
|
||||
* @param prefixLength The length of the common prefix.
|
||||
* @param suffixLength The length of the common suffix
|
||||
* @returns A new array with all of the option text trimmed.
|
||||
*/
|
||||
function applyTrim(
|
||||
options: [string, string][], prefixLength: number,
|
||||
suffixLength: number): MenuOption[] {
|
||||
return options.map(
|
||||
([text, value]) =>
|
||||
[text.substring(prefixLength, text.length - suffixLength),
|
||||
value,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the data structure to be processed as an options list.
|
||||
@@ -777,7 +750,7 @@ FieldDropdown.ARROW_CHAR = userAgent.ANDROID ? '▼' : '▾';
|
||||
* @param options The proposed dropdown options.
|
||||
* @throws {TypeError} If proposed options are incorrectly structured.
|
||||
*/
|
||||
function validateOptions(options: AnyDuringMigration) {
|
||||
function validateOptions(options: MenuOption[]) {
|
||||
if (!Array.isArray(options)) {
|
||||
throw TypeError('FieldDropdown options must be an array.');
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ function fromJsonInternal(options: AnyDuringMigration): Field|null {
|
||||
' the file is not loaded, the field does not register itself (Issue' +
|
||||
' #1584), or the registration is not being reached.');
|
||||
return null;
|
||||
} else if (typeof (fieldObject as any)['fromJson'] !== 'function') {
|
||||
} else if (typeof (fieldObject as any).fromJson !== 'function') {
|
||||
throw new TypeError('returned Field was not a IRegistrableField');
|
||||
} else {
|
||||
return (fieldObject as unknown as IRegistrableField).fromJson(options);
|
||||
|
||||
@@ -226,10 +226,6 @@ export class FieldTextInput extends Field {
|
||||
const source = this.sourceBlock_ as BlockSvg;
|
||||
|
||||
if (this.borderRect_) {
|
||||
if (!source.style.colourTertiary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
this.borderRect_.setAttribute('stroke', source.style.colourTertiary);
|
||||
} else {
|
||||
source.pathObject.svgPath.setAttribute(
|
||||
|
||||
@@ -17,7 +17,7 @@ import './events/events_block_change.js';
|
||||
|
||||
import type {Block} from './block.js';
|
||||
import {Field, FieldConfig, UnattachedFieldError} from './field.js';
|
||||
import {FieldDropdown} from './field_dropdown.js';
|
||||
import {FieldDropdown, MenuGenerator, MenuOption} from './field_dropdown.js';
|
||||
import * as fieldRegistry from './field_registry.js';
|
||||
import * as internalConstants from './internal_constants.js';
|
||||
import type {Menu} from './menu.js';
|
||||
@@ -37,8 +37,7 @@ import * as Xml from './xml.js';
|
||||
* @alias Blockly.FieldVariable
|
||||
*/
|
||||
export class FieldVariable extends FieldDropdown {
|
||||
protected override menuGenerator_: AnyDuringMigration[][]|
|
||||
((this: FieldDropdown) => AnyDuringMigration[][]);
|
||||
protected override menuGenerator_: MenuGenerator|undefined;
|
||||
defaultVariableName: string;
|
||||
|
||||
/** The type of the default variable for this field. */
|
||||
@@ -89,9 +88,7 @@ export class FieldVariable extends FieldDropdown {
|
||||
* An array of options for a dropdown list,
|
||||
* or a function which generates these options.
|
||||
*/
|
||||
// AnyDuringMigration because: Type '(this: FieldVariable) => any[][]' is
|
||||
// not assignable to type 'any[][] | ((this: FieldDropdown) => any[][])'.
|
||||
this.menuGenerator_ = FieldVariable.dropdownCreate as AnyDuringMigration;
|
||||
this.menuGenerator_ = FieldVariable.dropdownCreate as MenuGenerator;
|
||||
|
||||
/**
|
||||
* The initial variable name passed to this field's constructor, or an
|
||||
@@ -528,14 +525,14 @@ export class FieldVariable extends FieldDropdown {
|
||||
*
|
||||
* @returns Array of variable names/id tuples.
|
||||
*/
|
||||
static dropdownCreate(this: FieldVariable): AnyDuringMigration[][] {
|
||||
static dropdownCreate(this: FieldVariable): MenuOption[] {
|
||||
if (!this.variable_) {
|
||||
throw Error(
|
||||
'Tried to call dropdownCreate on a variable field with no' +
|
||||
' variable selected.');
|
||||
}
|
||||
const name = this.getText();
|
||||
let variableModelList: AnyDuringMigration[] = [];
|
||||
let variableModelList: VariableModel[] = [];
|
||||
if (this.sourceBlock_ && !this.sourceBlock_.isDeadOrDying()) {
|
||||
const variableTypes = this.getVariableTypes_();
|
||||
// Get a copy of the list, so that adding rename and new variable options
|
||||
@@ -549,7 +546,7 @@ export class FieldVariable extends FieldDropdown {
|
||||
}
|
||||
variableModelList.sort(VariableModel.compareByName);
|
||||
|
||||
const options = [];
|
||||
const options: [string, string][] = [];
|
||||
for (let i = 0; i < variableModelList.length; i++) {
|
||||
// Set the UUID as the internal representation of the variable.
|
||||
options[i] = [variableModelList[i].name, variableModelList[i].getId()];
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* @class
|
||||
*/
|
||||
import * as goog from '../closure/goog/goog.js';
|
||||
goog.declareModuleId('Blockly.Generator');
|
||||
goog.declareModuleId('Blockly.CodeGenerator');
|
||||
|
||||
import type {Block} from './block.js';
|
||||
import * as common from './common.js';
|
||||
@@ -24,14 +24,14 @@ import type {Workspace} from './workspace.js';
|
||||
* Class for a code generator that translates the blocks into a language.
|
||||
*
|
||||
* @unrestricted
|
||||
* @alias Blockly.Generator
|
||||
* @alias Blockly.CodeGenerator
|
||||
*/
|
||||
export class Generator {
|
||||
export class CodeGenerator {
|
||||
name_: string;
|
||||
|
||||
/**
|
||||
* This is used as a placeholder in functions defined using
|
||||
* Generator.provideFunction_. It must not be legal code that could
|
||||
* CodeGenerator.provideFunction_. It must not be legal code that could
|
||||
* legitimately appear in a function definition (or comment), and it must
|
||||
* not confuse the regular expression parser.
|
||||
*/
|
||||
@@ -205,7 +205,7 @@ export class Generator {
|
||||
|[string, number] {
|
||||
if (this.isInitialized === false) {
|
||||
console.warn(
|
||||
'Generator init was not called before blockToCode was called.');
|
||||
'CodeGenerator init was not called before blockToCode was called.');
|
||||
}
|
||||
if (!block) {
|
||||
return '';
|
||||
@@ -414,7 +414,7 @@ export class Generator {
|
||||
* "listRandom", not "random"). There is no danger of colliding with reserved
|
||||
* words, or user-defined variable or procedure names.
|
||||
*
|
||||
* The code gets output when Generator.finish() is called.
|
||||
* The code gets output when CodeGenerator.finish() is called.
|
||||
*
|
||||
* @param desiredName The desired name of the function (e.g. mathIsPrime).
|
||||
* @param code A list of statements or one multi-line code string. Use ' '
|
||||
@@ -514,23 +514,23 @@ export class Generator {
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperties(Generator.prototype, {
|
||||
Object.defineProperties(CodeGenerator.prototype, {
|
||||
/**
|
||||
* A database of variable names.
|
||||
*
|
||||
* @name Blockly.Generator.prototype.variableDB_
|
||||
* @name Blockly.CodeGenerator.prototype.variableDB_
|
||||
* @deprecated 'variableDB_' was renamed to 'nameDB_' (May 2021).
|
||||
* @suppress {checkTypes}
|
||||
*/
|
||||
variableDB_: ({
|
||||
/** @returns Name database. */
|
||||
get(this: Generator): Names |
|
||||
get(this: CodeGenerator): Names |
|
||||
undefined {
|
||||
deprecation.warn('variableDB_', 'version 9', 'version 10', 'nameDB_');
|
||||
return this.nameDB_;
|
||||
},
|
||||
/** @param nameDb New name database. */
|
||||
set(this: Generator, nameDb: Names|undefined) {
|
||||
set(this: CodeGenerator, nameDb: Names|undefined) {
|
||||
deprecation.warn('variableDB_', 'version 9', 'version 10', 'nameDB_');
|
||||
this.nameDB_ = nameDb;
|
||||
},
|
||||
|
||||
45
core/interfaces/i_parameter_model.ts
Normal file
45
core/interfaces/i_parameter_model.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* The interface for the data model of a procedure parameter.
|
||||
*
|
||||
* @namespace Blockly.IParameterModel
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* A data model for a procedure.
|
||||
*/
|
||||
export interface IParameterModel {
|
||||
/**
|
||||
* Sets the name of this parameter to the given name.
|
||||
*/
|
||||
setName(name: string): this;
|
||||
|
||||
/**
|
||||
* Sets the types of this parameter to the given type.
|
||||
*/
|
||||
setTypes(types: string[]): this;
|
||||
|
||||
/**
|
||||
* Returns the name of this parameter.
|
||||
*/
|
||||
getName(): string;
|
||||
|
||||
/**
|
||||
* Return the types of this parameter.
|
||||
*/
|
||||
getTypes(): string[];
|
||||
|
||||
/**
|
||||
* Returns the unique language-neutral ID for the parameter.
|
||||
*
|
||||
* This represents the identify of the variable model which does not change
|
||||
* over time.
|
||||
*/
|
||||
getId(): string;
|
||||
}
|
||||
19
core/interfaces/i_procedure_block.ts
Normal file
19
core/interfaces/i_procedure_block.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type {Block} from '../block.js';
|
||||
|
||||
|
||||
/** The interface for a block which models a procedure. */
|
||||
export interface IProcedureBlock {
|
||||
doProcedureUpdate(): void;
|
||||
}
|
||||
|
||||
/** A type guard which checks if the given block is a procedure block. */
|
||||
export function isProcedureBlock(block: Block|
|
||||
IProcedureBlock): block is IProcedureBlock {
|
||||
return (block as IProcedureBlock).doProcedureUpdate !== undefined;
|
||||
}
|
||||
20
core/interfaces/i_procedure_map.ts
Normal file
20
core/interfaces/i_procedure_map.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {IProcedureModel} from './i_procedure_model.js';
|
||||
|
||||
|
||||
export interface IProcedureMap extends Map<string, IProcedureModel> {
|
||||
/**
|
||||
* Adds the given ProcedureModel to the map of procedure models, so that
|
||||
* blocks can find it.
|
||||
*/
|
||||
add(proc: IProcedureModel): this;
|
||||
|
||||
|
||||
/** Returns all of the procedures stored in this map. */
|
||||
getProcedures(): IProcedureModel[];
|
||||
}
|
||||
70
core/interfaces/i_procedure_model.ts
Normal file
70
core/interfaces/i_procedure_model.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* The interface for the data model of a procedure.
|
||||
*
|
||||
* @namespace Blockly.IProcedureModel
|
||||
*/
|
||||
|
||||
import {IParameterModel} from './i_parameter_model.js';
|
||||
|
||||
|
||||
/**
|
||||
* A data model for a procedure.
|
||||
*/
|
||||
export interface IProcedureModel {
|
||||
/** Sets the human-readable name of the procedure. */
|
||||
setName(name: string): this;
|
||||
|
||||
/**
|
||||
* Inserts a parameter into the list of parameters.
|
||||
*
|
||||
* To move a parameter, first delete it, and then re-insert.
|
||||
*/
|
||||
insertParameter(parameterModel: IParameterModel, index: number): this;
|
||||
|
||||
/** Removes the parameter at the given index from the parameter list. */
|
||||
deleteParameter(index: number): this;
|
||||
|
||||
/**
|
||||
* Sets the return type(s) of the procedure.
|
||||
*
|
||||
* Pass null to represent a procedure that does not return.
|
||||
*/
|
||||
setReturnTypes(types: string[]|null): this;
|
||||
|
||||
/**
|
||||
* Sets whether this procedure is enabled/disabled. If a procedure is disabled
|
||||
* all procedure caller blocks should be disabled as well.
|
||||
*/
|
||||
setEnabled(enabled: boolean): this;
|
||||
|
||||
/** Returns the unique language-neutral ID for the procedure. */
|
||||
getId(): string;
|
||||
|
||||
/** Returns the human-readable name of the procedure. */
|
||||
getName(): string;
|
||||
|
||||
/** Returns the parameter at the given index in the parameter list. */
|
||||
getParameter(index: number): IParameterModel;
|
||||
|
||||
/** Returns an array of all of the parameters in the parameter list. */
|
||||
getParameters(): IParameterModel[];
|
||||
|
||||
/**
|
||||
* Returns the return type(s) of the procedure.
|
||||
*
|
||||
* Null represents a procedure that does not return a value.
|
||||
*/
|
||||
getReturnTypes(): string[]|null;
|
||||
|
||||
/**
|
||||
* Returns whether the procedure is enabled/disabled. If a procedure is
|
||||
* disabled, all procedure caller blocks should be disabled as well.
|
||||
*/
|
||||
getEnabled(): boolean;
|
||||
}
|
||||
@@ -288,7 +288,7 @@ Object.defineProperties(WidgetDiv, {
|
||||
// CJS or ES module there will not be a Blockly global variable
|
||||
// created. This can cause problems because a very common way of
|
||||
// loading translations is to use a <script> tag to load one of
|
||||
// msg/js/*.js, which consists of lines like:
|
||||
// the generated msg/*.js files, which consists of lines like:
|
||||
//
|
||||
// Blockly.Msg["ADD_COMMENT"] = "Add Comment";
|
||||
// Blockly.Msg["CLEAN_UP"] = "Clean up Blocks";
|
||||
|
||||
169
core/menu.ts
169
core/menu.ts
@@ -33,7 +33,7 @@ export class Menu {
|
||||
* (Nulls are never in the array, but typing the array as nullable prevents
|
||||
* the compiler from objecting to .indexOf(null))
|
||||
*/
|
||||
private readonly menuItems_: MenuItem[] = [];
|
||||
private readonly menuItems: MenuItem[] = [];
|
||||
|
||||
/**
|
||||
* Coordinates of the mousedown event that caused this menu to open. Used to
|
||||
@@ -46,28 +46,28 @@ export class Menu {
|
||||
* This is the element that we will listen to the real focus events on.
|
||||
* A value of null means no menu item is highlighted.
|
||||
*/
|
||||
private highlightedItem_: MenuItem|null = null;
|
||||
private highlightedItem: MenuItem|null = null;
|
||||
|
||||
/** Mouse over event data. */
|
||||
private mouseOverHandler_: browserEvents.Data|null = null;
|
||||
private mouseOverHandler: browserEvents.Data|null = null;
|
||||
|
||||
/** Click event data. */
|
||||
private clickHandler_: browserEvents.Data|null = null;
|
||||
private clickHandler: browserEvents.Data|null = null;
|
||||
|
||||
/** Mouse enter event data. */
|
||||
private mouseEnterHandler_: browserEvents.Data|null = null;
|
||||
private mouseEnterHandler: browserEvents.Data|null = null;
|
||||
|
||||
/** Mouse leave event data. */
|
||||
private mouseLeaveHandler_: browserEvents.Data|null = null;
|
||||
private mouseLeaveHandler: browserEvents.Data|null = null;
|
||||
|
||||
/** Key down event data. */
|
||||
private onKeyDownHandler_: browserEvents.Data|null = null;
|
||||
private onKeyDownHandler: browserEvents.Data|null = null;
|
||||
|
||||
/** The menu's root DOM element. */
|
||||
private element_: HTMLDivElement|null = null;
|
||||
private element: HTMLDivElement|null = null;
|
||||
|
||||
/** ARIA name for this menu. */
|
||||
private roleName_: aria.Role|null = null;
|
||||
private roleName: aria.Role|null = null;
|
||||
|
||||
/** Constructs a new Menu instance. */
|
||||
constructor() {}
|
||||
@@ -79,7 +79,7 @@ export class Menu {
|
||||
* @internal
|
||||
*/
|
||||
addChild(menuItem: MenuItem) {
|
||||
this.menuItems_.push(menuItem);
|
||||
this.menuItems.push(menuItem);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,27 +93,27 @@ export class Menu {
|
||||
// goog-menu is deprecated, use blocklyMenu. May 2020.
|
||||
element.className = 'blocklyMenu goog-menu blocklyNonSelectable';
|
||||
element.tabIndex = 0;
|
||||
if (this.roleName_) {
|
||||
aria.setRole(element, this.roleName_);
|
||||
if (this.roleName) {
|
||||
aria.setRole(element, this.roleName);
|
||||
}
|
||||
this.element_ = element;
|
||||
this.element = element;
|
||||
|
||||
// Add menu items.
|
||||
for (let i = 0, menuItem; menuItem = this.menuItems_[i]; i++) {
|
||||
for (let i = 0, menuItem; menuItem = this.menuItems[i]; i++) {
|
||||
element.appendChild(menuItem.createDom());
|
||||
}
|
||||
|
||||
// Add event handlers.
|
||||
this.mouseOverHandler_ = browserEvents.conditionalBind(
|
||||
element, 'mouseover', this, this.handleMouseOver_, true);
|
||||
this.clickHandler_ = browserEvents.conditionalBind(
|
||||
element, 'click', this, this.handleClick_, true);
|
||||
this.mouseEnterHandler_ = browserEvents.conditionalBind(
|
||||
element, 'mouseenter', this, this.handleMouseEnter_, true);
|
||||
this.mouseLeaveHandler_ = browserEvents.conditionalBind(
|
||||
element, 'mouseleave', this, this.handleMouseLeave_, true);
|
||||
this.onKeyDownHandler_ = browserEvents.conditionalBind(
|
||||
element, 'keydown', this, this.handleKeyEvent_);
|
||||
this.mouseOverHandler = browserEvents.conditionalBind(
|
||||
element, 'mouseover', this, this.handleMouseOver, true);
|
||||
this.clickHandler = browserEvents.conditionalBind(
|
||||
element, 'click', this, this.handleClick, true);
|
||||
this.mouseEnterHandler = browserEvents.conditionalBind(
|
||||
element, 'mouseenter', this, this.handleMouseEnter, true);
|
||||
this.mouseLeaveHandler = browserEvents.conditionalBind(
|
||||
element, 'mouseleave', this, this.handleMouseLeave, true);
|
||||
this.onKeyDownHandler = browserEvents.conditionalBind(
|
||||
element, 'keydown', this, this.handleKeyEvent);
|
||||
|
||||
container.appendChild(element);
|
||||
return element;
|
||||
@@ -126,7 +126,7 @@ export class Menu {
|
||||
* @internal
|
||||
*/
|
||||
getElement(): HTMLDivElement|null {
|
||||
return this.element_;
|
||||
return this.element;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,7 +143,7 @@ export class Menu {
|
||||
}
|
||||
|
||||
/** Blur the menu element. */
|
||||
private blur_() {
|
||||
private blur() {
|
||||
const el = this.getElement();
|
||||
if (el) {
|
||||
el.blur();
|
||||
@@ -158,38 +158,38 @@ export class Menu {
|
||||
* @internal
|
||||
*/
|
||||
setRole(roleName: aria.Role) {
|
||||
this.roleName_ = roleName;
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
/** Dispose of this menu. */
|
||||
dispose() {
|
||||
// Remove event handlers.
|
||||
if (this.mouseOverHandler_) {
|
||||
browserEvents.unbind(this.mouseOverHandler_);
|
||||
this.mouseOverHandler_ = null;
|
||||
if (this.mouseOverHandler) {
|
||||
browserEvents.unbind(this.mouseOverHandler);
|
||||
this.mouseOverHandler = null;
|
||||
}
|
||||
if (this.clickHandler_) {
|
||||
browserEvents.unbind(this.clickHandler_);
|
||||
this.clickHandler_ = null;
|
||||
if (this.clickHandler) {
|
||||
browserEvents.unbind(this.clickHandler);
|
||||
this.clickHandler = null;
|
||||
}
|
||||
if (this.mouseEnterHandler_) {
|
||||
browserEvents.unbind(this.mouseEnterHandler_);
|
||||
this.mouseEnterHandler_ = null;
|
||||
if (this.mouseEnterHandler) {
|
||||
browserEvents.unbind(this.mouseEnterHandler);
|
||||
this.mouseEnterHandler = null;
|
||||
}
|
||||
if (this.mouseLeaveHandler_) {
|
||||
browserEvents.unbind(this.mouseLeaveHandler_);
|
||||
this.mouseLeaveHandler_ = null;
|
||||
if (this.mouseLeaveHandler) {
|
||||
browserEvents.unbind(this.mouseLeaveHandler);
|
||||
this.mouseLeaveHandler = null;
|
||||
}
|
||||
if (this.onKeyDownHandler_) {
|
||||
browserEvents.unbind(this.onKeyDownHandler_);
|
||||
this.onKeyDownHandler_ = null;
|
||||
if (this.onKeyDownHandler) {
|
||||
browserEvents.unbind(this.onKeyDownHandler);
|
||||
this.onKeyDownHandler = null;
|
||||
}
|
||||
|
||||
// Remove menu items.
|
||||
for (let i = 0, menuItem; menuItem = this.menuItems_[i]; i++) {
|
||||
for (let i = 0, menuItem; menuItem = this.menuItems[i]; i++) {
|
||||
menuItem.dispose();
|
||||
}
|
||||
this.element_ = null;
|
||||
this.element = null;
|
||||
}
|
||||
|
||||
// Child component management.
|
||||
@@ -201,7 +201,7 @@ export class Menu {
|
||||
* @param elem DOM element whose owner is to be returned.
|
||||
* @returns Menu item for which the DOM element belongs to.
|
||||
*/
|
||||
private getMenuItem_(elem: Element): MenuItem|null {
|
||||
private getMenuItem(elem: Element): MenuItem|null {
|
||||
const menuElem = this.getElement();
|
||||
// Node might be the menu border (resulting in no associated menu item), or
|
||||
// a menu item's div, or some element within the menu item.
|
||||
@@ -211,7 +211,7 @@ export class Menu {
|
||||
while (currentElement && currentElement !== menuElem) {
|
||||
if (currentElement.classList.contains('blocklyMenuItem')) {
|
||||
// Having found a menu item's div, locate that menu item in this menu.
|
||||
for (let i = 0, menuItem; menuItem = this.menuItems_[i]; i++) {
|
||||
for (let i = 0, menuItem; menuItem = this.menuItems[i]; i++) {
|
||||
if (menuItem.getElement() === currentElement) {
|
||||
return menuItem;
|
||||
}
|
||||
@@ -231,14 +231,14 @@ export class Menu {
|
||||
* @internal
|
||||
*/
|
||||
setHighlighted(item: MenuItem|null) {
|
||||
const currentHighlighted = this.highlightedItem_;
|
||||
const currentHighlighted = this.highlightedItem;
|
||||
if (currentHighlighted) {
|
||||
currentHighlighted.setHighlighted(false);
|
||||
this.highlightedItem_ = null;
|
||||
this.highlightedItem = null;
|
||||
}
|
||||
if (item) {
|
||||
item.setHighlighted(true);
|
||||
this.highlightedItem_ = item;
|
||||
this.highlightedItem = item;
|
||||
// Bring the highlighted item into view. This has no effect if the menu is
|
||||
// not scrollable.
|
||||
const el = this.getElement() as Element;
|
||||
@@ -255,10 +255,10 @@ export class Menu {
|
||||
* @internal
|
||||
*/
|
||||
highlightNext() {
|
||||
const index = this.highlightedItem_ ?
|
||||
this.menuItems_.indexOf(this.highlightedItem_) :
|
||||
const index = this.highlightedItem ?
|
||||
this.menuItems.indexOf(this.highlightedItem) :
|
||||
-1;
|
||||
this.highlightHelper_(index, 1);
|
||||
this.highlightHelper(index, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,20 +268,20 @@ export class Menu {
|
||||
* @internal
|
||||
*/
|
||||
highlightPrevious() {
|
||||
const index = this.highlightedItem_ ?
|
||||
this.menuItems_.indexOf(this.highlightedItem_) :
|
||||
const index = this.highlightedItem ?
|
||||
this.menuItems.indexOf(this.highlightedItem) :
|
||||
-1;
|
||||
this.highlightHelper_(index < 0 ? this.menuItems_.length : index, -1);
|
||||
this.highlightHelper(index < 0 ? this.menuItems.length : index, -1);
|
||||
}
|
||||
|
||||
/** Highlights the first highlightable item. */
|
||||
private highlightFirst_() {
|
||||
this.highlightHelper_(-1, 1);
|
||||
private highlightFirst() {
|
||||
this.highlightHelper(-1, 1);
|
||||
}
|
||||
|
||||
/** Highlights the last highlightable item. */
|
||||
private highlightLast_() {
|
||||
this.highlightHelper_(this.menuItems_.length, -1);
|
||||
private highlightLast() {
|
||||
this.highlightHelper(this.menuItems.length, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -291,10 +291,10 @@ export class Menu {
|
||||
* @param startIndex Start index.
|
||||
* @param delta Step direction: 1 to go down, -1 to go up.
|
||||
*/
|
||||
private highlightHelper_(startIndex: number, delta: number) {
|
||||
private highlightHelper(startIndex: number, delta: number) {
|
||||
let index = startIndex + delta;
|
||||
let menuItem;
|
||||
while (menuItem = this.menuItems_[index]) {
|
||||
while (menuItem = this.menuItems[index]) {
|
||||
if (menuItem.isEnabled()) {
|
||||
this.setHighlighted(menuItem);
|
||||
break;
|
||||
@@ -310,12 +310,12 @@ export class Menu {
|
||||
*
|
||||
* @param e Mouse event to handle.
|
||||
*/
|
||||
private handleMouseOver_(e: Event) {
|
||||
const menuItem = this.getMenuItem_(e.target as Element);
|
||||
private handleMouseOver(e: Event) {
|
||||
const menuItem = this.getMenuItem(e.target as Element);
|
||||
|
||||
if (menuItem) {
|
||||
if (menuItem.isEnabled()) {
|
||||
if (this.highlightedItem_ !== menuItem) {
|
||||
if (this.highlightedItem !== menuItem) {
|
||||
this.setHighlighted(menuItem);
|
||||
}
|
||||
} else {
|
||||
@@ -329,7 +329,7 @@ export class Menu {
|
||||
*
|
||||
* @param e Click event to handle.
|
||||
*/
|
||||
private handleClick_(e: Event) {
|
||||
private handleClick(e: Event) {
|
||||
const oldCoords = this.openingCoords;
|
||||
// Clear out the saved opening coords immediately so they're not used twice.
|
||||
this.openingCoords = null;
|
||||
@@ -351,7 +351,7 @@ export class Menu {
|
||||
}
|
||||
}
|
||||
|
||||
const menuItem = this.getMenuItem_(e.target as Element);
|
||||
const menuItem = this.getMenuItem(e.target as Element);
|
||||
if (menuItem) {
|
||||
menuItem.performAction();
|
||||
}
|
||||
@@ -362,7 +362,7 @@ export class Menu {
|
||||
*
|
||||
* @param _e Mouse event to handle.
|
||||
*/
|
||||
private handleMouseEnter_(_e: Event) {
|
||||
private handleMouseEnter(_e: Event) {
|
||||
this.focus();
|
||||
}
|
||||
|
||||
@@ -371,9 +371,9 @@ export class Menu {
|
||||
*
|
||||
* @param _e Mouse event to handle.
|
||||
*/
|
||||
private handleMouseLeave_(_e: Event) {
|
||||
private handleMouseLeave(_e: Event) {
|
||||
if (this.getElement()) {
|
||||
this.blur_();
|
||||
this.blur();
|
||||
this.setHighlighted(null);
|
||||
}
|
||||
}
|
||||
@@ -387,27 +387,20 @@ export class Menu {
|
||||
*
|
||||
* @param e Key event to handle.
|
||||
*/
|
||||
private handleKeyEvent_(e: Event) {
|
||||
if (!this.menuItems_.length) {
|
||||
private handleKeyEvent(e: Event) {
|
||||
if (!this.menuItems.length) {
|
||||
// Empty menu.
|
||||
return;
|
||||
}
|
||||
// AnyDuringMigration because: Property 'altKey' does not exist on type
|
||||
// 'Event'. AnyDuringMigration because: Property 'metaKey' does not exist
|
||||
// on type 'Event'. AnyDuringMigration because: Property 'ctrlKey' does not
|
||||
// exist on type 'Event'. AnyDuringMigration because: Property 'shiftKey'
|
||||
// does not exist on type 'Event'.
|
||||
if ((e as AnyDuringMigration).shiftKey ||
|
||||
(e as AnyDuringMigration).ctrlKey ||
|
||||
(e as AnyDuringMigration).metaKey || (e as AnyDuringMigration).altKey) {
|
||||
const keyboardEvent = e as KeyboardEvent;
|
||||
if (keyboardEvent.shiftKey || keyboardEvent.ctrlKey ||
|
||||
keyboardEvent.metaKey || keyboardEvent.altKey) {
|
||||
// Do not handle the key event if any modifier key is pressed.
|
||||
return;
|
||||
}
|
||||
|
||||
const highlighted = this.highlightedItem_;
|
||||
// AnyDuringMigration because: Property 'keyCode' does not exist on type
|
||||
// 'Event'.
|
||||
switch ((e as AnyDuringMigration).keyCode) {
|
||||
const highlighted = this.highlightedItem;
|
||||
switch (keyboardEvent.keyCode) {
|
||||
case KeyCodes.ENTER:
|
||||
case KeyCodes.SPACE:
|
||||
if (highlighted) {
|
||||
@@ -425,12 +418,12 @@ export class Menu {
|
||||
|
||||
case KeyCodes.PAGE_UP:
|
||||
case KeyCodes.HOME:
|
||||
this.highlightFirst_();
|
||||
this.highlightFirst();
|
||||
break;
|
||||
|
||||
case KeyCodes.PAGE_DOWN:
|
||||
case KeyCodes.END:
|
||||
this.highlightLast_();
|
||||
this.highlightLast();
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -449,10 +442,10 @@ export class Menu {
|
||||
* @internal
|
||||
*/
|
||||
getSize(): Size {
|
||||
const menuDom = this.getElement();
|
||||
const menuSize = style.getSize(menuDom as Element);
|
||||
const menuDom = this.getElement() as HTMLDivElement;
|
||||
const menuSize = style.getSize(menuDom);
|
||||
// Recalculate height for the total content, not only box height.
|
||||
menuSize.height = menuDom!.scrollHeight;
|
||||
menuSize.height = menuDom.scrollHeight;
|
||||
return menuSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,28 +24,28 @@ import * as idGenerator from './utils/idgenerator.js';
|
||||
*/
|
||||
export class MenuItem {
|
||||
/** Is the menu item clickable, as opposed to greyed-out. */
|
||||
private enabled_ = true;
|
||||
private enabled = true;
|
||||
|
||||
/** The DOM element for the menu item. */
|
||||
private element_: HTMLDivElement|null = null;
|
||||
private element: HTMLDivElement|null = null;
|
||||
|
||||
/** Whether the menu item is rendered right-to-left. */
|
||||
private rightToLeft_ = false;
|
||||
private rightToLeft = false;
|
||||
|
||||
/** ARIA name for this menu. */
|
||||
private roleName_: aria.Role|null = null;
|
||||
private roleName: aria.Role|null = null;
|
||||
|
||||
/** Is this menu item checkable. */
|
||||
private checkable_ = false;
|
||||
private checkable = false;
|
||||
|
||||
/** Is this menu item currently checked. */
|
||||
private checked_ = false;
|
||||
private checked = false;
|
||||
|
||||
/** Is this menu item currently highlighted. */
|
||||
private highlight_ = false;
|
||||
private highlight = false;
|
||||
|
||||
/** Bound function to call when this menu item is clicked. */
|
||||
private actionHandler_: Function|null = null;
|
||||
private actionHandler: Function|null = null;
|
||||
|
||||
/**
|
||||
* @param content Text caption to display as the content of the item, or a
|
||||
@@ -64,22 +64,22 @@ export class MenuItem {
|
||||
createDom(): Element {
|
||||
const element = (document.createElement('div'));
|
||||
element.id = idGenerator.getNextUniqueId();
|
||||
this.element_ = element;
|
||||
this.element = element;
|
||||
|
||||
// Set class and style
|
||||
// goog-menuitem* is deprecated, use blocklyMenuItem*. May 2020.
|
||||
element.className = 'blocklyMenuItem goog-menuitem ' +
|
||||
(this.enabled_ ? '' :
|
||||
'blocklyMenuItemDisabled goog-menuitem-disabled ') +
|
||||
(this.checked_ ? 'blocklyMenuItemSelected goog-option-selected ' : '') +
|
||||
(this.highlight_ ? 'blocklyMenuItemHighlight goog-menuitem-highlight ' :
|
||||
'') +
|
||||
(this.rightToLeft_ ? 'blocklyMenuItemRtl goog-menuitem-rtl ' : '');
|
||||
(this.enabled ? '' :
|
||||
'blocklyMenuItemDisabled goog-menuitem-disabled ') +
|
||||
(this.checked ? 'blocklyMenuItemSelected goog-option-selected ' : '') +
|
||||
(this.highlight ? 'blocklyMenuItemHighlight goog-menuitem-highlight ' :
|
||||
'') +
|
||||
(this.rightToLeft ? 'blocklyMenuItemRtl goog-menuitem-rtl ' : '');
|
||||
|
||||
const content = (document.createElement('div'));
|
||||
content.className = 'blocklyMenuItemContent goog-menuitem-content';
|
||||
// Add a checkbox for checkable menu items.
|
||||
if (this.checkable_) {
|
||||
if (this.checkable) {
|
||||
const checkbox = (document.createElement('div'));
|
||||
checkbox.className = 'blocklyMenuItemCheckbox goog-menuitem-checkbox';
|
||||
content.appendChild(checkbox);
|
||||
@@ -93,20 +93,19 @@ export class MenuItem {
|
||||
element.appendChild(content);
|
||||
|
||||
// Initialize ARIA role and state.
|
||||
if (this.roleName_) {
|
||||
aria.setRole(element, this.roleName_);
|
||||
if (this.roleName) {
|
||||
aria.setRole(element, this.roleName);
|
||||
}
|
||||
aria.setState(
|
||||
element, aria.State.SELECTED,
|
||||
this.checkable_ && this.checked_ || false);
|
||||
aria.setState(element, aria.State.DISABLED, !this.enabled_);
|
||||
element, aria.State.SELECTED, this.checkable && this.checked || false);
|
||||
aria.setState(element, aria.State.DISABLED, !this.enabled);
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
/** Dispose of this menu item. */
|
||||
dispose() {
|
||||
this.element_ = null;
|
||||
this.element = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +115,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
getElement(): Element|null {
|
||||
return this.element_;
|
||||
return this.element;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,7 +125,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
getId(): string {
|
||||
return this.element_!.id;
|
||||
return this.element!.id;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +145,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
setRightToLeft(rtl: boolean) {
|
||||
this.rightToLeft_ = rtl;
|
||||
this.rightToLeft = rtl;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,7 +155,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
setRole(roleName: aria.Role) {
|
||||
this.roleName_ = roleName;
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,7 +166,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
setCheckable(checkable: boolean) {
|
||||
this.checkable_ = checkable;
|
||||
this.checkable = checkable;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,7 +176,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
setChecked(checked: boolean) {
|
||||
this.checked_ = checked;
|
||||
this.checked = checked;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,7 +186,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
setHighlighted(highlight: boolean) {
|
||||
this.highlight_ = highlight;
|
||||
this.highlight = highlight;
|
||||
|
||||
const el = this.getElement();
|
||||
if (el && this.isEnabled()) {
|
||||
@@ -212,7 +211,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
isEnabled(): boolean {
|
||||
return this.enabled_;
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,7 +221,7 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
setEnabled(enabled: boolean) {
|
||||
this.enabled_ = enabled;
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,8 +231,8 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
performAction() {
|
||||
if (this.isEnabled() && this.actionHandler_) {
|
||||
this.actionHandler_(this);
|
||||
if (this.isEnabled() && this.actionHandler) {
|
||||
this.actionHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +245,6 @@ export class MenuItem {
|
||||
* @internal
|
||||
*/
|
||||
onAction(fn: (p1: MenuItem) => void, obj: object) {
|
||||
this.actionHandler_ = fn.bind(obj);
|
||||
this.actionHandler = fn.bind(obj);
|
||||
}
|
||||
}
|
||||
|
||||
168
core/mutator.ts
168
core/mutator.ts
@@ -42,40 +42,40 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
* @alias Blockly.Mutator
|
||||
*/
|
||||
export class Mutator extends Icon {
|
||||
private quarkNames_: string[];
|
||||
private quarkNames: string[];
|
||||
|
||||
/** Workspace in the mutator's bubble. */
|
||||
private workspace_: WorkspaceSvg|null = null;
|
||||
private workspace: WorkspaceSvg|null = null;
|
||||
|
||||
/** Width of workspace. */
|
||||
private workspaceWidth_ = 0;
|
||||
private workspaceWidth = 0;
|
||||
|
||||
/** Height of workspace. */
|
||||
private workspaceHeight_ = 0;
|
||||
private workspaceHeight = 0;
|
||||
|
||||
/**
|
||||
* The SVG element that is the parent of the mutator workspace, or null if
|
||||
* not created.
|
||||
*/
|
||||
private svgDialog_: SVGSVGElement|null = null;
|
||||
private svgDialog: SVGSVGElement|null = null;
|
||||
|
||||
/**
|
||||
* The root block of the mutator workspace, created by decomposing the
|
||||
* source block.
|
||||
*/
|
||||
private rootBlock_: BlockSvg|null = null;
|
||||
private rootBlock: BlockSvg|null = null;
|
||||
|
||||
/**
|
||||
* Function registered on the main workspace to update the mutator contents
|
||||
* when the main workspace changes.
|
||||
*/
|
||||
private sourceListener_: Function|null = null;
|
||||
private sourceListener: Function|null = null;
|
||||
|
||||
/**
|
||||
* The PID associated with the updateWorkpace_ timeout, or null if no timeout
|
||||
* is currently running.
|
||||
*/
|
||||
private updateWorkspacePid_: ReturnType<typeof setTimeout>|null = null;
|
||||
private updateWorkspacePid: ReturnType<typeof setTimeout>|null = null;
|
||||
|
||||
/** @param quarkNames List of names of sub-blocks for flyout. */
|
||||
constructor(quarkNames: string[], block?: BlockSvg) {
|
||||
@@ -86,7 +86,7 @@ export class Mutator extends Icon {
|
||||
'the constructor by passing the list of subblocks and the block instance to attach the mutator to');
|
||||
}
|
||||
super(block ?? null);
|
||||
this.quarkNames_ = quarkNames;
|
||||
this.quarkNames = quarkNames;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ export class Mutator extends Icon {
|
||||
* @internal
|
||||
*/
|
||||
getWorkspace(): WorkspaceSvg|null {
|
||||
return this.workspace_;
|
||||
return this.workspace;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,19 +162,19 @@ export class Mutator extends Icon {
|
||||
*
|
||||
* @returns The top-level node of the editor.
|
||||
*/
|
||||
private createEditor_(): SVGElement {
|
||||
private createEditor(): SVGSVGElement {
|
||||
/* Create the editor. Here's the markup that will be generated:
|
||||
<svg>
|
||||
[Workspace]
|
||||
</svg>
|
||||
*/
|
||||
this.svgDialog_ = dom.createSvgElement(
|
||||
this.svgDialog = dom.createSvgElement(
|
||||
Svg.SVG, {'x': Bubble.BORDER_WIDTH, 'y': Bubble.BORDER_WIDTH});
|
||||
// Convert the list of names into a list of XML objects for the flyout.
|
||||
let quarkXml;
|
||||
if (this.quarkNames_.length) {
|
||||
if (this.quarkNames.length) {
|
||||
quarkXml = xml.createElement('xml');
|
||||
for (let i = 0, quarkName; quarkName = this.quarkNames_[i]; i++) {
|
||||
for (let i = 0, quarkName; quarkName = this.quarkNames[i]; i++) {
|
||||
const element = xml.createElement('block');
|
||||
element.setAttribute('type', quarkName);
|
||||
quarkXml.appendChild(element);
|
||||
@@ -200,26 +200,26 @@ export class Mutator extends Icon {
|
||||
if (hasFlyout) {
|
||||
workspaceOptions.languageTree = toolbox.convertToolboxDefToJson(quarkXml);
|
||||
}
|
||||
this.workspace_ = this.newWorkspaceSvg(workspaceOptions);
|
||||
this.workspace_.internalIsMutator = true;
|
||||
this.workspace_.addChangeListener(eventUtils.disableOrphans);
|
||||
this.workspace = this.newWorkspaceSvg(workspaceOptions);
|
||||
this.workspace.internalIsMutator = true;
|
||||
this.workspace.addChangeListener(eventUtils.disableOrphans);
|
||||
|
||||
// Mutator flyouts go inside the mutator workspace's <g> rather than in
|
||||
// a top level SVG. Instead of handling scale themselves, mutators
|
||||
// inherit scale from the parent workspace.
|
||||
// To fix this, scale needs to be applied at a different level in the DOM.
|
||||
const flyoutSvg = hasFlyout ? this.workspace_.addFlyout(Svg.G) : null;
|
||||
const background = this.workspace_.createDom('blocklyMutatorBackground');
|
||||
const flyoutSvg = hasFlyout ? this.workspace.addFlyout(Svg.G) : null;
|
||||
const background = this.workspace.createDom('blocklyMutatorBackground');
|
||||
|
||||
if (flyoutSvg) {
|
||||
// Insert the flyout after the <rect> but before the block canvas so that
|
||||
// the flyout is underneath in z-order. This makes blocks layering during
|
||||
// dragging work properly.
|
||||
background.insertBefore(flyoutSvg, this.workspace_.svgBlockCanvas_);
|
||||
background.insertBefore(flyoutSvg, this.workspace.svgBlockCanvas_);
|
||||
}
|
||||
this.svgDialog_!.appendChild(background);
|
||||
this.svgDialog.appendChild(background);
|
||||
|
||||
return this.svgDialog_;
|
||||
return this.svgDialog;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -251,50 +251,54 @@ export class Mutator extends Icon {
|
||||
}
|
||||
|
||||
/** Resize the bubble to match the size of the workspace. */
|
||||
private resizeBubble_() {
|
||||
private resizeBubble() {
|
||||
// If the bubble exists, the workspace also exists.
|
||||
if (!this.workspace) {
|
||||
return;
|
||||
}
|
||||
const doubleBorderWidth = 2 * Bubble.BORDER_WIDTH;
|
||||
const workspaceSize = this.workspace_!.getCanvas().getBBox();
|
||||
const canvas = this.workspace.getCanvas();
|
||||
const workspaceSize = canvas.getBBox();
|
||||
let width = workspaceSize.width + workspaceSize.x;
|
||||
let height = workspaceSize.height + doubleBorderWidth * 3;
|
||||
const flyout = this.workspace_!.getFlyout();
|
||||
const flyout = this.workspace.getFlyout();
|
||||
if (flyout) {
|
||||
const flyoutScrollMetrics =
|
||||
flyout.getWorkspace().getMetricsManager().getScrollMetrics();
|
||||
height = Math.max(height, flyoutScrollMetrics.height + 20);
|
||||
width += flyout.getWidth();
|
||||
}
|
||||
if (this.getBlock().RTL) {
|
||||
const isRtl = this.getBlock().RTL;
|
||||
if (isRtl) {
|
||||
width = -workspaceSize.x;
|
||||
}
|
||||
width += doubleBorderWidth * 3;
|
||||
// Only resize if the size difference is significant. Eliminates
|
||||
// shuddering.
|
||||
if (Math.abs(this.workspaceWidth_ - width) > doubleBorderWidth ||
|
||||
Math.abs(this.workspaceHeight_ - height) > doubleBorderWidth) {
|
||||
if (Math.abs(this.workspaceWidth - width) > doubleBorderWidth ||
|
||||
Math.abs(this.workspaceHeight - height) > doubleBorderWidth) {
|
||||
// Record some layout information for workspace metrics.
|
||||
this.workspaceWidth_ = width;
|
||||
this.workspaceHeight_ = height;
|
||||
this.workspaceWidth = width;
|
||||
this.workspaceHeight = height;
|
||||
// Resize the bubble.
|
||||
this.bubble_!.setBubbleSize(
|
||||
width + doubleBorderWidth, height + doubleBorderWidth);
|
||||
this.svgDialog_!.setAttribute('width', `${this.workspaceWidth_}`);
|
||||
this.svgDialog_!.setAttribute('height', `${this.workspaceHeight_}`);
|
||||
this.workspace_!.setCachedParentSvgSize(
|
||||
this.workspaceWidth_, this.workspaceHeight_);
|
||||
this.svgDialog!.setAttribute('width', `${width}`);
|
||||
this.svgDialog!.setAttribute('height', `${height}`);
|
||||
this.workspace.setCachedParentSvgSize(width, height);
|
||||
}
|
||||
|
||||
if (this.getBlock().RTL) {
|
||||
if (isRtl) {
|
||||
// Scroll the workspace to always left-align.
|
||||
const translation = 'translate(' + this.workspaceWidth_ + ',0)';
|
||||
this.workspace_!.getCanvas().setAttribute('transform', translation);
|
||||
canvas.setAttribute('transform', `translate(${this.workspaceWidth}, 0)`);
|
||||
}
|
||||
this.workspace_!.resize();
|
||||
this.workspace.resize();
|
||||
}
|
||||
|
||||
/** A method handler for when the bubble is moved. */
|
||||
private onBubbleMove_() {
|
||||
if (this.workspace_) {
|
||||
this.workspace_.recordDragTargets();
|
||||
private onBubbleMove() {
|
||||
if (this.workspace) {
|
||||
this.workspace.recordDragTargets();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,31 +318,33 @@ export class Mutator extends Icon {
|
||||
if (visible) {
|
||||
// Create the bubble.
|
||||
this.bubble_ = new Bubble(
|
||||
block.workspace, this.createEditor_(), block.pathObject.svgPath,
|
||||
block.workspace, this.createEditor(), block.pathObject.svgPath,
|
||||
(this.iconXY_ as Coordinate), null, null);
|
||||
// The workspace was created in createEditor.
|
||||
const ws = this.workspace!;
|
||||
// Expose this mutator's block's ID on its top-level SVG group.
|
||||
this.bubble_.setSvgId(block.id);
|
||||
this.bubble_.registerMoveEvent(this.onBubbleMove_.bind(this));
|
||||
const tree = this.workspace_!.options.languageTree;
|
||||
const flyout = this.workspace_!.getFlyout();
|
||||
this.bubble_.registerMoveEvent(this.onBubbleMove.bind(this));
|
||||
const tree = ws.options.languageTree;
|
||||
const flyout = ws.getFlyout();
|
||||
if (tree) {
|
||||
flyout!.init(this.workspace_!);
|
||||
flyout!.init(ws);
|
||||
flyout!.show(tree);
|
||||
}
|
||||
|
||||
this.rootBlock_ = block.decompose!(this.workspace_!)!;
|
||||
const blocks = this.rootBlock_!.getDescendants(false);
|
||||
this.rootBlock = block.decompose!(ws)!;
|
||||
const blocks = this.rootBlock.getDescendants(false);
|
||||
for (let i = 0, child; child = blocks[i]; i++) {
|
||||
child.render();
|
||||
}
|
||||
// The root block should not be draggable or deletable.
|
||||
this.rootBlock_!.setMovable(false);
|
||||
this.rootBlock_!.setDeletable(false);
|
||||
this.rootBlock.setMovable(false);
|
||||
this.rootBlock.setDeletable(false);
|
||||
let margin;
|
||||
let x;
|
||||
if (flyout) {
|
||||
margin = flyout.CORNER_RADIUS * 2;
|
||||
x = this.rootBlock_!.RTL ? flyout.getWidth() + margin : margin;
|
||||
x = this.rootBlock.RTL ? flyout.getWidth() + margin : margin;
|
||||
} else {
|
||||
margin = 16;
|
||||
x = margin;
|
||||
@@ -346,38 +352,38 @@ export class Mutator extends Icon {
|
||||
if (block.RTL) {
|
||||
x = -x;
|
||||
}
|
||||
this.rootBlock_!.moveBy(x, margin);
|
||||
this.rootBlock.moveBy(x, margin);
|
||||
// Save the initial connections, then listen for further changes.
|
||||
if (block.saveConnections) {
|
||||
const thisRootBlock = this.rootBlock_;
|
||||
const thisRootBlock = this.rootBlock;
|
||||
block.saveConnections(thisRootBlock);
|
||||
this.sourceListener_ = () => {
|
||||
this.sourceListener = () => {
|
||||
const currentBlock = this.getBlock();
|
||||
if (currentBlock.saveConnections) {
|
||||
currentBlock.saveConnections(thisRootBlock);
|
||||
}
|
||||
};
|
||||
block.workspace.addChangeListener(this.sourceListener_);
|
||||
block.workspace.addChangeListener(this.sourceListener);
|
||||
}
|
||||
this.resizeBubble_();
|
||||
this.resizeBubble();
|
||||
// When the mutator's workspace changes, update the source block.
|
||||
this.workspace_!.addChangeListener(this.workspaceChanged_.bind(this));
|
||||
ws.addChangeListener(this.workspaceChanged.bind(this));
|
||||
// Update the source block immediately after the bubble becomes visible.
|
||||
this.updateWorkspace_();
|
||||
this.updateWorkspace();
|
||||
this.applyColour();
|
||||
} else {
|
||||
// Dispose of the bubble.
|
||||
this.svgDialog_ = null;
|
||||
this.workspace_!.dispose();
|
||||
this.workspace_ = null;
|
||||
this.rootBlock_ = null;
|
||||
this.svgDialog = null;
|
||||
this.workspace!.dispose();
|
||||
this.workspace = null;
|
||||
this.rootBlock = null;
|
||||
this.bubble_?.dispose();
|
||||
this.bubble_ = null;
|
||||
this.workspaceWidth_ = 0;
|
||||
this.workspaceHeight_ = 0;
|
||||
if (this.sourceListener_) {
|
||||
block.workspace.removeChangeListener(this.sourceListener_);
|
||||
this.sourceListener_ = null;
|
||||
this.workspaceWidth = 0;
|
||||
this.workspaceHeight = 0;
|
||||
if (this.sourceListener) {
|
||||
block.workspace.removeChangeListener(this.sourceListener);
|
||||
this.sourceListener = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,11 +393,11 @@ export class Mutator extends Icon {
|
||||
*
|
||||
* @param e Custom data for event.
|
||||
*/
|
||||
private workspaceChanged_(e: Abstract) {
|
||||
if (!this.shouldIgnoreMutatorEvent_(e) && !this.updateWorkspacePid_) {
|
||||
this.updateWorkspacePid_ = setTimeout(() => {
|
||||
this.updateWorkspacePid_ = null;
|
||||
this.updateWorkspace_();
|
||||
private workspaceChanged(e: Abstract) {
|
||||
if (!this.shouldIgnoreMutatorEvent_(e) && !this.updateWorkspacePid) {
|
||||
this.updateWorkspacePid = setTimeout(() => {
|
||||
this.updateWorkspacePid = null;
|
||||
this.updateWorkspace();
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
@@ -413,9 +419,9 @@ export class Mutator extends Icon {
|
||||
* Updates the source block when the mutator's blocks are changed.
|
||||
* Bump down any block that's too high.
|
||||
*/
|
||||
private updateWorkspace_() {
|
||||
if (!this.workspace_!.isDragging()) {
|
||||
const blocks = this.workspace_!.getTopBlocks(false);
|
||||
private updateWorkspace() {
|
||||
if (!this.workspace!.isDragging()) {
|
||||
const blocks = this.workspace!.getTopBlocks(false);
|
||||
const MARGIN = 20;
|
||||
|
||||
for (let b = 0, block; block = blocks[b]; b++) {
|
||||
@@ -428,7 +434,7 @@ export class Mutator extends Icon {
|
||||
// Bump any block overlapping the flyout back inside.
|
||||
if (block.RTL) {
|
||||
let right = -MARGIN;
|
||||
const flyout = this.workspace_!.getFlyout();
|
||||
const flyout = this.workspace!.getFlyout();
|
||||
if (flyout) {
|
||||
right -= flyout.getWidth();
|
||||
}
|
||||
@@ -442,7 +448,7 @@ export class Mutator extends Icon {
|
||||
}
|
||||
|
||||
// When the mutator's workspace changes, update the source block.
|
||||
if (this.rootBlock_ && this.rootBlock_.workspace === this.workspace_) {
|
||||
if (this.rootBlock && this.rootBlock.workspace === this.workspace) {
|
||||
const existingGroup = eventUtils.getGroup();
|
||||
if (!existingGroup) {
|
||||
eventUtils.setGroup(true);
|
||||
@@ -456,7 +462,7 @@ export class Mutator extends Icon {
|
||||
block.rendered = false;
|
||||
|
||||
// Allow the source block to rebuild itself.
|
||||
block.compose!(this.rootBlock_);
|
||||
block.compose!(this.rootBlock);
|
||||
// Restore rendering and show the changes.
|
||||
block.rendered = savedRendered;
|
||||
// Mutation may have added some elements that need initializing.
|
||||
@@ -482,8 +488,8 @@ export class Mutator extends Icon {
|
||||
|
||||
// Don't update the bubble until the drag has ended, to avoid moving
|
||||
// blocks under the cursor.
|
||||
if (!this.workspace_!.isDragging()) {
|
||||
setTimeout(() => this.resizeBubble_(), 0);
|
||||
if (!this.workspace!.isDragging()) {
|
||||
setTimeout(() => this.resizeBubble(), 0);
|
||||
}
|
||||
eventUtils.setGroup(existingGroup);
|
||||
}
|
||||
@@ -497,7 +503,7 @@ export class Mutator extends Icon {
|
||||
|
||||
/** Update the styles on all blocks in the mutator. */
|
||||
updateBlockStyle() {
|
||||
const ws = this.workspace_;
|
||||
const ws = this.workspace;
|
||||
|
||||
if (ws && ws.getAllBlocks(false)) {
|
||||
const workspaceBlocks = ws.getAllBlocks(false);
|
||||
|
||||
@@ -25,6 +25,9 @@ import * as eventUtils from './events/utils.js';
|
||||
import {Field, UnattachedFieldError} from './field.js';
|
||||
import {Msg} from './msg.js';
|
||||
import {Names} from './names.js';
|
||||
import {ObservableProcedureMap} from './procedures/observable_procedure_map.js';
|
||||
import {ObservableProcedureModel} from './procedures/observable_procedure_model.js';
|
||||
import {ObservableParameterModel} from './procedures/observable_parameter_model.js';
|
||||
import * as utilsXml from './utils/xml.js';
|
||||
import * as Variables from './variables.js';
|
||||
import type {Workspace} from './workspace.js';
|
||||
@@ -450,3 +453,9 @@ export function getDefinition(name: string, workspace: Workspace): Block|null {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export {
|
||||
ObservableProcedureMap,
|
||||
ObservableProcedureModel,
|
||||
ObservableParameterModel,
|
||||
};
|
||||
|
||||
79
core/procedures/observable_parameter_model.ts
Normal file
79
core/procedures/observable_parameter_model.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {genUid} from '../utils/idgenerator.js';
|
||||
import type {IParameterModel} from '../interfaces/i_parameter_model.js';
|
||||
import {triggerProceduresUpdate} from './update_procedures.js';
|
||||
import type {VariableModel} from '../variable_model.js';
|
||||
import type {Workspace} from '../workspace.js';
|
||||
|
||||
|
||||
export class ObservableParameterModel implements IParameterModel {
|
||||
private id: string;
|
||||
private variable: VariableModel;
|
||||
|
||||
constructor(
|
||||
private readonly workspace: Workspace, name: string, id?: string) {
|
||||
this.id = id ?? genUid();
|
||||
this.variable =
|
||||
this.workspace.getVariable(name) ?? workspace.createVariable(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of this parameter to the given name.
|
||||
*/
|
||||
setName(name: string): this {
|
||||
// TODO(#6516): Fire events.
|
||||
if (name == this.variable.name) return this;
|
||||
this.variable =
|
||||
this.workspace.getVariable(name) ?? this.workspace.createVariable(name);
|
||||
triggerProceduresUpdate(this.workspace);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unimplemented. The built-in ParameterModel does not support typing.
|
||||
* If you want your procedure blocks to have typed parameters, you need to
|
||||
* implement your own ParameterModel.
|
||||
*
|
||||
* @throws Throws for the ObservableParameterModel specifically because this
|
||||
* method is unimplemented.
|
||||
*/
|
||||
setTypes(_types: string[]): this {
|
||||
throw new Error(
|
||||
'The built-in ParameterModel does not support typing. You need to ' +
|
||||
'implement your own custom ParameterModel.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of this parameter.
|
||||
*/
|
||||
getName(): string {
|
||||
return this.variable.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the types of this parameter.
|
||||
*/
|
||||
getTypes(): string[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unique language-neutral ID for the parameter.
|
||||
*
|
||||
* This represents the identify of the variable model which does not change
|
||||
* over time.
|
||||
*/
|
||||
getId(): string {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/** Returns the variable model associated with the parameter model. */
|
||||
getVariableModel(): VariableModel {
|
||||
return this.variable;
|
||||
}
|
||||
}
|
||||
64
core/procedures/observable_procedure_map.ts
Normal file
64
core/procedures/observable_procedure_map.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type {IProcedureModel} from '../interfaces/i_procedure_model.js';
|
||||
import {triggerProceduresUpdate} from './update_procedures.js';
|
||||
import type {Workspace} from '../workspace.js';
|
||||
import {IProcedureMap} from '../interfaces/i_procedure_map.js';
|
||||
|
||||
|
||||
export class ObservableProcedureMap extends
|
||||
Map<string, IProcedureModel> implements IProcedureMap {
|
||||
constructor(private readonly workspace: Workspace) {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the given procedure model to the procedure map.
|
||||
*/
|
||||
override set(id: string, proc: IProcedureModel): this {
|
||||
// TODO(#6516): Fire events.
|
||||
super.set(id, proc);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the ProcedureModel with the given ID from the procedure map (if it
|
||||
* exists).
|
||||
*/
|
||||
override delete(id: string): boolean {
|
||||
// TODO(#6516): Fire events.
|
||||
const existed = super.delete(id);
|
||||
triggerProceduresUpdate(this.workspace);
|
||||
return existed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all ProcedureModels from the procedure map.
|
||||
*/
|
||||
override clear() {
|
||||
// TODO(#6516): Fire events.
|
||||
super.clear();
|
||||
triggerProceduresUpdate(this.workspace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the given ProcedureModel to the map of procedure models, so that
|
||||
* blocks can find it.
|
||||
*/
|
||||
add(proc: IProcedureModel): this {
|
||||
// TODO(#6516): Fire events.
|
||||
// TODO(#6526): See if this method is actually useful.
|
||||
return this.set(proc.getId(), proc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all of the procedures stored in this map.
|
||||
*/
|
||||
getProcedures(): IProcedureModel[] {
|
||||
return [...this.values()];
|
||||
}
|
||||
}
|
||||
123
core/procedures/observable_procedure_model.ts
Normal file
123
core/procedures/observable_procedure_model.ts
Normal file
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {genUid} from '../utils/idgenerator.js';
|
||||
import type {IParameterModel} from '../interfaces/i_parameter_model.js';
|
||||
import type {IProcedureModel} from '../interfaces/i_procedure_model.js';
|
||||
import {triggerProceduresUpdate} from './update_procedures.js';
|
||||
import type {Workspace} from '../workspace.js';
|
||||
|
||||
|
||||
export class ObservableProcedureModel implements IProcedureModel {
|
||||
private id: string;
|
||||
private name: string;
|
||||
private parameters: IParameterModel[] = [];
|
||||
private returnTypes: string[]|null = null;
|
||||
private enabled = true;
|
||||
|
||||
constructor(
|
||||
private readonly workspace: Workspace, name: string, id?: string) {
|
||||
this.id = id ?? genUid();
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/** Sets the human-readable name of the procedure. */
|
||||
setName(name: string): this {
|
||||
// TODO(#6516): Fire events.
|
||||
this.name = name;
|
||||
triggerProceduresUpdate(this.workspace);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a parameter into the list of parameters.
|
||||
*
|
||||
* To move a parameter, first delete it, and then re-insert.
|
||||
*/
|
||||
insertParameter(parameterModel: IParameterModel, index: number): this {
|
||||
// TODO(#6516): Fire events.
|
||||
this.parameters.splice(index, 0, parameterModel);
|
||||
triggerProceduresUpdate(this.workspace);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Removes the parameter at the given index from the parameter list. */
|
||||
deleteParameter(index: number): this {
|
||||
// TODO(#6516): Fire events.
|
||||
this.parameters.splice(index, 1);
|
||||
triggerProceduresUpdate(this.workspace);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the procedure has a return value (empty array) or no return
|
||||
* value (null).
|
||||
*
|
||||
* The built-in procedure model does not support procedures that have actual
|
||||
* return types (i.e. non-empty arrays, e.g. ['number']). If you want your
|
||||
* procedure block to have return types, you need to implement your own
|
||||
* procedure model.
|
||||
*/
|
||||
setReturnTypes(types: string[]|null): this {
|
||||
if (types && types.length) {
|
||||
throw new Error(
|
||||
'The built-in ProcedureModel does not support typing. You need to ' +
|
||||
'implement your own custom ProcedureModel.');
|
||||
}
|
||||
this.returnTypes = types;
|
||||
// TODO(#6516): Fire events.
|
||||
triggerProceduresUpdate(this.workspace);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this procedure is enabled/disabled. If a procedure is disabled
|
||||
* all procedure caller blocks should be disabled as well.
|
||||
*/
|
||||
setEnabled(enabled: boolean): this {
|
||||
// TODO(#6516): Fire events.
|
||||
this.enabled = enabled;
|
||||
triggerProceduresUpdate(this.workspace);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Returns the unique language-neutral ID for the procedure. */
|
||||
getId(): string {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/** Returns the human-readable name of the procedure. */
|
||||
getName(): string {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/** Returns the parameter at the given index in the parameter list. */
|
||||
getParameter(index: number): IParameterModel {
|
||||
return this.parameters[index];
|
||||
}
|
||||
|
||||
/** Returns an array of all of the parameters in the parameter list. */
|
||||
getParameters(): IParameterModel[] {
|
||||
return [...this.parameters];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the return type of the procedure.
|
||||
*
|
||||
* Null represents a procedure that does not return a value.
|
||||
*/
|
||||
getReturnTypes(): string[]|null {
|
||||
return this.returnTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the procedure is enabled/disabled. If a procedure is
|
||||
* disabled, all procedure caller blocks should be disabled as well.
|
||||
*/
|
||||
getEnabled(): boolean {
|
||||
return this.enabled;
|
||||
}
|
||||
}
|
||||
22
core/procedures/update_procedures.ts
Normal file
22
core/procedures/update_procedures.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {isProcedureBlock} from '../interfaces/i_procedure_block.js';
|
||||
import {Workspace} from '../workspace.js';
|
||||
|
||||
|
||||
/**
|
||||
* Calls the `doProcedureUpdate` method on all blocks which implement it.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export function triggerProceduresUpdate(workspace: Workspace) {
|
||||
for (const block of workspace.getAllBlocks(false)) {
|
||||
if (isProcedureBlock(block)) {
|
||||
block.doProcedureUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,6 +280,10 @@ export class RenderedConnection extends Connection {
|
||||
|
||||
/** Add highlighting around this connection. */
|
||||
highlight() {
|
||||
if (this.highlightPath) {
|
||||
// This connection is already highlighted
|
||||
return;
|
||||
}
|
||||
let steps;
|
||||
const sourceBlockSvg = (this.sourceBlock_);
|
||||
const renderConstants =
|
||||
@@ -495,7 +499,7 @@ export class RenderedConnection extends Connection {
|
||||
* @returns List of connections.
|
||||
* @internal
|
||||
*/
|
||||
override neighbours(maxLimit: number): Connection[] {
|
||||
override neighbours(maxLimit: number): RenderedConnection[] {
|
||||
return this.dbOpposite_.getNeighbours(this, maxLimit);
|
||||
}
|
||||
|
||||
|
||||
@@ -658,12 +658,7 @@ export class ConstantProvider {
|
||||
* @param blockStyle A full or partial block style object.
|
||||
* @returns A full block style object, with all required properties populated.
|
||||
*/
|
||||
protected validatedBlockStyle_(blockStyle: {
|
||||
colourPrimary: string,
|
||||
colourSecondary?: string,
|
||||
colourTertiary?: string,
|
||||
hat?: string
|
||||
}): BlockStyle {
|
||||
protected validatedBlockStyle_(blockStyle: Partial<BlockStyle>): BlockStyle {
|
||||
// Make a new object with all of the same properties.
|
||||
const valid = {} as BlockStyle;
|
||||
if (blockStyle) {
|
||||
|
||||
@@ -137,10 +137,6 @@ export class PathObject implements IPathObject {
|
||||
* @internal
|
||||
*/
|
||||
applyColour(block: BlockSvg) {
|
||||
if (!this.style.colourTertiary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
this.svgPath.setAttribute('stroke', this.style.colourTertiary);
|
||||
this.svgPath.setAttribute('fill', this.style.colourPrimary);
|
||||
|
||||
@@ -199,10 +195,6 @@ export class PathObject implements IPathObject {
|
||||
*/
|
||||
protected updateShadow_(shadow: boolean) {
|
||||
if (shadow) {
|
||||
if (!this.style.colourSecondary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
this.svgPath.setAttribute('stroke', 'none');
|
||||
this.svgPath.setAttribute('fill', this.style.colourSecondary);
|
||||
}
|
||||
|
||||
@@ -77,19 +77,11 @@ export class PathObject extends BasePathObject {
|
||||
// Set shadow stroke colour.
|
||||
const parent = block.getParent();
|
||||
if (block.isShadow() && parent) {
|
||||
if (!parent.style.colourTertiary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
this.svgPath.setAttribute('stroke', parent.style.colourTertiary);
|
||||
}
|
||||
|
||||
// Apply colour to outlines.
|
||||
for (const outline of this.outlines.values()) {
|
||||
if (!this.style.colourTertiary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
outline.setAttribute('fill', this.style.colourTertiary);
|
||||
}
|
||||
}
|
||||
@@ -183,10 +175,6 @@ export class PathObject extends BasePathObject {
|
||||
setOutlinePath(name: string, pathString: string) {
|
||||
const outline = this.getOutlinePath_(name);
|
||||
outline.setAttribute('d', pathString);
|
||||
if (!this.style.colourTertiary) {
|
||||
throw new Error(
|
||||
'The renderer did not properly initialize the block style');
|
||||
}
|
||||
outline.setAttribute('fill', this.style.colourTertiary);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,18 @@ export class Scrollbar {
|
||||
* @internal
|
||||
*/
|
||||
static readonly DEFAULT_SCROLLBAR_MARGIN = 0.5;
|
||||
private readonly pair_: boolean;
|
||||
private readonly margin_: number;
|
||||
|
||||
/** Whether this scrollbar is part of a pair. */
|
||||
private readonly pair: boolean;
|
||||
|
||||
/**
|
||||
* Margin around the scrollbar (between the scrollbar and the edge of the
|
||||
* viewport in pixels).
|
||||
*/
|
||||
private readonly margin: number;
|
||||
|
||||
/** Previously recorded metrics from the workspace. */
|
||||
private oldHostMetrics_: Metrics|null = null;
|
||||
private oldHostMetrics: Metrics|null = null;
|
||||
|
||||
/**
|
||||
* The ratio of handle position offset to workspace content displacement.
|
||||
@@ -60,7 +67,14 @@ export class Scrollbar {
|
||||
* @internal
|
||||
*/
|
||||
ratio = 1;
|
||||
private origin_: Coordinate;
|
||||
|
||||
/**
|
||||
* The location of the origin of the workspace that the scrollbar is in,
|
||||
* measured in CSS pixels relative to the injection div origin. This is
|
||||
* usually (0, 0). When the scrollbar is in a flyout it may have a
|
||||
* different origin.
|
||||
*/
|
||||
private origin = new Coordinate(0, 0);
|
||||
|
||||
/**
|
||||
* The position of the mouse along this scrollbar's major axis at the start
|
||||
@@ -69,45 +83,72 @@ export class Scrollbar {
|
||||
* coordinate of the mouse down event; for a vertical scrollbar it's the y
|
||||
* coordinate of the mouse down event.
|
||||
*/
|
||||
private startDragMouse_ = 0;
|
||||
private startDragMouse = 0;
|
||||
|
||||
/**
|
||||
* The length of the scrollbars (including the handle and the background),
|
||||
* in CSS pixels. This is equivalent to scrollbar background length and the
|
||||
* area within which the scrollbar handle can move.
|
||||
*/
|
||||
private scrollbarLength_ = 0;
|
||||
private scrollbarLength = 0;
|
||||
|
||||
/** The length of the scrollbar handle in CSS pixels. */
|
||||
private handleLength_ = 0;
|
||||
private handleLength = 0;
|
||||
|
||||
/**
|
||||
* The offset of the start of the handle from the scrollbar position, in CSS
|
||||
* pixels.
|
||||
*/
|
||||
private handlePosition_ = 0;
|
||||
private handlePosition = 0;
|
||||
|
||||
private startDragHandle = 0;
|
||||
|
||||
/** Whether the scrollbar handle is visible. */
|
||||
private isVisible_ = true;
|
||||
private isHandleVisible = true;
|
||||
|
||||
/** Whether the workspace containing this scrollbar is visible. */
|
||||
private containerVisible_ = true;
|
||||
private svgBackground_: SVGRectElement|null = null;
|
||||
private containerVisible = true;
|
||||
|
||||
private svgHandle_: SVGRectElement|null = null;
|
||||
/** The transparent background behind the handle. */
|
||||
private svgBackground: SVGRectElement;
|
||||
|
||||
private outerSvg_: SVGSVGElement|null = null;
|
||||
/** The visible handle that can be dragged around. */
|
||||
private svgHandle: SVGRectElement;
|
||||
|
||||
private svgGroup_: SVGGElement|null = null;
|
||||
position: Coordinate;
|
||||
/** The outermost SVG element, which contains all parts of the scrollbar. */
|
||||
private outerSvg: SVGSVGElement;
|
||||
|
||||
lengthAttribute_ = 'width';
|
||||
positionAttribute_ = 'x';
|
||||
onMouseDownBarWrapper_: browserEvents.Data|null;
|
||||
onMouseDownHandleWrapper_: browserEvents.Data|null;
|
||||
/**
|
||||
* The upper left corner of the scrollbar's SVG group in CSS pixels relative
|
||||
* to the scrollbar's origin. This is usually relative to the injection div
|
||||
* origin.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
position = new Coordinate(0, 0);
|
||||
|
||||
/**
|
||||
* The DOM attribute that controls the length of the scrollbar. Different
|
||||
* for horizontal and vertical scrollbars.
|
||||
*/
|
||||
lengthAttribute_: string;
|
||||
|
||||
/**
|
||||
* The DOM attribute that controls the position of the scrollbar.
|
||||
* Different for horizontal and vertical scrollbars.
|
||||
*/
|
||||
positionAttribute_: string;
|
||||
|
||||
/** Handler for mouse down events on the background of the scrollbar. */
|
||||
onMouseDownBarWrapper_: browserEvents.Data;
|
||||
|
||||
/** Handler for mouse down events on the handle of the scrollbar. */
|
||||
onMouseDownHandleWrapper_: browserEvents.Data;
|
||||
|
||||
/** Handler for mouse move events during scrollbar drags. */
|
||||
onMouseUpWrapper_: browserEvents.Data|null = null;
|
||||
|
||||
/** Handler for mouse up events to end scrollbar drags. */
|
||||
onMouseMoveWrapper_: browserEvents.Data|null = null;
|
||||
|
||||
/**
|
||||
@@ -120,82 +161,92 @@ export class Scrollbar {
|
||||
constructor(
|
||||
private workspace: WorkspaceSvg, private readonly horizontal: boolean,
|
||||
opt_pair?: boolean, opt_class?: string, opt_margin?: number) {
|
||||
/** Whether this scrollbar is part of a pair. */
|
||||
this.pair_ = opt_pair || false;
|
||||
/**
|
||||
* Margin around the scrollbar (between the scrollbar and the edge of the
|
||||
* viewport in pixels).
|
||||
*/
|
||||
this.margin_ = opt_margin !== undefined ?
|
||||
opt_margin :
|
||||
Scrollbar.DEFAULT_SCROLLBAR_MARGIN;
|
||||
this.pair = opt_pair || false;
|
||||
|
||||
/**
|
||||
* The location of the origin of the workspace that the scrollbar is in,
|
||||
* measured in CSS pixels relative to the injection div origin. This is
|
||||
* usually (0, 0). When the scrollbar is in a flyout it may have a
|
||||
* different origin.
|
||||
*/
|
||||
this.origin_ = new Coordinate(0, 0);
|
||||
this.margin = opt_margin !== undefined ? opt_margin :
|
||||
Scrollbar.DEFAULT_SCROLLBAR_MARGIN;
|
||||
|
||||
this.createDom_(opt_class);
|
||||
let className =
|
||||
'blocklyScrollbar' + (this.horizontal ? 'Horizontal' : 'Vertical');
|
||||
if (opt_class) {
|
||||
className += ' ' + opt_class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The upper left corner of the scrollbar's SVG group in CSS pixels relative
|
||||
* to the scrollbar's origin. This is usually relative to the injection div
|
||||
* origin.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
this.position = new Coordinate(0, 0);
|
||||
/* Create the following DOM:
|
||||
<svg class="blocklyScrollbarHorizontal optionalClass">
|
||||
<g>
|
||||
<rect class="blocklyScrollbarBackground" />
|
||||
<rect class="blocklyScrollbarHandle" rx="8" ry="8" />
|
||||
</g>
|
||||
</svg>
|
||||
*/
|
||||
this.outerSvg = dom.createSvgElement(Svg.SVG, {'class': className});
|
||||
// Child group to hold the handle and background together.
|
||||
const group = dom.createSvgElement(Svg.G, {}, this.outerSvg);
|
||||
|
||||
this.svgBackground = dom.createSvgElement(
|
||||
Svg.RECT, {'class': 'blocklyScrollbarBackground'}, group);
|
||||
|
||||
const radius = Math.floor((Scrollbar.scrollbarThickness - 5) / 2);
|
||||
this.svgHandle = dom.createSvgElement(
|
||||
Svg.RECT,
|
||||
{'class': 'blocklyScrollbarHandle', 'rx': radius, 'ry': radius}, group);
|
||||
|
||||
this.workspace.getThemeManager().subscribe(
|
||||
this.svgHandle, 'scrollbarColour', 'fill');
|
||||
this.workspace.getThemeManager().subscribe(
|
||||
this.svgHandle, 'scrollbarOpacity', 'fill-opacity');
|
||||
|
||||
// Add everything to the DOM.
|
||||
dom.insertAfter(this.outerSvg, this.workspace.getParentSvg());
|
||||
|
||||
this.setInitialThickness();
|
||||
|
||||
// Store the thickness in a temp variable for readability.
|
||||
const scrollbarThickness = Scrollbar.scrollbarThickness;
|
||||
if (horizontal) {
|
||||
this.svgBackground_!.setAttribute('height', String(scrollbarThickness));
|
||||
this.outerSvg_!.setAttribute('height', String(scrollbarThickness));
|
||||
this.svgHandle_!.setAttribute('height', String(scrollbarThickness - 5));
|
||||
this.svgHandle_!.setAttribute('y', String(2.5));
|
||||
this.lengthAttribute_ = 'width';
|
||||
this.positionAttribute_ = 'x';
|
||||
} else {
|
||||
this.svgBackground_!.setAttribute('width', String(scrollbarThickness));
|
||||
this.outerSvg_!.setAttribute('width', String(scrollbarThickness));
|
||||
this.svgHandle_!.setAttribute('width', String(scrollbarThickness - 5));
|
||||
this.svgHandle_!.setAttribute('x', String(2.5));
|
||||
|
||||
this.lengthAttribute_ = 'height';
|
||||
this.positionAttribute_ = 'y';
|
||||
}
|
||||
|
||||
this.onMouseDownBarWrapper_ = browserEvents.conditionalBind(
|
||||
this.svgBackground_!, 'mousedown', this, this.onMouseDownBar_);
|
||||
this.svgBackground, 'mousedown', this, this.onMouseDownBar);
|
||||
this.onMouseDownHandleWrapper_ = browserEvents.conditionalBind(
|
||||
this.svgHandle_!, 'mousedown', this, this.onMouseDownHandle_);
|
||||
this.svgHandle, 'mousedown', this, this.onMouseDownHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose of this scrollbar.
|
||||
* Unlink from all DOM elements to prevent memory leaks.
|
||||
* Set the size of the scrollbar DOM elements along the minor axis.
|
||||
*/
|
||||
private setInitialThickness() {
|
||||
const scrollbarThickness = Scrollbar.scrollbarThickness;
|
||||
if (this.horizontal) {
|
||||
this.svgBackground.setAttribute('height', String(scrollbarThickness));
|
||||
this.outerSvg.setAttribute('height', String(scrollbarThickness));
|
||||
this.svgHandle.setAttribute('height', String(scrollbarThickness - 5));
|
||||
this.svgHandle.setAttribute('y', String(2.5));
|
||||
} else {
|
||||
this.svgBackground.setAttribute('width', String(scrollbarThickness));
|
||||
this.outerSvg.setAttribute('width', String(scrollbarThickness));
|
||||
this.svgHandle.setAttribute('width', String(scrollbarThickness - 5));
|
||||
this.svgHandle.setAttribute('x', String(2.5));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose of this scrollbar. Remove DOM elements, event listeners,
|
||||
* and theme subscriptions.
|
||||
*
|
||||
* @suppress {checkTypes}
|
||||
*/
|
||||
dispose() {
|
||||
this.cleanUp_();
|
||||
if (this.onMouseDownBarWrapper_) {
|
||||
browserEvents.unbind(this.onMouseDownBarWrapper_);
|
||||
this.onMouseDownBarWrapper_ = null;
|
||||
}
|
||||
if (this.onMouseDownHandleWrapper_) {
|
||||
browserEvents.unbind(this.onMouseDownHandleWrapper_);
|
||||
this.onMouseDownHandleWrapper_ = null;
|
||||
}
|
||||
this.cleanUp();
|
||||
browserEvents.unbind(this.onMouseDownBarWrapper_);
|
||||
browserEvents.unbind(this.onMouseDownHandleWrapper_);
|
||||
|
||||
dom.removeNode(this.outerSvg_);
|
||||
this.outerSvg_ = null;
|
||||
this.svgGroup_ = null;
|
||||
this.svgBackground_ = null;
|
||||
if (this.svgHandle_) {
|
||||
this.workspace.getThemeManager().unsubscribe(this.svgHandle_);
|
||||
this.svgHandle_ = null;
|
||||
}
|
||||
dom.removeNode(this.outerSvg);
|
||||
this.workspace.getThemeManager().unsubscribe(this.svgHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,11 +256,11 @@ export class Scrollbar {
|
||||
* @param value Value that is potentially out of bounds, in CSS pixels.
|
||||
* @returns Constrained value, in CSS pixels.
|
||||
*/
|
||||
private constrainHandleLength_(value: number): number {
|
||||
private constrainHandleLength(value: number): number {
|
||||
if (value <= 0 || isNaN(value)) {
|
||||
value = 0;
|
||||
} else {
|
||||
value = Math.min(value, this.scrollbarLength_);
|
||||
value = Math.min(value, this.scrollbarLength);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -220,10 +271,10 @@ export class Scrollbar {
|
||||
*
|
||||
* @param newLength The new scrollbar handle length in CSS pixels.
|
||||
*/
|
||||
private setHandleLength_(newLength: number) {
|
||||
this.handleLength_ = newLength;
|
||||
this.svgHandle_!.setAttribute(
|
||||
this.lengthAttribute_, String(this.handleLength_));
|
||||
private setHandleLength(newLength: number) {
|
||||
this.handleLength = newLength;
|
||||
this.svgHandle.setAttribute(
|
||||
this.lengthAttribute_, String(this.handleLength));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,14 +284,14 @@ export class Scrollbar {
|
||||
* @param value Value that is potentially out of bounds, in CSS pixels.
|
||||
* @returns Constrained value, in CSS pixels.
|
||||
*/
|
||||
private constrainHandlePosition_(value: number): number {
|
||||
private constrainHandlePosition(value: number): number {
|
||||
if (value <= 0 || isNaN(value)) {
|
||||
value = 0;
|
||||
} else {
|
||||
// Handle length should never be greater than this.scrollbarLength_.
|
||||
// If the viewSize is greater than or equal to the scrollSize, the
|
||||
// handleLength will end up equal to this.scrollbarLength_.
|
||||
value = Math.min(value, this.scrollbarLength_ - this.handleLength_);
|
||||
value = Math.min(value, this.scrollbarLength - this.handleLength);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -252,9 +303,9 @@ export class Scrollbar {
|
||||
* @param newPosition The new scrollbar handle offset in CSS pixels.
|
||||
*/
|
||||
setHandlePosition(newPosition: number) {
|
||||
this.handlePosition_ = newPosition;
|
||||
this.svgHandle_!.setAttribute(
|
||||
this.positionAttribute_, String(this.handlePosition_));
|
||||
this.handlePosition = newPosition;
|
||||
this.svgHandle.setAttribute(
|
||||
this.positionAttribute_, String(this.handlePosition));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -263,12 +314,12 @@ export class Scrollbar {
|
||||
*
|
||||
* @param newSize The new scrollbar background length in CSS pixels.
|
||||
*/
|
||||
private setScrollbarLength_(newSize: number) {
|
||||
this.scrollbarLength_ = newSize;
|
||||
this.outerSvg_!.setAttribute(
|
||||
this.lengthAttribute_, String(this.scrollbarLength_));
|
||||
this.svgBackground_!.setAttribute(
|
||||
this.lengthAttribute_, String(this.scrollbarLength_));
|
||||
private setScrollbarLength(newSize: number) {
|
||||
this.scrollbarLength = newSize;
|
||||
this.outerSvg.setAttribute(
|
||||
this.lengthAttribute_, String(this.scrollbarLength));
|
||||
this.svgBackground.setAttribute(
|
||||
this.lengthAttribute_, String(this.scrollbarLength));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,12 +335,10 @@ export class Scrollbar {
|
||||
this.position.x = x;
|
||||
this.position.y = y;
|
||||
|
||||
const tempX = this.position.x + this.origin_.x;
|
||||
const tempY = this.position.y + this.origin_.y;
|
||||
const tempX = this.position.x + this.origin.x;
|
||||
const tempY = this.position.y + this.origin.y;
|
||||
const transform = 'translate(' + tempX + 'px,' + tempY + 'px)';
|
||||
if (this.outerSvg_) {
|
||||
dom.setCssTransform(this.outerSvg_, transform);
|
||||
}
|
||||
dom.setCssTransform(this.outerSvg, transform);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,21 +358,21 @@ export class Scrollbar {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.oldHostMetrics_ &&
|
||||
Scrollbar.metricsAreEquivalent_(hostMetrics, this.oldHostMetrics_)) {
|
||||
if (this.oldHostMetrics &&
|
||||
Scrollbar.metricsAreEquivalent(hostMetrics, this.oldHostMetrics)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.horizontal) {
|
||||
this.resizeHorizontal_(hostMetrics);
|
||||
this.resizeHorizontal(hostMetrics);
|
||||
} else {
|
||||
this.resizeVertical_(hostMetrics);
|
||||
this.resizeVertical(hostMetrics);
|
||||
}
|
||||
|
||||
this.oldHostMetrics_ = hostMetrics;
|
||||
this.oldHostMetrics = hostMetrics;
|
||||
|
||||
// Resizing may have caused some scrolling.
|
||||
this.updateMetrics_();
|
||||
this.updateMetrics();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -334,14 +383,14 @@ export class Scrollbar {
|
||||
* possibly fetched from the host object.
|
||||
* @returns Whether a resizeView is necessary.
|
||||
*/
|
||||
private requiresViewResize_(hostMetrics: Metrics): boolean {
|
||||
if (!this.oldHostMetrics_) {
|
||||
private requiresViewResize(hostMetrics: Metrics): boolean {
|
||||
if (!this.oldHostMetrics) {
|
||||
return true;
|
||||
}
|
||||
return this.oldHostMetrics_.viewWidth !== hostMetrics.viewWidth ||
|
||||
this.oldHostMetrics_.viewHeight !== hostMetrics.viewHeight ||
|
||||
this.oldHostMetrics_.absoluteLeft !== hostMetrics.absoluteLeft ||
|
||||
this.oldHostMetrics_.absoluteTop !== hostMetrics.absoluteTop;
|
||||
return this.oldHostMetrics.viewWidth !== hostMetrics.viewWidth ||
|
||||
this.oldHostMetrics.viewHeight !== hostMetrics.viewHeight ||
|
||||
this.oldHostMetrics.absoluteLeft !== hostMetrics.absoluteLeft ||
|
||||
this.oldHostMetrics.absoluteTop !== hostMetrics.absoluteTop;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,8 +399,8 @@ export class Scrollbar {
|
||||
* @param hostMetrics A data structure describing all the required dimensions,
|
||||
* possibly fetched from the host object.
|
||||
*/
|
||||
private resizeHorizontal_(hostMetrics: Metrics) {
|
||||
if (this.requiresViewResize_(hostMetrics)) {
|
||||
private resizeHorizontal(hostMetrics: Metrics) {
|
||||
if (this.requiresViewResize(hostMetrics)) {
|
||||
this.resizeViewHorizontal(hostMetrics);
|
||||
} else {
|
||||
this.resizeContentHorizontal(hostMetrics);
|
||||
@@ -367,22 +416,22 @@ export class Scrollbar {
|
||||
* possibly fetched from the host object.
|
||||
*/
|
||||
resizeViewHorizontal(hostMetrics: Metrics) {
|
||||
let viewSize = hostMetrics.viewWidth - this.margin_ * 2;
|
||||
if (this.pair_) {
|
||||
let viewSize = hostMetrics.viewWidth - this.margin * 2;
|
||||
if (this.pair) {
|
||||
// Shorten the scrollbar to make room for the corner square.
|
||||
viewSize -= Scrollbar.scrollbarThickness;
|
||||
}
|
||||
this.setScrollbarLength_(Math.max(0, viewSize));
|
||||
this.setScrollbarLength(Math.max(0, viewSize));
|
||||
|
||||
let xCoordinate = hostMetrics.absoluteLeft + this.margin_;
|
||||
if (this.pair_ && this.workspace.RTL) {
|
||||
let xCoordinate = hostMetrics.absoluteLeft + this.margin;
|
||||
if (this.pair && this.workspace.RTL) {
|
||||
xCoordinate += Scrollbar.scrollbarThickness;
|
||||
}
|
||||
|
||||
// Horizontal toolbar should always be just above the bottom of the
|
||||
// workspace.
|
||||
const yCoordinate = hostMetrics.absoluteTop + hostMetrics.viewHeight -
|
||||
Scrollbar.scrollbarThickness - this.margin_;
|
||||
Scrollbar.scrollbarThickness - this.margin;
|
||||
this.setPosition(xCoordinate, yCoordinate);
|
||||
|
||||
// If the view has been resized, a content resize will also be necessary.
|
||||
@@ -401,25 +450,25 @@ export class Scrollbar {
|
||||
if (hostMetrics.viewWidth >= hostMetrics.scrollWidth) {
|
||||
// viewWidth is often greater than scrollWidth in flyouts and
|
||||
// non-scrollable workspaces.
|
||||
this.setHandleLength_(this.scrollbarLength_);
|
||||
this.setHandleLength(this.scrollbarLength);
|
||||
this.setHandlePosition(0);
|
||||
if (!this.pair_) {
|
||||
if (!this.pair) {
|
||||
// The scrollbar isn't needed.
|
||||
// This doesn't apply to scrollbar pairs because interactions with the
|
||||
// corner square aren't handled.
|
||||
this.setVisible(false);
|
||||
}
|
||||
return;
|
||||
} else if (!this.pair_) {
|
||||
} else if (!this.pair) {
|
||||
// The scrollbar is needed. Only non-paired scrollbars are hidden/shown.
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
// Resize the handle.
|
||||
let handleLength =
|
||||
this.scrollbarLength_ * hostMetrics.viewWidth / hostMetrics.scrollWidth;
|
||||
handleLength = this.constrainHandleLength_(handleLength);
|
||||
this.setHandleLength_(handleLength);
|
||||
this.scrollbarLength * hostMetrics.viewWidth / hostMetrics.scrollWidth;
|
||||
handleLength = this.constrainHandleLength(handleLength);
|
||||
this.setHandleLength(handleLength);
|
||||
|
||||
// Compute the handle offset.
|
||||
// The position of the handle can be between:
|
||||
@@ -435,9 +484,9 @@ export class Scrollbar {
|
||||
// Percent of content to the left of our current position.
|
||||
const offsetRatio = contentDisplacement / maxScrollDistance;
|
||||
// Area available to scroll * percent to the left
|
||||
const maxHandleOffset = this.scrollbarLength_ - this.handleLength_;
|
||||
const maxHandleOffset = this.scrollbarLength - this.handleLength;
|
||||
let handleOffset = maxHandleOffset * offsetRatio;
|
||||
handleOffset = this.constrainHandlePosition_(handleOffset);
|
||||
handleOffset = this.constrainHandlePosition(handleOffset);
|
||||
this.setHandlePosition(handleOffset);
|
||||
|
||||
// Compute ratio (for use with set calls, which pass in content
|
||||
@@ -451,8 +500,8 @@ export class Scrollbar {
|
||||
* @param hostMetrics A data structure describing all the required dimensions,
|
||||
* possibly fetched from the host object.
|
||||
*/
|
||||
private resizeVertical_(hostMetrics: Metrics) {
|
||||
if (this.requiresViewResize_(hostMetrics)) {
|
||||
private resizeVertical(hostMetrics: Metrics) {
|
||||
if (this.requiresViewResize(hostMetrics)) {
|
||||
this.resizeViewVertical(hostMetrics);
|
||||
} else {
|
||||
this.resizeContentVertical(hostMetrics);
|
||||
@@ -467,19 +516,19 @@ export class Scrollbar {
|
||||
* possibly fetched from the host object.
|
||||
*/
|
||||
resizeViewVertical(hostMetrics: Metrics) {
|
||||
let viewSize = hostMetrics.viewHeight - this.margin_ * 2;
|
||||
if (this.pair_) {
|
||||
let viewSize = hostMetrics.viewHeight - this.margin * 2;
|
||||
if (this.pair) {
|
||||
// Shorten the scrollbar to make room for the corner square.
|
||||
viewSize -= Scrollbar.scrollbarThickness;
|
||||
}
|
||||
this.setScrollbarLength_(Math.max(0, viewSize));
|
||||
this.setScrollbarLength(Math.max(0, viewSize));
|
||||
|
||||
const xCoordinate = this.workspace.RTL ?
|
||||
hostMetrics.absoluteLeft + this.margin_ :
|
||||
hostMetrics.absoluteLeft + this.margin :
|
||||
hostMetrics.absoluteLeft + hostMetrics.viewWidth -
|
||||
Scrollbar.scrollbarThickness - this.margin_;
|
||||
Scrollbar.scrollbarThickness - this.margin;
|
||||
|
||||
const yCoordinate = hostMetrics.absoluteTop + this.margin_;
|
||||
const yCoordinate = hostMetrics.absoluteTop + this.margin;
|
||||
this.setPosition(xCoordinate, yCoordinate);
|
||||
|
||||
// If the view has been resized, a content resize will also be necessary.
|
||||
@@ -498,25 +547,25 @@ export class Scrollbar {
|
||||
if (hostMetrics.viewHeight >= hostMetrics.scrollHeight) {
|
||||
// viewHeight is often greater than scrollHeight in flyouts and
|
||||
// non-scrollable workspaces.
|
||||
this.setHandleLength_(this.scrollbarLength_);
|
||||
this.setHandleLength(this.scrollbarLength);
|
||||
this.setHandlePosition(0);
|
||||
if (!this.pair_) {
|
||||
if (!this.pair) {
|
||||
// The scrollbar isn't needed.
|
||||
// This doesn't apply to scrollbar pairs because interactions with the
|
||||
// corner square aren't handled.
|
||||
this.setVisible(false);
|
||||
}
|
||||
return;
|
||||
} else if (!this.pair_) {
|
||||
} else if (!this.pair) {
|
||||
// The scrollbar is needed. Only non-paired scrollbars are hidden/shown.
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
// Resize the handle.
|
||||
let handleLength = this.scrollbarLength_ * hostMetrics.viewHeight /
|
||||
let handleLength = this.scrollbarLength * hostMetrics.viewHeight /
|
||||
hostMetrics.scrollHeight;
|
||||
handleLength = this.constrainHandleLength_(handleLength);
|
||||
this.setHandleLength_(handleLength);
|
||||
handleLength = this.constrainHandleLength(handleLength);
|
||||
this.setHandleLength(handleLength);
|
||||
|
||||
// Compute the handle offset.
|
||||
// The position of the handle can be between:
|
||||
@@ -532,9 +581,9 @@ export class Scrollbar {
|
||||
// Percent of content to the left of our current position.
|
||||
const offsetRatio = contentDisplacement / maxScrollDistance;
|
||||
// Area available to scroll * percent to the left
|
||||
const maxHandleOffset = this.scrollbarLength_ - this.handleLength_;
|
||||
const maxHandleOffset = this.scrollbarLength - this.handleLength;
|
||||
let handleOffset = maxHandleOffset * offsetRatio;
|
||||
handleOffset = this.constrainHandlePosition_(handleOffset);
|
||||
handleOffset = this.constrainHandlePosition(handleOffset);
|
||||
this.setHandlePosition(handleOffset);
|
||||
|
||||
// Compute ratio (for use with set calls, which pass in content
|
||||
@@ -542,42 +591,6 @@ export class Scrollbar {
|
||||
this.ratio = maxHandleOffset / maxScrollDistance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create all the DOM elements required for a scrollbar.
|
||||
* The resulting widget is not sized.
|
||||
*
|
||||
* @param opt_class A class to be applied to this scrollbar.
|
||||
*/
|
||||
private createDom_(opt_class?: string) {
|
||||
/* Create the following DOM:
|
||||
<svg class="blocklyScrollbarHorizontal optionalClass">
|
||||
<g>
|
||||
<rect class="blocklyScrollbarBackground" />
|
||||
<rect class="blocklyScrollbarHandle" rx="8" ry="8" />
|
||||
</g>
|
||||
</svg>
|
||||
*/
|
||||
let className =
|
||||
'blocklyScrollbar' + (this.horizontal ? 'Horizontal' : 'Vertical');
|
||||
if (opt_class) {
|
||||
className += ' ' + opt_class;
|
||||
}
|
||||
this.outerSvg_ = dom.createSvgElement(Svg.SVG, {'class': className});
|
||||
this.svgGroup_ = dom.createSvgElement(Svg.G, {}, this.outerSvg_);
|
||||
this.svgBackground_ = dom.createSvgElement(
|
||||
Svg.RECT, {'class': 'blocklyScrollbarBackground'}, this.svgGroup_);
|
||||
const radius = Math.floor((Scrollbar.scrollbarThickness - 5) / 2);
|
||||
this.svgHandle_ = dom.createSvgElement(
|
||||
Svg.RECT,
|
||||
{'class': 'blocklyScrollbarHandle', 'rx': radius, 'ry': radius},
|
||||
this.svgGroup_);
|
||||
this.workspace.getThemeManager().subscribe(
|
||||
this.svgHandle_!, 'scrollbarColour', 'fill');
|
||||
this.workspace.getThemeManager().subscribe(
|
||||
this.svgHandle_!, 'scrollbarOpacity', 'fill-opacity');
|
||||
dom.insertAfter(this.outerSvg_!, this.workspace.getParentSvg());
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the scrollbar visible. Non-paired scrollbars disappear when they aren't
|
||||
* needed.
|
||||
@@ -585,7 +598,7 @@ export class Scrollbar {
|
||||
* @returns True if visible.
|
||||
*/
|
||||
isVisible(): boolean {
|
||||
return this.isVisible_;
|
||||
return this.isHandleVisible;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -595,9 +608,9 @@ export class Scrollbar {
|
||||
* @param visible Whether the container is visible
|
||||
*/
|
||||
setContainerVisible(visible: boolean) {
|
||||
const visibilityChanged = visible !== this.containerVisible_;
|
||||
const visibilityChanged = visible !== this.containerVisible;
|
||||
|
||||
this.containerVisible_ = visible;
|
||||
this.containerVisible = visible;
|
||||
if (visibilityChanged) {
|
||||
this.updateDisplay_();
|
||||
}
|
||||
@@ -614,10 +627,10 @@ export class Scrollbar {
|
||||
|
||||
// Ideally this would also apply to scrollbar pairs, but that's a bigger
|
||||
// headache (due to interactions with the corner square).
|
||||
if (this.pair_) {
|
||||
if (this.pair) {
|
||||
throw Error('Unable to toggle visibility of paired scrollbars.');
|
||||
}
|
||||
this.isVisible_ = visible;
|
||||
this.isHandleVisible = visible;
|
||||
if (visibilityChanged) {
|
||||
this.updateDisplay_();
|
||||
}
|
||||
@@ -632,15 +645,15 @@ export class Scrollbar {
|
||||
updateDisplay_() {
|
||||
let show = true;
|
||||
// Check whether our parent/container is visible.
|
||||
if (!this.containerVisible_) {
|
||||
if (!this.containerVisible) {
|
||||
show = false;
|
||||
} else {
|
||||
show = this.isVisible();
|
||||
}
|
||||
if (show) {
|
||||
this.outerSvg_!.setAttribute('display', 'block');
|
||||
this.outerSvg.setAttribute('display', 'block');
|
||||
} else {
|
||||
this.outerSvg_!.setAttribute('display', 'none');
|
||||
this.outerSvg.setAttribute('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,10 +663,10 @@ export class Scrollbar {
|
||||
*
|
||||
* @param e Mouse down event.
|
||||
*/
|
||||
private onMouseDownBar_(e: MouseEvent) {
|
||||
private onMouseDownBar(e: MouseEvent) {
|
||||
this.workspace.markFocused();
|
||||
Touch.clearTouchIdentifier(); // This is really a click.
|
||||
this.cleanUp_();
|
||||
this.cleanUp();
|
||||
if (browserEvents.isRightButton(e)) {
|
||||
// Right-click.
|
||||
// Scrollbars have no context menu.
|
||||
@@ -664,22 +677,22 @@ export class Scrollbar {
|
||||
e, this.workspace.getParentSvg(), this.workspace.getInverseScreenCTM());
|
||||
const mouseLocation = this.horizontal ? mouseXY.x : mouseXY.y;
|
||||
|
||||
const handleXY = svgMath.getInjectionDivXY(this.svgHandle_ as Element);
|
||||
const handleXY = svgMath.getInjectionDivXY(this.svgHandle);
|
||||
const handleStart = this.horizontal ? handleXY.x : handleXY.y;
|
||||
let handlePosition = this.handlePosition_;
|
||||
let handlePosition = this.handlePosition;
|
||||
|
||||
const pageLength = this.handleLength_ * 0.95;
|
||||
const pageLength = this.handleLength * 0.95;
|
||||
if (mouseLocation <= handleStart) {
|
||||
// Decrease the scrollbar's value by a page.
|
||||
handlePosition -= pageLength;
|
||||
} else if (mouseLocation >= handleStart + this.handleLength_) {
|
||||
} else if (mouseLocation >= handleStart + this.handleLength) {
|
||||
// Increase the scrollbar's value by a page.
|
||||
handlePosition += pageLength;
|
||||
}
|
||||
|
||||
this.setHandlePosition(this.constrainHandlePosition_(handlePosition));
|
||||
this.setHandlePosition(this.constrainHandlePosition(handlePosition));
|
||||
|
||||
this.updateMetrics_();
|
||||
this.updateMetrics();
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
@@ -690,9 +703,9 @@ export class Scrollbar {
|
||||
*
|
||||
* @param e Mouse down event.
|
||||
*/
|
||||
private onMouseDownHandle_(e: MouseEvent) {
|
||||
private onMouseDownHandle(e: MouseEvent) {
|
||||
this.workspace.markFocused();
|
||||
this.cleanUp_();
|
||||
this.cleanUp();
|
||||
if (browserEvents.isRightButton(e)) {
|
||||
// Right-click.
|
||||
// Scrollbars have no context menu.
|
||||
@@ -700,7 +713,7 @@ export class Scrollbar {
|
||||
return;
|
||||
}
|
||||
// Look up the current translation and record it.
|
||||
this.startDragHandle = this.handlePosition_;
|
||||
this.startDragHandle = this.handlePosition;
|
||||
|
||||
// Tell the workspace to setup its drag surface since it is about to move.
|
||||
// onMouseMoveHandle will call onScroll which actually tells the workspace
|
||||
@@ -708,11 +721,11 @@ export class Scrollbar {
|
||||
this.workspace.setupDragSurface();
|
||||
|
||||
// Record the current mouse position.
|
||||
this.startDragMouse_ = this.horizontal ? e.clientX : e.clientY;
|
||||
this.startDragMouse = this.horizontal ? e.clientX : e.clientY;
|
||||
this.onMouseUpWrapper_ = browserEvents.conditionalBind(
|
||||
document, 'mouseup', this, this.onMouseUpHandle_);
|
||||
document, 'mouseup', this, this.onMouseUpHandle);
|
||||
this.onMouseMoveWrapper_ = browserEvents.conditionalBind(
|
||||
document, 'mousemove', this, this.onMouseMoveHandle_);
|
||||
document, 'mousemove', this, this.onMouseMoveHandle);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
@@ -722,28 +735,28 @@ export class Scrollbar {
|
||||
*
|
||||
* @param e Mouse move event.
|
||||
*/
|
||||
private onMouseMoveHandle_(e: MouseEvent) {
|
||||
private onMouseMoveHandle(e: MouseEvent) {
|
||||
const currentMouse = this.horizontal ? e.clientX : e.clientY;
|
||||
const mouseDelta = currentMouse - this.startDragMouse_;
|
||||
const mouseDelta = currentMouse - this.startDragMouse;
|
||||
const handlePosition = this.startDragHandle + mouseDelta;
|
||||
// Position the bar.
|
||||
this.setHandlePosition(this.constrainHandlePosition_(handlePosition));
|
||||
this.updateMetrics_();
|
||||
this.setHandlePosition(this.constrainHandlePosition(handlePosition));
|
||||
this.updateMetrics();
|
||||
}
|
||||
|
||||
/** Release the scrollbar handle and reset state accordingly. */
|
||||
private onMouseUpHandle_() {
|
||||
private onMouseUpHandle() {
|
||||
// Tell the workspace to clean up now that the workspace is done moving.
|
||||
this.workspace.resetDragSurface();
|
||||
Touch.clearTouchIdentifier();
|
||||
this.cleanUp_();
|
||||
this.cleanUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide chaff and stop binding to mouseup and mousemove events. Call this to
|
||||
* wrap up loose ends associated with the scrollbar.
|
||||
*/
|
||||
private cleanUp_() {
|
||||
private cleanUp() {
|
||||
this.workspace.hideChaff(true);
|
||||
if (this.onMouseUpWrapper_) {
|
||||
browserEvents.unbind(this.onMouseUpWrapper_);
|
||||
@@ -762,8 +775,8 @@ export class Scrollbar {
|
||||
* @internal
|
||||
*/
|
||||
getRatio_(): number {
|
||||
const scrollHandleRange = this.scrollbarLength_ - this.handleLength_;
|
||||
let ratio = this.handlePosition_ / scrollHandleRange;
|
||||
const scrollHandleRange = this.scrollbarLength - this.handleLength;
|
||||
let ratio = this.handlePosition / scrollHandleRange;
|
||||
if (isNaN(ratio)) {
|
||||
ratio = 0;
|
||||
}
|
||||
@@ -774,7 +787,7 @@ export class Scrollbar {
|
||||
* Updates workspace metrics based on new scroll ratio. Called when scrollbar
|
||||
* is moved.
|
||||
*/
|
||||
private updateMetrics_() {
|
||||
private updateMetrics() {
|
||||
const ratio = this.getRatio_();
|
||||
if (this.horizontal) {
|
||||
this.workspace.setMetrics({x: ratio});
|
||||
@@ -791,9 +804,9 @@ export class Scrollbar {
|
||||
* Defaults to true.
|
||||
*/
|
||||
set(value: number, updateMetrics?: boolean) {
|
||||
this.setHandlePosition(this.constrainHandlePosition_(value * this.ratio));
|
||||
this.setHandlePosition(this.constrainHandlePosition(value * this.ratio));
|
||||
if (updateMetrics || updateMetrics === undefined) {
|
||||
this.updateMetrics_();
|
||||
this.updateMetrics();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -807,7 +820,7 @@ export class Scrollbar {
|
||||
* @param y The y coordinate of the scrollbar's origin, in CSS pixels.
|
||||
*/
|
||||
setOrigin(x: number, y: number) {
|
||||
this.origin_ = new Coordinate(x, y);
|
||||
this.origin = new Coordinate(x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -816,7 +829,7 @@ export class Scrollbar {
|
||||
* workspace.
|
||||
* @returns Whether the two sets of metrics are equivalent.
|
||||
*/
|
||||
private static metricsAreEquivalent_(first: Metrics, second: Metrics):
|
||||
private static metricsAreEquivalent(first: Metrics, second: Metrics):
|
||||
boolean {
|
||||
return first.viewWidth === second.viewWidth &&
|
||||
first.viewHeight === second.viewHeight &&
|
||||
|
||||
31
core/serialization.ts
Normal file
31
core/serialization.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Serialization methods.
|
||||
*/
|
||||
import * as goog from '../closure/goog/goog.js';
|
||||
goog.declareModuleId('Blockly.serialization');
|
||||
|
||||
import * as blocks from './serialization/blocks.js';
|
||||
import * as exceptions from './serialization/exceptions.js';
|
||||
import * as priorities from './serialization/priorities.js';
|
||||
import * as procedures from './serialization/procedures.js';
|
||||
import * as registry from './serialization/registry.js';
|
||||
import * as variables from './serialization/variables.js';
|
||||
import * as workspaces from './serialization/workspaces.js';
|
||||
import {ISerializer} from './interfaces/i_serializer.js';
|
||||
|
||||
export {
|
||||
blocks,
|
||||
exceptions,
|
||||
priorities,
|
||||
procedures,
|
||||
registry,
|
||||
variables,
|
||||
workspaces,
|
||||
ISerializer,
|
||||
};
|
||||
@@ -665,7 +665,7 @@ const saveBlock = save;
|
||||
*
|
||||
* @alias Blockly.serialization.blocks.BlockSerializer
|
||||
*/
|
||||
class BlockSerializer implements ISerializer {
|
||||
export class BlockSerializer implements ISerializer {
|
||||
priority: number;
|
||||
|
||||
/* eslint-disable-next-line require-jsdoc */
|
||||
|
||||
@@ -21,6 +21,12 @@ goog.declareModuleId('Blockly.serialization.priorities');
|
||||
* @alias Blockly.serialization.priorities.VARIABLES
|
||||
*/
|
||||
export const VARIABLES = 100;
|
||||
|
||||
/**
|
||||
* The priority for deserializing variable data.
|
||||
*/
|
||||
export const PROCEDURES = 75;
|
||||
|
||||
/**
|
||||
* The priority for deserializing blocks.
|
||||
*
|
||||
|
||||
156
core/serialization/procedures.ts
Normal file
156
core/serialization/procedures.ts
Normal file
@@ -0,0 +1,156 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {IParameterModel} from '../interfaces/i_parameter_model.js';
|
||||
import {IProcedureModel} from '../interfaces/i_procedure_model.js';
|
||||
import type {ISerializer} from '../interfaces/i_serializer.js';
|
||||
import {ObservableProcedureModel} from '../procedures/observable_procedure_model.js';
|
||||
import {ObservableParameterModel} from '../procedures/observable_parameter_model.js';
|
||||
import * as priorities from './priorities.js';
|
||||
// import * as serializationRegistry from './registry.js';
|
||||
import type {Workspace} from '../workspace.js';
|
||||
|
||||
|
||||
/**
|
||||
* Representation of a procedure data model.
|
||||
*/
|
||||
export interface State {
|
||||
id: string, name: string, returnTypes: string[]|null,
|
||||
parameters?: ParameterState[],
|
||||
}
|
||||
|
||||
/**
|
||||
* Representation of a parameter data model.
|
||||
*/
|
||||
export interface ParameterState {
|
||||
id: string, name: string, types?: string[],
|
||||
}
|
||||
|
||||
/**
|
||||
* A newable signature for an IProcedureModel.
|
||||
*
|
||||
* Refer to
|
||||
* https://www.typescriptlang.org/docs/handbook/2/generics.html#using-class-types-in-generics
|
||||
* for what is going on with this.
|
||||
*/
|
||||
type ProcedureModelConstructor<ProcedureModel extends IProcedureModel> =
|
||||
new (workspace: Workspace, name: string, id: string) => ProcedureModel;
|
||||
|
||||
/**
|
||||
* A newable signature for an IParameterModel.
|
||||
*
|
||||
* Refer to
|
||||
* https://www.typescriptlang.org/docs/handbook/2/generics.html#using-class-types-in-generics
|
||||
* for what is going on with this.
|
||||
*/
|
||||
type ParameterModelConstructor<ParameterModel extends IParameterModel> =
|
||||
new (workspace: Workspace, name: string, id: string) => ParameterModel;
|
||||
|
||||
|
||||
/** Serializes the given IProcedureModel to JSON. */
|
||||
function saveProcedure(proc: IProcedureModel): State {
|
||||
const state: State = {
|
||||
id: proc.getId(),
|
||||
name: proc.getName(),
|
||||
returnTypes: proc.getReturnTypes(),
|
||||
};
|
||||
if (!proc.getParameters().length) return state;
|
||||
state.parameters = proc.getParameters().map((param) => saveParameter(param));
|
||||
return state;
|
||||
}
|
||||
|
||||
/** Serializes the given IParameterModel to JSON. */
|
||||
function saveParameter(param: IParameterModel): ParameterState {
|
||||
const state: ParameterState = {
|
||||
id: param.getId(),
|
||||
name: param.getName(),
|
||||
};
|
||||
if (!param.getTypes().length) return state;
|
||||
state.types = param.getTypes();
|
||||
return state;
|
||||
}
|
||||
|
||||
/** Deserializes the given procedure model State from JSON. */
|
||||
function
|
||||
loadProcedure<ProcedureModel extends IProcedureModel,
|
||||
ParameterModel extends IParameterModel>(
|
||||
procedureModelClass: ProcedureModelConstructor<ProcedureModel>,
|
||||
parameterModelClass: ParameterModelConstructor<ParameterModel>,
|
||||
state: State, workspace: Workspace): ProcedureModel {
|
||||
const proc = new procedureModelClass(workspace, state.name, state.id)
|
||||
.setReturnTypes(state.returnTypes);
|
||||
if (!state.parameters) return proc;
|
||||
for (const [index, param] of state.parameters.entries()) {
|
||||
proc.insertParameter(
|
||||
loadParameter(parameterModelClass, param, workspace), index);
|
||||
}
|
||||
return proc;
|
||||
}
|
||||
|
||||
/** Deserializes the given ParameterState from JSON. */
|
||||
function loadParameter<ParameterModel extends IParameterModel>(
|
||||
parameterModelClass: ParameterModelConstructor<ParameterModel>,
|
||||
state: ParameterState, workspace: Workspace): ParameterModel {
|
||||
return new parameterModelClass(workspace, state.name, state.id)
|
||||
.setTypes(state.types || []);
|
||||
}
|
||||
|
||||
/** Serializer for saving and loading procedure state. */
|
||||
export class ProcedureSerializer<ProcedureModel extends IProcedureModel,
|
||||
ParameterModel extends
|
||||
IParameterModel> implements ISerializer {
|
||||
public priority = priorities.PROCEDURES;
|
||||
|
||||
/**
|
||||
* Constructs the procedure serializer.
|
||||
*
|
||||
* Example usage:
|
||||
* new ProcedureSerializer(MyProcedureModelClass, MyParameterModelClass)
|
||||
*
|
||||
* @param procedureModelClass The class (implementing IProcedureModel) that
|
||||
* you want this serializer to deserialize.
|
||||
* @param parameterModelClass The class (implementing IParameterModel) that
|
||||
* you want this serializer to deserialize.
|
||||
*/
|
||||
constructor(
|
||||
private readonly procedureModelClass:
|
||||
ProcedureModelConstructor<ProcedureModel>,
|
||||
private readonly parameterModelClass:
|
||||
ParameterModelConstructor<ParameterModel>) {}
|
||||
|
||||
/** Serializes the procedure models of the given workspace. */
|
||||
save(workspace: Workspace): State[]|null {
|
||||
return workspace.getProcedureMap().getProcedures().map(
|
||||
(proc) => saveProcedure(proc));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the procedures models defined by the given state into the
|
||||
* workspace.
|
||||
*/
|
||||
load(state: State[], workspace: Workspace) {
|
||||
const map = workspace.getProcedureMap();
|
||||
for (const procState of state) {
|
||||
map.add(loadProcedure(
|
||||
this.procedureModelClass, this.parameterModelClass, procState,
|
||||
workspace));
|
||||
}
|
||||
}
|
||||
|
||||
/** Disposes of any procedure models that exist on the workspace. */
|
||||
clear(workspace: Workspace) {
|
||||
workspace.getProcedureMap().clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A ProcedureSerializer that deserializes to create the built-in
|
||||
* ObservableProcedureModels and ObservableParameterModels.
|
||||
*/
|
||||
export const observableProcedureSerializer =
|
||||
new ProcedureSerializer(ObservableProcedureModel, ObservableParameterModel);
|
||||
|
||||
// serializationRegistry.register('procedures', observableProcedureSerializer);
|
||||
@@ -36,7 +36,7 @@ export interface State {
|
||||
*
|
||||
* @alias Blockly.serialization.variables.VariableSerializer
|
||||
*/
|
||||
class VariableSerializer implements ISerializer {
|
||||
export class VariableSerializer implements ISerializer {
|
||||
priority: number;
|
||||
|
||||
/* eslint-disable-next-line require-jsdoc */
|
||||
|
||||
@@ -34,7 +34,7 @@ export enum names {
|
||||
CUT = 'cut',
|
||||
PASTE = 'paste',
|
||||
UNDO = 'undo',
|
||||
REDO = 'redo'
|
||||
REDO = 'redo',
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,8 +56,7 @@ export class ShortcutRegistry {
|
||||
register(shortcut: KeyboardShortcut, opt_allowOverrides?: boolean) {
|
||||
const registeredShortcut = this.shortcuts.get(shortcut.name);
|
||||
if (registeredShortcut && !opt_allowOverrides) {
|
||||
throw new Error(
|
||||
'Shortcut with name "' + shortcut.name + '" already exists.');
|
||||
throw new Error(`Shortcut named "${shortcut.name}" already exists.`);
|
||||
}
|
||||
this.shortcuts.set(shortcut.name, shortcut);
|
||||
|
||||
@@ -81,8 +80,7 @@ export class ShortcutRegistry {
|
||||
const shortcut = this.shortcuts.get(shortcutName);
|
||||
|
||||
if (!shortcut) {
|
||||
console.warn(
|
||||
'Keyboard shortcut with name "' + shortcutName + '" not found.');
|
||||
console.warn(`Keyboard shortcut named "${shortcutName}" not found.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -110,9 +108,8 @@ export class ShortcutRegistry {
|
||||
keyCode = String(keyCode);
|
||||
const shortcutNames = this.keyMap.get(keyCode);
|
||||
if (shortcutNames && !opt_allowCollision) {
|
||||
throw new Error(
|
||||
'Shortcut with name "' + shortcutName + '" collides with shortcuts ' +
|
||||
shortcutNames.toString());
|
||||
throw new Error(`Shortcut named "${
|
||||
shortcutName}" collides with shortcuts "${shortcutNames}"`);
|
||||
} else if (shortcutNames && opt_allowCollision) {
|
||||
shortcutNames.unshift(shortcutName);
|
||||
} else {
|
||||
@@ -138,9 +135,8 @@ export class ShortcutRegistry {
|
||||
|
||||
if (!shortcutNames) {
|
||||
if (!opt_quiet) {
|
||||
console.warn(
|
||||
'No keyboard shortcut with name "' + shortcutName +
|
||||
'" registered with key code "' + keyCode + '"');
|
||||
console.warn(`No keyboard shortcut named "${
|
||||
shortcutName}" registered with key code "${keyCode}"`);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -154,9 +150,8 @@ export class ShortcutRegistry {
|
||||
return true;
|
||||
}
|
||||
if (!opt_quiet) {
|
||||
console.warn(
|
||||
'No keyboard shortcut with name "' + shortcutName +
|
||||
'" registered with key code "' + keyCode + '"');
|
||||
console.warn(`No keyboard shortcut named "${
|
||||
shortcutName}" registered with key code "${keyCode}"`);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import * as object from './utils/object.js';
|
||||
|
||||
|
||||
export interface ITheme {
|
||||
blockStyles?: {[key: string]: BlockStyle};
|
||||
blockStyles?: {[key: string]: Partial<BlockStyle>};
|
||||
categoryStyles?: {[key: string]: CategoryStyle};
|
||||
componentStyles?: ComponentStyle;
|
||||
fontStyle?: FontStyle;
|
||||
@@ -58,7 +58,8 @@ export class Theme implements ITheme {
|
||||
* @param opt_componentStyles A map of Blockly component names to style value.
|
||||
*/
|
||||
constructor(
|
||||
public name: string, opt_blockStyles?: {[key: string]: BlockStyle},
|
||||
public name: string,
|
||||
opt_blockStyles?: {[key: string]: Partial<BlockStyle>},
|
||||
opt_categoryStyles?: {[key: string]: CategoryStyle},
|
||||
opt_componentStyles?: ComponentStyle) {
|
||||
/** The block styles map. */
|
||||
@@ -187,9 +188,9 @@ export class Theme implements ITheme {
|
||||
export namespace Theme {
|
||||
export interface BlockStyle {
|
||||
colourPrimary: string;
|
||||
colourSecondary?: string;
|
||||
colourTertiary?: string;
|
||||
hat?: string;
|
||||
colourSecondary: string;
|
||||
colourTertiary: string;
|
||||
hat: string;
|
||||
}
|
||||
|
||||
export interface CategoryStyle {
|
||||
|
||||
@@ -29,8 +29,7 @@ function tokenizeInterpolationInternal(
|
||||
message: string, parseInterpolationTokens: boolean): (string|number)[] {
|
||||
const tokens = [];
|
||||
const chars = message.split('');
|
||||
chars.push( // End marker.
|
||||
'');
|
||||
chars.push(''); // End marker.
|
||||
// Parse the message with a finite state machine.
|
||||
// 0 - Base case.
|
||||
// 1 - % found.
|
||||
|
||||
@@ -30,10 +30,10 @@ import {Svg} from './utils/svg.js';
|
||||
* @alias Blockly.Warning
|
||||
*/
|
||||
export class Warning extends Icon {
|
||||
private text_: {[key: string]: string};
|
||||
private text: {[key: string]: string};
|
||||
|
||||
/** The top-level node of the warning text, or null if not created. */
|
||||
private paragraphElement_: SVGTextElement|null = null;
|
||||
private paragraphElement: SVGTextElement|null = null;
|
||||
|
||||
/** Does this icon get hidden when the block is collapsed? */
|
||||
override collapseHidden = false;
|
||||
@@ -42,8 +42,8 @@ export class Warning extends Icon {
|
||||
constructor(block: BlockSvg) {
|
||||
super(block);
|
||||
this.createIcon();
|
||||
// The text_ object can contain multiple warnings.
|
||||
this.text_ = Object.create(null);
|
||||
// The text object can contain multiple warnings.
|
||||
this.text = Object.create(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,27 +91,27 @@ export class Warning extends Icon {
|
||||
eventUtils.fire(new (eventUtils.get(eventUtils.BUBBLE_OPEN))(
|
||||
this.getBlock(), visible, 'warning'));
|
||||
if (visible) {
|
||||
this.createBubble_();
|
||||
this.createBubble();
|
||||
} else {
|
||||
this.disposeBubble_();
|
||||
this.disposeBubble();
|
||||
}
|
||||
}
|
||||
|
||||
/** Show the bubble. */
|
||||
private createBubble_() {
|
||||
this.paragraphElement_ = Bubble.textToDom(this.getText());
|
||||
private createBubble() {
|
||||
this.paragraphElement = Bubble.textToDom(this.getText());
|
||||
this.bubble_ = Bubble.createNonEditableBubble(
|
||||
this.paragraphElement_, this.getBlock(), this.iconXY_ as Coordinate);
|
||||
this.paragraphElement, this.getBlock(), this.iconXY_ as Coordinate);
|
||||
this.applyColour();
|
||||
}
|
||||
|
||||
/** Dispose of the bubble and references to it. */
|
||||
private disposeBubble_() {
|
||||
private disposeBubble() {
|
||||
if (this.bubble_) {
|
||||
this.bubble_.dispose();
|
||||
this.bubble_ = null;
|
||||
}
|
||||
this.paragraphElement_ = null;
|
||||
this.paragraphElement = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,13 +122,13 @@ export class Warning extends Icon {
|
||||
* warnings.
|
||||
*/
|
||||
setText(text: string, id: string) {
|
||||
if (this.text_[id] === text) {
|
||||
if (this.text[id] === text) {
|
||||
return;
|
||||
}
|
||||
if (text) {
|
||||
this.text_[id] = text;
|
||||
this.text[id] = text;
|
||||
} else {
|
||||
delete this.text_[id];
|
||||
delete this.text[id];
|
||||
}
|
||||
if (this.isVisible()) {
|
||||
this.setVisible(false);
|
||||
@@ -143,8 +143,8 @@ export class Warning extends Icon {
|
||||
*/
|
||||
getText(): string {
|
||||
const allWarnings = [];
|
||||
for (const id in this.text_) {
|
||||
allWarnings.push(this.text_[id]);
|
||||
for (const id in this.text) {
|
||||
allWarnings.push(this.text[id]);
|
||||
}
|
||||
return allWarnings.join('\n');
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ import type * as toolbox from './utils/toolbox.js';
|
||||
import {VariableMap} from './variable_map.js';
|
||||
import type {VariableModel} from './variable_model.js';
|
||||
import type {WorkspaceComment} from './workspace_comment.js';
|
||||
import {IProcedureMap} from './interfaces/i_procedure_map.js';
|
||||
import {ObservableProcedureMap} from './procedures.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -101,15 +103,16 @@ export class Workspace implements IASTNodeLocation {
|
||||
connectionDBList: ConnectionDB[] = [];
|
||||
connectionChecker: IConnectionChecker;
|
||||
|
||||
private readonly topBlocks_: Block[] = [];
|
||||
private readonly topComments_: WorkspaceComment[] = [];
|
||||
private readonly topBlocks: Block[] = [];
|
||||
private readonly topComments: WorkspaceComment[] = [];
|
||||
private readonly commentDB = new Map<string, WorkspaceComment>();
|
||||
private readonly listeners_: Function[] = [];
|
||||
private readonly listeners: Function[] = [];
|
||||
protected undoStack_: Abstract[] = [];
|
||||
protected redoStack_: Abstract[] = [];
|
||||
private readonly blockDB = new Map<string, Block>();
|
||||
private readonly typedBlocksDB = new Map<string, Block[]>();
|
||||
private variableMap_: VariableMap;
|
||||
private variableMap: VariableMap;
|
||||
private procedureMap: IProcedureMap = new ObservableProcedureMap(this);
|
||||
|
||||
/**
|
||||
* Blocks in the flyout can refer to variables that don't exist in the main
|
||||
@@ -119,7 +122,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* these by tracking "potential" variables in the flyout. These variables
|
||||
* become real when references to them are dragged into the main workspace.
|
||||
*/
|
||||
private potentialVariableMap_: VariableMap|null = null;
|
||||
private potentialVariableMap: VariableMap|null = null;
|
||||
|
||||
/** @param opt_options Dictionary of options. */
|
||||
constructor(opt_options?: Options) {
|
||||
@@ -142,7 +145,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* all of the named variables in the workspace, including variables that are
|
||||
* not currently in use.
|
||||
*/
|
||||
this.variableMap_ = new VariableMap(this);
|
||||
this.variableMap = new VariableMap(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +155,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @suppress {checkTypes}
|
||||
*/
|
||||
dispose() {
|
||||
this.listeners_.length = 0;
|
||||
this.listeners.length = 0;
|
||||
this.clear();
|
||||
// Remove from workspace database.
|
||||
common.unregisterWorkpace(this);
|
||||
@@ -193,7 +196,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @param block Block to add.
|
||||
*/
|
||||
addTopBlock(block: Block) {
|
||||
this.topBlocks_.push(block);
|
||||
this.topBlocks.push(block);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,7 +205,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @param block Block to remove.
|
||||
*/
|
||||
removeTopBlock(block: Block) {
|
||||
if (!arrayUtils.removeElem(this.topBlocks_, block)) {
|
||||
if (!arrayUtils.removeElem(this.topBlocks, block)) {
|
||||
throw Error('Block not present in workspace\'s list of top-most blocks.');
|
||||
}
|
||||
}
|
||||
@@ -215,8 +218,8 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @returns The top-level block objects.
|
||||
*/
|
||||
getTopBlocks(ordered: boolean): Block[] {
|
||||
// Copy the topBlocks_ list.
|
||||
const blocks = (new Array<Block>()).concat(this.topBlocks_);
|
||||
// Copy the topBlocks list.
|
||||
const blocks = (new Array<Block>()).concat(this.topBlocks);
|
||||
if (ordered && blocks.length > 1) {
|
||||
// AnyDuringMigration because: Property 'offset' does not exist on type
|
||||
// '(a: Block | WorkspaceComment, b: Block | WorkspaceComment) => number'.
|
||||
@@ -296,7 +299,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @internal
|
||||
*/
|
||||
addTopComment(comment: WorkspaceComment) {
|
||||
this.topComments_.push(comment);
|
||||
this.topComments.push(comment);
|
||||
|
||||
// Note: If the comment database starts to hold block comments, this may
|
||||
// need to move to a separate function.
|
||||
@@ -315,7 +318,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @internal
|
||||
*/
|
||||
removeTopComment(comment: WorkspaceComment) {
|
||||
if (!arrayUtils.removeElem(this.topComments_, comment)) {
|
||||
if (!arrayUtils.removeElem(this.topComments, comment)) {
|
||||
throw Error(
|
||||
'Comment not present in workspace\'s list of top-most ' +
|
||||
'comments.');
|
||||
@@ -334,8 +337,8 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @internal
|
||||
*/
|
||||
getTopComments(ordered: boolean): WorkspaceComment[] {
|
||||
// Copy the topComments_ list.
|
||||
const comments = (new Array<WorkspaceComment>()).concat(this.topComments_);
|
||||
// Copy the topComments list.
|
||||
const comments = (new Array<WorkspaceComment>()).concat(this.topComments);
|
||||
if (ordered && comments.length > 1) {
|
||||
// AnyDuringMigration because: Property 'offset' does not exist on type
|
||||
// '(a: Block | WorkspaceComment, b: Block | WorkspaceComment) => number'.
|
||||
@@ -393,18 +396,18 @@ export class Workspace implements IASTNodeLocation {
|
||||
if (!existingGroup) {
|
||||
eventUtils.setGroup(true);
|
||||
}
|
||||
while (this.topBlocks_.length) {
|
||||
this.topBlocks_[0].dispose(false);
|
||||
while (this.topBlocks.length) {
|
||||
this.topBlocks[0].dispose(false);
|
||||
}
|
||||
while (this.topComments_.length) {
|
||||
this.topComments_[this.topComments_.length - 1].dispose();
|
||||
while (this.topComments.length) {
|
||||
this.topComments[this.topComments.length - 1].dispose();
|
||||
}
|
||||
if (!existingGroup) {
|
||||
eventUtils.setGroup(false);
|
||||
}
|
||||
this.variableMap_.clear();
|
||||
if (this.potentialVariableMap_) {
|
||||
this.potentialVariableMap_.clear();
|
||||
this.variableMap.clear();
|
||||
if (this.potentialVariableMap) {
|
||||
this.potentialVariableMap.clear();
|
||||
}
|
||||
} finally {
|
||||
this.isClearing = false;
|
||||
@@ -420,7 +423,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @param newName New variable name.
|
||||
*/
|
||||
renameVariableById(id: string, newName: string) {
|
||||
this.variableMap_.renameVariableById(id, newName);
|
||||
this.variableMap.renameVariableById(id, newName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -436,7 +439,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
*/
|
||||
createVariable(name: string, opt_type?: string|null, opt_id?: string|null):
|
||||
VariableModel {
|
||||
return this.variableMap_.createVariable(name, opt_type, opt_id);
|
||||
return this.variableMap.createVariable(name, opt_type, opt_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -446,7 +449,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @returns Array of block usages.
|
||||
*/
|
||||
getVariableUsesById(id: string): Block[] {
|
||||
return this.variableMap_.getVariableUsesById(id);
|
||||
return this.variableMap.getVariableUsesById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,7 +459,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @param id ID of variable to delete.
|
||||
*/
|
||||
deleteVariableById(id: string) {
|
||||
this.variableMap_.deleteVariableById(id);
|
||||
this.variableMap.deleteVariableById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -470,7 +473,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
*/
|
||||
getVariable(name: string, opt_type?: string): VariableModel|null {
|
||||
// TODO (#1559): Possibly delete this function after resolving #1559.
|
||||
return this.variableMap_.getVariable(name, opt_type);
|
||||
return this.variableMap.getVariable(name, opt_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,7 +483,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @returns The variable with the given ID.
|
||||
*/
|
||||
getVariableById(id: string): VariableModel|null {
|
||||
return this.variableMap_.getVariableById(id);
|
||||
return this.variableMap.getVariableById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -492,7 +495,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* if none are found.
|
||||
*/
|
||||
getVariablesOfType(type: string|null): VariableModel[] {
|
||||
return this.variableMap_.getVariablesOfType(type);
|
||||
return this.variableMap.getVariablesOfType(type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -502,7 +505,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @internal
|
||||
*/
|
||||
getVariableTypes(): string[] {
|
||||
return this.variableMap_.getVariableTypes(this);
|
||||
return this.variableMap.getVariableTypes(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -511,7 +514,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @returns List of variable models.
|
||||
*/
|
||||
getAllVariables(): VariableModel[] {
|
||||
return this.variableMap_.getAllVariables();
|
||||
return this.variableMap.getAllVariables();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -520,7 +523,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @returns List of all variable names of all types.
|
||||
*/
|
||||
getAllVariableNames(): string[] {
|
||||
return this.variableMap_.getAllVariableNames();
|
||||
return this.variableMap.getAllVariableNames();
|
||||
}
|
||||
/* End functions that are just pass-throughs to the variable map. */
|
||||
/**
|
||||
@@ -697,7 +700,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @returns Obsolete return value, ignore.
|
||||
*/
|
||||
addChangeListener(func: Function): Function {
|
||||
this.listeners_.push(func);
|
||||
this.listeners.push(func);
|
||||
return func;
|
||||
}
|
||||
|
||||
@@ -707,7 +710,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @param func Function to stop calling.
|
||||
*/
|
||||
removeChangeListener(func: Function) {
|
||||
arrayUtils.removeElem(this.listeners_, func);
|
||||
arrayUtils.removeElem(this.listeners, func);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -723,8 +726,8 @@ export class Workspace implements IASTNodeLocation {
|
||||
this.undoStack_.shift();
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.listeners_.length; i++) {
|
||||
const func = this.listeners_[i];
|
||||
for (let i = 0; i < this.listeners.length; i++) {
|
||||
const func = this.listeners[i];
|
||||
func(event);
|
||||
}
|
||||
}
|
||||
@@ -798,7 +801,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @internal
|
||||
*/
|
||||
getPotentialVariableMap(): VariableMap|null {
|
||||
return this.potentialVariableMap_;
|
||||
return this.potentialVariableMap;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -807,7 +810,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @internal
|
||||
*/
|
||||
createPotentialVariableMap() {
|
||||
this.potentialVariableMap_ = new VariableMap(this);
|
||||
this.potentialVariableMap = new VariableMap(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -816,7 +819,7 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @returns The variable map.
|
||||
*/
|
||||
getVariableMap(): VariableMap {
|
||||
return this.variableMap_;
|
||||
return this.variableMap;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -826,7 +829,12 @@ export class Workspace implements IASTNodeLocation {
|
||||
* @internal
|
||||
*/
|
||||
setVariableMap(variableMap: VariableMap) {
|
||||
this.variableMap_ = variableMap;
|
||||
this.variableMap = variableMap;
|
||||
}
|
||||
|
||||
/** Returns the map of all procedures on the workpace. */
|
||||
getProcedureMap(): IProcedureMap {
|
||||
return this.procedureMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,7 +96,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* A wrapper function called when a resize event occurs.
|
||||
* You can pass the result to `eventHandling.unbind`.
|
||||
*/
|
||||
private resizeHandlerWrapper_: browserEvents.Data|null = null;
|
||||
private resizeHandlerWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/**
|
||||
* The render status of an SVG workspace.
|
||||
@@ -115,7 +115,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* Whether this workspace has resizes enabled.
|
||||
* Disable during batch operations for a performance improvement.
|
||||
*/
|
||||
private resizesEnabled_ = true;
|
||||
private resizesEnabled = true;
|
||||
|
||||
/**
|
||||
* Current horizontal scrolling offset in pixel units, relative to the
|
||||
@@ -188,19 +188,19 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
startScrollY = 0;
|
||||
|
||||
/** Distance from mouse to object being dragged. */
|
||||
private dragDeltaXY_: Coordinate|null = null;
|
||||
private dragDeltaXY: Coordinate|null = null;
|
||||
|
||||
/** Current scale. */
|
||||
scale = 1;
|
||||
|
||||
/** Cached scale value. Used to detect changes in viewport. */
|
||||
private oldScale_ = 1;
|
||||
private oldScale = 1;
|
||||
|
||||
/** Cached viewport top value. Used to detect changes in viewport. */
|
||||
private oldTop_ = 0;
|
||||
private oldTop = 0;
|
||||
|
||||
/** Cached viewport left value. Used to detect changes in viewport. */
|
||||
private oldLeft_ = 0;
|
||||
private oldLeft = 0;
|
||||
|
||||
/** The workspace's trashcan (if any). */
|
||||
trashcan: Trashcan|null = null;
|
||||
@@ -211,7 +211,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
/**
|
||||
* Fixed flyout providing blocks which may be dragged into this workspace.
|
||||
*/
|
||||
private flyout_: IFlyout|null = null;
|
||||
private flyout: IFlyout|null = null;
|
||||
|
||||
/**
|
||||
* Category-based toolbox providing blocks which may be dragged into this
|
||||
@@ -227,16 +227,16 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
currentGesture_: TouchGesture|null = null;
|
||||
|
||||
/** This workspace's surface for dragging blocks, if it exists. */
|
||||
private readonly blockDragSurface_: BlockDragSurfaceSvg|null = null;
|
||||
private readonly blockDragSurface: BlockDragSurfaceSvg|null = null;
|
||||
|
||||
/** This workspace's drag surface, if it exists. */
|
||||
private readonly workspaceDragSurface_: WorkspaceDragSurfaceSvg|null = null;
|
||||
private readonly workspaceDragSurface: WorkspaceDragSurfaceSvg|null = null;
|
||||
|
||||
/**
|
||||
* Whether to move workspace to the drag surface when it is dragged.
|
||||
* True if it should move, false if it should be translated directly.
|
||||
*/
|
||||
private readonly useWorkspaceDragSurface_;
|
||||
private readonly useWorkspaceDragSurface;
|
||||
|
||||
/**
|
||||
* Whether the drag surface is actively in use. When true, calls to
|
||||
@@ -244,20 +244,20 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* workspace directly.
|
||||
* This is set to true in setupDragSurface and to false in resetDragSurface.
|
||||
*/
|
||||
private isDragSurfaceActive_ = false;
|
||||
private isDragSurfaceActive = false;
|
||||
|
||||
/**
|
||||
* The first parent div with 'injectionDiv' in the name, or null if not set.
|
||||
* Access this with getInjectionDiv.
|
||||
*/
|
||||
private injectionDiv_: Element|null = null;
|
||||
private injectionDiv: Element|null = null;
|
||||
|
||||
/**
|
||||
* Last known position of the page scroll.
|
||||
* This is used to determine whether we have recalculated screen coordinate
|
||||
* stuff since the page scrolled.
|
||||
*/
|
||||
private lastRecordedPageScroll_: Coordinate|null = null;
|
||||
private lastRecordedPageScroll: Coordinate|null = null;
|
||||
|
||||
/**
|
||||
* Developers may define this function to add custom menu options to the
|
||||
@@ -279,25 +279,25 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
targetWorkspace: WorkspaceSvg|null = null;
|
||||
|
||||
/** Inverted screen CTM, for use in mouseToSvg. */
|
||||
private inverseScreenCTM_: SVGMatrix|null = null;
|
||||
private inverseScreenCTM: SVGMatrix|null = null;
|
||||
|
||||
/** Inverted screen CTM is dirty, recalculate it. */
|
||||
private inverseScreenCTMDirty_ = true;
|
||||
private metricsManager_: IMetricsManager;
|
||||
private inverseScreenCTMDirty = true;
|
||||
private metricsManager: IMetricsManager;
|
||||
/** @internal */
|
||||
getMetrics: () => Metrics;
|
||||
/** @internal */
|
||||
setMetrics: (p1: {x?: number, y?: number}) => void;
|
||||
private readonly componentManager_: ComponentManager;
|
||||
private readonly componentManager: ComponentManager;
|
||||
|
||||
/**
|
||||
* List of currently highlighted blocks. Block highlighting is often used
|
||||
* to visually mark blocks currently being executed.
|
||||
*/
|
||||
private readonly highlightedBlocks_: BlockSvg[] = [];
|
||||
private audioManager_: WorkspaceAudio;
|
||||
private grid_: Grid|null;
|
||||
private markerManager_: MarkerManager;
|
||||
private readonly highlightedBlocks: BlockSvg[] = [];
|
||||
private audioManager: WorkspaceAudio;
|
||||
private grid: Grid|null;
|
||||
private markerManager: MarkerManager;
|
||||
|
||||
/**
|
||||
* Map from function names to callbacks, for deciding what to do when a
|
||||
@@ -312,21 +312,21 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
*/
|
||||
private flyoutButtonCallbacks = new Map<string, (p1: FlyoutButton) => void>();
|
||||
protected themeManager_: ThemeManager;
|
||||
private readonly renderer_: Renderer;
|
||||
private readonly renderer: Renderer;
|
||||
|
||||
/** Cached parent SVG. */
|
||||
private cachedParentSvg_: SVGElement|null = null;
|
||||
private cachedParentSvg: SVGElement|null = null;
|
||||
|
||||
/** True if keyboard accessibility mode is on, false otherwise. */
|
||||
keyboardAccessibilityMode = false;
|
||||
|
||||
/** The list of top-level bounded elements on the workspace. */
|
||||
private topBoundedElements_: IBoundedElement[] = [];
|
||||
private topBoundedElements: IBoundedElement[] = [];
|
||||
|
||||
/** The recorded drag targets. */
|
||||
private dragTargetAreas_: Array<{component: IDragTarget, clientRect: Rect}> =
|
||||
private dragTargetAreas: Array<{component: IDragTarget, clientRect: Rect}> =
|
||||
[];
|
||||
private readonly cachedParentSvgSize_: Size;
|
||||
private readonly cachedParentSvgSize: Size;
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
svgGroup_!: SVGElement;
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
@@ -350,43 +350,43 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const MetricsManagerClass = registry.getClassFromOptions(
|
||||
registry.Type.METRICS_MANAGER, options, true);
|
||||
/** Object in charge of calculating metrics for the workspace. */
|
||||
this.metricsManager_ = new MetricsManagerClass!(this);
|
||||
this.metricsManager = new MetricsManagerClass!(this);
|
||||
|
||||
/** Method to get all the metrics that have to do with a workspace. */
|
||||
this.getMetrics = options.getMetrics ||
|
||||
this.metricsManager_.getMetrics.bind(this.metricsManager_);
|
||||
this.metricsManager.getMetrics.bind(this.metricsManager);
|
||||
|
||||
/** Translates the workspace. */
|
||||
this.setMetrics =
|
||||
options.setMetrics || WorkspaceSvg.setTopLevelWorkspaceMetrics_;
|
||||
|
||||
this.componentManager_ = new ComponentManager();
|
||||
this.componentManager = new ComponentManager();
|
||||
|
||||
this.connectionDBList = ConnectionDB.init(this.connectionChecker);
|
||||
|
||||
if (opt_blockDragSurface) {
|
||||
this.blockDragSurface_ = opt_blockDragSurface;
|
||||
this.blockDragSurface = opt_blockDragSurface;
|
||||
}
|
||||
|
||||
if (opt_wsDragSurface) {
|
||||
this.workspaceDragSurface_ = opt_wsDragSurface;
|
||||
this.workspaceDragSurface = opt_wsDragSurface;
|
||||
}
|
||||
|
||||
this.useWorkspaceDragSurface_ = !!this.workspaceDragSurface_;
|
||||
this.useWorkspaceDragSurface = !!this.workspaceDragSurface;
|
||||
|
||||
/**
|
||||
* Object in charge of loading, storing, and playing audio for a workspace.
|
||||
*/
|
||||
this.audioManager_ =
|
||||
this.audioManager =
|
||||
new WorkspaceAudio((options.parentWorkspace as WorkspaceSvg));
|
||||
|
||||
/** This workspace's grid object or null. */
|
||||
this.grid_ = this.options.gridPattern ?
|
||||
this.grid = this.options.gridPattern ?
|
||||
new Grid(this.options.gridPattern, options.gridOptions) :
|
||||
null;
|
||||
|
||||
/** Manager in charge of markers and cursors. */
|
||||
this.markerManager_ = new MarkerManager(this);
|
||||
this.markerManager = new MarkerManager(this);
|
||||
|
||||
if (Variables && Variables.flyoutCategory) {
|
||||
this.registerToolboxCategoryCallback(
|
||||
@@ -411,7 +411,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.themeManager_.subscribeWorkspace(this);
|
||||
|
||||
/** The block renderer used for rendering blocks on this workspace. */
|
||||
this.renderer_ = blockRendering.init(
|
||||
this.renderer = blockRendering.init(
|
||||
this.options.renderer || 'geras', this.getTheme(),
|
||||
this.options.rendererOverrides ?? undefined);
|
||||
|
||||
@@ -419,7 +419,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* The cached size of the parent svg element.
|
||||
* Used to compute svg metrics.
|
||||
*/
|
||||
this.cachedParentSvgSize_ = new Size(0, 0);
|
||||
this.cachedParentSvgSize = new Size(0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -428,7 +428,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns The marker manager.
|
||||
*/
|
||||
getMarkerManager(): MarkerManager {
|
||||
return this.markerManager_;
|
||||
return this.markerManager;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -437,7 +437,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns The metrics manager.
|
||||
*/
|
||||
getMetricsManager(): IMetricsManager {
|
||||
return this.metricsManager_;
|
||||
return this.metricsManager;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -447,9 +447,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
setMetricsManager(metricsManager: IMetricsManager) {
|
||||
this.metricsManager_ = metricsManager;
|
||||
this.getMetrics =
|
||||
this.metricsManager_.getMetrics.bind(this.metricsManager_);
|
||||
this.metricsManager = metricsManager;
|
||||
this.getMetrics = this.metricsManager.getMetrics.bind(this.metricsManager);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -458,7 +457,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns The component manager.
|
||||
*/
|
||||
getComponentManager(): ComponentManager {
|
||||
return this.componentManager_;
|
||||
return this.componentManager;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -469,7 +468,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
setCursorSvg(cursorSvg: SVGElement) {
|
||||
this.markerManager_.setCursorSvg(cursorSvg);
|
||||
this.markerManager.setCursorSvg(cursorSvg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,7 +479,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
setMarkerSvg(markerSvg: SVGElement) {
|
||||
this.markerManager_.setMarkerSvg(markerSvg);
|
||||
this.markerManager.setMarkerSvg(markerSvg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -492,8 +491,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
getMarker(id: string): Marker|null {
|
||||
if (this.markerManager_) {
|
||||
return this.markerManager_.getMarker(id);
|
||||
if (this.markerManager) {
|
||||
return this.markerManager.getMarker(id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -504,8 +503,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns The cursor for the workspace.
|
||||
*/
|
||||
getCursor(): Cursor|null {
|
||||
if (this.markerManager_) {
|
||||
return this.markerManager_.getCursor();
|
||||
if (this.markerManager) {
|
||||
return this.markerManager.getCursor();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -516,7 +515,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns The renderer attached to this workspace.
|
||||
*/
|
||||
getRenderer(): Renderer {
|
||||
return this.renderer_;
|
||||
return this.renderer;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -556,7 +555,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
*/
|
||||
refreshTheme() {
|
||||
if (this.svgGroup_) {
|
||||
this.renderer_.refreshDom(this.svgGroup_, this.getTheme());
|
||||
this.renderer.refreshDom(this.svgGroup_, this.getTheme());
|
||||
}
|
||||
|
||||
// Update all blocks in workspace that have a style name.
|
||||
@@ -606,20 +605,20 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
getInverseScreenCTM(): SVGMatrix|null {
|
||||
// Defer getting the screen CTM until we actually need it, this should
|
||||
// avoid forced reflows from any calls to updateInverseScreenCTM.
|
||||
if (this.inverseScreenCTMDirty_) {
|
||||
if (this.inverseScreenCTMDirty) {
|
||||
const ctm = this.getParentSvg().getScreenCTM();
|
||||
if (ctm) {
|
||||
this.inverseScreenCTM_ = (ctm).inverse();
|
||||
this.inverseScreenCTMDirty_ = false;
|
||||
this.inverseScreenCTM = (ctm).inverse();
|
||||
this.inverseScreenCTMDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
return this.inverseScreenCTM_;
|
||||
return this.inverseScreenCTM;
|
||||
}
|
||||
|
||||
/** Mark the inverse screen CTM as dirty. */
|
||||
updateInverseScreenCTM() {
|
||||
this.inverseScreenCTMDirty_ = true;
|
||||
this.inverseScreenCTMDirty = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -671,7 +670,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
getCachedParentSvgSize(): Size {
|
||||
const size = this.cachedParentSvgSize_;
|
||||
const size = this.cachedParentSvgSize;
|
||||
return new Size(size.width, size.height);
|
||||
}
|
||||
|
||||
@@ -700,18 +699,18 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
getInjectionDiv(): Element {
|
||||
// NB: it would be better to pass this in at createDom, but is more likely
|
||||
// to break existing uses of Blockly.
|
||||
if (!this.injectionDiv_) {
|
||||
if (!this.injectionDiv) {
|
||||
let element: Element = this.svgGroup_;
|
||||
while (element) {
|
||||
const classes = element.getAttribute('class') || '';
|
||||
if ((' ' + classes + ' ').indexOf(' injectionDiv ') !== -1) {
|
||||
this.injectionDiv_ = element;
|
||||
this.injectionDiv = element;
|
||||
break;
|
||||
}
|
||||
element = element.parentNode as Element;
|
||||
}
|
||||
}
|
||||
return this.injectionDiv_!;
|
||||
return this.injectionDiv!;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -730,7 +729,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @param handler Data that can be passed to eventHandling.unbind.
|
||||
*/
|
||||
setResizeHandlerWrapper(handler: browserEvents.Data) {
|
||||
this.resizeHandlerWrapper_ = handler;
|
||||
this.resizeHandlerWrapper = handler;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -760,9 +759,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
{'height': '100%', 'width': '100%', 'class': opt_backgroundClass},
|
||||
this.svgGroup_);
|
||||
|
||||
if (opt_backgroundClass === 'blocklyMainBackground' && this.grid_) {
|
||||
if (opt_backgroundClass === 'blocklyMainBackground' && this.grid) {
|
||||
this.svgBackground_.style.fill =
|
||||
'url(#' + this.grid_.getPatternId() + ')';
|
||||
'url(#' + this.grid.getPatternId() + ')';
|
||||
} else {
|
||||
this.themeManager_.subscribe(
|
||||
this.svgBackground_, 'workspaceBackgroundColour', 'fill');
|
||||
@@ -791,16 +790,16 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
registry.Type.TOOLBOX, this.options, true);
|
||||
this.toolbox_ = new ToolboxClass!(this);
|
||||
}
|
||||
if (this.grid_) {
|
||||
this.grid_.update(this.scale);
|
||||
if (this.grid) {
|
||||
this.grid.update(this.scale);
|
||||
}
|
||||
this.recordDragTargets();
|
||||
const CursorClass =
|
||||
registry.getClassFromOptions(registry.Type.CURSOR, this.options);
|
||||
|
||||
CursorClass && this.markerManager_.setCursor(new CursorClass());
|
||||
CursorClass && this.markerManager.setCursor(new CursorClass());
|
||||
|
||||
this.renderer_.createDom(this.svgGroup_, this.getTheme());
|
||||
this.renderer.createDom(this.svgGroup_, this.getTheme());
|
||||
return this.svgGroup_;
|
||||
}
|
||||
|
||||
@@ -823,9 +822,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.toolbox_.dispose();
|
||||
this.toolbox_ = null;
|
||||
}
|
||||
if (this.flyout_) {
|
||||
this.flyout_.dispose();
|
||||
this.flyout_ = null;
|
||||
if (this.flyout) {
|
||||
this.flyout.dispose();
|
||||
this.flyout = null;
|
||||
}
|
||||
if (this.trashcan) {
|
||||
this.trashcan.dispose();
|
||||
@@ -839,18 +838,18 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.zoomControls_.dispose();
|
||||
}
|
||||
|
||||
if (this.audioManager_) {
|
||||
this.audioManager_.dispose();
|
||||
if (this.audioManager) {
|
||||
this.audioManager.dispose();
|
||||
}
|
||||
|
||||
if (this.grid_) {
|
||||
this.grid_ = null;
|
||||
if (this.grid) {
|
||||
this.grid = null;
|
||||
}
|
||||
|
||||
this.renderer_.dispose();
|
||||
this.renderer.dispose();
|
||||
|
||||
if (this.markerManager_) {
|
||||
this.markerManager_.dispose();
|
||||
if (this.markerManager) {
|
||||
this.markerManager.dispose();
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
@@ -877,9 +876,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
dom.removeNode(parentSvg.parentNode);
|
||||
}
|
||||
}
|
||||
if (this.resizeHandlerWrapper_) {
|
||||
browserEvents.unbind(this.resizeHandlerWrapper_);
|
||||
this.resizeHandlerWrapper_ = null;
|
||||
if (this.resizeHandlerWrapper) {
|
||||
browserEvents.unbind(this.resizeHandlerWrapper);
|
||||
this.resizeHandlerWrapper = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -938,19 +937,19 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
if (this.horizontalLayout) {
|
||||
const HorizontalFlyout = registry.getClassFromOptions(
|
||||
registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX, this.options, true);
|
||||
this.flyout_ = new HorizontalFlyout!(workspaceOptions);
|
||||
this.flyout = new HorizontalFlyout!(workspaceOptions);
|
||||
} else {
|
||||
const VerticalFlyout = registry.getClassFromOptions(
|
||||
registry.Type.FLYOUTS_VERTICAL_TOOLBOX, this.options, true);
|
||||
this.flyout_ = new VerticalFlyout!(workspaceOptions);
|
||||
this.flyout = new VerticalFlyout!(workspaceOptions);
|
||||
}
|
||||
this.flyout_.autoClose = false;
|
||||
this.flyout_.getWorkspace().setVisible(true);
|
||||
this.flyout.autoClose = false;
|
||||
this.flyout.getWorkspace().setVisible(true);
|
||||
|
||||
// Return the element so that callers can place it in their desired
|
||||
// spot in the DOM. For example, mutator flyouts do not go in the same
|
||||
// place as main workspace flyouts.
|
||||
return this.flyout_.createDom(tagName);
|
||||
return this.flyout.createDom(tagName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -963,8 +962,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
getFlyout(opt_own?: boolean): IFlyout|null {
|
||||
if (this.flyout_ || opt_own) {
|
||||
return this.flyout_;
|
||||
if (this.flyout || opt_own) {
|
||||
return this.flyout;
|
||||
}
|
||||
if (this.toolbox_) {
|
||||
return this.toolbox_.getFlyout();
|
||||
@@ -999,7 +998,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
resizeContents() {
|
||||
if (!this.resizesEnabled_ || !this.rendered) {
|
||||
if (!this.resizesEnabled || !this.rendered) {
|
||||
return;
|
||||
}
|
||||
if (this.scrollbar) {
|
||||
@@ -1019,11 +1018,11 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
if (this.toolbox_) {
|
||||
this.toolbox_.position();
|
||||
}
|
||||
if (this.flyout_) {
|
||||
this.flyout_.position();
|
||||
if (this.flyout) {
|
||||
this.flyout.position();
|
||||
}
|
||||
|
||||
const positionables = this.componentManager_.getComponents(
|
||||
const positionables = this.componentManager.getComponents(
|
||||
ComponentManager.Capability.POSITIONABLE, true);
|
||||
const metrics = this.getMetricsManager().getUiMetrics();
|
||||
const savedPositions = [];
|
||||
@@ -1050,8 +1049,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
updateScreenCalculationsIfScrolled() {
|
||||
/* eslint-disable indent */
|
||||
const currScroll = svgMath.getDocumentScroll();
|
||||
if (!Coordinate.equals(this.lastRecordedPageScroll_, currScroll)) {
|
||||
this.lastRecordedPageScroll_ = currScroll;
|
||||
if (!Coordinate.equals(this.lastRecordedPageScroll, currScroll)) {
|
||||
this.lastRecordedPageScroll = currScroll;
|
||||
this.updateScreenCalculations_();
|
||||
}
|
||||
}
|
||||
@@ -1077,13 +1076,13 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
setCachedParentSvgSize(width: number|null, height: number|null) {
|
||||
const svg = this.getParentSvg();
|
||||
if (width != null) {
|
||||
this.cachedParentSvgSize_.width = width;
|
||||
this.cachedParentSvgSize.width = width;
|
||||
// This is set to support the public (but deprecated) Blockly.svgSize
|
||||
// method.
|
||||
svg.setAttribute('data-cached-width', width.toString());
|
||||
}
|
||||
if (height != null) {
|
||||
this.cachedParentSvgSize_.height = height;
|
||||
this.cachedParentSvgSize.height = height;
|
||||
// This is set to support the public (but deprecated) Blockly.svgSize
|
||||
// method.
|
||||
svg.setAttribute('data-cached-height', height.toString());
|
||||
@@ -1107,17 +1106,17 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns SVG element.
|
||||
*/
|
||||
getParentSvg(): SVGSVGElement {
|
||||
if (!this.cachedParentSvg_) {
|
||||
if (!this.cachedParentSvg) {
|
||||
let element = this.svgGroup_;
|
||||
while (element) {
|
||||
if (element.tagName === 'svg') {
|
||||
this.cachedParentSvg_ = element;
|
||||
this.cachedParentSvg = element;
|
||||
break;
|
||||
}
|
||||
element = element.parentNode as SVGSVGElement;
|
||||
}
|
||||
}
|
||||
return this.cachedParentSvg_ as SVGSVGElement;
|
||||
return this.cachedParentSvg as SVGSVGElement;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1133,17 +1132,17 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const scale = this.scale;
|
||||
const top = -this.scrollY;
|
||||
const left = -this.scrollX;
|
||||
if (scale === this.oldScale_ && Math.abs(top - this.oldTop_) < 1 &&
|
||||
Math.abs(left - this.oldLeft_) < 1) {
|
||||
if (scale === this.oldScale && Math.abs(top - this.oldTop) < 1 &&
|
||||
Math.abs(left - this.oldLeft) < 1) {
|
||||
// Ignore sub-pixel changes in top and left. Due to #4192 there are a lot
|
||||
// of negligible changes in viewport top/left.
|
||||
return;
|
||||
}
|
||||
const event = new (eventUtils.get(eventUtils.VIEWPORT_CHANGE))(
|
||||
top, left, scale, this.id, this.oldScale_);
|
||||
this.oldScale_ = scale;
|
||||
this.oldTop_ = top;
|
||||
this.oldLeft_ = left;
|
||||
top, left, scale, this.id, this.oldScale);
|
||||
this.oldScale = scale;
|
||||
this.oldTop = top;
|
||||
this.oldLeft = left;
|
||||
eventUtils.fire(event);
|
||||
}
|
||||
|
||||
@@ -1156,8 +1155,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* the Blockly div.
|
||||
*/
|
||||
translate(x: number, y: number) {
|
||||
if (this.useWorkspaceDragSurface_ && this.isDragSurfaceActive_) {
|
||||
this.workspaceDragSurface_?.translateSurface(x, y);
|
||||
if (this.useWorkspaceDragSurface && this.isDragSurfaceActive) {
|
||||
this.workspaceDragSurface?.translateSurface(x, y);
|
||||
} else {
|
||||
const translation = 'translate(' + x + ',' + y + ') ' +
|
||||
'scale(' + this.scale + ')';
|
||||
@@ -1165,12 +1164,12 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.svgBubbleCanvas_.setAttribute('transform', translation);
|
||||
}
|
||||
// Now update the block drag surface if we're using one.
|
||||
if (this.blockDragSurface_) {
|
||||
this.blockDragSurface_.translateAndScaleGroup(x, y, this.scale);
|
||||
if (this.blockDragSurface) {
|
||||
this.blockDragSurface.translateAndScaleGroup(x, y, this.scale);
|
||||
}
|
||||
// And update the grid if we're using one.
|
||||
if (this.grid_) {
|
||||
this.grid_.moveTo(x, y);
|
||||
if (this.grid) {
|
||||
this.grid.moveTo(x, y);
|
||||
}
|
||||
|
||||
this.maybeFireViewportChangeEvent();
|
||||
@@ -1185,14 +1184,14 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
*/
|
||||
resetDragSurface() {
|
||||
// Don't do anything if we aren't using a drag surface.
|
||||
if (!this.useWorkspaceDragSurface_) {
|
||||
if (!this.useWorkspaceDragSurface) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isDragSurfaceActive_ = false;
|
||||
this.isDragSurfaceActive = false;
|
||||
|
||||
const trans = this.workspaceDragSurface_!.getSurfaceTranslation();
|
||||
this.workspaceDragSurface_!.clearAndHide(this.svgGroup_);
|
||||
const trans = this.workspaceDragSurface!.getSurfaceTranslation();
|
||||
this.workspaceDragSurface!.clearAndHide(this.svgGroup_);
|
||||
const translation = 'translate(' + trans.x + ',' + trans.y + ') ' +
|
||||
'scale(' + this.scale + ')';
|
||||
this.svgBlockCanvas_.setAttribute('transform', translation);
|
||||
@@ -1208,7 +1207,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
*/
|
||||
setupDragSurface() {
|
||||
// Don't do anything if we aren't using a drag surface.
|
||||
if (!this.useWorkspaceDragSurface_) {
|
||||
if (!this.useWorkspaceDragSurface) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1217,11 +1216,11 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
// iframe) and then moves the mouse back in the workspace. On mobile and
|
||||
// ff, we get the mouseup outside the frame. On chrome and safari desktop we
|
||||
// do not.
|
||||
if (this.isDragSurfaceActive_) {
|
||||
if (this.isDragSurfaceActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isDragSurfaceActive_ = true;
|
||||
this.isDragSurfaceActive = true;
|
||||
|
||||
// Figure out where we want to put the canvas back. The order
|
||||
// in the is important because things are layered.
|
||||
@@ -1229,10 +1228,10 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const width = parseInt(this.getParentSvg().getAttribute('width') ?? '0');
|
||||
const height = parseInt(this.getParentSvg().getAttribute('height') ?? '0');
|
||||
const coord = svgMath.getRelativeXY(this.getCanvas());
|
||||
this.workspaceDragSurface_!.setContentsAndShow(
|
||||
this.workspaceDragSurface!.setContentsAndShow(
|
||||
this.getCanvas(), this.getBubbleCanvas(), previousElement, width,
|
||||
height, this.scale);
|
||||
this.workspaceDragSurface_!.translateSurface(coord.x, coord.y);
|
||||
this.workspaceDragSurface!.translateSurface(coord.x, coord.y);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1242,7 +1241,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
getBlockDragSurface(): BlockDragSurfaceSvg|null {
|
||||
return this.blockDragSurface_;
|
||||
return this.blockDragSurface;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1317,7 +1316,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
}
|
||||
}
|
||||
|
||||
this.markerManager_.updateMarkers();
|
||||
this.markerManager.updateMarkers();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1333,10 +1332,10 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
highlightBlock(id: string|null, opt_state?: boolean) {
|
||||
if (opt_state === undefined) {
|
||||
// Unhighlight all blocks.
|
||||
for (let i = 0, block; block = this.highlightedBlocks_[i]; i++) {
|
||||
for (let i = 0, block; block = this.highlightedBlocks[i]; i++) {
|
||||
block.setHighlighted(false);
|
||||
}
|
||||
this.highlightedBlocks_.length = 0;
|
||||
this.highlightedBlocks.length = 0;
|
||||
}
|
||||
// Highlight/unhighlight the specified block.
|
||||
const block = id ? this.getBlockById(id) : null;
|
||||
@@ -1344,9 +1343,9 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const state = opt_state === undefined || opt_state;
|
||||
// Using Set here would be great, but at the cost of IE10 support.
|
||||
if (!state) {
|
||||
arrayUtils.removeElem(this.highlightedBlocks_, block);
|
||||
} else if (this.highlightedBlocks_.indexOf(block) === -1) {
|
||||
this.highlightedBlocks_.push(block);
|
||||
arrayUtils.removeElem(this.highlightedBlocks, block);
|
||||
} else if (this.highlightedBlocks.indexOf(block) === -1) {
|
||||
this.highlightedBlocks.push(block);
|
||||
}
|
||||
block.setHighlighted(state);
|
||||
}
|
||||
@@ -1564,14 +1563,14 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
|
||||
/** Make a list of all the delete areas for this workspace. */
|
||||
recordDragTargets() {
|
||||
const dragTargets = this.componentManager_.getComponents(
|
||||
const dragTargets = this.componentManager.getComponents(
|
||||
ComponentManager.Capability.DRAG_TARGET, true);
|
||||
|
||||
this.dragTargetAreas_ = [];
|
||||
this.dragTargetAreas = [];
|
||||
for (let i = 0, targetArea; targetArea = dragTargets[i]; i++) {
|
||||
const rect = targetArea.getClientRect();
|
||||
if (rect) {
|
||||
this.dragTargetAreas_.push({
|
||||
this.dragTargetAreas.push({
|
||||
component: targetArea,
|
||||
clientRect: rect,
|
||||
});
|
||||
@@ -1604,7 +1603,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* over.
|
||||
*/
|
||||
getDragTarget(e: Event): IDragTarget|null {
|
||||
for (let i = 0, targetArea; targetArea = this.dragTargetAreas_[i]; i++) {
|
||||
for (let i = 0, targetArea; targetArea = this.dragTargetAreas[i]; i++) {
|
||||
if (targetArea.clientRect.contains(
|
||||
(e as AnyDuringMigration).clientX,
|
||||
(e as AnyDuringMigration).clientY)) {
|
||||
@@ -1639,7 +1638,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
// Fix scale of mouse event.
|
||||
point.x /= this.scale;
|
||||
point.y /= this.scale;
|
||||
this.dragDeltaXY_ = Coordinate.difference(xy, point);
|
||||
this.dragDeltaXY = Coordinate.difference(xy, point);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1654,7 +1653,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
// Fix scale of mouse event.
|
||||
point.x /= this.scale;
|
||||
point.y /= this.scale;
|
||||
return Coordinate.sum((this.dragDeltaXY_!), point);
|
||||
return Coordinate.sum((this.dragDeltaXY!), point);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1829,7 +1828,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
block.snapToGrid();
|
||||
cursorY = block.getRelativeToSurfaceXY().y +
|
||||
block.getHeightWidth().height +
|
||||
this.renderer_.getConstants().MIN_BLOCK_HEIGHT;
|
||||
this.renderer.getConstants().MIN_BLOCK_HEIGHT;
|
||||
}
|
||||
eventUtils.setGroup(false);
|
||||
this.setResizesEnabled(true);
|
||||
@@ -1882,11 +1881,11 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.options.languageTree = parsedToolboxDef;
|
||||
this.toolbox_.render(parsedToolboxDef);
|
||||
} else {
|
||||
if (!this.flyout_) {
|
||||
if (!this.flyout) {
|
||||
throw Error('Existing toolbox has categories. Can\'t change mode.');
|
||||
}
|
||||
this.options.languageTree = parsedToolboxDef;
|
||||
this.flyout_.show(parsedToolboxDef);
|
||||
this.flyout.show(parsedToolboxDef);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1997,7 +1996,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const metrics = this.getMetrics();
|
||||
let x;
|
||||
let y;
|
||||
if (this.flyout_) {
|
||||
if (this.flyout) {
|
||||
// If you want blocks in the center of the view (visible portion of the
|
||||
// workspace) to stay centered when the size of the view decreases (i.e.
|
||||
// when the size of the flyout increases) you need the center of the
|
||||
@@ -2031,19 +2030,19 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
if (!blocksWidth) {
|
||||
return; // Prevents zooming to infinity.
|
||||
}
|
||||
if (this.flyout_) {
|
||||
if (this.flyout) {
|
||||
// We have to add the flyout size to both the workspace size and the
|
||||
// block size because the blocks we want to resize include the blocks in
|
||||
// the flyout, and the area we want to fit them includes the portion of
|
||||
// the workspace that is behind the flyout.
|
||||
if (this.horizontalLayout) {
|
||||
workspaceHeight += this.flyout_.getHeight();
|
||||
workspaceHeight += this.flyout.getHeight();
|
||||
// Convert from pixels to workspace coordinates.
|
||||
blocksHeight += this.flyout_.getHeight() / this.scale;
|
||||
blocksHeight += this.flyout.getHeight() / this.scale;
|
||||
} else {
|
||||
workspaceWidth += this.flyout_.getWidth();
|
||||
workspaceWidth += this.flyout.getWidth();
|
||||
// Convert from pixels to workspace coordinates.
|
||||
blocksWidth += this.flyout_.getWidth() / this.scale;
|
||||
blocksWidth += this.flyout.getWidth() / this.scale;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2180,8 +2179,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
flyout.reflow();
|
||||
this.recordDragTargets();
|
||||
}
|
||||
if (this.grid_) {
|
||||
this.grid_.update(this.scale);
|
||||
if (this.grid) {
|
||||
this.grid.update(this.scale);
|
||||
}
|
||||
|
||||
// We call scroll instead of scrollbar.resize() so that we can center the
|
||||
@@ -2198,7 +2197,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
|
||||
this.scroll(this.scrollX, this.scrollY);
|
||||
if (this.scrollbar) {
|
||||
if (this.flyout_) {
|
||||
if (this.flyout) {
|
||||
this.scrollbar.resizeView(metrics);
|
||||
} else {
|
||||
this.scrollbar.resizeContent(metrics);
|
||||
@@ -2344,7 +2343,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @param element Bounded element to add.
|
||||
*/
|
||||
addTopBoundedElement(element: IBoundedElement) {
|
||||
this.topBoundedElements_.push(element);
|
||||
this.topBoundedElements.push(element);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2353,7 +2352,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @param element Bounded element to remove.
|
||||
*/
|
||||
removeTopBoundedElement(element: IBoundedElement) {
|
||||
arrayUtils.removeElem(this.topBoundedElements_, element);
|
||||
arrayUtils.removeElem(this.topBoundedElements, element);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2362,7 +2361,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns The top-level bounded elements.
|
||||
*/
|
||||
getTopBoundedElements(): IBoundedElement[] {
|
||||
return (new Array<IBoundedElement>()).concat(this.topBoundedElements_);
|
||||
return (new Array<IBoundedElement>()).concat(this.topBoundedElements);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2374,8 +2373,8 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @param enabled Whether resizes should be enabled.
|
||||
*/
|
||||
setResizesEnabled(enabled: boolean) {
|
||||
const reenabled = !this.resizesEnabled_ && enabled;
|
||||
this.resizesEnabled_ = enabled;
|
||||
const reenabled = !this.resizesEnabled && enabled;
|
||||
this.resizesEnabled = enabled;
|
||||
if (reenabled) {
|
||||
// Newly enabled. Trigger a resize.
|
||||
this.resizeContents();
|
||||
@@ -2389,7 +2388,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
override clear() {
|
||||
this.setResizesEnabled(false);
|
||||
super.clear();
|
||||
this.topBoundedElements_ = [];
|
||||
this.topBoundedElements = [];
|
||||
this.setResizesEnabled(true);
|
||||
}
|
||||
|
||||
@@ -2531,7 +2530,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns The audio manager for this workspace.
|
||||
*/
|
||||
getAudioManager(): WorkspaceAudio {
|
||||
return this.audioManager_;
|
||||
return this.audioManager;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2541,7 +2540,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @internal
|
||||
*/
|
||||
getGrid(): Grid|null {
|
||||
return this.grid_;
|
||||
return this.grid;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,19 +47,19 @@ export class ZoomControls implements IPositionable {
|
||||
* A handle to use to unbind the mouse down event handler for zoom reset
|
||||
* button. Opaque data returned from browserEvents.conditionalBind.
|
||||
*/
|
||||
private onZoomResetWrapper_: browserEvents.Data|null = null;
|
||||
private onZoomResetWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/**
|
||||
* A handle to use to unbind the mouse down event handler for zoom in
|
||||
* button. Opaque data returned from browserEvents.conditionalBind.
|
||||
*/
|
||||
private onZoomInWrapper_: browserEvents.Data|null = null;
|
||||
private onZoomInWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/**
|
||||
* A handle to use to unbind the mouse down event handler for zoom out
|
||||
* button. Opaque data returned from browserEvents.conditionalBind.
|
||||
*/
|
||||
private onZoomOutWrapper_: browserEvents.Data|null = null;
|
||||
private onZoomOutWrapper: browserEvents.Data|null = null;
|
||||
|
||||
/** The zoom in svg <g> element. */
|
||||
private zoomInGroup: SVGGElement|null = null;
|
||||
@@ -71,36 +71,36 @@ export class ZoomControls implements IPositionable {
|
||||
private zoomResetGroup: SVGGElement|null = null;
|
||||
|
||||
/** Width of the zoom controls. */
|
||||
private readonly WIDTH_ = 32;
|
||||
private readonly WIDTH = 32;
|
||||
|
||||
/** Height of each zoom control. */
|
||||
private readonly HEIGHT_ = 32;
|
||||
private readonly HEIGHT = 32;
|
||||
|
||||
/** Small spacing used between the zoom in and out control, in pixels. */
|
||||
private readonly SMALL_SPACING_ = 2;
|
||||
private readonly SMALL_SPACING = 2;
|
||||
|
||||
/**
|
||||
* Large spacing used between the zoom in and reset control, in pixels.
|
||||
*/
|
||||
private readonly LARGE_SPACING_ = 11;
|
||||
private readonly LARGE_SPACING = 11;
|
||||
|
||||
/** Distance between zoom controls and bottom or top edge of workspace. */
|
||||
private readonly MARGIN_VERTICAL_ = 20;
|
||||
private readonly MARGIN_VERTICAL = 20;
|
||||
|
||||
/** Distance between zoom controls and right or left edge of workspace. */
|
||||
private readonly MARGIN_HORIZONTAL_ = 20;
|
||||
private readonly MARGIN_HORIZONTAL = 20;
|
||||
|
||||
/** The SVG group containing the zoom controls. */
|
||||
private svgGroup: SVGElement|null = null;
|
||||
|
||||
/** Left coordinate of the zoom controls. */
|
||||
private left_ = 0;
|
||||
private left = 0;
|
||||
|
||||
/** Top coordinate of the zoom controls. */
|
||||
private top_ = 0;
|
||||
private top = 0;
|
||||
|
||||
/** Whether this has been initialized. */
|
||||
private initialized_ = false;
|
||||
private initialized = false;
|
||||
|
||||
/** @param workspace The workspace to sit in. */
|
||||
constructor(private readonly workspace: WorkspaceSvg) {}
|
||||
@@ -117,12 +117,12 @@ export class ZoomControls implements IPositionable {
|
||||
// instances on a page. Browser behaviour becomes undefined otherwise.
|
||||
// https://neil.fraser.name/news/2015/11/01/
|
||||
const rnd = String(Math.random()).substring(2);
|
||||
this.createZoomOutSvg_(rnd);
|
||||
this.createZoomInSvg_(rnd);
|
||||
this.createZoomOutSvg(rnd);
|
||||
this.createZoomInSvg(rnd);
|
||||
if (this.workspace.isMovable()) {
|
||||
// If we zoom to the center and the workspace isn't movable we could
|
||||
// loose blocks at the edges of the workspace.
|
||||
this.createZoomResetSvg_(rnd);
|
||||
this.createZoomResetSvg(rnd);
|
||||
}
|
||||
return this.svgGroup;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ export class ZoomControls implements IPositionable {
|
||||
weight: 2,
|
||||
capabilities: [ComponentManager.Capability.POSITIONABLE],
|
||||
});
|
||||
this.initialized_ = true;
|
||||
this.initialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,14 +146,14 @@ export class ZoomControls implements IPositionable {
|
||||
if (this.svgGroup) {
|
||||
dom.removeNode(this.svgGroup);
|
||||
}
|
||||
if (this.onZoomResetWrapper_) {
|
||||
browserEvents.unbind(this.onZoomResetWrapper_);
|
||||
if (this.onZoomResetWrapper) {
|
||||
browserEvents.unbind(this.onZoomResetWrapper);
|
||||
}
|
||||
if (this.onZoomInWrapper_) {
|
||||
browserEvents.unbind(this.onZoomInWrapper_);
|
||||
if (this.onZoomInWrapper) {
|
||||
browserEvents.unbind(this.onZoomInWrapper);
|
||||
}
|
||||
if (this.onZoomOutWrapper_) {
|
||||
browserEvents.unbind(this.onZoomOutWrapper_);
|
||||
if (this.onZoomOutWrapper) {
|
||||
browserEvents.unbind(this.onZoomOutWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,13 +165,13 @@ export class ZoomControls implements IPositionable {
|
||||
* ignored by other UI elements.
|
||||
*/
|
||||
getBoundingRectangle(): Rect|null {
|
||||
let height = this.SMALL_SPACING_ + 2 * this.HEIGHT_;
|
||||
let height = this.SMALL_SPACING + 2 * this.HEIGHT;
|
||||
if (this.zoomResetGroup) {
|
||||
height += this.LARGE_SPACING_ + this.HEIGHT_;
|
||||
height += this.LARGE_SPACING + this.HEIGHT;
|
||||
}
|
||||
const bottom = this.top_ + height;
|
||||
const right = this.left_ + this.WIDTH_;
|
||||
return new Rect(this.top_, bottom, this.left_, right);
|
||||
const bottom = this.top + height;
|
||||
const right = this.left + this.WIDTH;
|
||||
return new Rect(this.top, bottom, this.left, right);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,52 +184,52 @@ export class ZoomControls implements IPositionable {
|
||||
*/
|
||||
position(metrics: UiMetrics, savedPositions: Rect[]) {
|
||||
// Not yet initialized.
|
||||
if (!this.initialized_) {
|
||||
if (!this.initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
const cornerPosition =
|
||||
uiPosition.getCornerOppositeToolbox(this.workspace, metrics);
|
||||
let height = this.SMALL_SPACING_ + 2 * this.HEIGHT_;
|
||||
let height = this.SMALL_SPACING + 2 * this.HEIGHT;
|
||||
if (this.zoomResetGroup) {
|
||||
height += this.LARGE_SPACING_ + this.HEIGHT_;
|
||||
height += this.LARGE_SPACING + this.HEIGHT;
|
||||
}
|
||||
const startRect = uiPosition.getStartPositionRect(
|
||||
cornerPosition, new Size(this.WIDTH_, height), this.MARGIN_HORIZONTAL_,
|
||||
this.MARGIN_VERTICAL_, metrics, this.workspace);
|
||||
cornerPosition, new Size(this.WIDTH, height), this.MARGIN_HORIZONTAL,
|
||||
this.MARGIN_VERTICAL, metrics, this.workspace);
|
||||
|
||||
const verticalPosition = cornerPosition.vertical;
|
||||
const bumpDirection = verticalPosition === uiPosition.verticalPosition.TOP ?
|
||||
uiPosition.bumpDirection.DOWN :
|
||||
uiPosition.bumpDirection.UP;
|
||||
const positionRect = uiPosition.bumpPositionRect(
|
||||
startRect, this.MARGIN_VERTICAL_, bumpDirection, savedPositions);
|
||||
startRect, this.MARGIN_VERTICAL, bumpDirection, savedPositions);
|
||||
|
||||
if (verticalPosition === uiPosition.verticalPosition.TOP) {
|
||||
const zoomInTranslateY = this.SMALL_SPACING_ + this.HEIGHT_;
|
||||
const zoomInTranslateY = this.SMALL_SPACING + this.HEIGHT;
|
||||
this.zoomInGroup?.setAttribute(
|
||||
'transform', 'translate(0, ' + zoomInTranslateY + ')');
|
||||
if (this.zoomResetGroup) {
|
||||
const zoomResetTranslateY =
|
||||
zoomInTranslateY + this.LARGE_SPACING_ + this.HEIGHT_;
|
||||
zoomInTranslateY + this.LARGE_SPACING + this.HEIGHT;
|
||||
this.zoomResetGroup.setAttribute(
|
||||
'transform', 'translate(0, ' + zoomResetTranslateY + ')');
|
||||
}
|
||||
} else {
|
||||
const zoomInTranslateY =
|
||||
this.zoomResetGroup ? this.LARGE_SPACING_ + this.HEIGHT_ : 0;
|
||||
this.zoomResetGroup ? this.LARGE_SPACING + this.HEIGHT : 0;
|
||||
this.zoomInGroup?.setAttribute(
|
||||
'transform', 'translate(0, ' + zoomInTranslateY + ')');
|
||||
const zoomOutTranslateY =
|
||||
zoomInTranslateY + this.SMALL_SPACING_ + this.HEIGHT_;
|
||||
zoomInTranslateY + this.SMALL_SPACING + this.HEIGHT;
|
||||
this.zoomOutGroup?.setAttribute(
|
||||
'transform', 'translate(0, ' + zoomOutTranslateY + ')');
|
||||
}
|
||||
|
||||
this.top_ = positionRect.top;
|
||||
this.left_ = positionRect.left;
|
||||
this.top = positionRect.top;
|
||||
this.left = positionRect.left;
|
||||
this.svgGroup?.setAttribute(
|
||||
'transform', 'translate(' + this.left_ + ',' + this.top_ + ')');
|
||||
'transform', 'translate(' + this.left + ',' + this.top + ')');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,7 +239,7 @@ export class ZoomControls implements IPositionable {
|
||||
* These IDs must be unique in case there are multiple Blockly instances
|
||||
* on the same page.
|
||||
*/
|
||||
private createZoomOutSvg_(rnd: string) {
|
||||
private createZoomOutSvg(rnd: string) {
|
||||
/* This markup will be generated and added to the .svgGroup:
|
||||
<g class="blocklyZoom">
|
||||
<clipPath id="blocklyZoomoutClipPath837493">
|
||||
@@ -275,8 +275,8 @@ export class ZoomControls implements IPositionable {
|
||||
this.workspace.options.pathToMedia + SPRITE.url);
|
||||
|
||||
// Attach listener.
|
||||
this.onZoomOutWrapper_ = browserEvents.conditionalBind(
|
||||
this.zoomOutGroup, 'mousedown', null, this.zoom_.bind(this, -1));
|
||||
this.onZoomOutWrapper = browserEvents.conditionalBind(
|
||||
this.zoomOutGroup, 'mousedown', null, this.zoom.bind(this, -1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +286,7 @@ export class ZoomControls implements IPositionable {
|
||||
* These IDs must be unique in case there are multiple Blockly instances
|
||||
* on the same page.
|
||||
*/
|
||||
private createZoomInSvg_(rnd: string) {
|
||||
private createZoomInSvg(rnd: string) {
|
||||
/* This markup will be generated and added to the .svgGroup:
|
||||
<g class="blocklyZoom">
|
||||
<clipPath id="blocklyZoominClipPath837493">
|
||||
@@ -321,8 +321,8 @@ export class ZoomControls implements IPositionable {
|
||||
this.workspace.options.pathToMedia + SPRITE.url);
|
||||
|
||||
// Attach listener.
|
||||
this.onZoomInWrapper_ = browserEvents.conditionalBind(
|
||||
this.zoomInGroup, 'mousedown', null, this.zoom_.bind(this, 1));
|
||||
this.onZoomInWrapper = browserEvents.conditionalBind(
|
||||
this.zoomInGroup, 'mousedown', null, this.zoom.bind(this, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -333,10 +333,10 @@ export class ZoomControls implements IPositionable {
|
||||
* positive amount values zoom in.
|
||||
* @param e A mouse down event.
|
||||
*/
|
||||
private zoom_(amount: number, e: Event) {
|
||||
private zoom(amount: number, e: Event) {
|
||||
this.workspace.markFocused();
|
||||
this.workspace.zoomCenter(amount);
|
||||
this.fireZoomEvent_();
|
||||
this.fireZoomEvent();
|
||||
Touch.clearTouchIdentifier(); // Don't block future drags.
|
||||
e.stopPropagation(); // Don't start a workspace scroll.
|
||||
e.preventDefault(); // Stop double-clicking from selecting text.
|
||||
@@ -349,7 +349,7 @@ export class ZoomControls implements IPositionable {
|
||||
* These IDs must be unique in case there are multiple Blockly instances
|
||||
* on the same page.
|
||||
*/
|
||||
private createZoomResetSvg_(rnd: string) {
|
||||
private createZoomResetSvg(rnd: string) {
|
||||
/* This markup will be generated and added to the .svgGroup:
|
||||
<g class="blocklyZoom">
|
||||
<clipPath id="blocklyZoomresetClipPath837493">
|
||||
@@ -379,8 +379,8 @@ export class ZoomControls implements IPositionable {
|
||||
this.workspace.options.pathToMedia + SPRITE.url);
|
||||
|
||||
// Attach event listeners.
|
||||
this.onZoomResetWrapper_ = browserEvents.conditionalBind(
|
||||
this.zoomResetGroup, 'mousedown', null, this.resetZoom_.bind(this));
|
||||
this.onZoomResetWrapper = browserEvents.conditionalBind(
|
||||
this.zoomResetGroup, 'mousedown', null, this.resetZoom.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -388,7 +388,7 @@ export class ZoomControls implements IPositionable {
|
||||
*
|
||||
* @param e A mouse down event.
|
||||
*/
|
||||
private resetZoom_(e: Event) {
|
||||
private resetZoom(e: Event) {
|
||||
this.workspace.markFocused();
|
||||
|
||||
// zoom is passed amount and computes the new scale using the formula:
|
||||
@@ -406,14 +406,14 @@ export class ZoomControls implements IPositionable {
|
||||
this.workspace.scrollCenter();
|
||||
|
||||
setTimeout(this.workspace.endCanvasTransition.bind(this.workspace), 500);
|
||||
this.fireZoomEvent_();
|
||||
this.fireZoomEvent();
|
||||
Touch.clearTouchIdentifier(); // Don't block future drags.
|
||||
e.stopPropagation(); // Don't start a workspace scroll.
|
||||
e.preventDefault(); // Stop double-clicking from selecting text.
|
||||
}
|
||||
|
||||
/** Fires a zoom control UI event. */
|
||||
private fireZoomEvent_() {
|
||||
private fireZoomEvent() {
|
||||
const uiEvent = new (eventUtils.get(eventUtils.CLICK))(
|
||||
null, this.workspace.id, 'zoom_controls');
|
||||
eventUtils.fire(uiEvent);
|
||||
|
||||
@@ -1,405 +0,0 @@
|
||||
// Do not edit this file; automatically generated.
|
||||
|
||||
/* eslint-disable */
|
||||
;(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) { // AMD
|
||||
define(["./blockly_compressed.js"], factory);
|
||||
} else if (typeof exports === 'object') { // Node.js
|
||||
module.exports = factory(require("./blockly_compressed.js"));
|
||||
} else { // Browser
|
||||
var factoryExports = factory(root.Blockly);
|
||||
root.Blockly.Dart = factoryExports.dartGenerator;
|
||||
root.Blockly.Dart.__namespace__ = factoryExports.__namespace__;
|
||||
}
|
||||
}(this, function(__parent__) {
|
||||
var $=__parent__.__namespace__;
|
||||
var module$exports$Blockly$Dart={},module$contents$Blockly$Dart_Variables=$.module$build$src$core$variables,module$contents$Blockly$Dart_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$Dart_Generator=$.Generator$$module$build$src$core$generator,module$contents$Blockly$Dart_Names=$.module$build$src$core$names.Names,module$contents$Blockly$Dart_NameType=$.NameType$$module$build$src$core$names,module$contents$Blockly$Dart_inputTypes=$.module$build$src$core$input_types.inputTypes;
|
||||
module$exports$Blockly$Dart.dartGenerator=new $.Generator$$module$build$src$core$generator("Dart");module$exports$Blockly$Dart.dartGenerator.addReservedWords("assert,break,case,catch,class,const,continue,default,do,else,enum,extends,false,final,finally,for,if,in,is,new,null,rethrow,return,super,switch,this,throw,true,try,var,void,while,with,print,identityHashCode,identical,BidirectionalIterator,Comparable,double,Function,int,Invocation,Iterable,Iterator,List,Map,Match,num,Pattern,RegExp,Set,StackTrace,String,StringSink,Type,bool,DateTime,Deprecated,Duration,Expando,Null,Object,RuneIterator,Runes,Stopwatch,StringBuffer,Symbol,Uri,Comparator,AbstractClassInstantiationError,ArgumentError,AssertionError,CastError,ConcurrentModificationError,CyclicInitializationError,Error,Exception,FallThroughError,FormatException,IntegerDivisionByZeroException,NoSuchMethodError,NullThrownError,OutOfMemoryError,RangeError,StackOverflowError,StateError,TypeError,UnimplementedError,UnsupportedError");
|
||||
module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC=0;module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX=1;module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX=2;module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE=3;module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE=4;module$exports$Blockly$Dart.dartGenerator.ORDER_SHIFT=5;module$exports$Blockly$Dart.dartGenerator.ORDER_BITWISE_AND=6;module$exports$Blockly$Dart.dartGenerator.ORDER_BITWISE_XOR=7;
|
||||
module$exports$Blockly$Dart.dartGenerator.ORDER_BITWISE_OR=8;module$exports$Blockly$Dart.dartGenerator.ORDER_RELATIONAL=9;module$exports$Blockly$Dart.dartGenerator.ORDER_EQUALITY=10;module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_AND=11;module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_OR=12;module$exports$Blockly$Dart.dartGenerator.ORDER_IF_NULL=13;module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL=14;module$exports$Blockly$Dart.dartGenerator.ORDER_CASCADE=15;
|
||||
module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT=16;module$exports$Blockly$Dart.dartGenerator.ORDER_NONE=99;module$exports$Blockly$Dart.dartGenerator.isInitialized=!1;
|
||||
module$exports$Blockly$Dart.dartGenerator.init=function(a){Object.getPrototypeOf(this).init.call(this);this.nameDB_?this.nameDB_.reset():this.nameDB_=new $.module$build$src$core$names.Names(this.RESERVED_WORDS_);this.nameDB_.setVariableMap(a.getVariableMap());this.nameDB_.populateVariables(a);this.nameDB_.populateProcedures(a);const b=[];var c=$.module$build$src$core$variables.allDeveloperVariables(a);for(let d=0;d<c.length;d++)b.push(this.nameDB_.getName(c[d],$.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE));
|
||||
a=$.module$build$src$core$variables.allUsedVarModels(a);for(c=0;c<a.length;c++)b.push(this.nameDB_.getName(a[c].getId(),$.NameType$$module$build$src$core$names.VARIABLE));b.length&&(this.definitions_.variables="var "+b.join(", ")+";");this.isInitialized=!0};
|
||||
module$exports$Blockly$Dart.dartGenerator.finish=function(a){a&&(a=this.prefixLines(a,this.INDENT));a="main() {\n"+a+"}";const b=[],c=[];for(let d in this.definitions_){const e=this.definitions_[d];e.match(/^import\s/)?b.push(e):c.push(e)}a=Object.getPrototypeOf(this).finish.call(this,a);this.isInitialized=!1;this.nameDB_.reset();return(b.join("\n")+"\n\n"+c.join("\n\n")).replace(/\n\n+/g,"\n\n").replace(/\n*$/,"\n\n\n")+a};
|
||||
module$exports$Blockly$Dart.dartGenerator.scrubNakedValue=function(a){return a+";\n"};module$exports$Blockly$Dart.dartGenerator.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/\$/g,"\\$").replace(/'/g,"\\'");return"'"+a+"'"};module$exports$Blockly$Dart.dartGenerator.multiline_quote_=function(a){return a.split(/\n/g).map(this.quote_).join(" + '\\n' + \n")};
|
||||
module$exports$Blockly$Dart.dartGenerator.scrub_=function(a,b,c){let d="";if(!a.outputConnection||!a.outputConnection.targetConnection){var e=a.getCommentText();e&&(e=$.module$build$src$core$utils$string.wrap(e,this.COMMENT_WRAP-3),d=a.getProcedureDef?d+this.prefixLines(e+"\n","/// "):d+this.prefixLines(e+"\n","// "));for(let f=0;f<a.inputList.length;f++)a.inputList[f].type===$.module$build$src$core$input_types.inputTypes.VALUE&&(e=a.inputList[f].connection.targetBlock())&&(e=this.allNestedComments(e))&&
|
||||
(d+=this.prefixLines(e,"// "))}a=a.nextConnection&&a.nextConnection.targetBlock();c=c?"":this.blockToCode(a);return d+b+c};
|
||||
module$exports$Blockly$Dart.dartGenerator.getAdjusted=function(a,b,c,d,e){c=c||0;e=e||this.ORDER_NONE;a.workspace.options.oneBasedIndex&&c--;const f=a.workspace.options.oneBasedIndex?"1":"0";let g,h;c?h=g=this.ORDER_ADDITIVE:d?h=g=this.ORDER_UNARY_PREFIX:g=e;a=this.valueToCode(a,b,g)||f;$.module$build$src$core$utils$string.isNumber(a)?(a=parseInt(a,10)+c,d&&(a=-a)):(0<c?a=a+" + "+c:0>c&&(a=a+" - "+-c),d&&(a=c?"-("+a+")":"-"+a),h=Math.floor(h),e=Math.floor(e),h&&e>=h&&(a="("+a+")"));return a};var module$exports$Blockly$Dart$variables={},module$contents$Blockly$Dart$variables_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.variables_get=function(a){return[module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Dart.dartGenerator.variables_set=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"0";return module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE)+" = "+b+";\n"};var module$exports$Blockly$Dart$variablesDynamic={};module$exports$Blockly$Dart.dartGenerator.variables_get_dynamic=module$exports$Blockly$Dart.dartGenerator.variables_get;module$exports$Blockly$Dart.dartGenerator.variables_set_dynamic=module$exports$Blockly$Dart.dartGenerator.variables_set;var module$exports$Blockly$Dart$texts={},module$contents$Blockly$Dart$texts_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.addReservedWords("Html,Math");module$exports$Blockly$Dart.dartGenerator.text=function(a){return[module$exports$Blockly$Dart.dartGenerator.quote_(a.getFieldValue("TEXT")),module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_multiline=function(a){a=module$exports$Blockly$Dart.dartGenerator.multiline_quote_(a.getFieldValue("TEXT"));const b=-1!==a.indexOf("+")?module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE:module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC;return[a,b]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_join=function(a){switch(a.itemCount_){case 0:return["''",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC];case 1:return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ADD0",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+".toString()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];default:const b=Array(a.itemCount_);for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
||||
"ADD"+c,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return["["+b.join(",")+"].join()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_append=function(a){const b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return b+" = ["+b+", "+a+"].join();\n"};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_length=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+".length",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_isEmpty=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+".isEmpty",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_indexOf=function(a){var b="FIRST"===a.getFieldValue("END")?"indexOf":"lastIndexOf";const c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FIND",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";b=(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+"."+b+"("+c+")";return a.workspace.options.oneBasedIndex?[b+" + 1",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE]:
|
||||
[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_charAt=function(a){const b=a.getFieldValue("WHERE")||"FROM_START",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE","FIRST"===b||"FROM_START"===b?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";switch(b){case "FIRST":return[c+"[0]",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];case "FROM_START":return a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,
|
||||
"AT"),[c+"["+a+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];case "LAST":case "FROM_END":return a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1),[module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_get_from_end",`
|
||||
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String text, num x) {
|
||||
return text[text.length - x];
|
||||
}
|
||||
`)+"("+c+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];case "RANDOM":return module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;",[module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_random_letter",`
|
||||
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String text) {
|
||||
int x = new Math.Random().nextInt(text.length);
|
||||
return text[x];
|
||||
}
|
||||
`)+"("+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}throw Error("Unhandled option (text_charAt).");};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_getSubstring=function(a){var b=a.getFieldValue("WHERE1"),c=a.getFieldValue("WHERE2");const d="FROM_END"!==b&&"FROM_START"===c,e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"STRING",d?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";if("FIRST"===b&&"LAST"===c)return[e,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE];if(e.match(/^'?\w+'?$/)||d){switch(b){case "FROM_START":b=
|
||||
module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1");break;case "FROM_END":b=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);b=e+".length - "+b;break;case "FIRST":b="0";break;default:throw Error("Unhandled option (text_getSubstring).");}switch(c){case "FROM_START":var f=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2",1);break;case "FROM_END":f=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,
|
||||
"AT2",0,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);f=e+".length - "+f;break;case "LAST":break;default:throw Error("Unhandled option (text_getSubstring).");}c="LAST"===c?e+".substring("+b+")":e+".substring("+b+", "+f+")"}else f=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1"),a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2"),c=module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_get_substring",`
|
||||
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String text, String where1, num at1, String where2, num at2) {
|
||||
int getAt(String where, num at) {
|
||||
if (where == 'FROM_END') {
|
||||
at = text.length - 1 - at;
|
||||
} else if (where == 'FIRST') {
|
||||
at = 0;
|
||||
} else if (where == 'LAST') {
|
||||
at = text.length - 1;
|
||||
} else if (where != 'FROM_START') {
|
||||
throw 'Unhandled option (text_getSubstring).';
|
||||
}
|
||||
return at;
|
||||
}
|
||||
at1 = getAt(where1, at1);
|
||||
at2 = getAt(where2, at2) + 1;
|
||||
return text.substring(at1, at2);
|
||||
}
|
||||
`)+"("+e+", '"+b+"', "+f+", '"+c+"', "+a+")";return[c,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_changeCase=function(a){const b={UPPERCASE:".toUpperCase()",LOWERCASE:".toLowerCase()",TITLECASE:null}[a.getFieldValue("CASE")];a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",b?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return[b?a+b:module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_toTitleCase",`
|
||||
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String str) {
|
||||
RegExp exp = new RegExp(r'\\b');
|
||||
List<String> list = str.split(exp);
|
||||
final title = new StringBuffer();
|
||||
for (String part in list) {
|
||||
if (part.length > 0) {
|
||||
title.write(part[0].toUpperCase());
|
||||
if (part.length > 0) {
|
||||
title.write(part.substring(1).toLowerCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
return title.toString();
|
||||
}
|
||||
`)+"("+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.text_trim=function(a){const b={LEFT:".replaceFirst(new RegExp(r'^\\s+'), '')",RIGHT:".replaceFirst(new RegExp(r'\\s+$'), '')",BOTH:".trim()"}[a.getFieldValue("MODE")];return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_print=function(a){return"print("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''")+");\n"};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_prompt_ext=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_html="import 'dart:html' as Html;";let b="Html.window.prompt("+(a.getField("TEXT")?module$exports$Blockly$Dart.dartGenerator.quote_(a.getFieldValue("TEXT")):module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''")+", '')";"NUMBER"===a.getFieldValue("TYPE")&&(module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math=
|
||||
"import 'dart:math' as Math;",b="Math.parseDouble("+b+")");return[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.text_prompt=module$exports$Blockly$Dart.dartGenerator.text_prompt_ext;
|
||||
module$exports$Blockly$Dart.dartGenerator.text_count=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"SUB",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_count",`
|
||||
int ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String haystack, String needle) {
|
||||
if (needle.length == 0) {
|
||||
return haystack.length + 1;
|
||||
}
|
||||
int index = 0;
|
||||
int count = 0;
|
||||
while (index != -1) {
|
||||
index = haystack.indexOf(needle, index);
|
||||
if (index != -1) {
|
||||
count++;
|
||||
index += needle.length;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
`)+"("+b+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_replace=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FROM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TO",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return[b+".replaceAll("+c+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.text_reverse=function(a){return["new String.fromCharCodes("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+".runes.toList().reversed)",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX]};var module$exports$Blockly$Dart$procedures={},module$contents$Blockly$Dart$procedures_NameType=$.NameType$$module$build$src$core$names;
|
||||
module$exports$Blockly$Dart.dartGenerator.procedures_defreturn=function(a){const b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE);var c="";module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&(c+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,
|
||||
a));c&&(c=module$exports$Blockly$Dart.dartGenerator.prefixLines(c,module$exports$Blockly$Dart.dartGenerator.INDENT));let d="";module$exports$Blockly$Dart.dartGenerator.INFINITE_LOOP_TRAP&&(d=module$exports$Blockly$Dart.dartGenerator.prefixLines(module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.INFINITE_LOOP_TRAP,a),module$exports$Blockly$Dart.dartGenerator.INDENT));const e=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"STACK");let f=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
||||
"RETURN",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"",g="";e&&f&&(g=c);f&&(f=module$exports$Blockly$Dart.dartGenerator.INDENT+"return "+f+";\n");const h=f?"dynamic":"void",k=[],l=a.getVars();for(let m=0;m<l.length;m++)k[m]=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(l[m],$.NameType$$module$build$src$core$names.VARIABLE);c=h+" "+b+"("+k.join(", ")+") {\n"+c+d+e+g+f+"}";c=module$exports$Blockly$Dart.dartGenerator.scrub_(a,c);module$exports$Blockly$Dart.dartGenerator.definitions_["%"+
|
||||
b]=c;return null};module$exports$Blockly$Dart.dartGenerator.procedures_defnoreturn=module$exports$Blockly$Dart.dartGenerator.procedures_defreturn;
|
||||
module$exports$Blockly$Dart.dartGenerator.procedures_callreturn=function(a){const b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE),c=[],d=a.getVars();for(let e=0;e<d.length;e++)c[e]=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ARG"+e,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null";return[b+"("+c.join(", ")+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.procedures_callnoreturn=function(a){return module$exports$Blockly$Dart.dartGenerator.procedures_callreturn(a)[0]+";\n"};
|
||||
module$exports$Blockly$Dart.dartGenerator.procedures_ifreturn=function(a){let b="if ("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"CONDITION",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"false")+") {\n";module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$Dart.dartGenerator.prefixLines(module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Dart.dartGenerator.INDENT));
|
||||
a.hasReturnValue_?(a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null",b+=module$exports$Blockly$Dart.dartGenerator.INDENT+"return "+a+";\n"):b+=module$exports$Blockly$Dart.dartGenerator.INDENT+"return;\n";return b+"}\n"};var module$exports$Blockly$Dart$math={},module$contents$Blockly$Dart$math_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.addReservedWords("Math");
|
||||
module$exports$Blockly$Dart.dartGenerator.math_number=function(a){a=Number(a.getFieldValue("NUM"));let b;Infinity===a?(a="double.infinity",b=module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX):-Infinity===a?(a="-double.infinity",b=module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX):b=0>a?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC;return[a,b]};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_arithmetic=function(a){var b={ADD:[" + ",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE],MINUS:[" - ",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE],MULTIPLY:[" * ",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE],POWER:[null,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE]}[a.getFieldValue("OP")];const c=b[0];b=b[1];const d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
||||
"A",b)||"0";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"B",b)||"0";return c?[d+c+a,b]:(module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;",["Math.pow("+d+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX])};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_single=function(a){const b=a.getFieldValue("OP");let c;if("NEG"===b)return a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"NUM",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX)||"0","-"===a[0]&&(a=" "+a),["-"+a,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX];module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";a="ABS"===b||"ROUND"===b.substring(0,5)?module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
||||
"NUM",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"0":"SIN"===b||"COS"===b||"TAN"===b?module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"NUM",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE)||"0":module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"NUM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0";switch(b){case "ABS":c=a+".abs()";break;case "ROOT":c="Math.sqrt("+a+")";break;case "LN":c="Math.log("+a+")";break;case "EXP":c="Math.exp("+a+")";
|
||||
break;case "POW10":c="Math.pow(10,"+a+")";break;case "ROUND":c=a+".round()";break;case "ROUNDUP":c=a+".ceil()";break;case "ROUNDDOWN":c=a+".floor()";break;case "SIN":c="Math.sin("+a+" / 180 * Math.pi)";break;case "COS":c="Math.cos("+a+" / 180 * Math.pi)";break;case "TAN":c="Math.tan("+a+" / 180 * Math.pi)"}if(c)return[c,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];switch(b){case "LOG10":c="Math.log("+a+") / Math.log(10)";break;case "ASIN":c="Math.asin("+a+") / Math.pi * 180";break;
|
||||
case "ACOS":c="Math.acos("+a+") / Math.pi * 180";break;case "ATAN":c="Math.atan("+a+") / Math.pi * 180";break;default:throw Error("Unknown math operator: "+b);}return[c,module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE]};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_constant=function(a){const b={PI:["Math.pi",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX],E:["Math.e",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE],SQRT2:["Math.sqrt2",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX],SQRT1_2:["Math.sqrt1_2",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX],
|
||||
INFINITY:["double.infinity",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};a=a.getFieldValue("CONSTANT");"INFINITY"!==a&&(module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;");return b[a]};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_number_property=function(a){var b={EVEN:[" % 2 == 0",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Dart.dartGenerator.ORDER_EQUALITY],ODD:[" % 2 == 1",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Dart.dartGenerator.ORDER_EQUALITY],WHOLE:[" % 1 == 0",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Dart.dartGenerator.ORDER_EQUALITY],POSITIVE:[" > 0",
|
||||
module$exports$Blockly$Dart.dartGenerator.ORDER_RELATIONAL,module$exports$Blockly$Dart.dartGenerator.ORDER_RELATIONAL],NEGATIVE:[" < 0",module$exports$Blockly$Dart.dartGenerator.ORDER_RELATIONAL,module$exports$Blockly$Dart.dartGenerator.ORDER_RELATIONAL],DIVISIBLE_BY:[null,module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Dart.dartGenerator.ORDER_EQUALITY],PRIME:[null,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
const c=a.getFieldValue("PROPERTY"),[d,e,f]=b[c];b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"NUMBER_TO_CHECK",e)||"0";if("PRIME"===c)module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;",a=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_isPrime",`
|
||||
bool ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
||||
// https://en.wikipedia.org/wiki/Primality_test#Naive_methods
|
||||
if (n == 2 || n == 3) {
|
||||
return true;
|
||||
}
|
||||
// False if n is null, negative, is 1, or not whole.
|
||||
// And false if n is divisible by 2 or 3.
|
||||
if (n == null || n <= 1 || n % 1 != 0 || n % 2 == 0 || n % 3 == 0) {
|
||||
return false;
|
||||
}
|
||||
// Check all the numbers of form 6k +/- 1, up to sqrt(n).
|
||||
for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {
|
||||
if (n % (x - 1) == 0 || n % (x + 1) == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
`)+"("+b+")";else if("DIVISIBLE_BY"===c){a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"DIVISOR",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE)||"0";if("0"===a)return["false",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC];a=b+" % "+a+" == 0"}else a=b+d;return[a,f]};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_change=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"DELTA",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE)||"0";a=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);return a+" = ("+a+" is num ? "+a+" : 0) + "+b+";\n"};module$exports$Blockly$Dart.dartGenerator.math_round=module$exports$Blockly$Dart.dartGenerator.math_single;
|
||||
module$exports$Blockly$Dart.dartGenerator.math_trig=module$exports$Blockly$Dart.dartGenerator.math_single;module$exports$Blockly$Dart.dartGenerator.math_on_list=function(a){var b=a.getFieldValue("OP");a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"[]";switch(b){case "SUM":b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_sum",`
|
||||
num ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List<num> myList) {
|
||||
num sumVal = 0;
|
||||
myList.forEach((num entry) {sumVal += entry;});
|
||||
return sumVal;
|
||||
}
|
||||
`)+"("+a+")";break;case "MIN":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_min",`
|
||||
num ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List<num> myList) {
|
||||
if (myList.isEmpty) return null;
|
||||
num minVal = myList[0];
|
||||
myList.forEach((num entry) {minVal = Math.min(minVal, entry);});
|
||||
return minVal;
|
||||
}
|
||||
`)+"("+a+")";break;case "MAX":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_max",`
|
||||
num ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List<num> myList) {
|
||||
if (myList.isEmpty) return null;
|
||||
num maxVal = myList[0];
|
||||
myList.forEach((num entry) {maxVal = Math.max(maxVal, entry);});
|
||||
return maxVal;
|
||||
}
|
||||
`)+"("+a+")";break;case "AVERAGE":b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_mean",`
|
||||
num ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List myList) {
|
||||
// First filter list for numbers only.
|
||||
List localList = new List.from(myList);
|
||||
localList.removeWhere((a) => a is! num);
|
||||
if (localList.isEmpty) return null;
|
||||
num sumVal = 0;
|
||||
localList.forEach((var entry) {sumVal += entry;});
|
||||
return sumVal / localList.length;
|
||||
}
|
||||
`)+"("+a+")";break;case "MEDIAN":b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_median",`
|
||||
num ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List myList) {
|
||||
// First filter list for numbers only, then sort, then return middle value
|
||||
// or the average of two middle values if list has an even number of elements.
|
||||
List localList = new List.from(myList);
|
||||
localList.removeWhere((a) => a is! num);
|
||||
if (localList.isEmpty) return null;
|
||||
localList.sort((a, b) => (a - b));
|
||||
int index = localList.length ~/ 2;
|
||||
if (localList.length % 2 == 1) {
|
||||
return localList[index];
|
||||
} else {
|
||||
return (localList[index - 1] + localList[index]) / 2;
|
||||
}
|
||||
}
|
||||
`)+"("+a+")";break;case "MODE":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_modes",`
|
||||
List ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List values) {
|
||||
List modes = [];
|
||||
List counts = [];
|
||||
int maxCount = 0;
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
var value = values[i];
|
||||
bool found = false;
|
||||
int thisCount;
|
||||
for (int j = 0; j < counts.length; j++) {
|
||||
if (counts[j][0] == value) {
|
||||
thisCount = ++counts[j][1];
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
counts.add([value, 1]);
|
||||
thisCount = 1;
|
||||
}
|
||||
maxCount = Math.max(thisCount, maxCount);
|
||||
}
|
||||
for (int j = 0; j < counts.length; j++) {
|
||||
if (counts[j][1] == maxCount) {
|
||||
modes.add(counts[j][0]);
|
||||
}
|
||||
}
|
||||
return modes;
|
||||
}
|
||||
`)+"("+a+")";break;case "STD_DEV":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_standard_deviation",`
|
||||
num ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List myList) {
|
||||
// First filter list for numbers only.
|
||||
List numbers = new List.from(myList);
|
||||
numbers.removeWhere((a) => a is! num);
|
||||
if (numbers.isEmpty) return null;
|
||||
num n = numbers.length;
|
||||
num sum = 0;
|
||||
numbers.forEach((x) => sum += x);
|
||||
num mean = sum / n;
|
||||
num sumSquare = 0;
|
||||
numbers.forEach((x) => sumSquare += Math.pow(x - mean, 2));
|
||||
return Math.sqrt(sumSquare / n);
|
||||
}
|
||||
`)+"("+a+")";break;case "RANDOM":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_random_item",`
|
||||
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List myList) {
|
||||
int x = new Math.Random().nextInt(myList.length);
|
||||
return myList[x];
|
||||
}
|
||||
`)+"("+a+")";break;default:throw Error("Unknown operator: "+b);}return[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_modulo=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"DIVIDEND",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE)||"0";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"DIVISOR",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE)||"0";return[b+" % "+a,module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE]};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_constrain=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LOW",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"HIGH",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||
|
||||
"double.infinity";return["Math.min(Math.max("+b+", "+c+"), "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_random_int=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FROM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TO",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("math_random_int",
|
||||
`
|
||||
int ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(num a, num b) {
|
||||
if (a > b) {
|
||||
// Swap a and b to ensure a is smaller.
|
||||
num c = a;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
return new Math.Random().nextInt(b - a + 1) + a;
|
||||
}
|
||||
`)+"("+b+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.math_random_float=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";return["new Math.Random().nextDouble()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.math_atan2=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"X",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0";return["Math.atan2("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"Y",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0")+", "+b+") / Math.pi * 180",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE]};var module$exports$Blockly$Dart$loops={},module$contents$Blockly$Dart$loops_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$Dart$loops_NameType=$.NameType$$module$build$src$core$names;
|
||||
module$exports$Blockly$Dart.dartGenerator.controls_repeat_ext=function(a){let b;b=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TIMES",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"0";let c=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO");c=module$exports$Blockly$Dart.dartGenerator.addLoopTrap(c,a);a="";const d=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("count",$.NameType$$module$build$src$core$names.VARIABLE);
|
||||
let e=b;b.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(b)||(e=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("repeat_end",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+e+" = "+b+";\n");return a+("for (int "+d+" = 0; "+d+" < "+e+"; "+d+"++) {\n"+c+"}\n")};module$exports$Blockly$Dart.dartGenerator.controls_repeat=module$exports$Blockly$Dart.dartGenerator.controls_repeat_ext;
|
||||
module$exports$Blockly$Dart.dartGenerator.controls_whileUntil=function(a){const b="UNTIL"===a.getFieldValue("MODE");let c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"BOOL",b?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"false",d=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO");d=module$exports$Blockly$Dart.dartGenerator.addLoopTrap(d,a);b&&(c="!"+c);return"while ("+c+") {\n"+d+"}\n"};
|
||||
module$exports$Blockly$Dart.dartGenerator.controls_for=function(a){var b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FROM",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"0",d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TO",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"0";const e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
||||
"BY",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"1";let f=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO");f=module$exports$Blockly$Dart.dartGenerator.addLoopTrap(f,a);if($.module$build$src$core$utils$string.isNumber(c)&&$.module$build$src$core$utils$string.isNumber(d)&&$.module$build$src$core$utils$string.isNumber(e)){var g=Number(c)<=Number(d);a="for ("+b+" = "+c+"; "+b+(g?" <= ":" >= ")+d+"; "+b;b=Math.abs(Number(e));a=1===b?a+(g?"++":"--"):a+((g?" += ":" -= ")+
|
||||
b);a+=") {\n"+f+"}\n"}else a="",g=c,c.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(c)||(g=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName(b+"_start",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+g+" = "+c+";\n"),c=d,d.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(d)||(c=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName(b+"_end",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+c+" = "+d+";\n"),d=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName(b+
|
||||
"_inc",$.NameType$$module$build$src$core$names.VARIABLE),a+="num "+d+" = ",a=$.module$build$src$core$utils$string.isNumber(e)?a+(Math.abs(e)+";\n"):a+("("+e+").abs();\n"),a+="if ("+g+" > "+c+") {\n",a+=module$exports$Blockly$Dart.dartGenerator.INDENT+d+" = -"+d+";\n",a=a+"}\nfor ("+(b+" = "+g+"; "+d+" >= 0 ? "+b+" <= "+c+" : "+b+" >= "+c+"; "+b+" += "+d+") {\n"+f+"}\n");return a};
|
||||
module$exports$Blockly$Dart.dartGenerator.controls_forEach=function(a){const b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"[]";let d=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO");d=module$exports$Blockly$Dart.dartGenerator.addLoopTrap(d,a);return"for (var "+b+" in "+
|
||||
c+") {\n"+d+"}\n"};
|
||||
module$exports$Blockly$Dart.dartGenerator.controls_flow_statements=function(a){let b="";module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX&&(b+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,a));if(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX){const c=a.getSurroundLoop();
|
||||
c&&!c.suppressPrefixSuffix&&(b+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX,c))}switch(a.getFieldValue("FLOW")){case "BREAK":return b+"break;\n";case "CONTINUE":return b+"continue;\n"}throw Error("Unknown flow statement.");};var module$exports$Blockly$Dart$logic={};
|
||||
module$exports$Blockly$Dart.dartGenerator.controls_if=function(a){let b=0,c="",d,e;module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX,a));do e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"IF"+b,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"false",d=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO"+b),module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&
|
||||
(d=module$exports$Blockly$Dart.dartGenerator.prefixLines(module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Dart.dartGenerator.INDENT)+d),c+=(0<b?"else ":"")+"if ("+e+") {\n"+d+"}",b++;while(a.getInput("IF"+b));if(a.getInput("ELSE")||module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX)d=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"ELSE"),module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&
|
||||
(d=module$exports$Blockly$Dart.dartGenerator.prefixLines(module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Dart.dartGenerator.INDENT)+d),c+=" else {\n"+d+"}";return c+"\n"};module$exports$Blockly$Dart.dartGenerator.controls_ifelse=module$exports$Blockly$Dart.dartGenerator.controls_if;
|
||||
module$exports$Blockly$Dart.dartGenerator.logic_compare=function(a){const b={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c="=="===b||"!="===b?module$exports$Blockly$Dart.dartGenerator.ORDER_EQUALITY:module$exports$Blockly$Dart.dartGenerator.ORDER_RELATIONAL,d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"A",c)||"0";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"B",c)||"0";return[d+" "+b+" "+a,c]};
|
||||
module$exports$Blockly$Dart.dartGenerator.logic_operation=function(a){const b="AND"===a.getFieldValue("OP")?"&&":"||",c="&&"===b?module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_AND:module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_OR;let d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"A",c);a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"B",c);if(d||a){const e="&&"===b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]};
|
||||
module$exports$Blockly$Dart.dartGenerator.logic_negate=function(a){const b=module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX;return["!"+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"BOOL",b)||"true"),b]};module$exports$Blockly$Dart.dartGenerator.logic_boolean=function(a){return["TRUE"===a.getFieldValue("BOOL")?"true":"false",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};module$exports$Blockly$Dart.dartGenerator.logic_null=function(a){return["null",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Dart.dartGenerator.logic_ternary=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"IF",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"false",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"THEN",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"null";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ELSE",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"null";return[b+" ? "+c+" : "+a,module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL]};var module$exports$Blockly$Dart$lists={},module$contents$Blockly$Dart$lists_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.addReservedWords("Math");module$exports$Blockly$Dart.dartGenerator.lists_create_empty=function(a){return["[]",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_create_with=function(a){const b=Array(a.itemCount_);for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ADD"+c,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null";return["["+b.join(", ")+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_repeat=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ITEM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null";return["new List.filled("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"NUM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0")+", "+b+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_length=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+".length",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_isEmpty=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+".isEmpty",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_indexOf=function(a){var b="FIRST"===a.getFieldValue("END")?"indexOf":"lastIndexOf";const c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FIND",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";b=(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+"."+b+"("+c+")";return a.workspace.options.oneBasedIndex?[b+" + 1",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE]:
|
||||
[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_getIndex=function(a){function b(){const f=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_list",$.NameType$$module$build$src$core$names.VARIABLE),g="List "+f+" = "+e+";\n";e=f;return g}var c=a.getFieldValue("MODE")||"GET";const d=a.getFieldValue("WHERE")||"FROM_START";let e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE","RANDOM"===d||"FROM_END"===d?module$exports$Blockly$Dart.dartGenerator.ORDER_NONE:module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||
|
||||
"[]";if(("RANDOM"!==d||"REMOVE"!==c)&&"FROM_END"!==d||e.match(/^\w+$/))switch(d){case "FIRST":if("GET"===c)return[e+".first",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[e+".removeAt(0)",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("REMOVE"===c)return e+".removeAt(0);\n";break;case "LAST":if("GET"===c)return[e+".last",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[e+".removeLast()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];
|
||||
if("REMOVE"===c)return e+".removeLast();\n";break;case "FROM_START":a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT");if("GET"===c)return[e+"["+a+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[e+".removeAt("+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("REMOVE"===c)return e+".removeAt("+a+");\n";break;case "FROM_END":a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);
|
||||
if("GET"===c)return[e+"["+e+".length - "+a+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c||"REMOVE"===c){a=e+".removeAt("+e+".length - "+a+")";if("GET_REMOVE"===c)return[a,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("REMOVE"===c)return a+";\n"}break;case "RANDOM":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";if("REMOVE"===c)return c=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_x",
|
||||
$.NameType$$module$build$src$core$names.VARIABLE),"int "+c+" = new Math.Random().nextInt("+e+".length);\n"+(e+".removeAt("+c+");\n");if("GET"===c)return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_random_item",`
|
||||
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list) {
|
||||
int x = new Math.Random().nextInt(my_list.length);
|
||||
return my_list[x];
|
||||
}
|
||||
`)+"("+e+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_remove_random_item",`
|
||||
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list) {
|
||||
int x = new Math.Random().nextInt(my_list.length);
|
||||
return my_list.removeAt(x);
|
||||
}
|
||||
`)+"("+e+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}else{if("RANDOM"===d)return module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;",c=b(),a=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_x",$.NameType$$module$build$src$core$names.VARIABLE),c+("int "+a+" = new Math.Random().nextInt("+e+".length);\n")+(e+".removeAt("+a+");\n");if("REMOVE"===c)return c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,
|
||||
"AT",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE),b()+(e+".removeAt("+e+".length - "+c+");\n");if("GET"===c)return c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1),[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_from_end",`
|
||||
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list, num x) {
|
||||
x = my_list.length - x;
|
||||
return my_list[x];
|
||||
}
|
||||
`)+"("+e+", "+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1),[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_remove_from_end",`
|
||||
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list, num x) {
|
||||
x = my_list.length - x;
|
||||
return my_list.removeAt(x);
|
||||
}
|
||||
`)+"("+e+", "+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}throw Error("Unhandled combination (lists_getIndex).");};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_setIndex=function(a){function b(){if(e.match(/^\w+$/))return"";const g=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_list",$.NameType$$module$build$src$core$names.VARIABLE),h="List "+g+" = "+e+";\n";e=g;return h}const c=a.getFieldValue("MODE")||"GET";var d=a.getFieldValue("WHERE")||"FROM_START";let e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||
|
||||
"[]";const f=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TO",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"null";switch(d){case "FIRST":if("SET"===c)return e+"[0] = "+f+";\n";if("INSERT"===c)return e+".insert(0, "+f+");\n";break;case "LAST":if("SET"===c)return b()+(e+"["+e+".length - 1] = "+f+";\n");if("INSERT"===c)return e+".add("+f+");\n";break;case "FROM_START":a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT");if("SET"===c)return e+"["+a+"] = "+f+";\n";
|
||||
if("INSERT"===c)return e+".insert("+a+", "+f+");\n";break;case "FROM_END":a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);d=b();if("SET"===c)return d+(e+"["+e+".length - "+a+"] = "+f+";\n");if("INSERT"===c)return d+(e+".insert("+e+".length - "+a+", "+f+");\n");break;case "RANDOM":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";a=b();d=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_x",
|
||||
$.NameType$$module$build$src$core$names.VARIABLE);a+="int "+d+" = new Math.Random().nextInt("+e+".length);\n";if("SET"===c)return a+(e+"["+d+"] = "+f+";\n");if("INSERT"===c)return a+(e+".insert("+d+", "+f+");\n")}throw Error("Unhandled combination (lists_setIndex).");};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_getSublist=function(a){var b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]",c=a.getFieldValue("WHERE1");const d=a.getFieldValue("WHERE2");if(b.match(/^\w+$/)||"FROM_END"!==c&&"FROM_START"===d){switch(c){case "FROM_START":c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1");break;case "FROM_END":c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1",
|
||||
1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);c=b+".length - "+c;break;case "FIRST":c="0";break;default:throw Error("Unhandled option (lists_getSublist).");}switch(d){case "FROM_START":var e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2",1);break;case "FROM_END":e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2",0,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);e=b+".length - "+e;break;case "LAST":break;default:throw Error("Unhandled option (lists_getSublist).");
|
||||
}b="LAST"===d?b+".sublist("+c+")":b+".sublist("+c+", "+e+")"}else e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1"),a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2"),b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_sublist",`
|
||||
List ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List list, String where1, num at1, String where2, num at2) {
|
||||
int getAt(String where, num at) {
|
||||
if (where == 'FROM_END') {
|
||||
at = list.length - 1 - at;
|
||||
} else if (where == 'FIRST') {
|
||||
at = 0;
|
||||
} else if (where == 'LAST') {
|
||||
at = list.length - 1;
|
||||
} else if (where != 'FROM_START') {
|
||||
throw 'Unhandled option (lists_getSublist).';
|
||||
}
|
||||
return at;
|
||||
}
|
||||
at1 = getAt(where1, at1);
|
||||
at2 = getAt(where2, at2) + 1;
|
||||
return list.sublist(at1, at2);
|
||||
}
|
||||
`)+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")";return[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.lists_sort=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"[]",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_sort",`
|
||||
List ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List list, String type, int direction) {
|
||||
var compareFuncs = {
|
||||
'NUMERIC': (a, b) => (direction * a.compareTo(b)).toInt(),
|
||||
'TEXT': (a, b) => direction * a.toString().compareTo(b.toString()),
|
||||
'IGNORE_CASE':
|
||||
(a, b) => direction *
|
||||
a.toString().toLowerCase().compareTo(b.toString().toLowerCase())
|
||||
};
|
||||
list = new List.from(list);
|
||||
var compare = compareFuncs[type];
|
||||
list.sort(compare);
|
||||
return list;
|
||||
}
|
||||
`)+"("+b+', "'+a+'", '+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_split=function(a){let b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"INPUT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX);const c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"DELIM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"===a)b||(b="''"),a="split";else if("JOIN"===a)b||(b="[]"),a="join";else throw Error("Unknown mode: "+a);return[b+"."+a+"("+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.lists_reverse=function(a){return["new List.from("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"[]")+".reversed)",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};var module$exports$Blockly$Dart$colour={};module$exports$Blockly$Dart.dartGenerator.addReservedWords("Math");module$exports$Blockly$Dart.dartGenerator.colour_picker=function(a){return[module$exports$Blockly$Dart.dartGenerator.quote_(a.getFieldValue("COLOUR")),module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Dart.dartGenerator.colour_random=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("colour_random",`
|
||||
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}() {
|
||||
String hex = '0123456789abcdef';
|
||||
var rnd = new Math.Random();
|
||||
return '#\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}'
|
||||
'\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}'
|
||||
'\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}';
|
||||
}
|
||||
`)+"()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.colour_rgb=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"RED",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||0,c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"GREEN",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||0;a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"BLUE",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||0;module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math=
|
||||
"import 'dart:math' as Math;";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("colour_rgb",`
|
||||
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(num r, num g, num b) {
|
||||
num rn = (Math.max(Math.min(r, 100), 0) * 2.55).round();
|
||||
String rs = rn.toInt().toRadixString(16);
|
||||
rs = '0$rs';
|
||||
rs = rs.substring(rs.length - 2);
|
||||
num gn = (Math.max(Math.min(g, 100), 0) * 2.55).round();
|
||||
String gs = gn.toInt().toRadixString(16);
|
||||
gs = '0$gs';
|
||||
gs = gs.substring(gs.length - 2);
|
||||
num bn = (Math.max(Math.min(b, 100), 0) * 2.55).round();
|
||||
String bs = bn.toInt().toRadixString(16);
|
||||
bs = '0$bs';
|
||||
bs = bs.substring(bs.length - 2);
|
||||
return '#$rs$gs$bs';
|
||||
}
|
||||
`)+"("+b+", "+c+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
||||
module$exports$Blockly$Dart.dartGenerator.colour_blend=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"COLOUR1",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"'#000000'",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"COLOUR2",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"'#000000'";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"RATIO",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||.5;module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math=
|
||||
"import 'dart:math' as Math;";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("colour_blend",`
|
||||
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String c1, String c2, num ratio) {
|
||||
ratio = Math.max(Math.min(ratio, 1), 0);
|
||||
int r1 = int.parse('0x\${c1.substring(1, 3)}');
|
||||
int g1 = int.parse('0x\${c1.substring(3, 5)}');
|
||||
int b1 = int.parse('0x\${c1.substring(5, 7)}');
|
||||
int r2 = int.parse('0x\${c2.substring(1, 3)}');
|
||||
int g2 = int.parse('0x\${c2.substring(3, 5)}');
|
||||
int b2 = int.parse('0x\${c2.substring(5, 7)}');
|
||||
num rn = (r1 * (1 - ratio) + r2 * ratio).round();
|
||||
String rs = rn.toInt().toRadixString(16);
|
||||
num gn = (g1 * (1 - ratio) + g2 * ratio).round();
|
||||
String gs = gn.toInt().toRadixString(16);
|
||||
num bn = (b1 * (1 - ratio) + b2 * ratio).round();
|
||||
String bs = bn.toInt().toRadixString(16);
|
||||
rs = '0$rs';
|
||||
rs = rs.substring(rs.length - 2);
|
||||
gs = '0$gs';
|
||||
gs = gs.substring(gs.length - 2);
|
||||
bs = '0$bs';
|
||||
bs = bs.substring(bs.length - 2);
|
||||
return '#$rs$gs$bs';
|
||||
}
|
||||
`)+"("+b+", "+c+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};var module$exports$Blockly$Dart$all=module$exports$Blockly$Dart;
|
||||
module$exports$Blockly$Dart.__namespace__=$;
|
||||
return module$exports$Blockly$Dart;
|
||||
}));
|
||||
|
||||
|
||||
//# sourceMappingURL=dart_compressed.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -194,4 +194,3 @@ BlocklyDevTools.Analytics.sendQueued = function() {
|
||||
// stub
|
||||
this.LOG_TO_CONSOLE_ && console.log('Analytics.sendQueued');
|
||||
};
|
||||
|
||||
|
||||
@@ -716,7 +716,7 @@ BlockDefinitionExtractor.colourBlockFromHue_ = function(hue) {
|
||||
var colourBlock = BlockDefinitionExtractor.newDomElement_(
|
||||
'block', {type: 'colour_hue'});
|
||||
colourBlock.append(BlockDefinitionExtractor.newDomElement_('mutation', {
|
||||
colour: Blockly.hueToRgb(hue)
|
||||
colour: Blockly.utils.colour.hueToHex(hue)
|
||||
}));
|
||||
colourBlock.append(BlockDefinitionExtractor.newDomElement_(
|
||||
'field', {name: 'HUE'}, hue.toString()));
|
||||
|
||||
@@ -65,18 +65,25 @@ BlockFactory.updateBlocksFlagDelayed = false;
|
||||
*/
|
||||
BlockFactory.STARTER_BLOCK_XML_TEXT =
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">' +
|
||||
'<block type="factory_base" deletable="false" movable="false">' +
|
||||
'<value name="TOOLTIP">' +
|
||||
'<block type="text" deletable="false" movable="false">' +
|
||||
'<field name="TEXT"></field></block></value>' +
|
||||
'<value name="HELPURL">' +
|
||||
'<block type="text" deletable="false" movable="false">' +
|
||||
'<field name="TEXT"></field></block></value>' +
|
||||
'<value name="COLOUR">' +
|
||||
'<block type="colour_hue">' +
|
||||
'<mutation colour="#5b67a5"></mutation>' +
|
||||
'<field name="HUE">230</field>' +
|
||||
'</block></value></block></xml>';
|
||||
'<block type="factory_base" deletable="false" movable="false">' +
|
||||
'<value name="TOOLTIP">' +
|
||||
'<block type="text" deletable="false" movable="false">' +
|
||||
'<field name="TEXT"></field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'<value name="HELPURL">' +
|
||||
'<block type="text" deletable="false" movable="false">' +
|
||||
'<field name="TEXT"></field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'<value name="COLOUR">' +
|
||||
'<block type="colour_hue">' +
|
||||
'<mutation colour="#5b67a5"></mutation>' +
|
||||
'<field name="HUE">230</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'</xml>';
|
||||
|
||||
/**
|
||||
* Change the language code format.
|
||||
@@ -178,26 +185,38 @@ BlockFactory.updatePreview = function() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Backup Blockly.Blocks definitions so we can delete them all
|
||||
// before instantiating user-defined block. This avoids a collision
|
||||
// between the main workspace and preview if the user creates a
|
||||
// 'factory_base' block, for instance.
|
||||
var originalBlocks = Object.assign(Object.create(null), Blockly.Blocks);
|
||||
try {
|
||||
// Delete existing blocks.
|
||||
for (var key in Blockly.Blocks) {
|
||||
delete Blockly.Blocks[key];
|
||||
// Don't let the user create a block type that already exists,
|
||||
// because it doesn't work.
|
||||
var warnExistingBlock = function(blockType) {
|
||||
if (blockType in Blockly.Blocks) {
|
||||
var text = `You can't make a block called ${blockType} in this tool because that name already exists.`;
|
||||
FactoryUtils.getRootBlock(BlockFactory.mainWorkspace).setWarningText(text);
|
||||
console.error(text);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var blockType = 'block_type';
|
||||
var blockCreated = false;
|
||||
try {
|
||||
if (format === 'JSON') {
|
||||
var json = JSON.parse(code);
|
||||
Blockly.Blocks[json.type || BlockFactory.UNNAMED] = {
|
||||
blockType = json.type || BlockFactory.UNNAMED;
|
||||
if (warnExistingBlock(blockType)) {
|
||||
return;
|
||||
}
|
||||
Blockly.Blocks[blockType] = {
|
||||
init: function() {
|
||||
this.jsonInit(json);
|
||||
}
|
||||
};
|
||||
} else if (format === 'JavaScript') {
|
||||
try {
|
||||
blockType = FactoryUtils.getBlockTypeFromJsDefinition(code);
|
||||
if (warnExistingBlock(blockType)) {
|
||||
return;
|
||||
}
|
||||
eval(code);
|
||||
} catch (e) {
|
||||
// TODO: Display error in the UI
|
||||
@@ -205,15 +224,7 @@ BlockFactory.updatePreview = function() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Look for newly-created block(s) (ideally just one).
|
||||
var createdTypes = Object.getOwnPropertyNames(Blockly.Blocks);
|
||||
if (createdTypes.length < 1) {
|
||||
return;
|
||||
} else if (createdTypes.length > 1) {
|
||||
console.log('Unexpectedly found more than one block definition');
|
||||
}
|
||||
var blockType = createdTypes[0];
|
||||
blockCreated = true;
|
||||
|
||||
// Create the preview block.
|
||||
var previewBlock = BlockFactory.previewWorkspace.newBlock(blockType);
|
||||
@@ -247,12 +258,12 @@ BlockFactory.updatePreview = function() {
|
||||
BlockFactory.updateBlocksFlag = false
|
||||
BlockFactory.updateBlocksFlagDelayed = false
|
||||
} finally {
|
||||
// Remove all newly-created block(s).
|
||||
for (var key in Blockly.Blocks) {
|
||||
delete Blockly.Blocks[key];
|
||||
// Remove the newly-created block.
|
||||
// We have to check if the block was actually created so that we don't remove
|
||||
// one of the built-in blocks, like factory_base.
|
||||
if (blockCreated) {
|
||||
delete Blockly.Blocks[blockType];
|
||||
}
|
||||
// Restore original blocks.
|
||||
Object.assign(Blockly.Blocks, originalBlocks);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -324,4 +335,4 @@ BlockFactory.manualEdit = function() {
|
||||
BlockFactory.updateBlocksFlag = true;
|
||||
BlockFactory.updateBlocksFlagDelayed = true;
|
||||
BlockFactory.updateLanguage();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="target-densitydpi=device-dpi, height=660, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<title>Blockly Demo: Blockly Developer Tools</title>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../javascript_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../dist/blockly_compressed.js"></script>
|
||||
<script src="../../dist/blocks_compressed.js"></script>
|
||||
<script src="../../dist/javascript_compressed.js"></script>
|
||||
<script src="../../build/msg/en.js"></script>
|
||||
<script src="analytics.js"></script>
|
||||
<script src="block_definition_extractor.js"></script>
|
||||
<script src="factory_utils.js"></script>
|
||||
|
||||
@@ -29,13 +29,13 @@ StandardCategories.categoryMap['logic'] =
|
||||
StandardCategories.categoryMap['logic'].xml =
|
||||
Blockly.Xml.textToDom(
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">' +
|
||||
'<block type="controls_if"></block>' +
|
||||
'<block type="logic_compare"></block>' +
|
||||
'<block type="logic_operation"></block>' +
|
||||
'<block type="logic_negate"></block>' +
|
||||
'<block type="logic_boolean"></block>' +
|
||||
'<block type="logic_null"></block>' +
|
||||
'<block type="logic_ternary"></block>' +
|
||||
'<block type="controls_if"></block>' +
|
||||
'<block type="logic_compare"></block>' +
|
||||
'<block type="logic_operation"></block>' +
|
||||
'<block type="logic_negate"></block>' +
|
||||
'<block type="logic_boolean"></block>' +
|
||||
'<block type="logic_null"></block>' +
|
||||
'<block type="logic_ternary"></block>' +
|
||||
'</xml>');
|
||||
StandardCategories.categoryMap['logic'].hue = 210;
|
||||
|
||||
@@ -44,33 +44,33 @@ StandardCategories.categoryMap['loops'] =
|
||||
StandardCategories.categoryMap['loops'].xml =
|
||||
Blockly.Xml.textToDom(
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">' +
|
||||
'<block type="controls_repeat_ext">' +
|
||||
'<value name="TIMES">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">10</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="controls_whileUntil"></block>' +
|
||||
'<block type="controls_for">' +
|
||||
'<value name="FROM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="TO">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">10</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="BY">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="controls_forEach"></block>' +
|
||||
'<block type="controls_flow_statements"></block>' +
|
||||
'<block type="controls_repeat_ext">' +
|
||||
'<value name="TIMES">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">10</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="controls_whileUntil"></block>' +
|
||||
'<block type="controls_for">' +
|
||||
'<value name="FROM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="TO">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">10</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="BY">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="controls_forEach"></block>' +
|
||||
'<block type="controls_flow_statements"></block>' +
|
||||
'</xml>');
|
||||
StandardCategories.categoryMap['loops'].hue = 120;
|
||||
|
||||
@@ -79,91 +79,91 @@ StandardCategories.categoryMap['math'] =
|
||||
StandardCategories.categoryMap['math'].xml =
|
||||
Blockly.Xml.textToDom(
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">' +
|
||||
'<block type="math_number"></block>' +
|
||||
'<block type="math_arithmetic">' +
|
||||
'<value name="A">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="B">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_single">' +
|
||||
'<value name="NUM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">9</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_trig">' +
|
||||
'<value name="NUM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">45</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_constant"></block>' +
|
||||
'<block type="math_number_property">' +
|
||||
'<value name="NUMBER_TO_CHECK">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">0</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_round">' +
|
||||
'<value name="NUM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">3.1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_on_list"></block>' +
|
||||
'<block type="math_modulo">' +
|
||||
'<value name="DIVIDEND">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">64</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="DIVISOR">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">10</field>'+
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_constrain">' +
|
||||
'<value name="VALUE">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">50</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="LOW">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="HIGH">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">100</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_random_int">' +
|
||||
'<value name="FROM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="TO">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">100</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_random_float"></block>' +
|
||||
'<block type="math_number"></block>' +
|
||||
'<block type="math_arithmetic">' +
|
||||
'<value name="A">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="B">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_single">' +
|
||||
'<value name="NUM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">9</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_trig">' +
|
||||
'<value name="NUM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">45</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_constant"></block>' +
|
||||
'<block type="math_number_property">' +
|
||||
'<value name="NUMBER_TO_CHECK">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">0</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_round">' +
|
||||
'<value name="NUM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">3.1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_on_list"></block>' +
|
||||
'<block type="math_modulo">' +
|
||||
'<value name="DIVIDEND">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">64</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="DIVISOR">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">10</field>'+
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_constrain">' +
|
||||
'<value name="VALUE">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">50</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="LOW">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="HIGH">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">100</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_random_int">' +
|
||||
'<value name="FROM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">1</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="TO">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">100</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="math_random_float"></block>' +
|
||||
'</xml>');
|
||||
StandardCategories.categoryMap['math'].hue = 230;
|
||||
|
||||
@@ -172,81 +172,81 @@ StandardCategories.categoryMap['text'] =
|
||||
StandardCategories.categoryMap['text'].xml =
|
||||
Blockly.Xml.textToDom(
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">' +
|
||||
'<block type="text"></block>' +
|
||||
'<block type="text_join"></block>' +
|
||||
'<block type="text_append">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text"></shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_length">' +
|
||||
'<value name="VALUE">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_isEmpty">' +
|
||||
'<value name="VALUE">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT"></field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_indexOf">' +
|
||||
'<value name="VALUE">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">text</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'<value name="FIND">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_charAt">' +
|
||||
'<value name="VALUE">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">text</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_getSubstring">' +
|
||||
'<value name="STRING">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">text</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_changeCase">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_trim">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_print">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_prompt_ext">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text"></block>' +
|
||||
'<block type="text_join"></block>' +
|
||||
'<block type="text_append">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text"></shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_length">' +
|
||||
'<value name="VALUE">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_isEmpty">' +
|
||||
'<value name="VALUE">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT"></field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_indexOf">' +
|
||||
'<value name="VALUE">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">text</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'<value name="FIND">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_charAt">' +
|
||||
'<value name="VALUE">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">text</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_getSubstring">' +
|
||||
'<value name="STRING">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">text</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_changeCase">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_trim">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_print">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="text_prompt_ext">' +
|
||||
'<value name="TEXT">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">abc</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'</xml>');
|
||||
StandardCategories.categoryMap['text'].hue = 160;
|
||||
|
||||
@@ -255,55 +255,55 @@ StandardCategories.categoryMap['lists'] =
|
||||
StandardCategories.categoryMap['lists'].xml =
|
||||
Blockly.Xml.textToDom(
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">' +
|
||||
'<block type="lists_create_with">' +
|
||||
'<mutation items="0"></mutation>' +
|
||||
'</block>' +
|
||||
'<block type="lists_create_with"></block>' +
|
||||
'<block type="lists_repeat">' +
|
||||
'<value name="NUM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">5</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_length"></block>' +
|
||||
'<block type="lists_isEmpty"></block>' +
|
||||
'<block type="lists_indexOf">' +
|
||||
'<value name="VALUE">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">list</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_getIndex">' +
|
||||
'<value name="VALUE">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">list</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_setIndex">' +
|
||||
'<value name="LIST">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">list</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_getSublist">' +
|
||||
'<value name="LIST">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">list</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_split">' +
|
||||
'<value name="DELIM">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">,</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_sort"></block>' +
|
||||
'<block type="lists_create_with">' +
|
||||
'<mutation items="0"></mutation>' +
|
||||
'</block>' +
|
||||
'<block type="lists_create_with"></block>' +
|
||||
'<block type="lists_repeat">' +
|
||||
'<value name="NUM">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">5</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_length"></block>' +
|
||||
'<block type="lists_isEmpty"></block>' +
|
||||
'<block type="lists_indexOf">' +
|
||||
'<value name="VALUE">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">list</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_getIndex">' +
|
||||
'<value name="VALUE">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">list</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_setIndex">' +
|
||||
'<value name="LIST">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">list</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_getSublist">' +
|
||||
'<value name="LIST">' +
|
||||
'<block type="variables_get">' +
|
||||
'<field name="VAR">list</field>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_split">' +
|
||||
'<value name="DELIM">' +
|
||||
'<shadow type="text">' +
|
||||
'<field name="TEXT">,</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="lists_sort"></block>' +
|
||||
'</xml>');
|
||||
StandardCategories.categoryMap['lists'].hue = 260;
|
||||
|
||||
@@ -312,42 +312,42 @@ StandardCategories.categoryMap['colour'] =
|
||||
StandardCategories.categoryMap['colour'].xml =
|
||||
Blockly.Xml.textToDom(
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">' +
|
||||
'<block type="colour_picker"></block>' +
|
||||
'<block type="colour_random"></block>' +
|
||||
'<block type="colour_rgb">' +
|
||||
'<value name="RED">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">100</field>' +
|
||||
'<block type="colour_picker"></block>' +
|
||||
'<block type="colour_random"></block>' +
|
||||
'<block type="colour_rgb">' +
|
||||
'<value name="RED">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">100</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="GREEN">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">50</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="BLUE">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">0</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="colour_blend">' +
|
||||
'<value name="COLOUR1">' +
|
||||
'<shadow type="colour_picker">' +
|
||||
'<field name="COLOUR">#ff0000</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="COLOUR2">' +
|
||||
'<shadow type="colour_picker">' +
|
||||
'<field name="COLOUR">#3333ff</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="RATIO">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">0.5</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="GREEN">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">50</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="BLUE">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">0</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'<block type="colour_blend">' +
|
||||
'<value name="COLOUR1">' +
|
||||
'<shadow type="colour_picker">' +
|
||||
'<field name="COLOUR">#ff0000</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="COLOUR2">' +
|
||||
'<shadow type="colour_picker">' +
|
||||
'<field name="COLOUR">#3333ff</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'<value name="RATIO">' +
|
||||
'<shadow type="math_number">' +
|
||||
'<field name="NUM">0.5</field>' +
|
||||
'</shadow>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'</value>' +
|
||||
'</block>' +
|
||||
'</xml>');
|
||||
StandardCategories.categoryMap['colour'].hue = 20;
|
||||
|
||||
|
||||
@@ -606,7 +606,7 @@ WorkspaceFactoryController.prototype.loadCategoryByName = function(name) {
|
||||
// Update the copy in the view.
|
||||
var tab = this.view.addCategoryRow(copy.name, copy.id);
|
||||
this.addClickToSwitch(tab, copy.id);
|
||||
// Color the category tab in the view.
|
||||
// Colour the category tab in the view.
|
||||
if (copy.colour) {
|
||||
this.view.setBorderColour(copy.id, copy.colour);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ WorkspaceFactoryGenerator = function(model) {
|
||||
var hiddenBlocks = document.createElement('div');
|
||||
// Generate a globally unique ID for the hidden div element to avoid
|
||||
// collisions.
|
||||
var hiddenBlocksId = Blockly.utils.genUid();
|
||||
var hiddenBlocksId = Blockly.utils.idGenerator.genUid();
|
||||
hiddenBlocks.id = hiddenBlocksId;
|
||||
hiddenBlocks.style.display = 'none';
|
||||
document.body.appendChild(hiddenBlocks);
|
||||
|
||||
@@ -477,7 +477,7 @@ ListElement = function(type, opt_name) {
|
||||
// Name of category. Can be changed by user. Null if separator.
|
||||
this.name = opt_name ? opt_name : null;
|
||||
// Unique ID of element. Does not change.
|
||||
this.id = Blockly.utils.genUid();
|
||||
this.id = Blockly.utils.idGenerator.genUid();
|
||||
// Colour of category. Default is no colour. Null if separator.
|
||||
this.colour = null;
|
||||
// Stores a custom tag, if necessary. Null if no custom tag or separator.
|
||||
@@ -538,7 +538,7 @@ ListElement.prototype.changeColour = function(colour) {
|
||||
ListElement.prototype.copy = function() {
|
||||
copy = new ListElement(this.type);
|
||||
// Generate a unique ID for the element.
|
||||
copy.id = Blockly.utils.genUid();
|
||||
copy.id = Blockly.utils.idGenerator.genUid();
|
||||
// Copy all attributes except ID.
|
||||
copy.name = this.name;
|
||||
copy.xml = this.xml;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
* Depends on WorkspaceFactoryController (for adding mouse listeners). Tabs for
|
||||
* each category are stored in tab map, which associates a unique ID for a
|
||||
* category with a particular tab.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -122,7 +121,7 @@ WorkspaceFactoryView.prototype.createCategoryIdName = function(name) {
|
||||
WorkspaceFactoryView.prototype.setCategoryTabSelection =
|
||||
function(id, selected) {
|
||||
if (!this.tabMap[id]) {
|
||||
return; // Exit if tab does not exist.
|
||||
return; // Exit if tab does not exist.
|
||||
}
|
||||
this.tabMap[id].className = selected ? 'tabon' : 'taboff';
|
||||
};
|
||||
@@ -144,8 +143,8 @@ WorkspaceFactoryView.prototype.bindClick = function(el, func) {
|
||||
/**
|
||||
* Creates a file and downloads it. In some browsers downloads, and in other
|
||||
* browsers, opens new tab with contents.
|
||||
* @param {string} filename Name of file
|
||||
* @param {!Blob} data Blob containing contents to download
|
||||
* @param {string} filename Name of file.
|
||||
* @param {!Blob} data Blob containing contents to download.
|
||||
*/
|
||||
WorkspaceFactoryView.prototype.createAndDownloadFile =
|
||||
function(filename, data) {
|
||||
@@ -164,8 +163,8 @@ WorkspaceFactoryView.prototype.createAndDownloadFile =
|
||||
/**
|
||||
* Given the ID of a certain category, updates the corresponding tab in
|
||||
* the DOM to show a new name.
|
||||
* @param {string} newName Name of string to be displayed on tab
|
||||
* @param {string} id ID of category to be updated
|
||||
* @param {string} newName Name of string to be displayed on tab.
|
||||
* @param {string} id ID of category to be updated.
|
||||
*/
|
||||
WorkspaceFactoryView.prototype.updateCategoryName = function(newName, id) {
|
||||
this.tabMap[id].textContent = newName;
|
||||
@@ -311,7 +310,7 @@ WorkspaceFactoryView.prototype.markShadowBlocks = function(blocks) {
|
||||
*/
|
||||
WorkspaceFactoryView.prototype.markShadowBlock = function(block) {
|
||||
// Add Blockly CSS for user-generated shadow blocks.
|
||||
Blockly.utils.dom.addClass(block.svgGroup_, 'shadowBlock');
|
||||
block.getSvgRoot().classList.add('shadowBlock');
|
||||
// If not a valid shadow block, add a warning message.
|
||||
if (!block.getSurroundParent()) {
|
||||
block.setWarningText('Shadow blocks must be nested inside' +
|
||||
@@ -329,7 +328,7 @@ WorkspaceFactoryView.prototype.markShadowBlock = function(block) {
|
||||
*/
|
||||
WorkspaceFactoryView.prototype.unmarkShadowBlock = function(block) {
|
||||
// Remove Blockly CSS for user-generated shadow blocks.
|
||||
Blockly.utils.dom.removeClass(block.svgGroup_, 'shadowBlock');
|
||||
block.getSvgRoot().classList.remove('shadowBlock');
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -387,8 +386,7 @@ WorkspaceFactoryView.prototype.setBaseOptions = function() {
|
||||
|
||||
// Check infinite blocks and hide suboption.
|
||||
document.getElementById('option_infiniteBlocks_checkbox').checked = true;
|
||||
document.getElementById('maxBlockNumber_option').style.display =
|
||||
'none';
|
||||
document.getElementById('maxBlockNumber_option').style.display = 'none';
|
||||
|
||||
// Uncheck grid and zoom options and hide suboptions.
|
||||
document.getElementById('option_grid_checkbox').checked = false;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<title>Blockly Demo: Block Factory</title>
|
||||
<script src="/storage.js"></script>
|
||||
<script src="factory.js"></script>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
<script src="../../dist/blockly_compressed.js"></script>
|
||||
<script src="../../build/msg/en.js"></script>
|
||||
<script src="blocks.js"></script>
|
||||
<style>
|
||||
html, body {
|
||||
|
||||
@@ -373,7 +373,7 @@ Code.renderContent = function() {
|
||||
|
||||
/**
|
||||
* Attempt to generate the code and display it in the UI, pretty printed.
|
||||
* @param generator {!Blockly.Generator} The generator to use.
|
||||
* @param generator {!Blockly.CodeGenerator} The generator to use.
|
||||
*/
|
||||
Code.attemptCodeGeneration = function(generator) {
|
||||
var content = document.getElementById('content_' + Code.selected);
|
||||
@@ -388,7 +388,7 @@ Code.attemptCodeGeneration = function(generator) {
|
||||
|
||||
/**
|
||||
* Check whether all blocks in use have generator functions.
|
||||
* @param generator {!Blockly.Generator} The generator to use.
|
||||
* @param generator {!Blockly.CodeGenerator} The generator to use.
|
||||
*/
|
||||
Code.checkAllGeneratorFunctionsDefined = function(generator) {
|
||||
var blocks = Code.workspace.getAllBlocks(false);
|
||||
@@ -621,6 +621,6 @@ Code.discard = function() {
|
||||
// Load the Code demo's language strings.
|
||||
document.write('<script src="msg/' + Code.LANG + '.js"></script>\n');
|
||||
// Load Blockly's language strings.
|
||||
document.write('<script src="../../msg/js/' + Code.LANG + '.js"></script>\n');
|
||||
document.write('<script src="../../build/msg/' + Code.LANG + '.js"></script>\n');
|
||||
|
||||
window.addEventListener('load', Code.init);
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
<title>Blockly Demo:</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="/storage.js"></script>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../javascript_compressed.js"></script>
|
||||
<script src="../../python_compressed.js"></script>
|
||||
<script src="../../php_compressed.js"></script>
|
||||
<script src="../../lua_compressed.js"></script>
|
||||
<script src="../../dart_compressed.js"></script>
|
||||
<script src="../../dist/blockly_compressed.js"></script>
|
||||
<script src="../../dist/blocks_compressed.js"></script>
|
||||
<script src="../../dist/javascript_compressed.js"></script>
|
||||
<script src="../../dist/python_compressed.js"></script>
|
||||
<script src="../../dist/php_compressed.js"></script>
|
||||
<script src="../../dist/lua_compressed.js"></script>
|
||||
<script src="../../dist/dart_compressed.js"></script>
|
||||
<script src="code.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Minimap</title>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
<script src="../../dist/blockly_compressed.js"></script>
|
||||
<script src="../../dist/blocks_compressed.js"></script>
|
||||
<script src="../../build/msg/en.js"></script>
|
||||
<script src="minimap.js"></script>
|
||||
<style>
|
||||
body {
|
||||
|
||||
@@ -28,16 +28,30 @@ task copyBlocklyHtmlFile(type: Copy) {
|
||||
rename('index.html', 'webview.html')
|
||||
}
|
||||
|
||||
task copyBlocklyMoreFiles(type: Copy) {
|
||||
task copyBlocklyDistFiles(type: Copy) {
|
||||
from('../../../../dist') {
|
||||
include 'blockly_compressed.js', 'blocks_compressed.js'
|
||||
}
|
||||
into project(':app').file('./src/main/assets/blockly')
|
||||
}
|
||||
|
||||
task copyBlocklyBuildFiles(type: Copy) {
|
||||
from('../../../../build') {
|
||||
include 'msg/**'
|
||||
}
|
||||
into project(':app').file('./src/main/assets/blockly')
|
||||
}
|
||||
|
||||
task copyBlocklyMediaFiles(type: Copy) {
|
||||
from('../../../..') {
|
||||
include 'blockly_compressed.js', 'blocks_compressed.js', 'msg/js/**', 'media/**'
|
||||
include 'media/**'
|
||||
exclude 'media/test_*'
|
||||
}
|
||||
into project(':app').file('./src/main/assets/blockly')
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
preBuild.dependsOn(copyBlocklyHtmlFile, copyBlocklyMoreFiles)
|
||||
preBuild.dependsOn(copyBlocklyHtmlFile, copyBlocklyBuildFiles, copyBlocklyDistFiles, copyBlocklyMediaFiles)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.0'
|
||||
|
||||
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<script src="blockly_compressed.js"></script>
|
||||
<script src="blocks_compressed.js"></script>
|
||||
<!-- TODO: Select msg file based on locale. -->
|
||||
<script src="msg/js/en.js"></script>
|
||||
<script src="msg/en.js"></script>
|
||||
<script src="toolbox_standard.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -28,4 +28,4 @@
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
# Create symbolic links in this directory for the
|
||||
# Blockly library files used by this demo's index.html.
|
||||
|
||||
if [[ ! -e ../../../blockly_compressed.js ]]; then
|
||||
if [[ ! -e ../../../dist/blockly_compressed.js ]]; then
|
||||
echo "ERROR: Could not locate blockly_compressed.js. Run from demos/mobile/html/" 1>&2
|
||||
exit 1 # terminate and indicate error
|
||||
fi
|
||||
|
||||
if [ ! -L blockly_compressed.js ]; then
|
||||
ln -s ../../../blockly_compressed.js blockly_compressed.js
|
||||
ln -s ../../../dist/blockly_compressed.js blockly_compressed.js
|
||||
fi
|
||||
if [ ! -L blocks_compressed.js ]; then
|
||||
ln -s ../../../blocks_compressed.js blocks_compressed.js
|
||||
ln -s ../../../dist/blocks_compressed.js blocks_compressed.js
|
||||
fi
|
||||
if [ ! -L media ]; then
|
||||
ln -s ../../../media media
|
||||
fi
|
||||
if [ ! -L msg ]; then
|
||||
ln -s ../../../msg msg
|
||||
ln -s ../../../build/msg msg
|
||||
fi
|
||||
|
||||
@@ -15,9 +15,9 @@ class ViewController: UIViewController, WKUIDelegate {
|
||||
/// The name used to reference this iOS object when executing callbacks from the JS code.
|
||||
/// If this value is changed, it should also be changed in the `CODE_GENERATOR_BRIDGE_JS` file.
|
||||
fileprivate static let HOST_HTML = "Blockly/webview.html"
|
||||
|
||||
|
||||
@IBOutlet weak var webView: WKWebView!
|
||||
|
||||
|
||||
/// Additional setup after loading the UI NIB.
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
@@ -25,7 +25,7 @@ class ViewController: UIViewController, WKUIDelegate {
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
loadWebContent()
|
||||
}
|
||||
|
||||
|
||||
/// Load the root HTML page into the webview.
|
||||
func loadWebContent() {
|
||||
if let htmlUrl = Bundle.main.url(forResource: "webview", withExtension: "html",
|
||||
@@ -41,7 +41,7 @@ class ViewController: UIViewController, WKUIDelegate {
|
||||
runJavaScriptAlertPanelWithMessage message: String,
|
||||
initiatedByFrame frame: WKFrameInfo,
|
||||
completionHandler: @escaping () -> Void) {
|
||||
|
||||
|
||||
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
|
||||
let title = NSLocalizedString("OK", comment: "OK Button")
|
||||
let ok = UIAlertAction(title: title, style: .default) { (action: UIAlertAction) -> Void in
|
||||
@@ -51,25 +51,25 @@ class ViewController: UIViewController, WKUIDelegate {
|
||||
present(alert, animated: true)
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
|
||||
/// Handle window.confirm() with a native dialog.
|
||||
func webView(_ webView: WKWebView,
|
||||
runJavaScriptConfirmPanelWithMessage message: String,
|
||||
initiatedByFrame frame: WKFrameInfo,
|
||||
completionHandler: @escaping (Bool) -> Void) {
|
||||
|
||||
|
||||
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
|
||||
let closeAndHandle = { (okayed: Bool) in
|
||||
alert.dismiss(animated: true, completion: nil)
|
||||
completionHandler(okayed)
|
||||
}
|
||||
|
||||
|
||||
let okTitle = NSLocalizedString("OK", comment: "OK button title")
|
||||
let ok = UIAlertAction(title: okTitle, style: .default) { (action: UIAlertAction) -> Void in
|
||||
closeAndHandle(true)
|
||||
}
|
||||
alert.addAction(ok)
|
||||
|
||||
|
||||
let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel button title")
|
||||
let cancel = UIAlertAction(title: cancelTitle, style: .default) {
|
||||
(action: UIAlertAction) -> Void in
|
||||
@@ -78,34 +78,33 @@ class ViewController: UIViewController, WKUIDelegate {
|
||||
alert.addAction(cancel)
|
||||
present(alert, animated: true)
|
||||
}
|
||||
|
||||
|
||||
/// Handle window.prompt() with a native dialog.
|
||||
func webView(_ webView: WKWebView,
|
||||
runJavaScriptTextInputPanelWithPrompt prompt: String,
|
||||
defaultText: String?,
|
||||
initiatedByFrame frame: WKFrameInfo,
|
||||
completionHandler: @escaping (String?) -> Void) {
|
||||
|
||||
|
||||
let alert = UIAlertController(title: prompt, message: nil, preferredStyle: .alert)
|
||||
|
||||
|
||||
alert.addTextField { (textField) in
|
||||
textField.text = defaultText
|
||||
}
|
||||
|
||||
|
||||
let okTitle = NSLocalizedString("OK", comment: "OK button title")
|
||||
let okAction = UIAlertAction(title: okTitle, style: .default) { (_) in
|
||||
let textInput = alert.textFields![0] as UITextField
|
||||
completionHandler(textInput.text)
|
||||
}
|
||||
alert.addAction(okAction)
|
||||
|
||||
|
||||
let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel button title")
|
||||
let cancelAction = UIAlertAction(title: cancelTitle, style: .cancel) { (_) in
|
||||
completionHandler(nil)
|
||||
}
|
||||
alert.addAction(cancelAction)
|
||||
|
||||
|
||||
present(alert, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ BLOCKLY_ROOT=../../..
|
||||
IOS_RESOURCES=Resources/Non-Localized/Blockly
|
||||
|
||||
MORE_FILES_TO_COPY=(
|
||||
"blockly_compressed.js"
|
||||
"blocks_compressed.js"
|
||||
"dist/blockly_compressed.js"
|
||||
"dist/blocks_compressed.js"
|
||||
"media"
|
||||
"msg/js"
|
||||
"build/msg"
|
||||
)
|
||||
|
||||
mkdir -p $IOS_RESOURCES/media
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Cloud Storage</title>
|
||||
<script src="/storage.js"></script>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
<script src="../../dist/blockly_compressed.js"></script>
|
||||
<script src="../../dist/blocks_compressed.js"></script>
|
||||
<script src="../../build/msg/en.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #fff;
|
||||
|
||||
@@ -15,7 +15,7 @@ goog.module('Blockly.Dart');
|
||||
const Variables = goog.require('Blockly.Variables');
|
||||
const stringUtils = goog.require('Blockly.utils.string');
|
||||
const {Block} = goog.requireType('Blockly.Block');
|
||||
const {Generator} = goog.require('Blockly.Generator');
|
||||
const {CodeGenerator} = goog.require('Blockly.CodeGenerator');
|
||||
const {Names, NameType} = goog.require('Blockly.Names');
|
||||
const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
const {inputTypes} = goog.require('Blockly.inputTypes');
|
||||
@@ -23,9 +23,9 @@ const {inputTypes} = goog.require('Blockly.inputTypes');
|
||||
|
||||
/**
|
||||
* Dart code generator.
|
||||
* @type {!Generator}
|
||||
* @type {!CodeGenerator}
|
||||
*/
|
||||
const Dart = new Generator('Dart');
|
||||
const Dart = new CodeGenerator('Dart');
|
||||
|
||||
/**
|
||||
* List of illegal variable names.
|
||||
@@ -86,7 +86,7 @@ Dart.isInitialized = false;
|
||||
* @param {!Workspace} workspace Workspace to generate code from.
|
||||
*/
|
||||
Dart.init = function(workspace) {
|
||||
// Call Blockly.Generator's init.
|
||||
// Call Blockly.CodeGenerator's init.
|
||||
Object.getPrototypeOf(this).init.call(this);
|
||||
|
||||
if (!this.nameDB_) {
|
||||
@@ -145,7 +145,7 @@ Dart.finish = function(code) {
|
||||
definitions.push(def);
|
||||
}
|
||||
}
|
||||
// Call Blockly.Generator's finish.
|
||||
// Call Blockly.CodeGenerator's finish.
|
||||
code = Object.getPrototypeOf(this).finish.call(this, code);
|
||||
this.isInitialized = false;
|
||||
|
||||
|
||||
@@ -13,10 +13,9 @@
|
||||
goog.module('Blockly.JavaScript');
|
||||
|
||||
const Variables = goog.require('Blockly.Variables');
|
||||
const objectUtils = goog.require('Blockly.utils.object');
|
||||
const stringUtils = goog.require('Blockly.utils.string');
|
||||
const {Block} = goog.requireType('Blockly.Block');
|
||||
const {Generator} = goog.require('Blockly.Generator');
|
||||
const {CodeGenerator} = goog.require('Blockly.CodeGenerator');
|
||||
const {inputTypes} = goog.require('Blockly.inputTypes');
|
||||
const {Names, NameType} = goog.require('Blockly.Names');
|
||||
const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
@@ -24,9 +23,9 @@ const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
|
||||
/**
|
||||
* JavaScript code generator.
|
||||
* @type {!Generator}
|
||||
* @type {!CodeGenerator}
|
||||
*/
|
||||
const JavaScript = new Generator('JavaScript');
|
||||
const JavaScript = new CodeGenerator('JavaScript');
|
||||
|
||||
/**
|
||||
* List of illegal variable names.
|
||||
@@ -128,7 +127,7 @@ JavaScript.isInitialized = false;
|
||||
* @param {!Workspace} workspace Workspace to generate code from.
|
||||
*/
|
||||
JavaScript.init = function(workspace) {
|
||||
// Call Blockly.Generator's init.
|
||||
// Call Blockly.CodeGenerator's init.
|
||||
Object.getPrototypeOf(this).init.call(this);
|
||||
|
||||
if (!this.nameDB_) {
|
||||
@@ -169,8 +168,8 @@ JavaScript.init = function(workspace) {
|
||||
*/
|
||||
JavaScript.finish = function(code) {
|
||||
// Convert the definitions dictionary into a list.
|
||||
const definitions = objectUtils.values(this.definitions_);
|
||||
// Call Blockly.Generator's finish.
|
||||
const definitions = Object.values(this.definitions_);
|
||||
// Call Blockly.CodeGenerator's finish.
|
||||
code = Object.getPrototypeOf(this).finish.call(this, code);
|
||||
this.isInitialized = false;
|
||||
|
||||
|
||||
@@ -13,10 +13,9 @@
|
||||
|
||||
goog.module('Blockly.Lua');
|
||||
|
||||
const objectUtils = goog.require('Blockly.utils.object');
|
||||
const stringUtils = goog.require('Blockly.utils.string');
|
||||
const {Block} = goog.requireType('Blockly.Block');
|
||||
const {Generator} = goog.require('Blockly.Generator');
|
||||
const {CodeGenerator} = goog.require('Blockly.CodeGenerator');
|
||||
const {inputTypes} = goog.require('Blockly.inputTypes');
|
||||
const {Names} = goog.require('Blockly.Names');
|
||||
const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
@@ -24,9 +23,9 @@ const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
|
||||
/**
|
||||
* Lua code generator.
|
||||
* @type {!Generator}
|
||||
* @type {!CodeGenerator}
|
||||
*/
|
||||
const Lua = new Generator('Lua');
|
||||
const Lua = new CodeGenerator('Lua');
|
||||
|
||||
/**
|
||||
* List of illegal variable names.
|
||||
@@ -93,7 +92,7 @@ Lua.isInitialized = false;
|
||||
* @param {!Workspace} workspace Workspace to generate code from.
|
||||
*/
|
||||
Lua.init = function(workspace) {
|
||||
// Call Blockly.Generator's init.
|
||||
// Call Blockly.CodeGenerator's init.
|
||||
Object.getPrototypeOf(this).init.call(this);
|
||||
|
||||
if (!this.nameDB_) {
|
||||
@@ -115,8 +114,8 @@ Lua.init = function(workspace) {
|
||||
*/
|
||||
Lua.finish = function(code) {
|
||||
// Convert the definitions dictionary into a list.
|
||||
const definitions = objectUtils.values(this.definitions_);
|
||||
// Call Blockly.Generator's finish.
|
||||
const definitions = Object.values(this.definitions_);
|
||||
// Call Blockly.CodeGenerator's finish.
|
||||
code = Object.getPrototypeOf(this).finish.call(this, code);
|
||||
this.isInitialized = false;
|
||||
|
||||
|
||||
@@ -12,10 +12,9 @@
|
||||
|
||||
goog.module('Blockly.PHP');
|
||||
|
||||
const objectUtils = goog.require('Blockly.utils.object');
|
||||
const stringUtils = goog.require('Blockly.utils.string');
|
||||
const {Block} = goog.requireType('Blockly.Block');
|
||||
const {Generator} = goog.require('Blockly.Generator');
|
||||
const {CodeGenerator} = goog.require('Blockly.CodeGenerator');
|
||||
const {inputTypes} = goog.require('Blockly.inputTypes');
|
||||
const {Names} = goog.require('Blockly.Names');
|
||||
const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
@@ -23,9 +22,9 @@ const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
|
||||
/**
|
||||
* PHP code generator.
|
||||
* @type {!Generator}
|
||||
* @type {!CodeGenerator}
|
||||
*/
|
||||
const PHP = new Generator('PHP');
|
||||
const PHP = new CodeGenerator('PHP');
|
||||
|
||||
/**
|
||||
* List of illegal variable names.
|
||||
@@ -131,7 +130,7 @@ PHP.isInitialized = false;
|
||||
* @param {!Workspace} workspace Workspace to generate code from.
|
||||
*/
|
||||
PHP.init = function(workspace) {
|
||||
// Call Blockly.Generator's init.
|
||||
// Call Blockly.CodeGenerator's init.
|
||||
Object.getPrototypeOf(this).init.call(this);
|
||||
|
||||
if (!this.nameDB_) {
|
||||
@@ -154,8 +153,8 @@ PHP.init = function(workspace) {
|
||||
*/
|
||||
PHP.finish = function(code) {
|
||||
// Convert the definitions dictionary into a list.
|
||||
const definitions = objectUtils.values(this.definitions_);
|
||||
// Call Blockly.Generator's finish.
|
||||
const definitions = Object.values(this.definitions_);
|
||||
// Call Blockly.CodeGenerator's finish.
|
||||
code = Object.getPrototypeOf(this).finish.call(this, code);
|
||||
this.isInitialized = false;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ goog.module('Blockly.Python');
|
||||
const stringUtils = goog.require('Blockly.utils.string');
|
||||
const Variables = goog.require('Blockly.Variables');
|
||||
const {Block} = goog.requireType('Blockly.Block');
|
||||
const {Generator} = goog.require('Blockly.Generator');
|
||||
const {CodeGenerator} = goog.require('Blockly.CodeGenerator');
|
||||
const {inputTypes} = goog.require('Blockly.inputTypes');
|
||||
const {Names, NameType} = goog.require('Blockly.Names');
|
||||
const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
@@ -23,9 +23,9 @@ const {Workspace} = goog.requireType('Blockly.Workspace');
|
||||
|
||||
/**
|
||||
* Python code generator.
|
||||
* @type {!Generator}
|
||||
* @type {!CodeGenerator}
|
||||
*/
|
||||
const Python = new Generator('Python');
|
||||
const Python = new CodeGenerator('Python');
|
||||
|
||||
/**
|
||||
* List of illegal variable names.
|
||||
@@ -137,10 +137,10 @@ Python.isInitialized = false;
|
||||
/**
|
||||
* Initialise the database of variable names.
|
||||
* @param {!Workspace} workspace Workspace to generate code from.
|
||||
* @this {Generator}
|
||||
* @this {CodeGenerator}
|
||||
*/
|
||||
Python.init = function(workspace) {
|
||||
// Call Blockly.Generator's init.
|
||||
// Call Blockly.CodeGenerator's init.
|
||||
Object.getPrototypeOf(this).init.call(this);
|
||||
|
||||
/**
|
||||
@@ -196,7 +196,7 @@ Python.finish = function(code) {
|
||||
definitions.push(def);
|
||||
}
|
||||
}
|
||||
// Call Blockly.Generator's finish.
|
||||
// Call Blockly.CodeGenerator's finish.
|
||||
code = Object.getPrototypeOf(this).finish.call(this, code);
|
||||
this.isInitialized = false;
|
||||
|
||||
|
||||
56
gulpfile.js
56
gulpfile.js
@@ -19,35 +19,45 @@ const licenseTasks = require('./scripts/gulpfiles/license_tasks');
|
||||
const appengineTasks = require('./scripts/gulpfiles/appengine_tasks');
|
||||
const releaseTasks = require('./scripts/gulpfiles/release_tasks');
|
||||
const cleanupTasks = require('./scripts/gulpfiles/cleanup_tasks');
|
||||
const docsTasks = require('./scripts/gulpfiles/docs_tasks');
|
||||
const testTasks = require('./scripts/gulpfiles/test_tasks');
|
||||
|
||||
module.exports = {
|
||||
deployDemos: appengineTasks.deployDemos,
|
||||
deployDemosBeta: appengineTasks.deployDemosBeta,
|
||||
// Default target if gulp invoked without specifying.
|
||||
default: buildTasks.build,
|
||||
generateLangfiles: buildTasks.generateLangfiles,
|
||||
|
||||
// Main sequence targets. They already invoke prerequisites.
|
||||
langfiles: buildTasks.langfiles, // Build build/msg/*.js from msg/json/*.
|
||||
tsc: buildTasks.tsc,
|
||||
deps: buildTasks.deps,
|
||||
minify: buildTasks.minify,
|
||||
build: buildTasks.build,
|
||||
buildDeps: buildTasks.deps,
|
||||
buildLangfiles: buildTasks.langfiles,
|
||||
buildCompiled: buildTasks.compiled,
|
||||
buildAdvancedCompilationTest: buildTasks.advancedCompilationTest,
|
||||
buildJavaScript: buildTasks.javaScript,
|
||||
buildJavaScriptAndDeps: buildTasks.javaScriptAndDeps,
|
||||
checkin: gulp.parallel(buildTasks.checkinBuilt),
|
||||
checkinBuilt: buildTasks.checkinBuilt,
|
||||
clangFormat: buildTasks.format,
|
||||
clean: gulp.parallel(buildTasks.cleanBuildDir, packageTasks.cleanReleaseDir),
|
||||
cleanBuildDir: buildTasks.cleanBuildDir,
|
||||
cleanReleaseDir: packageTasks.cleanReleaseDir,
|
||||
gitSyncDevelop: gitTasks.syncDevelop,
|
||||
gitSyncMaster: gitTasks.syncMaster,
|
||||
gitCreateRC: gitTasks.createRC,
|
||||
gitUpdateGithubPages: gitTasks.updateGithubPages,
|
||||
package: packageTasks.package,
|
||||
prepare: buildTasks.prepare,
|
||||
checkLicenses: licenseTasks.checkLicenses,
|
||||
recompile: releaseTasks.recompile,
|
||||
prepareDemos: appengineTasks.prepareDemos,
|
||||
publish: releaseTasks.publish,
|
||||
publishBeta: releaseTasks.publishBeta,
|
||||
prepareDemos: appengineTasks.prepareDemos,
|
||||
deployDemos: appengineTasks.deployDemos,
|
||||
deployDemosBeta: appengineTasks.deployDemosBeta,
|
||||
gitUpdateGithubPages: gitTasks.updateGithubPages,
|
||||
|
||||
// Manually-invokable targets, with prequisites where required.
|
||||
prepare: buildTasks.prepare,
|
||||
format: buildTasks.format,
|
||||
messages: buildTasks.messages, // Generate msg/json/en.json et al.
|
||||
sortRequires: cleanupTasks.sortRequires,
|
||||
checkLicenses: licenseTasks.checkLicenses,
|
||||
clean: gulp.parallel(buildTasks.cleanBuildDir, packageTasks.cleanReleaseDir),
|
||||
test: testTasks.test,
|
||||
testGenerators: testTasks.generators,
|
||||
buildAdvancedCompilationTest: buildTasks.buildAdvancedCompilationTest,
|
||||
gitCreateRC: gitTasks.createRC,
|
||||
docs: docsTasks.docs,
|
||||
|
||||
// Targets intended only for invocation by scripts; may omit prerequisites.
|
||||
onlyBuildAdvancedCompilationTest: buildTasks.onlyBuildAdvancedCompilationTest,
|
||||
|
||||
// Legacy targets, to be deleted.
|
||||
recompile: releaseTasks.recompile,
|
||||
gitSyncDevelop: gitTasks.syncDevelop,
|
||||
gitSyncMaster: gitTasks.syncMaster,
|
||||
};
|
||||
|
||||
@@ -1,331 +0,0 @@
|
||||
// Do not edit this file; automatically generated.
|
||||
|
||||
/* eslint-disable */
|
||||
;(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) { // AMD
|
||||
define(["./blockly_compressed.js"], factory);
|
||||
} else if (typeof exports === 'object') { // Node.js
|
||||
module.exports = factory(require("./blockly_compressed.js"));
|
||||
} else { // Browser
|
||||
var factoryExports = factory(root.Blockly);
|
||||
root.Blockly.JavaScript = factoryExports.javascriptGenerator;
|
||||
root.Blockly.JavaScript.__namespace__ = factoryExports.__namespace__;
|
||||
}
|
||||
}(this, function(__parent__) {
|
||||
var $=__parent__.__namespace__;
|
||||
var module$exports$Blockly$JavaScript={},module$contents$Blockly$JavaScript_Variables=$.module$build$src$core$variables,module$contents$Blockly$JavaScript_objectUtils=$.module$build$src$core$utils$object,module$contents$Blockly$JavaScript_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$JavaScript_Generator=$.Generator$$module$build$src$core$generator,module$contents$Blockly$JavaScript_inputTypes=$.module$build$src$core$input_types.inputTypes,module$contents$Blockly$JavaScript_Names=
|
||||
$.module$build$src$core$names.Names,module$contents$Blockly$JavaScript_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$JavaScript.javascriptGenerator=new $.Generator$$module$build$src$core$generator("JavaScript");
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.addReservedWords("break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,new,return,super,switch,this,throw,try,typeof,var,void,while,with,yield,enum,implements,interface,let,package,private,protected,public,static,await,null,true,false,arguments,"+Object.getOwnPropertyNames(globalThis).join(","));module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC=0;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NEW=1.1;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER=1.2;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL=2;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_INCREMENT=3;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_DECREMENT=3;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_BITWISE_NOT=4.1;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_UNARY_PLUS=4.2;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_UNARY_NEGATION=4.3;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_NOT=4.4;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_TYPEOF=4.5;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_VOID=4.6;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_DELETE=4.7;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_AWAIT=4.8;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_EXPONENTIATION=5;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MULTIPLICATION=5.1;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_DIVISION=5.2;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS=5.3;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_SUBTRACTION=6.1;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION=6.2;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_BITWISE_SHIFT=7;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_RELATIONAL=8;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_IN=8;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_INSTANCEOF=8;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_EQUALITY=9;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_BITWISE_AND=10;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_BITWISE_XOR=11;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_BITWISE_OR=12;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_AND=13;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_OR=14;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_CONDITIONAL=15;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ASSIGNMENT=16;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_YIELD=17;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_COMMA=18;module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE=99;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_OVERRIDES=[[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER],[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL],[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER],[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER,
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL],[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_NOT,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_NOT],[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MULTIPLICATION,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MULTIPLICATION],[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION],
|
||||
[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_AND,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_AND],[module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_OR,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_OR]];module$exports$Blockly$JavaScript.javascriptGenerator.isInitialized=!1;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.init=function(a){Object.getPrototypeOf(this).init.call(this);this.nameDB_?this.nameDB_.reset():this.nameDB_=new $.module$build$src$core$names.Names(this.RESERVED_WORDS_);this.nameDB_.setVariableMap(a.getVariableMap());this.nameDB_.populateVariables(a);this.nameDB_.populateProcedures(a);const b=[];var c=$.module$build$src$core$variables.allDeveloperVariables(a);for(let d=0;d<c.length;d++)b.push(this.nameDB_.getName(c[d],$.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE));
|
||||
a=$.module$build$src$core$variables.allUsedVarModels(a);for(c=0;c<a.length;c++)b.push(this.nameDB_.getName(a[c].getId(),$.NameType$$module$build$src$core$names.VARIABLE));b.length&&(this.definitions_.variables="var "+b.join(", ")+";");this.isInitialized=!0};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.finish=function(a){const b=$.module$build$src$core$utils$object.values(this.definitions_);a=Object.getPrototypeOf(this).finish.call(this,a);this.isInitialized=!1;this.nameDB_.reset();return b.join("\n\n")+"\n\n\n"+a};module$exports$Blockly$JavaScript.javascriptGenerator.scrubNakedValue=function(a){return a+";\n"};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'");return"'"+a+"'"};module$exports$Blockly$JavaScript.javascriptGenerator.multiline_quote_=function(a){return a.split(/\n/g).map(this.quote_).join(" + '\\n' +\n")};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.scrub_=function(a,b,c){let d="";if(!a.outputConnection||!a.outputConnection.targetConnection){var e=a.getCommentText();e&&(e=$.module$build$src$core$utils$string.wrap(e,this.COMMENT_WRAP-3),d+=this.prefixLines(e+"\n","// "));for(let f=0;f<a.inputList.length;f++)a.inputList[f].type===$.module$build$src$core$input_types.inputTypes.VALUE&&(e=a.inputList[f].connection.targetBlock())&&(e=this.allNestedComments(e))&&(d+=this.prefixLines(e,"// "))}a=
|
||||
a.nextConnection&&a.nextConnection.targetBlock();c=c?"":this.blockToCode(a);return d+b+c};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted=function(a,b,c,d,e){c=c||0;e=e||this.ORDER_NONE;a.workspace.options.oneBasedIndex&&c--;const f=a.workspace.options.oneBasedIndex?"1":"0";let g,h=e;0<c?g=h=this.ORDER_ADDITION:0>c?g=h=this.ORDER_SUBTRACTION:d&&(g=h=this.ORDER_UNARY_NEGATION);a=this.valueToCode(a,b,h)||f;$.module$build$src$core$utils$string.isNumber(a)?(a=Number(a)+c,d&&(a=-a)):(0<c?a=a+" + "+c:0>c&&(a=a+" - "+-c),d&&(a=c?"-("+a+")":"-"+a),g=Math.floor(g),e=Math.floor(e),
|
||||
g&&e>=g&&(a="("+a+")"));return a};var module$exports$Blockly$JavaScript$variables={},module$contents$Blockly$JavaScript$variables_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$JavaScript.javascriptGenerator.variables_get=function(a){return[module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.variables_set=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ASSIGNMENT)||"0";return module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE)+" = "+b+";\n"};var module$exports$Blockly$JavaScript$variablesDynamic={};module$exports$Blockly$JavaScript.javascriptGenerator.variables_get_dynamic=module$exports$Blockly$JavaScript.javascriptGenerator.variables_get;module$exports$Blockly$JavaScript.javascriptGenerator.variables_set_dynamic=module$exports$Blockly$JavaScript.javascriptGenerator.variables_set;var module$exports$Blockly$JavaScript$texts={},module$contents$Blockly$JavaScript$texts_NameType=$.NameType$$module$build$src$core$names,module$contents$Blockly$JavaScript$texts_strRegExp=/^\s*'([^']|\\')*'\s*$/,module$contents$Blockly$JavaScript$texts_forceString=function(a){return module$contents$Blockly$JavaScript$texts_strRegExp.test(a)?[a,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]:["String("+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]},
|
||||
module$contents$Blockly$JavaScript$texts_getSubstringIndex=function(a,b,c){return"FIRST"===b?"0":"FROM_END"===b?a+".length - 1 - "+c:"LAST"===b?a+".length - 1":c};module$exports$Blockly$JavaScript.javascriptGenerator.text=function(a){return[module$exports$Blockly$JavaScript.javascriptGenerator.quote_(a.getFieldValue("TEXT")),module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_multiline=function(a){a=module$exports$Blockly$JavaScript.javascriptGenerator.multiline_quote_(a.getFieldValue("TEXT"));const b=-1!==a.indexOf("+")?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC;return[a,b]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_join=function(a){switch(a.itemCount_){case 0:return["''",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC];case 1:return a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"ADD0",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''",module$contents$Blockly$JavaScript$texts_forceString(a);case 2:var b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"ADD0",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||
|
||||
"''";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"ADD1",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";return[module$contents$Blockly$JavaScript$texts_forceString(b)[0]+" + "+module$contents$Blockly$JavaScript$texts_forceString(a)[0],module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION];default:b=Array(a.itemCount_);for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"ADD"+c,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||
|
||||
"''";return["["+b.join(",")+"].join('')",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]}};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_append=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TEXT",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";return b+" += "+module$contents$Blockly$JavaScript$texts_forceString(a)[0]+";\n"};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_length=function(a){return[(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"''")+".length",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_isEmpty=function(a){return["!"+(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"''")+".length",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_NOT]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_indexOf=function(a){var b="FIRST"===a.getFieldValue("END")?"indexOf":"lastIndexOf";const c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"FIND",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";b=(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"''")+"."+b+"("+c+")";return a.workspace.options.oneBasedIndex?
|
||||
[b+" + 1",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION]:[b,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_charAt=function(a){const b=a.getFieldValue("WHERE")||"FROM_START",c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE","RANDOM"===b?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"''";switch(b){case "FIRST":return[c+".charAt(0)",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];case "LAST":return[c+".slice(-1)",
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];case "FROM_START":return a=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT"),[c+".charAt("+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];case "FROM_END":return a=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT",1,!0),[c+".slice("+a+").charAt(0)",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];case "RANDOM":return[module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("textRandomLetter",
|
||||
`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(text) {
|
||||
var x = Math.floor(Math.random() * text.length);
|
||||
return text[x];
|
||||
}
|
||||
`)+"("+c+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]}throw Error("Unhandled option (text_charAt).");};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_getSubstring=function(a){var b=a.getFieldValue("WHERE1"),c=a.getFieldValue("WHERE2"),d="FROM_END"!==b&&"LAST"!==b&&"FROM_END"!==c&&"LAST"!==c,e=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"STRING",d?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";if("FIRST"===b&&"LAST"===c)return[e,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE];
|
||||
if(e.match(/^'?\w+'?$/)||d){switch(b){case "FROM_START":b=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT1");break;case "FROM_END":b=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT1",1,!1,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_SUBTRACTION);b=e+".length - "+b;break;case "FIRST":b="0";break;default:throw Error("Unhandled option (text_getSubstring).");}switch(c){case "FROM_START":c=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,
|
||||
"AT2",1);break;case "FROM_END":c=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT2",0,!1,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_SUBTRACTION);c=e+".length - "+c;break;case "LAST":c=e+".length";break;default:throw Error("Unhandled option (text_getSubstring).");}e=e+".slice("+b+", "+c+")"}else{d=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT1");a=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT2");const f={FIRST:"First",
|
||||
LAST:"Last",FROM_START:"FromStart",FROM_END:"FromEnd"};e=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("subsequence"+f[b]+f[c],`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(sequence${"FROM_END"===b||"FROM_START"===b?", at1":""}${"FROM_END"===c||"FROM_START"===c?", at2":""}) {
|
||||
var start = ${module$contents$Blockly$JavaScript$texts_getSubstringIndex("sequence",b,"at1")};
|
||||
var end = ${module$contents$Blockly$JavaScript$texts_getSubstringIndex("sequence",c,"at2")} + 1;
|
||||
return sequence.slice(start, end);
|
||||
}
|
||||
`)+"("+e+("FROM_END"===b||"FROM_START"===b?", "+d:"")+("FROM_END"===c||"FROM_START"===c?", "+a:"")+")"}return[e,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_changeCase=function(a){const b={UPPERCASE:".toUpperCase()",LOWERCASE:".toLowerCase()",TITLECASE:null}[a.getFieldValue("CASE")];a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TEXT",b?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";return[b?a+b:module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("textToTitleCase",
|
||||
`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(str) {
|
||||
return str.replace(/\\S+/g,
|
||||
function(txt) {return txt[0].toUpperCase() + txt.substring(1).toLowerCase();});
|
||||
}
|
||||
`)+"("+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};module$exports$Blockly$JavaScript.javascriptGenerator.text_trim=function(a){const b={LEFT:".replace(/^[\\s\\xa0]+/, '')",RIGHT:".replace(/[\\s\\xa0]+$/, '')",BOTH:".trim()"}[a.getFieldValue("MODE")];return[(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TEXT",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"''")+b,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_print=function(a){return"window.alert("+(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TEXT",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''")+");\n"};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_prompt_ext=function(a){let b="window.prompt("+(a.getField("TEXT")?module$exports$Blockly$JavaScript.javascriptGenerator.quote_(a.getFieldValue("TEXT")):module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TEXT",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''")+")";"NUMBER"===a.getFieldValue("TYPE")&&(b="Number("+b+")");return[b,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_prompt=module$exports$Blockly$JavaScript.javascriptGenerator.text_prompt_ext;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_count=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TEXT",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"SUB",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";return[module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("textCount",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle) {
|
||||
if (needle.length === 0) {
|
||||
return haystack.length + 1;
|
||||
} else {
|
||||
return haystack.split(needle).length - 1;
|
||||
}
|
||||
}
|
||||
`)+"("+b+", "+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.text_replace=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TEXT",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''",c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"FROM",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TO",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||
|
||||
"''";return[module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("textReplace",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
|
||||
needle = needle.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1')
|
||||
.replace(/\\x08/g, '\\\\x08');
|
||||
return haystack.replace(new RegExp(needle, 'g'), replacement);
|
||||
}
|
||||
`)+"("+b+", "+c+", "+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};module$exports$Blockly$JavaScript.javascriptGenerator.text_reverse=function(a){return[(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TEXT",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"''")+".split('').reverse().join('')",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};var module$exports$Blockly$JavaScript$procedures={},module$contents$Blockly$JavaScript$procedures_NameType=$.NameType$$module$build$src$core$names;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.procedures_defreturn=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE);var c="";module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX&&
|
||||
(c+=module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX,a));c&&(c=module$exports$Blockly$JavaScript.javascriptGenerator.prefixLines(c,module$exports$Blockly$JavaScript.javascriptGenerator.INDENT));let d="";module$exports$Blockly$JavaScript.javascriptGenerator.INFINITE_LOOP_TRAP&&(d=module$exports$Blockly$JavaScript.javascriptGenerator.prefixLines(module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.INFINITE_LOOP_TRAP,
|
||||
a),module$exports$Blockly$JavaScript.javascriptGenerator.INDENT));const e=module$exports$Blockly$JavaScript.javascriptGenerator.statementToCode(a,"STACK");let f=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"RETURN",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"",g="";e&&f&&(g=c);f&&(f=module$exports$Blockly$JavaScript.javascriptGenerator.INDENT+"return "+f+";\n");const h=[],k=a.getVars();for(let l=0;l<k.length;l++)h[l]=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(k[l],
|
||||
$.NameType$$module$build$src$core$names.VARIABLE);c="function "+b+"("+h.join(", ")+") {\n"+c+d+e+g+f+"}";c=module$exports$Blockly$JavaScript.javascriptGenerator.scrub_(a,c);module$exports$Blockly$JavaScript.javascriptGenerator.definitions_["%"+b]=c;return null};module$exports$Blockly$JavaScript.javascriptGenerator.procedures_defnoreturn=module$exports$Blockly$JavaScript.javascriptGenerator.procedures_defreturn;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.procedures_callreturn=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE),c=[],d=a.getVars();for(let e=0;e<d.length;e++)c[e]=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"ARG"+e,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"null";return[b+"("+c.join(", ")+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.procedures_callnoreturn=function(a){return module$exports$Blockly$JavaScript.javascriptGenerator.procedures_callreturn(a)[0]+";\n"};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.procedures_ifreturn=function(a){let b="if ("+(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"CONDITION",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"false")+") {\n";module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$JavaScript.javascriptGenerator.prefixLines(module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX,
|
||||
a),module$exports$Blockly$JavaScript.javascriptGenerator.INDENT));a.hasReturnValue_?(a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"null",b+=module$exports$Blockly$JavaScript.javascriptGenerator.INDENT+"return "+a+";\n"):b+=module$exports$Blockly$JavaScript.javascriptGenerator.INDENT+"return;\n";return b+"}\n"};var module$exports$Blockly$JavaScript$math={},module$contents$Blockly$JavaScript$math_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$JavaScript.javascriptGenerator.math_number=function(a){a=Number(a.getFieldValue("NUM"));return[a,0<=a?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_UNARY_NEGATION]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_arithmetic=function(a){var b={ADD:[" + ",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION],MINUS:[" - ",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_SUBTRACTION],MULTIPLY:[" * ",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MULTIPLICATION],DIVIDE:[" / ",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_DIVISION],POWER:[null,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE]}[a.getFieldValue("OP")];
|
||||
const c=b[0];b=b[1];const d=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"A",b)||"0";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"B",b)||"0";return c?[d+c+a,b]:["Math.pow("+d+", "+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_single=function(a){const b=a.getFieldValue("OP");let c;if("NEG"===b)return a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"NUM",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_UNARY_NEGATION)||"0","-"===a[0]&&(a=" "+a),["-"+a,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_UNARY_NEGATION];a="SIN"===b||"COS"===b||"TAN"===b?module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"NUM",
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_DIVISION)||"0":module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"NUM",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"0";switch(b){case "ABS":c="Math.abs("+a+")";break;case "ROOT":c="Math.sqrt("+a+")";break;case "LN":c="Math.log("+a+")";break;case "EXP":c="Math.exp("+a+")";break;case "POW10":c="Math.pow(10,"+a+")";break;case "ROUND":c="Math.round("+a+")";break;case "ROUNDUP":c="Math.ceil("+a+")";break;
|
||||
case "ROUNDDOWN":c="Math.floor("+a+")";break;case "SIN":c="Math.sin("+a+" / 180 * Math.PI)";break;case "COS":c="Math.cos("+a+" / 180 * Math.PI)";break;case "TAN":c="Math.tan("+a+" / 180 * Math.PI)"}if(c)return[c,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];switch(b){case "LOG10":c="Math.log("+a+") / Math.log(10)";break;case "ASIN":c="Math.asin("+a+") / Math.PI * 180";break;case "ACOS":c="Math.acos("+a+") / Math.PI * 180";break;case "ATAN":c="Math.atan("+a+") / Math.PI * 180";
|
||||
break;default:throw Error("Unknown math operator: "+b);}return[c,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_DIVISION]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_constant=function(a){return{PI:["Math.PI",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER],E:["Math.E",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_DIVISION],SQRT2:["Math.SQRT2",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER],SQRT1_2:["Math.SQRT1_2",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER],
|
||||
INFINITY:["Infinity",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]}[a.getFieldValue("CONSTANT")]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_number_property=function(a){var b={EVEN:[" % 2 === 0",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_EQUALITY],ODD:[" % 2 === 1",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_EQUALITY],WHOLE:[" % 1 === 0",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_EQUALITY],
|
||||
POSITIVE:[" > 0",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_RELATIONAL,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_RELATIONAL],NEGATIVE:[" < 0",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_RELATIONAL,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_RELATIONAL],DIVISIBLE_BY:[null,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_EQUALITY],PRIME:[null,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE,
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};const c=a.getFieldValue("PROPERTY"),[d,e,f]=b[c];b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"NUMBER_TO_CHECK",e)||"0";"PRIME"===c?a=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("mathIsPrime",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
||||
// https://en.wikipedia.org/wiki/Primality_test#Naive_methods
|
||||
if (n == 2 || n == 3) {
|
||||
return true;
|
||||
}
|
||||
// False if n is NaN, negative, is 1, or not whole.
|
||||
// And false if n is divisible by 2 or 3.
|
||||
if (isNaN(n) || n <= 1 || n % 1 !== 0 || n % 2 === 0 || n % 3 === 0) {
|
||||
return false;
|
||||
}
|
||||
// Check all the numbers of form 6k +/- 1, up to sqrt(n).
|
||||
for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {
|
||||
if (n % (x - 1) === 0 || n % (x + 1) === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
`)+"("+b+")":"DIVISIBLE_BY"===c?(a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"DIVISOR",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS)||"0",a=b+" % "+a+" === 0"):a=b+d;return[a,f]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_change=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"DELTA",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION)||"0";a=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);return a+" = (typeof "+a+" === 'number' ? "+a+" : 0) + "+b+";\n"};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_round=module$exports$Blockly$JavaScript.javascriptGenerator.math_single;module$exports$Blockly$JavaScript.javascriptGenerator.math_trig=module$exports$Blockly$JavaScript.javascriptGenerator.math_single;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_on_list=function(a){var b=a.getFieldValue("OP");switch(b){case "SUM":a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"[]";a+=".reduce(function(x, y) {return x + y;}, 0)";break;case "MIN":a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"[]";a="Math.min.apply(null, "+
|
||||
a+")";break;case "MAX":a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"[]";a="Math.max.apply(null, "+a+")";break;case "AVERAGE":b=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("mathMean",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
||||
return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length;
|
||||
}
|
||||
`);a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"[]";a=b+"("+a+")";break;case "MEDIAN":b=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("mathMedian",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
||||
var localList = myList.filter(function (x) {return typeof x === 'number';});
|
||||
if (!localList.length) return null;
|
||||
localList.sort(function(a, b) {return b - a;});
|
||||
if (localList.length % 2 === 0) {
|
||||
return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2;
|
||||
} else {
|
||||
return localList[(localList.length - 1) / 2];
|
||||
}
|
||||
}
|
||||
`);a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"[]";a=b+"("+a+")";break;case "MODE":b=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("mathModes",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(values) {
|
||||
var modes = [];
|
||||
var counts = [];
|
||||
var maxCount = 0;
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
var value = values[i];
|
||||
var found = false;
|
||||
var thisCount;
|
||||
for (var j = 0; j < counts.length; j++) {
|
||||
if (counts[j][0] === value) {
|
||||
thisCount = ++counts[j][1];
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
counts.push([value, 1]);
|
||||
thisCount = 1;
|
||||
}
|
||||
maxCount = Math.max(thisCount, maxCount);
|
||||
}
|
||||
for (var j = 0; j < counts.length; j++) {
|
||||
if (counts[j][1] === maxCount) {
|
||||
modes.push(counts[j][0]);
|
||||
}
|
||||
}
|
||||
return modes;
|
||||
}
|
||||
`);a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"[]";a=b+"("+a+")";break;case "STD_DEV":b=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("mathStandardDeviation",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(numbers) {
|
||||
var n = numbers.length;
|
||||
if (!n) return null;
|
||||
var mean = numbers.reduce(function(x, y) {return x + y;}) / n;
|
||||
var variance = 0;
|
||||
for (var j = 0; j < n; j++) {
|
||||
variance += Math.pow(numbers[j] - mean, 2);
|
||||
}
|
||||
variance = variance / n;
|
||||
return Math.sqrt(variance);
|
||||
}
|
||||
`);a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"[]";a=b+"("+a+")";break;case "RANDOM":b=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("mathRandomList",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(list) {
|
||||
var x = Math.floor(Math.random() * list.length);
|
||||
return list[x];
|
||||
}
|
||||
`);a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"[]";a=b+"("+a+")";break;default:throw Error("Unknown operator: "+b);}return[a,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_modulo=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"DIVIDEND",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS)||"0";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"DIVISOR",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS)||"0";return[b+" % "+a,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MODULUS]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_constrain=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"0",c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LOW",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"0";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"HIGH",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||
|
||||
"Infinity";return["Math.min(Math.max("+b+", "+c+"), "+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_random_int=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"FROM",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"0";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TO",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"0";return[module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("mathRandomInt",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(a, b) {
|
||||
if (a > b) {
|
||||
// Swap a and b to ensure a is smaller.
|
||||
var c = a;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
return Math.floor(Math.random() * (b - a + 1) + a);
|
||||
}
|
||||
`)+"("+b+", "+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};module$exports$Blockly$JavaScript.javascriptGenerator.math_random_float=function(a){return["Math.random()",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.math_atan2=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"X",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"0";return["Math.atan2("+(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"Y",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"0")+", "+b+") / Math.PI * 180",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_DIVISION]};var module$exports$Blockly$JavaScript$loops={},module$contents$Blockly$JavaScript$loops_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$JavaScript$loops_NameType=$.NameType$$module$build$src$core$names;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.controls_repeat_ext=function(a){let b;b=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TIMES",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ASSIGNMENT)||"0";let c=module$exports$Blockly$JavaScript.javascriptGenerator.statementToCode(a,"DO");c=module$exports$Blockly$JavaScript.javascriptGenerator.addLoopTrap(c,a);a="";const d=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName("count",
|
||||
$.NameType$$module$build$src$core$names.VARIABLE);let e=b;b.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(b)||(e=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName("repeat_end",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+e+" = "+b+";\n");return a+("for (var "+d+" = 0; "+d+" < "+e+"; "+d+"++) {\n"+c+"}\n")};module$exports$Blockly$JavaScript.javascriptGenerator.controls_repeat=module$exports$Blockly$JavaScript.javascriptGenerator.controls_repeat_ext;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.controls_whileUntil=function(a){const b="UNTIL"===a.getFieldValue("MODE");let c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"BOOL",b?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_NOT:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"false",d=module$exports$Blockly$JavaScript.javascriptGenerator.statementToCode(a,"DO");d=module$exports$Blockly$JavaScript.javascriptGenerator.addLoopTrap(d,
|
||||
a);b&&(c="!"+c);return"while ("+c+") {\n"+d+"}\n"};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.controls_for=function(a){var b=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"FROM",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ASSIGNMENT)||"0",d=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TO",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ASSIGNMENT)||
|
||||
"0";const e=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"BY",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ASSIGNMENT)||"1";let f=module$exports$Blockly$JavaScript.javascriptGenerator.statementToCode(a,"DO");f=module$exports$Blockly$JavaScript.javascriptGenerator.addLoopTrap(f,a);if($.module$build$src$core$utils$string.isNumber(c)&&$.module$build$src$core$utils$string.isNumber(d)&&$.module$build$src$core$utils$string.isNumber(e)){var g=Number(c)<=Number(d);a=
|
||||
"for ("+b+" = "+c+"; "+b+(g?" <= ":" >= ")+d+"; "+b;b=Math.abs(Number(e));a=1===b?a+(g?"++":"--"):a+((g?" += ":" -= ")+b);a+=") {\n"+f+"}\n"}else a="",g=c,c.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(c)||(g=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName(b+"_start",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+g+" = "+c+";\n"),c=d,d.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(d)||(c=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName(b+
|
||||
"_end",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+c+" = "+d+";\n"),d=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName(b+"_inc",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+d+" = ",a=$.module$build$src$core$utils$string.isNumber(e)?a+(Math.abs(e)+";\n"):a+("Math.abs("+e+");\n"),a+="if ("+g+" > "+c+") {\n",a+=module$exports$Blockly$JavaScript.javascriptGenerator.INDENT+d+" = -"+d+";\n",a=a+"}\nfor ("+(b+" = "+g+"; "+d+" >= 0 ? "+b+" <= "+
|
||||
c+" : "+b+" >= "+c+"; "+b+" += "+d+") {\n"+f+"}\n");return a};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.controls_forEach=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);var c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ASSIGNMENT)||"[]";let d=module$exports$Blockly$JavaScript.javascriptGenerator.statementToCode(a,"DO");d=module$exports$Blockly$JavaScript.javascriptGenerator.addLoopTrap(d,
|
||||
a);a="";let e=c;c.match(/^\w+$/)||(e=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName(b+"_list",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+e+" = "+c+";\n");c=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName(b+"_index",$.NameType$$module$build$src$core$names.VARIABLE);d=module$exports$Blockly$JavaScript.javascriptGenerator.INDENT+b+" = "+e+"["+c+"];\n"+d;return a+("for (var "+c+" in "+e+") {\n"+d+"}\n")};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.controls_flow_statements=function(a){let b="";module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_PREFIX&&(b+=module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX,
|
||||
a));if(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_PREFIX){const c=a.getSurroundLoop();c&&!c.suppressPrefixSuffix&&(b+=module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_PREFIX,c))}switch(a.getFieldValue("FLOW")){case "BREAK":return b+"break;\n";case "CONTINUE":return b+"continue;\n"}throw Error("Unknown flow statement.");};var module$exports$Blockly$JavaScript$logic={};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.controls_if=function(a){var b=0;let c="";module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_PREFIX,a));do{const d=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"IF"+b,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"false";let e=module$exports$Blockly$JavaScript.javascriptGenerator.statementToCode(a,
|
||||
"DO"+b);module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX&&(e=module$exports$Blockly$JavaScript.javascriptGenerator.prefixLines(module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$JavaScript.javascriptGenerator.INDENT)+e);c+=(0<b?" else ":"")+"if ("+d+") {\n"+e+"}";b++}while(a.getInput("IF"+b));if(a.getInput("ELSE")||module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX)b=
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.statementToCode(a,"ELSE"),module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX&&(b=module$exports$Blockly$JavaScript.javascriptGenerator.prefixLines(module$exports$Blockly$JavaScript.javascriptGenerator.injectId(module$exports$Blockly$JavaScript.javascriptGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$JavaScript.javascriptGenerator.INDENT)+b),c+=" else {\n"+b+"}";return c+"\n"};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.controls_ifelse=module$exports$Blockly$JavaScript.javascriptGenerator.controls_if;
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.logic_compare=function(a){const b={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c="=="===b||"!="===b?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_EQUALITY:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_RELATIONAL,d=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"A",c)||"0";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"B",c)||"0";return[d+" "+b+
|
||||
" "+a,c]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.logic_operation=function(a){const b="AND"===a.getFieldValue("OP")?"&&":"||",c="&&"===b?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_AND:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_OR;let d=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"A",c);a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"B",c);if(d||a){const e="&&"===b?"true":"false";d||(d=e);a||(a=e)}else a=
|
||||
d="false";return[d+" "+b+" "+a,c]};module$exports$Blockly$JavaScript.javascriptGenerator.logic_negate=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_NOT;return["!"+(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"BOOL",b)||"true"),b]};module$exports$Blockly$JavaScript.javascriptGenerator.logic_boolean=function(a){return["TRUE"===a.getFieldValue("BOOL")?"true":"false",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.logic_null=function(a){return["null",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.logic_ternary=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"IF",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_CONDITIONAL)||"false",c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"THEN",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_CONDITIONAL)||"null";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"ELSE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_CONDITIONAL)||
|
||||
"null";return[b+" ? "+c+" : "+a,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_CONDITIONAL]};var module$exports$Blockly$JavaScript$lists={},module$contents$Blockly$JavaScript$lists_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$JavaScript.javascriptGenerator.lists_create_empty=function(a){return["[]",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_create_with=function(a){const b=Array(a.itemCount_);for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"ADD"+c,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"null";return["["+b.join(", ")+"]",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_repeat=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("listsRepeat",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(value, n) {
|
||||
var array = [];
|
||||
for (var i = 0; i < n; i++) {
|
||||
array[i] = value;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
`),c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"ITEM",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"null";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"NUM",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"0";return[b+"("+c+", "+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_length=function(a){return[(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"[]")+".length",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_isEmpty=function(a){return["!"+(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"[]")+".length",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_LOGICAL_NOT]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_indexOf=function(a){var b="FIRST"===a.getFieldValue("END")?"indexOf":"lastIndexOf";const c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"FIND",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";b=(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"[]")+"."+b+"("+c+")";return a.workspace.options.oneBasedIndex?
|
||||
[b+" + 1",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ADDITION]:[b,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_getIndex=function(a){const b=a.getFieldValue("MODE")||"GET",c=a.getFieldValue("WHERE")||"FROM_START";var d=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"VALUE","RANDOM"===c?module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE:module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"[]";switch(c){case "FIRST":if("GET"===b)return[d+"[0]",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER];
|
||||
if("GET_REMOVE"===b)return[d+".shift()",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER];if("REMOVE"===b)return d+".shift();\n";break;case "LAST":if("GET"===b)return[d+".slice(-1)[0]",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER];if("GET_REMOVE"===b)return[d+".pop()",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER];if("REMOVE"===b)return d+".pop();\n";break;case "FROM_START":a=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,
|
||||
"AT");if("GET"===b)return[d+"["+a+"]",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER];if("GET_REMOVE"===b)return[d+".splice("+a+", 1)[0]",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];if("REMOVE"===b)return d+".splice("+a+", 1);\n";break;case "FROM_END":a=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT",1,!0);if("GET"===b)return[d+".slice("+a+")[0]",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];if("GET_REMOVE"===
|
||||
b)return[d+".splice("+a+", 1)[0]",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];if("REMOVE"===b)return d+".splice("+a+", 1);";break;case "RANDOM":d=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("listsGetRandomItem",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(list, remove) {
|
||||
var x = Math.floor(Math.random() * list.length);
|
||||
if (remove) {
|
||||
return list.splice(x, 1)[0];
|
||||
} else {
|
||||
return list[x];
|
||||
}
|
||||
}
|
||||
`)+"("+d+", "+("GET"!==b)+")";if("GET"===b||"GET_REMOVE"===b)return[d,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL];if("REMOVE"===b)return d+";\n"}throw Error("Unhandled combination (lists_getIndex).");};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_setIndex=function(a){function b(){if(c.match(/^\w+$/))return"";const g=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName("tmpList",$.NameType$$module$build$src$core$names.VARIABLE),h="var "+g+" = "+c+";\n";c=g;return h}let c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"[]";const d=a.getFieldValue("MODE")||"GET";
|
||||
var e=a.getFieldValue("WHERE")||"FROM_START";const f=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"TO",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ASSIGNMENT)||"null";switch(e){case "FIRST":if("SET"===d)return c+"[0] = "+f+";\n";if("INSERT"===d)return c+".unshift("+f+");\n";break;case "LAST":if("SET"===d)return b()+(c+"["+c+".length - 1] = "+f+";\n");if("INSERT"===d)return c+".push("+f+");\n";break;case "FROM_START":a=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,
|
||||
"AT");if("SET"===d)return c+"["+a+"] = "+f+";\n";if("INSERT"===d)return c+".splice("+a+", 0, "+f+");\n";break;case "FROM_END":a=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT",1,!1,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_SUBTRACTION);e=b();if("SET"===d)return e+(c+"["+c+".length - "+a+"] = "+f+";\n");if("INSERT"===d)return e+(c+".splice("+c+".length - "+a+", 0, "+f+");\n");break;case "RANDOM":a=b();e=module$exports$Blockly$JavaScript.javascriptGenerator.nameDB_.getDistinctName("tmpX",
|
||||
$.NameType$$module$build$src$core$names.VARIABLE);a+="var "+e+" = Math.floor(Math.random() * "+c+".length);\n";if("SET"===d)return a+(c+"["+e+"] = "+f+";\n");if("INSERT"===d)return a+(c+".splice("+e+", 0, "+f+");\n")}throw Error("Unhandled combination (lists_setIndex).");};var module$contents$Blockly$JavaScript$lists_getSubstringIndex=function(a,b,c){return"FIRST"===b?"0":"FROM_END"===b?a+".length - 1 - "+c:"LAST"===b?a+".length - 1":c};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_getSublist=function(a){var b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER)||"[]",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2");if("FIRST"===c&&"LAST"===d)b+=".slice(0)";else if(b.match(/^\w+$/)||"FROM_END"!==c&&"FROM_START"===d){switch(c){case "FROM_START":c=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT1");
|
||||
break;case "FROM_END":c=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT1",1,!1,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_SUBTRACTION);c=b+".length - "+c;break;case "FIRST":c="0";break;default:throw Error("Unhandled option (lists_getSublist).");}switch(d){case "FROM_START":d=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT2",1);break;case "FROM_END":d=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT2",0,!1,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_SUBTRACTION);
|
||||
d=b+".length - "+d;break;case "LAST":d=b+".length";break;default:throw Error("Unhandled option (lists_getSublist).");}b=b+".slice("+c+", "+d+")"}else{const e=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT1");a=module$exports$Blockly$JavaScript.javascriptGenerator.getAdjusted(a,"AT2");const f={FIRST:"First",LAST:"Last",FROM_START:"FromStart",FROM_END:"FromEnd"};b=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("subsequence"+f[c]+f[d],`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(sequence${"FROM_END"===c||"FROM_START"===c?", at1":""}${"FROM_END"===d||"FROM_START"===d?", at2":""}) {
|
||||
var start = ${module$contents$Blockly$JavaScript$lists_getSubstringIndex("sequence",c,"at1")};
|
||||
var end = ${module$contents$Blockly$JavaScript$lists_getSubstringIndex("sequence",d,"at2")} + 1;
|
||||
return sequence.slice(start, end);
|
||||
}
|
||||
`)+"("+b+("FROM_END"===c||"FROM_START"===c?", "+e:"")+("FROM_END"===d||"FROM_START"===d?", "+a:"")+")"}return[b,module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_sort=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL)||"[]",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");const d=module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("listsGetSortCompare",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(type, direction) {
|
||||
var compareFuncs = {
|
||||
'NUMERIC': function(a, b) {
|
||||
return Number(a) - Number(b); },
|
||||
'TEXT': function(a, b) {
|
||||
return a.toString() > b.toString() ? 1 : -1; },
|
||||
'IGNORE_CASE': function(a, b) {
|
||||
return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },
|
||||
};
|
||||
var compare = compareFuncs[type];
|
||||
return function(a, b) { return compare(a, b) * direction; };
|
||||
}
|
||||
`);return[b+".slice().sort("+d+'("'+a+'", '+c+"))",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.lists_split=function(a){let b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"INPUT",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_MEMBER);const c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"DELIM",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"===a)b||(b="''"),a="split";else if("JOIN"===a)b||(b="[]"),a="join";else throw Error("Unknown mode: "+
|
||||
a);return[b+"."+a+"("+c+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};module$exports$Blockly$JavaScript.javascriptGenerator.lists_reverse=function(a){return[(module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"LIST",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL)||"[]")+".slice().reverse()",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};var module$exports$Blockly$JavaScript$colour={};module$exports$Blockly$JavaScript.javascriptGenerator.colour_picker=function(a){return[module$exports$Blockly$JavaScript.javascriptGenerator.quote_(a.getFieldValue("COLOUR")),module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_ATOMIC]};module$exports$Blockly$JavaScript.javascriptGenerator.colour_random=function(a){return[module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("colourRandom",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}() {
|
||||
var num = Math.floor(Math.random() * Math.pow(2, 24));
|
||||
return '#' + ('00000' + num.toString(16)).substr(-6);
|
||||
}
|
||||
`)+"()",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.colour_rgb=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"RED",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||0,c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"GREEN",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||0;a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"BLUE",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||
|
||||
0;return[module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("colourRgb",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
|
||||
r = Math.max(Math.min(Number(r), 100), 0) * 2.55;
|
||||
g = Math.max(Math.min(Number(g), 100), 0) * 2.55;
|
||||
b = Math.max(Math.min(Number(b), 100), 0) * 2.55;
|
||||
r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2);
|
||||
g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2);
|
||||
b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2);
|
||||
return '#' + r + g + b;
|
||||
}
|
||||
`)+"("+b+", "+c+", "+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};
|
||||
module$exports$Blockly$JavaScript.javascriptGenerator.colour_blend=function(a){const b=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"COLOUR1",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"'#000000'",c=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"COLOUR2",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||"'#000000'";a=module$exports$Blockly$JavaScript.javascriptGenerator.valueToCode(a,"RATIO",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_NONE)||
|
||||
.5;return[module$exports$Blockly$JavaScript.javascriptGenerator.provideFunction_("colourBlend",`
|
||||
function ${module$exports$Blockly$JavaScript.javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) {
|
||||
ratio = Math.max(Math.min(Number(ratio), 1), 0);
|
||||
var r1 = parseInt(c1.substring(1, 3), 16);
|
||||
var g1 = parseInt(c1.substring(3, 5), 16);
|
||||
var b1 = parseInt(c1.substring(5, 7), 16);
|
||||
var r2 = parseInt(c2.substring(1, 3), 16);
|
||||
var g2 = parseInt(c2.substring(3, 5), 16);
|
||||
var b2 = parseInt(c2.substring(5, 7), 16);
|
||||
var r = Math.round(r1 * (1 - ratio) + r2 * ratio);
|
||||
var g = Math.round(g1 * (1 - ratio) + g2 * ratio);
|
||||
var b = Math.round(b1 * (1 - ratio) + b2 * ratio);
|
||||
r = ('0' + (r || 0).toString(16)).slice(-2);
|
||||
g = ('0' + (g || 0).toString(16)).slice(-2);
|
||||
b = ('0' + (b || 0).toString(16)).slice(-2);
|
||||
return '#' + r + g + b;
|
||||
}
|
||||
`)+"("+b+", "+c+", "+a+")",module$exports$Blockly$JavaScript.javascriptGenerator.ORDER_FUNCTION_CALL]};var module$exports$Blockly$JavaScript$all=module$exports$Blockly$JavaScript;
|
||||
module$exports$Blockly$JavaScript.__namespace__=$;
|
||||
return module$exports$Blockly$JavaScript;
|
||||
}));
|
||||
|
||||
|
||||
//# sourceMappingURL=javascript_compressed.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,416 +0,0 @@
|
||||
// Do not edit this file; automatically generated.
|
||||
|
||||
/* eslint-disable */
|
||||
;(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) { // AMD
|
||||
define(["./blockly_compressed.js"], factory);
|
||||
} else if (typeof exports === 'object') { // Node.js
|
||||
module.exports = factory(require("./blockly_compressed.js"));
|
||||
} else { // Browser
|
||||
var factoryExports = factory(root.Blockly);
|
||||
root.Blockly.Lua = factoryExports.luaGenerator;
|
||||
root.Blockly.Lua.__namespace__ = factoryExports.__namespace__;
|
||||
}
|
||||
}(this, function(__parent__) {
|
||||
var $=__parent__.__namespace__;
|
||||
var module$exports$Blockly$Lua={},module$contents$Blockly$Lua_objectUtils=$.module$build$src$core$utils$object,module$contents$Blockly$Lua_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$Lua_Generator=$.Generator$$module$build$src$core$generator,module$contents$Blockly$Lua_inputTypes=$.module$build$src$core$input_types.inputTypes,module$contents$Blockly$Lua_Names=$.module$build$src$core$names.Names;module$exports$Blockly$Lua.luaGenerator=new $.Generator$$module$build$src$core$generator("Lua");
|
||||
module$exports$Blockly$Lua.luaGenerator.addReservedWords("_,__inext,assert,bit,colors,colours,coroutine,disk,dofile,error,fs,fetfenv,getmetatable,gps,help,io,ipairs,keys,loadfile,loadstring,math,native,next,os,paintutils,pairs,parallel,pcall,peripheral,print,printError,rawequal,rawget,rawset,read,rednet,redstone,rs,select,setfenv,setmetatable,sleep,string,table,term,textutils,tonumber,tostring,turtle,type,unpack,vector,write,xpcall,_VERSION,__indext,HTTP,and,break,do,else,elseif,end,false,for,function,if,in,local,nil,not,or,repeat,return,then,true,until,while,add,sub,mul,div,mod,pow,unm,concat,len,eq,lt,le,index,newindex,call,assert,collectgarbage,dofile,error,_G,getmetatable,inpairs,load,loadfile,next,pairs,pcall,print,rawequal,rawget,rawlen,rawset,select,setmetatable,tonumber,tostring,type,_VERSION,xpcall,require,package,string,table,math,bit32,io,file,os,debug");
|
||||
module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC=0;module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH=1;module$exports$Blockly$Lua.luaGenerator.ORDER_EXPONENTIATION=2;module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY=3;module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE=4;module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE=5;module$exports$Blockly$Lua.luaGenerator.ORDER_CONCATENATION=6;module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL=7;
|
||||
module$exports$Blockly$Lua.luaGenerator.ORDER_AND=8;module$exports$Blockly$Lua.luaGenerator.ORDER_OR=9;module$exports$Blockly$Lua.luaGenerator.ORDER_NONE=99;module$exports$Blockly$Lua.luaGenerator.isInitialized=!1;
|
||||
module$exports$Blockly$Lua.luaGenerator.init=function(a){Object.getPrototypeOf(this).init.call(this);this.nameDB_?this.nameDB_.reset():this.nameDB_=new $.module$build$src$core$names.Names(this.RESERVED_WORDS_);this.nameDB_.setVariableMap(a.getVariableMap());this.nameDB_.populateVariables(a);this.nameDB_.populateProcedures(a);this.isInitialized=!0};
|
||||
module$exports$Blockly$Lua.luaGenerator.finish=function(a){const b=$.module$build$src$core$utils$object.values(this.definitions_);a=Object.getPrototypeOf(this).finish.call(this,a);this.isInitialized=!1;this.nameDB_.reset();return b.join("\n\n")+"\n\n\n"+a};module$exports$Blockly$Lua.luaGenerator.scrubNakedValue=function(a){return"local _ = "+a+"\n"};module$exports$Blockly$Lua.luaGenerator.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'");return"'"+a+"'"};
|
||||
module$exports$Blockly$Lua.luaGenerator.multiline_quote_=function(a){return a.split(/\n/g).map(this.quote_).join(" .. '\\n' ..\n")};
|
||||
module$exports$Blockly$Lua.luaGenerator.scrub_=function(a,b,c){let d="";if(!a.outputConnection||!a.outputConnection.targetConnection){var e=a.getCommentText();e&&(e=$.module$build$src$core$utils$string.wrap(e,this.COMMENT_WRAP-3),d+=this.prefixLines(e,"-- ")+"\n");for(let f=0;f<a.inputList.length;f++)a.inputList[f].type===$.module$build$src$core$input_types.inputTypes.VALUE&&(e=a.inputList[f].connection.targetBlock())&&(e=this.allNestedComments(e))&&(d+=this.prefixLines(e,"-- "))}a=a.nextConnection&&
|
||||
a.nextConnection.targetBlock();c=c?"":this.blockToCode(a);return d+b+c};var module$exports$Blockly$Lua$variables={},module$contents$Blockly$Lua$variables_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Lua.luaGenerator.variables_get=function(a){return[module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Lua.luaGenerator.variables_set=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";return module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE)+" = "+b+"\n"};var module$exports$Blockly$Lua$variablesDynamic={};module$exports$Blockly$Lua.luaGenerator.variables_get_dynamic=module$exports$Blockly$Lua.luaGenerator.variables_get;module$exports$Blockly$Lua.luaGenerator.variables_set_dynamic=module$exports$Blockly$Lua.luaGenerator.variables_set;var module$exports$Blockly$Lua$texts={},module$contents$Blockly$Lua$texts_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Lua.luaGenerator.text=function(a){return[module$exports$Blockly$Lua.luaGenerator.quote_(a.getFieldValue("TEXT")),module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_multiline=function(a){a=module$exports$Blockly$Lua.luaGenerator.multiline_quote_(a.getFieldValue("TEXT"));const b=-1!==a.indexOf("..")?module$exports$Blockly$Lua.luaGenerator.ORDER_CONCATENATION:module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC;return[a,b]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_join=function(a){if(0===a.itemCount_)return["''",module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC];if(1===a.itemCount_)return["tostring("+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ADD0",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''")+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH];if(2===a.itemCount_){var b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ADD0",module$exports$Blockly$Lua.luaGenerator.ORDER_CONCATENATION)||
|
||||
"''";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ADD1",module$exports$Blockly$Lua.luaGenerator.ORDER_CONCATENATION)||"''";return[b+" .. "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_CONCATENATION]}b=[];for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ADD"+c,module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";return["table.concat({"+b.join(", ")+"})",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_append=function(a){const b=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Lua.luaGenerator.ORDER_CONCATENATION)||"''";return b+" = "+b+" .. "+a+"\n"};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_length=function(a){return["#"+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY)||"''"),module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY]};module$exports$Blockly$Lua.luaGenerator.text_isEmpty=function(a){return["#"+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY)||"''")+" == 0",module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_indexOf=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"FIND",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''",c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";return[("FIRST"===a.getFieldValue("END")?module$exports$Blockly$Lua.luaGenerator.provideFunction_("firstIndexOf",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(str, substr)
|
||||
local i = string.find(str, substr, 1, true)
|
||||
if i == nil then
|
||||
return 0
|
||||
end
|
||||
return i
|
||||
end
|
||||
`):module$exports$Blockly$Lua.luaGenerator.provideFunction_("lastIndexOf",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(str, substr)
|
||||
local i = string.find(string.reverse(str), string.reverse(substr), 1, true)
|
||||
if i then
|
||||
return #str + 2 - i - #substr
|
||||
end
|
||||
return 0
|
||||
end
|
||||
`))+"("+c+", "+b+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_charAt=function(a){var b=a.getFieldValue("WHERE")||"FROM_START";const c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT","FROM_END"===b?module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY:module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";if("RANDOM"===b)b=module$exports$Blockly$Lua.luaGenerator.provideFunction_("text_random_letter",
|
||||
`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(str)
|
||||
local index = math.random(string.len(str))
|
||||
return string.sub(str, index, index)
|
||||
end
|
||||
`)+"("+a+")";else{if("FIRST"===b)b="1";else if("LAST"===b)b="-1";else if("FROM_START"===b)b=c;else if("FROM_END"===b)b="-"+c;else throw Error("Unhandled option (text_charAt).");b=b.match(/^-?\w*$/)?"string.sub("+a+", "+b+", "+b+")":module$exports$Blockly$Lua.luaGenerator.provideFunction_("text_char_at",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(str, index)
|
||||
return string.sub(str, index, index)
|
||||
end
|
||||
`)+"("+a+", "+b+")"}return[b,module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_getSubstring=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"STRING",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";var c=a.getFieldValue("WHERE1"),d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT1","FROM_END"===c?module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY:module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1";if("FIRST"===c)c=1;else if("FROM_START"===c)c=d;else if("FROM_END"===c)c="-"+d;else throw Error("Unhandled option (text_getSubstring)");
|
||||
d=a.getFieldValue("WHERE2");a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT2","FROM_END"===d?module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY:module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1";if("LAST"===d)a=-1;else if("FROM_START"!==d)if("FROM_END"===d)a="-"+a;else throw Error("Unhandled option (text_getSubstring)");return["string.sub("+b+", "+c+", "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_changeCase=function(a){const b=a.getFieldValue("CASE");a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";let c;"UPPERCASE"===b?c="string.upper":"LOWERCASE"===b?c="string.lower":"TITLECASE"===b&&(c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("text_titlecase",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(str)
|
||||
local buf = {}
|
||||
local inWord = false
|
||||
for i = 1, #str do
|
||||
local c = string.sub(str, i, i)
|
||||
if inWord then
|
||||
table.insert(buf, string.lower(c))
|
||||
if string.find(c, "%s") then
|
||||
inWord = false
|
||||
end
|
||||
else
|
||||
table.insert(buf, string.upper(c))
|
||||
inWord = true
|
||||
end
|
||||
end
|
||||
return table.concat(buf)
|
||||
end
|
||||
`));return[c+"("+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.text_trim=function(a){const b={LEFT:"^%s*(,-)",RIGHT:"(.-)%s*$",BOTH:"^%s*(.-)%s*$"}[a.getFieldValue("MODE")];return["string.gsub("+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''")+', "'+b+'", "%1")',module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_print=function(a){return"print("+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''")+")\n"};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_prompt_ext=function(a){var b=a.getField("TEXT")?module$exports$Blockly$Lua.luaGenerator.quote_(a.getFieldValue("TEXT")):module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";b=module$exports$Blockly$Lua.luaGenerator.provideFunction_("text_prompt",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(msg)
|
||||
io.write(msg)
|
||||
io.flush()
|
||||
return io.read()
|
||||
end
|
||||
`)+"("+b+")";"NUMBER"===a.getFieldValue("TYPE")&&(b="tonumber("+b+", 10)");return[b,module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.text_prompt=module$exports$Blockly$Lua.luaGenerator.text_prompt_ext;
|
||||
module$exports$Blockly$Lua.luaGenerator.text_count=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"SUB",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";return[module$exports$Blockly$Lua.luaGenerator.provideFunction_("text_count",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle)
|
||||
if #needle == 0 then
|
||||
return #haystack + 1
|
||||
end
|
||||
local i = 1
|
||||
local count = 0
|
||||
while true do
|
||||
i = string.find(haystack, needle, i, true)
|
||||
if i == nil then
|
||||
break
|
||||
end
|
||||
count = count + 1
|
||||
i = i + #needle
|
||||
end
|
||||
return count
|
||||
end
|
||||
`)+"("+b+", "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.text_replace=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''",c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"FROM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TO",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";return[module$exports$Blockly$Lua.luaGenerator.provideFunction_("text_replace",
|
||||
`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement)
|
||||
local buf = {}
|
||||
local i = 1
|
||||
while i <= #haystack do
|
||||
if string.sub(haystack, i, i + #needle - 1) == needle then
|
||||
for j = 1, #replacement do
|
||||
table.insert(buf, string.sub(replacement, j, j))
|
||||
end
|
||||
i = i + #needle
|
||||
else
|
||||
table.insert(buf, string.sub(haystack, i, i))
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
return table.concat(buf)
|
||||
end
|
||||
`)+"("+b+", "+c+", "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.text_reverse=function(a){return["string.reverse("+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''")+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};var module$exports$Blockly$Lua$procedures={},module$contents$Blockly$Lua$procedures_NameType=$.NameType$$module$build$src$core$names;
|
||||
module$exports$Blockly$Lua.luaGenerator.procedures_defreturn=function(a){const b=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE);var c="";module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX&&(c+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX,
|
||||
a));c&&(c=module$exports$Blockly$Lua.luaGenerator.prefixLines(c,module$exports$Blockly$Lua.luaGenerator.INDENT));let d="";module$exports$Blockly$Lua.luaGenerator.INFINITE_LOOP_TRAP&&(d=module$exports$Blockly$Lua.luaGenerator.prefixLines(module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.INFINITE_LOOP_TRAP,a),module$exports$Blockly$Lua.luaGenerator.INDENT));let e=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"STACK"),f=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,
|
||||
"RETURN",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"",g="";e&&f&&(g=c);f?f=module$exports$Blockly$Lua.luaGenerator.INDENT+"return "+f+"\n":e||(e="");const h=[],k=a.getVars();for(let l=0;l<k.length;l++)h[l]=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(k[l],$.NameType$$module$build$src$core$names.VARIABLE);c="function "+b+"("+h.join(", ")+")\n"+c+d+e+g+f+"end\n";c=module$exports$Blockly$Lua.luaGenerator.scrub_(a,c);module$exports$Blockly$Lua.luaGenerator.definitions_["%"+b]=c;
|
||||
return null};module$exports$Blockly$Lua.luaGenerator.procedures_defnoreturn=module$exports$Blockly$Lua.luaGenerator.procedures_defreturn;
|
||||
module$exports$Blockly$Lua.luaGenerator.procedures_callreturn=function(a){const b=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE),c=[],d=a.getVars();for(let e=0;e<d.length;e++)c[e]=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ARG"+e,module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"nil";return[b+"("+c.join(", ")+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.procedures_callnoreturn=function(a){return module$exports$Blockly$Lua.luaGenerator.procedures_callreturn(a)[0]+"\n"};
|
||||
module$exports$Blockly$Lua.luaGenerator.procedures_ifreturn=function(a){let b="if "+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"CONDITION",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"false")+" then\n";module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$Lua.luaGenerator.prefixLines(module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Lua.luaGenerator.INDENT));a.hasReturnValue_?
|
||||
(a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"nil",b+=module$exports$Blockly$Lua.luaGenerator.INDENT+"return "+a+"\n"):b+=module$exports$Blockly$Lua.luaGenerator.INDENT+"return\n";return b+"end\n"};var module$exports$Blockly$Lua$math={},module$contents$Blockly$Lua$math_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Lua.luaGenerator.math_number=function(a){a=Number(a.getFieldValue("NUM"));return[a,0>a?module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY:module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Lua.luaGenerator.math_arithmetic=function(a){var b={ADD:[" + ",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE],MINUS:[" - ",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE],MULTIPLY:[" * ",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE],POWER:[" ^ ",module$exports$Blockly$Lua.luaGenerator.ORDER_EXPONENTIATION]}[a.getFieldValue("OP")];const c=b[0];b=b[1];const d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,
|
||||
"A",b)||"0";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"B",b)||"0";return[d+c+a,b]};
|
||||
module$exports$Blockly$Lua.luaGenerator.math_single=function(a){var b=a.getFieldValue("OP");if("NEG"===b)return a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY)||"0",["-"+a,module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY];if("POW10"===b)return a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_EXPONENTIATION)||"0",["10 ^ "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_EXPONENTIATION];
|
||||
a="ROUND"===b?module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE)||"0":module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";switch(b){case "ABS":b="math.abs("+a+")";break;case "ROOT":b="math.sqrt("+a+")";break;case "LN":b="math.log("+a+")";break;case "LOG10":b="math.log("+a+", 10)";break;case "EXP":b="math.exp("+a+")";break;case "ROUND":b="math.floor("+a+" + .5)";break;case "ROUNDUP":b=
|
||||
"math.ceil("+a+")";break;case "ROUNDDOWN":b="math.floor("+a+")";break;case "SIN":b="math.sin(math.rad("+a+"))";break;case "COS":b="math.cos(math.rad("+a+"))";break;case "TAN":b="math.tan(math.rad("+a+"))";break;case "ASIN":b="math.deg(math.asin("+a+"))";break;case "ACOS":b="math.deg(math.acos("+a+"))";break;case "ATAN":b="math.deg(math.atan("+a+"))";break;default:throw Error("Unknown math operator: "+b);}return[b,module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.math_constant=function(a){return{PI:["math.pi",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH],E:["math.exp(1)",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH],GOLDEN_RATIO:["(1 + math.sqrt(5)) / 2",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE],SQRT2:["math.sqrt(2)",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH],SQRT1_2:["math.sqrt(1 / 2)",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH],INFINITY:["math.huge",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]}[a.getFieldValue("CONSTANT")]};
|
||||
module$exports$Blockly$Lua.luaGenerator.math_number_property=function(a){var b={EVEN:[" % 2 == 0",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],ODD:[" % 2 == 1",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],WHOLE:[" % 1 == 0",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],POSITIVE:[" > 0",
|
||||
module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],NEGATIVE:[" < 0",module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],DIVISIBLE_BY:[null,module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],PRIME:[null,module$exports$Blockly$Lua.luaGenerator.ORDER_NONE,module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
const c=a.getFieldValue("PROPERTY"),[d,e,f]=b[c];b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUMBER_TO_CHECK",e)||"0";if("PRIME"===c)a=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_isPrime",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(n)
|
||||
-- https://en.wikipedia.org/wiki/Primality_test#Naive_methods
|
||||
if n == 2 or n == 3 then
|
||||
return true
|
||||
end
|
||||
-- False if n is NaN, negative, is 1, or not whole.
|
||||
-- And false if n is divisible by 2 or 3.
|
||||
if not(n > 1) or n % 1 ~= 0 or n % 2 == 0 or n % 3 == 0 then
|
||||
return false
|
||||
end
|
||||
-- Check all the numbers of form 6k +/- 1, up to sqrt(n).
|
||||
for x = 6, math.sqrt(n) + 1.5, 6 do
|
||||
if n % (x - 1) == 0 or n % (x + 1) == 0 then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
`)+"("+b+")";else if("DIVISIBLE_BY"===c){a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DIVISOR",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE)||"0";if("0"===a)return["nil",module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC];a=b+" % "+a+" == 0"}else a=b+d;return[a,f]};
|
||||
module$exports$Blockly$Lua.luaGenerator.math_change=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DELTA",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE)||"0";a=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);return a+" = "+a+" + "+b+"\n"};module$exports$Blockly$Lua.luaGenerator.math_round=module$exports$Blockly$Lua.luaGenerator.math_single;
|
||||
module$exports$Blockly$Lua.luaGenerator.math_trig=module$exports$Blockly$Lua.luaGenerator.math_single;module$exports$Blockly$Lua.luaGenerator.math_on_list=function(a){function b(){return module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_sum",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t)
|
||||
local result = 0
|
||||
for _, v in ipairs(t) do
|
||||
result = result + v
|
||||
end
|
||||
return result
|
||||
end
|
||||
`)}var c=a.getFieldValue("OP");a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LIST",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"{}";switch(c){case "SUM":c=b();break;case "MIN":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_min",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t)
|
||||
if #t == 0 then
|
||||
return 0
|
||||
end
|
||||
local result = math.huge
|
||||
for _, v in ipairs(t) do
|
||||
if v < result then
|
||||
result = v
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
`);break;case "AVERAGE":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_average",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t)
|
||||
if #t == 0 then
|
||||
return 0
|
||||
end
|
||||
return ${b()}(t) / #t
|
||||
end
|
||||
`);break;case "MAX":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_max",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t)
|
||||
if #t == 0 then
|
||||
return 0
|
||||
end
|
||||
local result = -math.huge
|
||||
for _, v in ipairs(t) do
|
||||
if v > result then
|
||||
result = v
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
`);break;case "MEDIAN":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_median",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t)
|
||||
-- Source: http://lua-users.org/wiki/SimpleStats
|
||||
if #t == 0 then
|
||||
return 0
|
||||
end
|
||||
local temp = {}
|
||||
for _, v in ipairs(t) do
|
||||
if type(v) == 'number' then
|
||||
table.insert(temp, v)
|
||||
end
|
||||
end
|
||||
table.sort(temp)
|
||||
if #temp % 2 == 0 then
|
||||
return (temp[#temp / 2] + temp[(#temp / 2) + 1]) / 2
|
||||
else
|
||||
return temp[math.ceil(#temp / 2)]
|
||||
end
|
||||
end
|
||||
`);break;case "MODE":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_modes",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t)
|
||||
-- Source: http://lua-users.org/wiki/SimpleStats
|
||||
local counts = {}
|
||||
for _, v in ipairs(t) do
|
||||
if counts[v] == nil then
|
||||
counts[v] = 1
|
||||
else
|
||||
counts[v] = counts[v] + 1
|
||||
end
|
||||
end
|
||||
local biggestCount = 0
|
||||
for _, v in pairs(counts) do
|
||||
if v > biggestCount then
|
||||
biggestCount = v
|
||||
end
|
||||
end
|
||||
local temp = {}
|
||||
for k, v in pairs(counts) do
|
||||
if v == biggestCount then
|
||||
table.insert(temp, k)
|
||||
end
|
||||
end
|
||||
return temp
|
||||
end
|
||||
`);break;case "STD_DEV":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_standard_deviation",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t)
|
||||
local m
|
||||
local vm
|
||||
local total = 0
|
||||
local count = 0
|
||||
local result
|
||||
m = #t == 0 and 0 or ${b()}(t) / #t
|
||||
for _, v in ipairs(t) do
|
||||
if type(v) == 'number' then
|
||||
vm = v - m
|
||||
total = total + (vm * vm)
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
result = math.sqrt(total / (count-1))
|
||||
return result
|
||||
end
|
||||
`);break;case "RANDOM":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_random_list",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t)
|
||||
if #t == 0 then
|
||||
return nil
|
||||
end
|
||||
return t[math.random(#t)]
|
||||
end
|
||||
`);break;default:throw Error("Unknown operator: "+c);}return[c+"("+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.math_modulo=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DIVIDEND",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE)||"0";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DIVISOR",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE)||"0";return[b+" % "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE]};
|
||||
module$exports$Blockly$Lua.luaGenerator.math_constrain=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0",c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LOW",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"-math.huge";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"HIGH",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"math.huge";return["math.min(math.max("+b+", "+c+"), "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.math_random_int=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"FROM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TO",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";return["math.random("+b+", "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.math_random_float=function(a){return["math.random()",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.math_atan2=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"X",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";return["math.deg(math.atan2("+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"Y",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0")+", "+b+"))",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};var module$exports$Blockly$Lua$loops={},module$contents$Blockly$Lua$loops_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$Lua$loops_NameType=$.NameType$$module$build$src$core$names,module$contents$Blockly$Lua$loops_CONTINUE_STATEMENT="goto continue\n",module$contents$Blockly$Lua$loops_addContinueLabel=function(a){return-1!==a.indexOf(module$contents$Blockly$Lua$loops_CONTINUE_STATEMENT)?a+module$exports$Blockly$Lua.luaGenerator.INDENT+"::continue::\n":a};
|
||||
module$exports$Blockly$Lua.luaGenerator.controls_repeat_ext=function(a){let b;b=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TIMES",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";b=$.module$build$src$core$utils$string.isNumber(b)?parseInt(b,10):"math.floor("+b+")";let c=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO");c=module$exports$Blockly$Lua.luaGenerator.addLoopTrap(c,a);c=module$contents$Blockly$Lua$loops_addContinueLabel(c);
|
||||
return"for "+module$exports$Blockly$Lua.luaGenerator.nameDB_.getDistinctName("count",$.NameType$$module$build$src$core$names.VARIABLE)+" = 1, "+b+" do\n"+c+"end\n"};module$exports$Blockly$Lua.luaGenerator.controls_repeat=module$exports$Blockly$Lua.luaGenerator.controls_repeat_ext;
|
||||
module$exports$Blockly$Lua.luaGenerator.controls_whileUntil=function(a){const b="UNTIL"===a.getFieldValue("MODE");let c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"BOOL",b?module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY:module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"false",d=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO");d=module$exports$Blockly$Lua.luaGenerator.addLoopTrap(d,a);d=module$contents$Blockly$Lua$loops_addContinueLabel(d);b&&(c="not "+c);return"while "+
|
||||
c+" do\n"+d+"end\n"};
|
||||
module$exports$Blockly$Lua.luaGenerator.controls_for=function(a){const b=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"FROM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0",d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TO",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0",e=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"BY",
|
||||
module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1";let f=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO");f=module$exports$Blockly$Lua.luaGenerator.addLoopTrap(f,a);f=module$contents$Blockly$Lua$loops_addContinueLabel(f);a="";let g;$.module$build$src$core$utils$string.isNumber(c)&&$.module$build$src$core$utils$string.isNumber(d)&&$.module$build$src$core$utils$string.isNumber(e)?g=(Number(c)<=Number(d)?"":"-")+Math.abs(Number(e)):(a="",g=module$exports$Blockly$Lua.luaGenerator.nameDB_.getDistinctName(b+
|
||||
"_inc",$.NameType$$module$build$src$core$names.VARIABLE),a+=g+" = ",a=$.module$build$src$core$utils$string.isNumber(e)?a+(Math.abs(e)+"\n"):a+("math.abs("+e+")\n"),a=a+("if ("+c+") > ("+d+") then\n")+(module$exports$Blockly$Lua.luaGenerator.INDENT+g+" = -"+g+"\n"),a+="end\n");return a+("for "+b+" = "+c+", "+d+", "+g)+(" do\n"+f+"end\n")};
|
||||
module$exports$Blockly$Lua.luaGenerator.controls_forEach=function(a){const b=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LIST",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"{}";let d=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO");d=module$exports$Blockly$Lua.luaGenerator.addLoopTrap(d,a);d=module$contents$Blockly$Lua$loops_addContinueLabel(d);
|
||||
return"for _, "+b+" in ipairs("+c+") do \n"+d+"end\n"};
|
||||
module$exports$Blockly$Lua.luaGenerator.controls_flow_statements=function(a){let b="";module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX&&(b+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX,a));if(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX){const c=a.getSurroundLoop();
|
||||
c&&!c.suppressPrefixSuffix&&(b+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX,c))}switch(a.getFieldValue("FLOW")){case "BREAK":return b+"break\n";case "CONTINUE":return b+module$contents$Blockly$Lua$loops_CONTINUE_STATEMENT}throw Error("Unknown flow statement.");};var module$exports$Blockly$Lua$logic={};
|
||||
module$exports$Blockly$Lua.luaGenerator.controls_if=function(a){var b=0;let c="";module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX,a));do{const d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"IF"+b,module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"false";let e=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO"+b);module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX&&(e=
|
||||
module$exports$Blockly$Lua.luaGenerator.prefixLines(module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Lua.luaGenerator.INDENT)+e);c+=(0<b?"else":"")+"if "+d+" then\n"+e;b++}while(a.getInput("IF"+b));if(a.getInput("ELSE")||module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX)b=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"ELSE"),module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX&&(b=module$exports$Blockly$Lua.luaGenerator.prefixLines(module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX,
|
||||
a),module$exports$Blockly$Lua.luaGenerator.INDENT)+b),c+="else\n"+b;return c+"end\n"};module$exports$Blockly$Lua.luaGenerator.controls_ifelse=module$exports$Blockly$Lua.luaGenerator.controls_if;
|
||||
module$exports$Blockly$Lua.luaGenerator.logic_compare=function(a){const b={EQ:"==",NEQ:"~=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"A",module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL)||"0";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"B",module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL)||"0";return[c+" "+b+" "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL]};
|
||||
module$exports$Blockly$Lua.luaGenerator.logic_operation=function(a){const b="AND"===a.getFieldValue("OP")?"and":"or",c="and"===b?module$exports$Blockly$Lua.luaGenerator.ORDER_AND:module$exports$Blockly$Lua.luaGenerator.ORDER_OR;let d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"A",c);a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"B",c);if(d||a){const e="and"===b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]};
|
||||
module$exports$Blockly$Lua.luaGenerator.logic_negate=function(a){return["not "+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"BOOL",module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY)||"true"),module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY]};module$exports$Blockly$Lua.luaGenerator.logic_boolean=function(a){return["TRUE"===a.getFieldValue("BOOL")?"true":"false",module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Lua.luaGenerator.logic_null=function(a){return["nil",module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]};
|
||||
module$exports$Blockly$Lua.luaGenerator.logic_ternary=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"IF",module$exports$Blockly$Lua.luaGenerator.ORDER_AND)||"false",c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"THEN",module$exports$Blockly$Lua.luaGenerator.ORDER_AND)||"nil";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ELSE",module$exports$Blockly$Lua.luaGenerator.ORDER_OR)||"nil";return[b+" and "+c+" or "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_OR]};var module$exports$Blockly$Lua$lists={},module$contents$Blockly$Lua$lists_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Lua.luaGenerator.lists_create_empty=function(a){return["{}",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.lists_create_with=function(a){const b=Array(a.itemCount_);for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ADD"+c,module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"None";return["{"+b.join(", ")+"}",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.lists_repeat=function(a){const b=module$exports$Blockly$Lua.luaGenerator.provideFunction_("create_list_repeated",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(item, count)
|
||||
local t = {}
|
||||
for i = 1, count do
|
||||
table.insert(t, item)
|
||||
end
|
||||
return t
|
||||
end
|
||||
`),c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ITEM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"None";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";return[b+"("+c+", "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.lists_length=function(a){return["#"+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY)||"{}"),module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY]};module$exports$Blockly$Lua.luaGenerator.lists_isEmpty=function(a){return["#"+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY)||"{}")+" == 0",module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL]};
|
||||
module$exports$Blockly$Lua.luaGenerator.lists_indexOf=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"FIND",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''",c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"{}";return[("FIRST"===a.getFieldValue("END")?module$exports$Blockly$Lua.luaGenerator.provideFunction_("first_index",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t, elem)
|
||||
for k, v in ipairs(t) do
|
||||
if v == elem then
|
||||
return k
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
`):module$exports$Blockly$Lua.luaGenerator.provideFunction_("last_index",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t, elem)
|
||||
for i = #t, 1, -1 do
|
||||
if t[i] == elem then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
`))+"("+c+", "+b+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};var module$contents$Blockly$Lua$lists_getListIndex=function(a,b,c){return"FIRST"===b?"1":"FROM_END"===b?"#"+a+" + 1 - "+c:"LAST"===b?"#"+a:"RANDOM"===b?"math.random(#"+a+")":c};
|
||||
module$exports$Blockly$Lua.luaGenerator.lists_getIndex=function(a){var b=a.getFieldValue("MODE")||"GET",c=a.getFieldValue("WHERE")||"FROM_START";const d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH)||"({})";if("LAST"!==c&&"FROM_END"!==c&&"RANDOM"!==c||d.match(/^\w+$/)){a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT","GET"===b&&"FROM_END"===c?module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE:module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||
|
||||
"1";a=module$contents$Blockly$Lua$lists_getListIndex(d,c,a);if("GET"===b)return[d+"["+a+"]",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH];c="table.remove("+d+", "+a+")";return"GET_REMOVE"===b?[c,module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]:c+"\n"}if("REMOVE"===b)return b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT","FROM_END"===c?module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE:module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1",a=module$exports$Blockly$Lua.luaGenerator.nameDB_.getDistinctName("tmp_list",
|
||||
$.NameType$$module$build$src$core$names.VARIABLE),b=module$contents$Blockly$Lua$lists_getListIndex(a,c,b),a+" = "+d+"\ntable.remove("+a+", "+b+")\n";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1";return[("GET"===b?module$exports$Blockly$Lua.luaGenerator.provideFunction_("list_get_"+c.toLowerCase(),["function "+module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_+"(t"+("FROM_END"===c||"FROM_START"===c?", at)":")"),
|
||||
" return t["+module$contents$Blockly$Lua$lists_getListIndex("t",c,"at")+"]","end"]):module$exports$Blockly$Lua.luaGenerator.provideFunction_("list_remove_"+c.toLowerCase(),["function "+module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_+"(t"+("FROM_END"===c||"FROM_START"===c?", at)":")")," return table.remove(t, "+module$contents$Blockly$Lua$lists_getListIndex("t",c,"at")+")","end"]))+"("+d+("FROM_END"===c||"FROM_START"===c?", "+a:"")+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.lists_setIndex=function(a){let b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LIST",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH)||"{}";const c=a.getFieldValue("MODE")||"SET",d=a.getFieldValue("WHERE")||"FROM_START",e=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE)||"1";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TO",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||
|
||||
"None";let f="";if(("LAST"===d||"FROM_END"===d||"RANDOM"===d)&&!b.match(/^\w+$/)){const g=module$exports$Blockly$Lua.luaGenerator.nameDB_.getDistinctName("tmp_list",$.NameType$$module$build$src$core$names.VARIABLE);f=g+" = "+b+"\n";b=g}f="SET"===c?f+(b+"["+module$contents$Blockly$Lua$lists_getListIndex(b,d,e)+"] = "+a):f+("table.insert("+b+", "+(module$contents$Blockly$Lua$lists_getListIndex(b,d,e)+("LAST"===d?" + 1":""))+", "+a+")");return f+"\n"};
|
||||
module$exports$Blockly$Lua.luaGenerator.lists_getSublist=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LIST",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"{}",c=a.getFieldValue("WHERE1"),d=a.getFieldValue("WHERE2"),e=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT1",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"AT2",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1";const f="FROM_END"===
|
||||
c||"FROM_START"===c?", at1":"",g="FROM_END"===d||"FROM_START"===d?", at2":"";return[module$exports$Blockly$Lua.luaGenerator.provideFunction_("list_sublist_"+c.toLowerCase()+"_"+d.toLowerCase(),`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(source${f}${g})
|
||||
local t = {}
|
||||
local start = ${module$contents$Blockly$Lua$lists_getListIndex("source",c,"at1")}
|
||||
local finish = ${module$contents$Blockly$Lua$lists_getListIndex("source",d,"at2")}
|
||||
for i = start, finish do
|
||||
table.insert(t, source[i])
|
||||
end
|
||||
return t
|
||||
end
|
||||
`)+"("+b+("FROM_END"===c||"FROM_START"===c?", "+e:"")+("FROM_END"===d||"FROM_START"===d?", "+a:"")+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.lists_sort=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LIST",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"{}",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");return[module$exports$Blockly$Lua.luaGenerator.provideFunction_("list_sort",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(list, typev, direction)
|
||||
local t = {}
|
||||
for n,v in pairs(list) do table.insert(t, v) end
|
||||
local compareFuncs = {
|
||||
NUMERIC = function(a, b)
|
||||
return (tonumber(tostring(a)) or 0)
|
||||
< (tonumber(tostring(b)) or 0) end,
|
||||
TEXT = function(a, b)
|
||||
return tostring(a) < tostring(b) end,
|
||||
IGNORE_CASE = function(a, b)
|
||||
return string.lower(tostring(a)) < string.lower(tostring(b)) end
|
||||
}
|
||||
local compareTemp = compareFuncs[typev]
|
||||
local compare = compareTemp
|
||||
if direction == -1
|
||||
then compare = function(a, b) return compareTemp(b, a) end
|
||||
end
|
||||
table.sort(t, compare)
|
||||
return t
|
||||
end
|
||||
`)+"("+b+',"'+a+'", '+c+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.lists_split=function(a){let b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"INPUT",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE);const c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DELIM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"===a)b||(b="''"),a=module$exports$Blockly$Lua.luaGenerator.provideFunction_("list_string_split",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(input, delim)
|
||||
local t = {}
|
||||
local pos = 1
|
||||
while true do
|
||||
next_delim = string.find(input, delim, pos)
|
||||
if next_delim == nil then
|
||||
table.insert(t, string.sub(input, pos))
|
||||
break
|
||||
else
|
||||
table.insert(t, string.sub(input, pos, next_delim-1))
|
||||
pos = next_delim + #delim
|
||||
end
|
||||
end
|
||||
return t
|
||||
end
|
||||
`);else if("JOIN"===a)b||(b="{}"),a="table.concat";else throw Error("Unknown mode: "+a);return[a+"("+b+", "+c+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.lists_reverse=function(a){a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LIST",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"{}";return[module$exports$Blockly$Lua.luaGenerator.provideFunction_("list_reverse",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(input)
|
||||
local reversed = {}
|
||||
for i = #input, 1, -1 do
|
||||
table.insert(reversed, input[i])
|
||||
end
|
||||
return reversed
|
||||
end
|
||||
`)+"("+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};var module$exports$Blockly$Lua$colour={};module$exports$Blockly$Lua.luaGenerator.colour_picker=function(a){return[module$exports$Blockly$Lua.luaGenerator.quote_(a.getFieldValue("COLOUR")),module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]};module$exports$Blockly$Lua.luaGenerator.colour_random=function(a){return['string.format("#%06x", math.random(0, 2^24 - 1))',module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.colour_rgb=function(a){const b=module$exports$Blockly$Lua.luaGenerator.provideFunction_("colour_rgb",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(r, g, b)
|
||||
r = math.floor(math.min(100, math.max(0, r)) * 2.55 + .5)
|
||||
g = math.floor(math.min(100, math.max(0, g)) * 2.55 + .5)
|
||||
b = math.floor(math.min(100, math.max(0, b)) * 2.55 + .5)
|
||||
return string.format("#%02x%02x%02x", r, g, b)
|
||||
end
|
||||
`),c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"RED",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||0,d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"GREEN",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||0;a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"BLUE",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||0;return[b+"("+c+", "+d+", "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};
|
||||
module$exports$Blockly$Lua.luaGenerator.colour_blend=function(a){const b=module$exports$Blockly$Lua.luaGenerator.provideFunction_("colour_blend",`
|
||||
function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(colour1, colour2, ratio)
|
||||
local r1 = tonumber(string.sub(colour1, 2, 3), 16)
|
||||
local r2 = tonumber(string.sub(colour2, 2, 3), 16)
|
||||
local g1 = tonumber(string.sub(colour1, 4, 5), 16)
|
||||
local g2 = tonumber(string.sub(colour2, 4, 5), 16)
|
||||
local b1 = tonumber(string.sub(colour1, 6, 7), 16)
|
||||
local b2 = tonumber(string.sub(colour2, 6, 7), 16)
|
||||
local ratio = math.min(1, math.max(0, ratio))
|
||||
local r = math.floor(r1 * (1 - ratio) + r2 * ratio + .5)
|
||||
local g = math.floor(g1 * (1 - ratio) + g2 * ratio + .5)
|
||||
local b = math.floor(b1 * (1 - ratio) + b2 * ratio + .5)
|
||||
return string.format("#%02x%02x%02x", r, g, b)
|
||||
end
|
||||
`),c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"COLOUR1",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"'#000000'",d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"COLOUR2",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"'#000000'";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"RATIO",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||0;return[b+"("+c+", "+d+", "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};var module$exports$Blockly$Lua$all=module$exports$Blockly$Lua;
|
||||
module$exports$Blockly$Lua.__namespace__=$;
|
||||
return module$exports$Blockly$Lua;
|
||||
}));
|
||||
|
||||
|
||||
//# sourceMappingURL=lua_compressed.js.map
|
||||
File diff suppressed because one or more lines are too long
425
msg/js/ab.js
425
msg/js/ab.js
@@ -1,425 +0,0 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
var Blockly = Blockly || { Msg: Object.create(null) };
|
||||
|
||||
Blockly.Msg["ADD_COMMENT"] = "Иацҵатәуп ахцәажәара";
|
||||
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'"; // untranslated
|
||||
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Ишәыԥсах аҵакы";
|
||||
Blockly.Msg["CLEAN_UP"] = "Иқәгатәуп аблокқәа";
|
||||
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Collapsed blocks contain warnings."; // untranslated
|
||||
Blockly.Msg["COLLAPSE_ALL"] = "Иеикәрҳәтәуп Аблокқәа";
|
||||
Blockly.Msg["COLLAPSE_BLOCK"] = "Иеикәрҳәтәуп Аблокқәа";
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "аԥштәы 1";
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "аԥштәы 2";
|
||||
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_RATIO"] = "аԥштәы 1 ахәҭа";
|
||||
Blockly.Msg["COLOUR_BLEND_TITLE"] = "еилаҵатәуп";
|
||||
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Blends two colours together with a given ratio (0.0 - 1.0)."; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://ab.wikipedia.org/wiki/Аԥштәы";
|
||||
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Иалышәх аԥштәы";
|
||||
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "иарбанзаалакь аԥштәы";
|
||||
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Иалнахуеит аԥштәы машәыршақә";
|
||||
Blockly.Msg["COLOUR_RGB_BLUE"] = "жәҩангәԥштәы";
|
||||
Blockly.Msg["COLOUR_RGB_GREEN"] = "аиаҵәа";
|
||||
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_RED"] = "аҟаԥшь";
|
||||
Blockly.Msg["COLOUR_RGB_TITLE"] = "аԥштәы аҟынтәи";
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "ацикл иҭыҵтәуп";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "ииастәуп ацикл анаҩстәи ашьаҿахьы";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Иааннакылоит абри ацикл.";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Skip the rest of this loop, and continue with the next iteration."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Агәҽанҵара:Ари аблок ахархәара амоуп ацикл аҩныҵҟа мацара.";
|
||||
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "for each item %1 in list %2"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "For each item in a list, set the variable '%1' to the item, and then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_TITLE"] = "ацикл %1 ала %2 инаркны %3 рҟынӡа ашьаҿа %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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Иацнаҵоит аҭагыазаашьа аблок \"акәзар\" ахь";
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Add a final, catch-all condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "акәымзар";
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "акәымзар";
|
||||
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "акәзар";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "Аҭагылазаашьа иашазар, инанагӡоит акомандақәа.";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_2"] = "Аҭагылазаашьа иашазар, инанагӡоит актәи аблок акомандақәа. Акәымзар инанагӡоит аҩбатәи аблок акомандақәа.";
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://ab.wikipedia.org/wiki/Ацикл";
|
||||
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "инагӡатәуп";
|
||||
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "инагӡалатәуп %1 - нтә";
|
||||
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Инанагӡоит акомандақәа кырынтә";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "инагӡалатәуп акәымзар";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "инагӡалатәуп акәзар";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "Аҭагылазаашьа мцнаҵы, инанагӡалоит акомандақәа.";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "Аҭагылазаашьа иашанаҵ, инанагӡалоит акомандақәа.";
|
||||
Blockly.Msg["DELETE_ALL_BLOCKS"] = "Ианыхтәуп аблокқәа (%1) зегьы?";
|
||||
Blockly.Msg["DELETE_BLOCK"] = "Ианыхтәуп аблок";
|
||||
Blockly.Msg["DELETE_VARIABLE"] = "Ианыхтәуп аҽеиҭак '%1'";
|
||||
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Delete %1 uses of the '%2' variable?"; // untranslated
|
||||
Blockly.Msg["DELETE_X_BLOCKS"] = "Ианыхтәуп %1 блокк";
|
||||
Blockly.Msg["DIALOG_CANCEL"] = "Аҟәыхра";
|
||||
Blockly.Msg["DIALOG_OK"] = "OK";
|
||||
Blockly.Msg["DISABLE_BLOCK"] = "Иаҿыхтәуп Аблок";
|
||||
Blockly.Msg["DUPLICATE_BLOCK"] = "Акопиа ахыхтәуп";
|
||||
Blockly.Msg["DUPLICATE_COMMENT"] = "Duplicate Comment"; // untranslated
|
||||
Blockly.Msg["ENABLE_BLOCK"] = "Иаҿыхтәуп Аблокқәа";
|
||||
Blockly.Msg["EXPAND_ALL"] = "Иаарԥштәуп Аблокқәа";
|
||||
Blockly.Msg["EXPAND_BLOCK"] = "Иаарԥштәуп Аблокқәа";
|
||||
Blockly.Msg["EXTERNAL_INPUTS"] = "External Inputs"; // untranslated
|
||||
Blockly.Msg["HELP"] = "Ацхыраара";
|
||||
Blockly.Msg["INLINE_INPUTS"] = "Inline Inputs"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "иаԥцатәуп иҭацәу ахьӡынҵа";
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "ахьӡынҵа";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this list block."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "иаԥҵатәуп ахьӡынҵа аҟынтәи";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Иацнаҵоит аелемент ахьӡынҵахьы";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Create a list with any number of items."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "актәи";
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "№ анҵәамнҭа аҟынтәи";
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET"] = "игатәуп";
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "иалхны ианыхтәуп";
|
||||
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "аҵыхәтәантәи";
|
||||
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "иарбанзаалакь";
|
||||
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "ианыхтәуп";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Иҳанаҭоит ахьӡынҵа актәи аелемент.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Иҳанаҭоит ахьӡынҵа аҵыхәтәантәи аелемент.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Иҳанаҭоит ахьӡынҵа иарбанзаалакь елементк.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Removes and returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Removes and returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Removes and returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Removes and returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Ианнахәуеит ахьӡынҵа актәи аелемент.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Removes the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Ианнахәуеит ахьӡынҵа аҵыхәтәантәи аелемент.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Ианнахәуеит ахьӡынҵа иарбанзаалакь елементк.";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "to # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "№ ала";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "to last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "get sub-list from first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "get sub-list from # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "get sub-list from #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Creates a copy of the specified portion of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 - аҵыхәтәантәи аелемент.";
|
||||
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 - актәи аелемент.";
|
||||
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "find first occurrence of item"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "find last occurrence of item"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["LISTS_INLIST"] = "ахьӡынҵа аҟны";
|
||||
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 ҭацәуп";
|
||||
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Иҳанаҭоит аиаша, ахьӡынҵа ҭацәызар.";
|
||||
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TITLE"] = "аура %1";
|
||||
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Иҳанаҭоит ахьӡынҵа аура.";
|
||||
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TITLE"] = "create list with item %1 repeated %2 times"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Creates a list consisting of the given value repeated the specified number of times."; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "=";
|
||||
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "ибжьаргылатәуп";
|
||||
Blockly.Msg["LISTS_SET_INDEX_SET"] = "иаҭатәуп";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Inserts the item at the start of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Inserts the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Иацнаҵоит аелемент ахьӡынҵа анҵәамҭахь.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Inserts the item randomly in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Sets the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Sets the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Sets the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Sets a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "еиҵоу-еиҳауала";
|
||||
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "еиҳау-еиҵоуала";
|
||||
Blockly.Msg["LISTS_SORT_TITLE"] = "еилыԥшаатәуп %1 %2 %3";
|
||||
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Еилыԥшаатәуп ахьӡынҵа акопиа.";
|
||||
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetic, ignore case"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "ахыԥхьаӡаратәи";
|
||||
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "алфавитла";
|
||||
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "make list from text"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "еизгатәуп атеқст ахьӡынҵа аҟынтәи";
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Join a list of texts into one text, separated by a delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Split text into a list of texts, breaking at each delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "with delimiter"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "амц";
|
||||
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Иҳанаҭоит аҵакы аиаша ма амц";
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "аиаша";
|
||||
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://ru.wikipedia.org/wiki/Аиҟарамра";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Иҳанаҭоит иҵоуроу аҵакы, иҭагалақәоу еиҟаразар.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Иҳанаҭоит аҵакы аиаша, актәи иҭагалоу аҩбатәи аасҭа еиҳазар.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Иҳанаҭоит аҵакы аиаша, актәи иҭагалоу аҩбатәи аасҭа еиҳазар ма иаҟаразар.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Иҳанаҭоит иҵоуроу аҵакы, актәи иҭагалоу аҩбатәи аасҭа еиҵазар.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Иҳанаҭоит аҵакы аиаша, актәи иҭагалоу аҩбатәи аасҭа еиҵазар ма иаҟаразар.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Иҳанаҭоит иҵоуроу аҵакы, иҭагалақәоу еиҟарамзар.";
|
||||
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "%1 акәӡам";
|
||||
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Иҳанаҭоит аҵакы аиаша, иҭагалоу мцызар. Иҳанаҭоит аҵакы амц, иҭагалоу иашазар.";
|
||||
Blockly.Msg["LOGIC_NULL"] = "акагьы";
|
||||
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Иҳанаҭоит акагьы";
|
||||
Blockly.Msg["LOGIC_OPERATION_AND"] = "и";
|
||||
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_OR"] = "ма";
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Иҳанаҭоит аҵакы аиаша, иҭагалоу аҩбагьы иашазар.";
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Иҳанаҭоит аҵакы аиаша, иҭагалоу руак иашазар.";
|
||||
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "иалхтәуп ала";
|
||||
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "амц акәзар";
|
||||
Blockly.Msg["LOGIC_TERNARY_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."; // untranslated
|
||||
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://ab.wikipedia.org/wiki/Арифметика";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Иҳанаҭоит ҩ-хыԥхьаӡарак реицҵалыҵ.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Иҳанаҭоит ҩ-хыԥхьаӡарак ршалыҵ.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Иҳанаҭоит ҩ-хыԥхьаӡарак реигырхалыҵ.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Иҳанаҭоит ҩ-хыԥхьаӡарак рышьҭыхлыҵ.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Return the first number raised to the power of the second number."; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Return the arctangent of point (X, Y) in degrees from -180 to 180."; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TITLE"] = "иеизырҳатәуп %1 %2 рыла";
|
||||
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Иацнаҵоит ахыԥхьаӡара аҽеиҭак '%1' ахь.";
|
||||
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://ab.wikipedia.org/wiki/Аматематикатә_константа";
|
||||
Blockly.Msg["MATH_CONSTANT_TOOLTIP"] = "Иҳанаҭооит аконстантақәа руак: π (3.141...), e (2.718...), φ (1.618...), sqrt(2) (1.414...), sqrt(½) (0.707...) ма ∞ (аҵыхәаԥҵәарадара).";
|
||||
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "constrain %1 low %2 high %3"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Constrain a number to be between the specified limits (inclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated
|
||||
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "ишоит ала";
|
||||
Blockly.Msg["MATH_IS_EVEN"] = "еиҩшо";
|
||||
Blockly.Msg["MATH_IS_NEGATIVE"] = "иҵоурам";
|
||||
Blockly.Msg["MATH_IS_ODD"] = "еиҩымшо";
|
||||
Blockly.Msg["MATH_IS_POSITIVE"] = "иҵоуроу";
|
||||
Blockly.Msg["MATH_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."; // untranslated
|
||||
Blockly.Msg["MATH_IS_WHOLE"] = "аибга";
|
||||
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://ru.wikipedia.org/wiki/Ашара_цәынхала";
|
||||
Blockly.Msg["MATH_MODULO_TITLE"] = "ацәынха %1 : %2";
|
||||
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Иҳанаҭоит ацәынха ҩ-хыԥхьаӡарак ршараан.";
|
||||
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://ab.wikipedia.org/wiki/Ахыԥхьаӡара";
|
||||
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "Ахыԥхьаӡара.";
|
||||
Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "ахьӡынҵа арифметикатә бжьара";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "ахьӡынҵа аҟны иреиҳау";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "ахьӡынҵа амедиана";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "ахьӡынҵа аҟны иреиҵо";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "ахьӡынҵа амода";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "ахьӡынҵа иарбанзаалакь аелемент";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "standard deviation of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "ахьӡынҵа аицҵалыҵ";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Иҳанаҭоит ахьӡынҵа аҟны ахыԥхьаӡарақәа зегьы рарифметикатә бжьара.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Иҳанаҭоит ахьӡынҵа аҟны иреиҳау ахыԥхьаӡара.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Иҳанаҭоит ахьӡынҵа аҟны ахыԥхьаӡарақәа зегьы рмедиана.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Иҳанаҭоит ахьӡынҵа аҟны иреицо ахыԥхьаӡара.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Return a list of the most common item(s) in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Иҳанаҭоит ахьӡынҵа аҟны иарбанзаалакь елементк.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Return the standard deviation of the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Иҳанаҭоит ахьӡынҵа иаҵанакуа ахыԥхьаӡарақәа зегьы реицҵалыҵ.";
|
||||
Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "иарбанзаалакь ахыԥхьашара 0 инаркны (иалаҵаны) 1 аҟынӡа";
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Иҳанаҭоит иарбанзаалакь ахыԥхьаӡара 0.0 инаркны (иалаҵаны) 1.0 аҟынӡа.";
|
||||
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "иарбанзаалакь еибгоу ахыԥхьаӡара %1 инаркны %2 нӡа";
|
||||
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Return a random integer between the two specified limits, inclusive."; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://ab.wikipedia.org/wiki/Ахыркәшара";
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "ихыркәшатәуп";
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "ихыркәшатәуп еиҵоу ахь";
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "ихыркәшатәуп еиҳау ахь";
|
||||
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Round a number up or down."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://en.wikipedia.org/wiki/Square_root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "амодуль";
|
||||
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "square root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Иҳанаҭоит ахыԥхьаӡара амодуль.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Return e to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Иҳанаҭоит ахыԥхьаӡара иԥсабаратәу алогарифм.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Иҳанаҭоит ахыԥхьаӡара ажәабатә логарифм.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Иҳанаҭоит иаҿагыло ахыԥхьаӡара.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Return 10 to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Return the square root of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ACOS"] = "acos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ASIN"] = "asin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ATAN"] = "atan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_COS"] = "cos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://ab.wikipedia.org/wiki/Атригонометриатә_функциа";
|
||||
Blockly.Msg["MATH_TRIG_SIN"] = "sin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TAN"] = "tan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Иҳанаҭоит арккосинус градусла.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Иҳанаҭоит арксинус градусла.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Иҳанаҭоит арктангенс градусла.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Иҳанаҭоит акосинус градусла.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Иҳанаҭоит асинус градусла.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Иҳанаҭоит атангенс градусла.";
|
||||
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Create colour variable..."; // untranslated
|
||||
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Create number variable..."; // untranslated
|
||||
Blockly.Msg["NEW_STRING_VARIABLE"] = "Create string variable..."; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE"] = "Иаԥҵатәуп аҽеиҭак";
|
||||
Blockly.Msg["NEW_VARIABLE_TITLE"] = "Аҽеиҭак ахьӡ ҿыц:";
|
||||
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "New variable type:"; // untranslated
|
||||
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "аоператорқәа азин рыҭара";
|
||||
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "аҟынтәи:";
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://ru.wikipedia.org/wiki/Ацхыраагӡатә программа";
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Run the user-defined function '%1'."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://ru.wikipedia.org/wiki/Ацхыраагӡатә программа";
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Run the user-defined function '%1' and use its output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "аҟынтәи:";
|
||||
Blockly.Msg["PROCEDURES_CREATE_DO"] = "Иаԥҵатәуп ааԥхьара '%1'";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Абри афункциа ахҳәа азыҟашәҵа...";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "иҟаҵатәуп џьара акы";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "азы";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Иаԥнаҵоит апроцедура, аҵакы ҳазымҭо.";
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "ирхынҳәтәуп";
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Иаԥнаҵоит апроцедура, аҵакы ҳазҭо.";
|
||||
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Warning: This function has duplicate parameters."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Highlight function definition"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "Актәи аҵакы иашазар, иҳанаҭоит аҩбатәи аҵакы.";
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Агәаҽанҵара: Ари аблок ахархәара ауеит афункциа аԥҵара аҟны.";
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "апараметр ахьӡ:";
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Add an input to the function."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "апараметрқәа";
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
Blockly.Msg["REDO"] = "Аиҭаҟаҵара";
|
||||
Blockly.Msg["REMOVE_COMMENT"] = "Ианыхтәуп ахцәажәара";
|
||||
Blockly.Msg["RENAME_VARIABLE"] = "Аҽеиҭак ахьӡ ԥсахтәуп";
|
||||
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Аҽеиҭакқәа'%1' зегь рыхьӡ ԥсахтәуп аҟны:";
|
||||
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TITLE"] = "%1 ахьы иацҵатәуп атеқст %2";
|
||||
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Иацҵатәуп атеқст аҽеиҭак «%1» ахь.";
|
||||
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "to lower case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "to Title Case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "to UPPER CASE"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Return a copy of the text in a different case."; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FIRST"] = "игатәуп актәи анбан";
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "игатәуп анбан № анҵәамҭа аҟынтәи";
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "игатәуп анбан №";
|
||||
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_LAST"] = "игатәуп аҵыхәтәантәи анбан";
|
||||
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "игатәуп иарбанзаалакь нбанк";
|
||||
Blockly.Msg["TEXT_CHARAT_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TITLE"] = "атеқст %1 %2 аҟны";
|
||||
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Иҳанаҭоит анбан иарбоу апозициа аҟны";
|
||||
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Count how many times some text occurs within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Иацҵатәуп аелемент атеқст ахь.";
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "иеиԥшьтәуп";
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this text block."; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "to letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "анбан № ала";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "аҵыхәтәантәи анбан ала";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "атеқст аҟны";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "get substring from first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "get substring from letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "get substring from letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Иҳанаҭоит атеқст аҟны иарбоу ахәҭа.";
|
||||
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "find first occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "find last occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "атеқст %1 %2 %3 аҟны";
|
||||
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."; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 ҭацәуп";
|
||||
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Иҳанаҭоит аҵакы аиаша, иҟоу атеқст ҭацәызар.";
|
||||
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "иаԥҵатәуп атеқст аҟынтәи";
|
||||
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Create a piece of text by joining together any number of items."; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TITLE"] = "аура %1";
|
||||
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Иҳанаҭоит асимволқәа рхыԥхьаӡара (абжьажьқәа алаҵаны) иҟоу атеқст аҟны.";
|
||||
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TITLE"] = "икьыԥхьтәуп %1";
|
||||
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Иакьыԥхьуеит атеқст, ахыԥхьаӡара ма даҽа обиеқтк.";
|
||||
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Prompt for user for a number."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Prompt for user for some text."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "prompt for number with message"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "prompt for text with message"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "иԥсахтәуп %1 %2 ала %3 аҟны";
|
||||
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text."; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://ab.wikipedia.org/wiki/Ацәаҳәатә_хкы";
|
||||
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "Анбан, ажәа ма ацәаҳәа атеқст аҟны.";
|
||||
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "trim spaces from both sides of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "trim spaces from left side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "trim spaces from right side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Return a copy of the text with spaces removed from one or both ends."; // untranslated
|
||||
Blockly.Msg["TODAY"] = "Иахьа";
|
||||
Blockly.Msg["UNDO"] = "Иаҟәыхтәуп";
|
||||
Blockly.Msg["UNNAMED_KEY"] = "unnamed"; // untranslated
|
||||
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "аелемент";
|
||||
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Иаԥҵатәуп аблок \"иаҭатәуп %1\" азы";
|
||||
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Иҳанаҭоит аҽеиҭак аҵакы.";
|
||||
Blockly.Msg["VARIABLES_SET"] = "иаҭатәуп %1 = %2";
|
||||
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Create 'get %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Sets this variable to be equal to the input."; // untranslated
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "Аҽеиҭак ахьӡ '%1' змоу ыҟоуп.";
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "A variable named '%1' already exists for another type: '%2'."; // untranslated
|
||||
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly Workspace"; // untranslated
|
||||
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Say something..."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
||||
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
||||
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
||||
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["MATH_HUE"] = "230";
|
||||
Blockly.Msg["LOOPS_HUE"] = "120";
|
||||
Blockly.Msg["LISTS_HUE"] = "260";
|
||||
Blockly.Msg["LOGIC_HUE"] = "210";
|
||||
Blockly.Msg["VARIABLES_HUE"] = "330";
|
||||
Blockly.Msg["TEXTS_HUE"] = "160";
|
||||
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
||||
Blockly.Msg["COLOUR_HUE"] = "20";
|
||||
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
||||
425
msg/js/ace.js
425
msg/js/ace.js
@@ -1,425 +0,0 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
var Blockly = Blockly || { Msg: Object.create(null) };
|
||||
|
||||
Blockly.Msg["ADD_COMMENT"] = "Add Comment"; // untranslated
|
||||
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'"; // untranslated
|
||||
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Change value:"; // untranslated
|
||||
Blockly.Msg["CLEAN_UP"] = "Clean up Blocks"; // untranslated
|
||||
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Collapsed blocks contain warnings."; // untranslated
|
||||
Blockly.Msg["COLLAPSE_ALL"] = "Collapse Blocks"; // untranslated
|
||||
Blockly.Msg["COLLAPSE_BLOCK"] = "Collapse Block"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "colour 1"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "colour 2"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_RATIO"] = "ratio"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_TITLE"] = "blend"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Blends two colours together with a given ratio (0.0 - 1.0)."; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://en.wikipedia.org/wiki/Color"; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Choose a colour from the palette."; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "random colour"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Choose a colour at random."; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_BLUE"] = "blue"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_GREEN"] = "green"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_RED"] = "red"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_TITLE"] = "colour with"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "break out of loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "continue with next iteration of loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Break out of the containing loop."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Skip the rest of this loop, and continue with the next iteration."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Warning: This block may only be used within a loop."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "for each item %1 in list %2"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "For each item in a list, set the variable '%1' to the item, and then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_TITLE"] = "count with %1 from %2 to %3 by %4"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Add a condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Add a final, catch-all condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "else"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "else if"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "if"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "If a value is true, then do some statements."; // untranslated
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "do"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "repeat %1 times"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Do some statements several times."; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "repeat until"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "repeat while"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "While a value is false, then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "While a value is true, then do some statements."; // untranslated
|
||||
Blockly.Msg["DELETE_ALL_BLOCKS"] = "Delete all %1 blocks?"; // untranslated
|
||||
Blockly.Msg["DELETE_BLOCK"] = "Delete Block"; // untranslated
|
||||
Blockly.Msg["DELETE_VARIABLE"] = "Delete the '%1' variable"; // untranslated
|
||||
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Delete %1 uses of the '%2' variable?"; // untranslated
|
||||
Blockly.Msg["DELETE_X_BLOCKS"] = "Delete %1 Blocks"; // untranslated
|
||||
Blockly.Msg["DIALOG_CANCEL"] = "Peubateuë";
|
||||
Blockly.Msg["DIALOG_OK"] = "Ka got";
|
||||
Blockly.Msg["DISABLE_BLOCK"] = "Disable Block"; // untranslated
|
||||
Blockly.Msg["DUPLICATE_BLOCK"] = "Duplicate"; // untranslated
|
||||
Blockly.Msg["DUPLICATE_COMMENT"] = "Duplicate Comment"; // untranslated
|
||||
Blockly.Msg["ENABLE_BLOCK"] = "Enable Block"; // untranslated
|
||||
Blockly.Msg["EXPAND_ALL"] = "Expand Blocks"; // untranslated
|
||||
Blockly.Msg["EXPAND_BLOCK"] = "Expand Block"; // untranslated
|
||||
Blockly.Msg["EXTERNAL_INPUTS"] = "External Inputs"; // untranslated
|
||||
Blockly.Msg["HELP"] = "Help"; // untranslated
|
||||
Blockly.Msg["INLINE_INPUTS"] = "Inline Inputs"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this list block."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "create list with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Add an item to the list."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Create a list with any number of items."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "# from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET"] = "get"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "get and remove"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "random"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "remove"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Removes and returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Removes and returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Removes and returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Removes and returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Removes the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Removes the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Removes the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Removes a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "to # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "to #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "to last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "get sub-list from first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "get sub-list from # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "get sub-list from #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Creates a copy of the specified portion of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 is the last item."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 is the first item."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "find first occurrence of item"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "find last occurrence of item"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["LISTS_INLIST"] = "in list"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 is empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Returns true if the list is empty."; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TITLE"] = "length of %1"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Returns the length of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TITLE"] = "create list with item %1 repeated %2 times"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Creates a list consisting of the given value repeated the specified number of times."; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "as"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "insert at"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_SET"] = "set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Inserts the item at the start of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Inserts the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Append the item to the end of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Inserts the item randomly in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Sets the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Sets the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Sets the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Sets a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "ascending"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "descending"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TITLE"] = "sort %1 %2 %3"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Sort a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetic, ignore case"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "numeric"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "alphabetic"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "make list from text"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "make text from list"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Join a list of texts into one text, separated by a delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Split text into a list of texts, breaking at each delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "with delimiter"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "false"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Returns either true or false."; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "true"; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)"; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Return true if both inputs equal each other."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Return true if the first input is greater than the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Return true if the first input is greater than or equal to the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Return true if the first input is smaller than the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Return true if the first input is smaller than or equal to the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Return true if both inputs are not equal to each other."; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "not %1"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Returns true if the input is false. Returns false if the input is true."; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL"] = "null"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Returns null."; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_AND"] = "and"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_OR"] = "or"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Return true if both inputs are true."; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Return true if at least one of the inputs is true."; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "test"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "if false"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "if true"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://en.wikipedia.org/wiki/Arithmetic"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Return the sum of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Return the quotient of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Return the difference of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Return the product of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Return the first number raised to the power of the second number."; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Return the arctangent of point (X, Y) in degrees from -180 to 180."; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TITLE"] = "change %1 by %2"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Add a number to variable '%1'."; // untranslated
|
||||
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://en.wikipedia.org/wiki/Mathematical_constant"; // untranslated
|
||||
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)."; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "constrain %1 low %2 high %3"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Constrain a number to be between the specified limits (inclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated
|
||||
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "is divisible by"; // untranslated
|
||||
Blockly.Msg["MATH_IS_EVEN"] = "is even"; // untranslated
|
||||
Blockly.Msg["MATH_IS_NEGATIVE"] = "is negative"; // untranslated
|
||||
Blockly.Msg["MATH_IS_ODD"] = "is odd"; // untranslated
|
||||
Blockly.Msg["MATH_IS_POSITIVE"] = "is positive"; // untranslated
|
||||
Blockly.Msg["MATH_IS_PRIME"] = "is prime"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["MATH_IS_WHOLE"] = "is whole"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TITLE"] = "remainder of %1 ÷ %2"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Return the remainder from dividing the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://en.wikipedia.org/wiki/Number"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "A number."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "average of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "max of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "median of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "min of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "modes of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "random item of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "standard deviation of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "sum of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Return the average (arithmetic mean) of the numeric values in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Return the largest number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Return the median number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Return the smallest number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Return a list of the most common item(s) in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Return a random element from the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Return the standard deviation of the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Return the sum of all the numbers in the list."; // untranslated
|
||||
Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "random fraction"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "random integer from %1 to %2"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Return a random integer between the two specified limits, inclusive."; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "round"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "round down"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "round up"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Round a number up or down."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://en.wikipedia.org/wiki/Square_root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "absolute"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "square root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Return the absolute value of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Return e to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Return the natural logarithm of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Return the base 10 logarithm of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Return the negation of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Return 10 to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Return the square root of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ACOS"] = "acos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ASIN"] = "asin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ATAN"] = "atan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_COS"] = "cos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://en.wikipedia.org/wiki/Trigonometric_functions"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_SIN"] = "sin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TAN"] = "tan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Return the arccosine of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Return the arcsine of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Return the arctangent of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Return the cosine of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Return the sine of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Return the tangent of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Create colour variable..."; // untranslated
|
||||
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Create number variable..."; // untranslated
|
||||
Blockly.Msg["NEW_STRING_VARIABLE"] = "Create string variable..."; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE"] = "Create variable..."; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE_TITLE"] = "New variable name:"; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "New variable type:"; // untranslated
|
||||
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "allow statements"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "with:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Run the user-defined function '%1'."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Run the user-defined function '%1' and use its output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "with:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CREATE_DO"] = "Create '%1'"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Describe this function..."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "do something"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "to"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Creates a function with no output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "return"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Creates a function with an output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Warning: This function has duplicate parameters."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Highlight function definition"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "If a value is true, then return a second value."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Warning: This block may be used only within a function definition."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "input name:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Add an input to the function."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "inputs"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
Blockly.Msg["REDO"] = "Redo"; // untranslated
|
||||
Blockly.Msg["REMOVE_COMMENT"] = "Remove Comment"; // untranslated
|
||||
Blockly.Msg["RENAME_VARIABLE"] = "Rename variable..."; // untranslated
|
||||
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Rename all '%1' variables to:"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TITLE"] = "to %1 append text %2"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Append some text to variable '%1'."; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "to lower case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "to Title Case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "to UPPER CASE"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Return a copy of the text in a different case."; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FIRST"] = "get first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "get letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "get letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_LAST"] = "get last letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "get random letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TITLE"] = "in text %1 %2"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Returns the letter at the specified position."; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Count how many times some text occurs within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Add an item to the text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "join"; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this text block."; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "to letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "to letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "to last letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "in text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "get substring from first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "get substring from letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "get substring from letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Returns a specified portion of the text."; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "find first occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "find last occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "in text %1 %2 %3"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 is empty"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Returns true if the provided text is empty."; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "create text with"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Create a piece of text by joining together any number of items."; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TITLE"] = "length of %1"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Returns the number of letters (including spaces) in the provided text."; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TITLE"] = "print %1"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Print the specified text, number or other value."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Prompt for user for a number."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Prompt for user for some text."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "prompt for number with message"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "prompt for text with message"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "replace %1 with %2 in %3"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text."; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)"; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "A letter, word, or line of text."; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "trim spaces from both sides of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "trim spaces from left side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "trim spaces from right side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Return a copy of the text with spaces removed from one or both ends."; // untranslated
|
||||
Blockly.Msg["TODAY"] = "Today"; // untranslated
|
||||
Blockly.Msg["UNDO"] = "Undo"; // untranslated
|
||||
Blockly.Msg["UNNAMED_KEY"] = "unnamed"; // untranslated
|
||||
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "item"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Create 'set %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Returns the value of this variable."; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET"] = "set %1 to %2"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Create 'get %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Sets this variable to be equal to the input."; // untranslated
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "A variable named '%1' already exists."; // untranslated
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "A variable named '%1' already exists for another type: '%2'."; // untranslated
|
||||
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly Workspace"; // untranslated
|
||||
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Say something..."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
||||
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
||||
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
||||
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["MATH_HUE"] = "230";
|
||||
Blockly.Msg["LOOPS_HUE"] = "120";
|
||||
Blockly.Msg["LISTS_HUE"] = "260";
|
||||
Blockly.Msg["LOGIC_HUE"] = "210";
|
||||
Blockly.Msg["VARIABLES_HUE"] = "330";
|
||||
Blockly.Msg["TEXTS_HUE"] = "160";
|
||||
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
||||
Blockly.Msg["COLOUR_HUE"] = "20";
|
||||
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
||||
425
msg/js/af.js
425
msg/js/af.js
@@ -1,425 +0,0 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
var Blockly = Blockly || { Msg: Object.create(null) };
|
||||
|
||||
Blockly.Msg["ADD_COMMENT"] = "Voeg kommentaar by";
|
||||
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'"; // untranslated
|
||||
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Wysig waarde:";
|
||||
Blockly.Msg["CLEAN_UP"] = "Clean up Blocks"; // untranslated
|
||||
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Collapsed blocks contain warnings."; // untranslated
|
||||
Blockly.Msg["COLLAPSE_ALL"] = "Collapse Blocks"; // untranslated
|
||||
Blockly.Msg["COLLAPSE_BLOCK"] = "Collapse Block"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "colour 1"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "colour 2"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_RATIO"] = "ratio"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_TITLE"] = "blend"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Blends two colours together with a given ratio (0.0 - 1.0)."; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://en.wikipedia.org/wiki/Color"; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Choose a colour from the palette."; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "random colour"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Choose a colour at random."; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_BLUE"] = "blue"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_GREEN"] = "green"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_RED"] = "red"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_TITLE"] = "colour with"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "break out of loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "continue with next iteration of loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Break out of the containing loop."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Skip the rest of this loop, and continue with the next iteration."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Warning: This block may only be used within a loop."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "for each item %1 in list %2"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "For each item in a list, set the variable '%1' to the item, and then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_TITLE"] = "count with %1 from %2 to %3 by %4"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Add a condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Add a final, catch-all condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "else"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "else if"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "if"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "If a value is true, then do some statements."; // untranslated
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "do"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "repeat %1 times"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Do some statements several times."; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "repeat until"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "repeat while"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "While a value is false, then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "While a value is true, then do some statements."; // untranslated
|
||||
Blockly.Msg["DELETE_ALL_BLOCKS"] = "verwyder al %1 blokke?";
|
||||
Blockly.Msg["DELETE_BLOCK"] = "verwyder blok";
|
||||
Blockly.Msg["DELETE_VARIABLE"] = "Delete the '%1' variable"; // untranslated
|
||||
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Wissig %1 gebruike van die '%2' veranderlike?";
|
||||
Blockly.Msg["DELETE_X_BLOCKS"] = "verwyder %1 blokke";
|
||||
Blockly.Msg["DIALOG_CANCEL"] = "Cancel"; // untranslated
|
||||
Blockly.Msg["DIALOG_OK"] = "Oukei";
|
||||
Blockly.Msg["DISABLE_BLOCK"] = "Disable Block"; // untranslated
|
||||
Blockly.Msg["DUPLICATE_BLOCK"] = "duplikaat";
|
||||
Blockly.Msg["DUPLICATE_COMMENT"] = "Dupliseer kommentaar";
|
||||
Blockly.Msg["ENABLE_BLOCK"] = "Enable Block"; // untranslated
|
||||
Blockly.Msg["EXPAND_ALL"] = "Expand Blocks"; // untranslated
|
||||
Blockly.Msg["EXPAND_BLOCK"] = "Expand Block"; // untranslated
|
||||
Blockly.Msg["EXTERNAL_INPUTS"] = "External Inputs"; // untranslated
|
||||
Blockly.Msg["HELP"] = "Hulp";
|
||||
Blockly.Msg["INLINE_INPUTS"] = "Inline Inputs"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this list block."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "create list with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Add an item to the list."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Create a list with any number of items."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "# from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET"] = "get"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "get and remove"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "random"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "remove"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Removes and returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Removes and returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Removes and returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Removes and returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Removes the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Removes the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Removes the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Removes a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "to # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "to #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "to last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "get sub-list from first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "get sub-list from # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "get sub-list from #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Creates a copy of the specified portion of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 is the last item."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 is the first item."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "find first occurrence of item"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "find last occurrence of item"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["LISTS_INLIST"] = "in list"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 is empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Returns true if the list is empty."; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TITLE"] = "length of %1"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Returns the length of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TITLE"] = "create list with item %1 repeated %2 times"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Creates a list consisting of the given value repeated the specified number of times."; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "as"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "insert at"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_SET"] = "set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Inserts the item at the start of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Inserts the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Append the item to the end of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Inserts the item randomly in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Sets the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Sets the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Sets the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Sets a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "ascending"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "descending"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TITLE"] = "sort %1 %2 %3"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Sort a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetic, ignore case"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "numeric"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "alphabetic"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "make list from text"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "make text from list"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Join a list of texts into one text, separated by a delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Split text into a list of texts, breaking at each delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "with delimiter"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "false"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Returns either true or false."; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "true"; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)"; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Return true if both inputs equal each other."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Return true if the first input is greater than the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Return true if the first input is greater than or equal to the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Return true if the first input is smaller than the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Return true if the first input is smaller than or equal to the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Return true if both inputs are not equal to each other."; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "not %1"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Returns true if the input is false. Returns false if the input is true."; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL"] = "null"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Returns null."; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_AND"] = "and"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_OR"] = "or"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Return true if both inputs are true."; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Return true if at least one of the inputs is true."; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "test"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "if false"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "if true"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://en.wikipedia.org/wiki/Arithmetic"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Return the sum of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Return the quotient of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Return the difference of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Return the product of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Return the first number raised to the power of the second number."; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Return the arctangent of point (X, Y) in degrees from -180 to 180."; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TITLE"] = "change %1 by %2"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Add a number to variable '%1'."; // untranslated
|
||||
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://en.wikipedia.org/wiki/Mathematical_constant"; // untranslated
|
||||
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)."; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "constrain %1 low %2 high %3"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Constrain a number to be between the specified limits (inclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated
|
||||
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "is divisible by"; // untranslated
|
||||
Blockly.Msg["MATH_IS_EVEN"] = "is even"; // untranslated
|
||||
Blockly.Msg["MATH_IS_NEGATIVE"] = "is negative"; // untranslated
|
||||
Blockly.Msg["MATH_IS_ODD"] = "is odd"; // untranslated
|
||||
Blockly.Msg["MATH_IS_POSITIVE"] = "is positive"; // untranslated
|
||||
Blockly.Msg["MATH_IS_PRIME"] = "is prime"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["MATH_IS_WHOLE"] = "is whole"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TITLE"] = "remainder of %1 ÷ %2"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Return the remainder from dividing the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://en.wikipedia.org/wiki/Number"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "A number."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "average of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "max of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "median of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "min of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "modes of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "random item of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "standard deviation of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "sum of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Return the average (arithmetic mean) of the numeric values in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Return the largest number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Return the median number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Return the smallest number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Return a list of the most common item(s) in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Return a random element from the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Return the standard deviation of the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Return the sum of all the numbers in the list."; // untranslated
|
||||
Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "random fraction"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "random integer from %1 to %2"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Return a random integer between the two specified limits, inclusive."; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "round"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "round down"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "round up"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Round a number up or down."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://en.wikipedia.org/wiki/Square_root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "absolute"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "square root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Return the absolute value of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Return e to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Return the natural logarithm of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Return the base 10 logarithm of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Return the negation of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Return 10 to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Return the square root of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ACOS"] = "acos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ASIN"] = "asin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ATAN"] = "atan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_COS"] = "cos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://en.wikipedia.org/wiki/Trigonometric_functions"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_SIN"] = "sin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TAN"] = "tan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Return the arccosine of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Return the arcsine of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Return the arctangent of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Return the cosine of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Return the sine of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Return the tangent of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Skep kleur veranderlike";
|
||||
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Skep numeriese veranderlike";
|
||||
Blockly.Msg["NEW_STRING_VARIABLE"] = "Skep teks veranderlike";
|
||||
Blockly.Msg["NEW_VARIABLE"] = "Skep veranderlike";
|
||||
Blockly.Msg["NEW_VARIABLE_TITLE"] = "Nuwe veranderlike naam:";
|
||||
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "Nuwe veranderlike tipe:";
|
||||
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "allow statements"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "with:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Run the user-defined function '%1'."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Run the user-defined function '%1' and use its output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "with:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CREATE_DO"] = "Create '%1'"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Describe this function..."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "do something"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "to"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Creates a function with no output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "return"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Creates a function with an output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Warning: This function has duplicate parameters."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Highlight function definition"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "If a value is true, then return a second value."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Warning: This block may be used only within a function definition."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "input name:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Add an input to the function."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "inputs"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
Blockly.Msg["REDO"] = "Doen weer";
|
||||
Blockly.Msg["REMOVE_COMMENT"] = "Verwyder kommentaar";
|
||||
Blockly.Msg["RENAME_VARIABLE"] = "Hernoem veranderlike...";
|
||||
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Hernoem al %1 veranderlikes na:";
|
||||
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TITLE"] = "to %1 append text %2"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Append some text to variable '%1'."; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "to lower case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "to Title Case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "to UPPER CASE"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Return a copy of the text in a different case."; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FIRST"] = "get first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "get letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "get letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_LAST"] = "get last letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "get random letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TITLE"] = "in text %1 %2"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Returns the letter at the specified position."; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Count how many times some text occurs within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Add an item to the text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "join"; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this text block."; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "to letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "to letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "to last letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "in text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "get substring from first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "get substring from letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "get substring from letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Returns a specified portion of the text."; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "find first occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "find last occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "in text %1 %2 %3"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 is empty"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Returns true if the provided text is empty."; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "create text with"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Create a piece of text by joining together any number of items."; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TITLE"] = "length of %1"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Returns the number of letters (including spaces) in the provided text."; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TITLE"] = "print %1"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Print the specified text, number or other value."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Prompt for user for a number."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Prompt for user for some text."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "prompt for number with message"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "prompt for text with message"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "replace %1 with %2 in %3"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text."; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)"; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "A letter, word, or line of text."; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "trim spaces from both sides of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "trim spaces from left side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "trim spaces from right side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Return a copy of the text with spaces removed from one or both ends."; // untranslated
|
||||
Blockly.Msg["TODAY"] = "vandag";
|
||||
Blockly.Msg["UNDO"] = "Ontdaan";
|
||||
Blockly.Msg["UNNAMED_KEY"] = "onbenoem";
|
||||
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "item";
|
||||
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Create 'set %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Returns the value of this variable."; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET"] = "set %1 to %2"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Create 'get %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Sets this variable to be equal to the input."; // untranslated
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "'n Veranderlike met die naam '%1' bestaan reeds.";
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "'n Veranderlike met die naam '%1' bestaan reeds vir 'n ander tipe veranderlike: '%2'.";
|
||||
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly Workspace"; // untranslated
|
||||
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Say something..."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
||||
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
||||
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
||||
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["MATH_HUE"] = "230";
|
||||
Blockly.Msg["LOOPS_HUE"] = "120";
|
||||
Blockly.Msg["LISTS_HUE"] = "260";
|
||||
Blockly.Msg["LOGIC_HUE"] = "210";
|
||||
Blockly.Msg["VARIABLES_HUE"] = "330";
|
||||
Blockly.Msg["TEXTS_HUE"] = "160";
|
||||
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
||||
Blockly.Msg["COLOUR_HUE"] = "20";
|
||||
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
||||
425
msg/js/am.js
425
msg/js/am.js
@@ -1,425 +0,0 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
var Blockly = Blockly || { Msg: Object.create(null) };
|
||||
|
||||
Blockly.Msg["ADD_COMMENT"] = "ማስታወሻ ያክሉ";
|
||||
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'"; // untranslated
|
||||
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Change value:"; // untranslated
|
||||
Blockly.Msg["CLEAN_UP"] = "ብሎኮቹን ይሰድሩ";
|
||||
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Collapsed blocks contain warnings."; // untranslated
|
||||
Blockly.Msg["COLLAPSE_ALL"] = "የብሎኮቹን መረጃዎች ያሳጥሩ";
|
||||
Blockly.Msg["COLLAPSE_BLOCK"] = "የብሎኩን መረጃ ያሳጥሩ";
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "colour 1"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "colour 2"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_RATIO"] = "ratio"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_TITLE"] = "blend"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Blends two colours together with a given ratio (0.0 - 1.0)."; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://en.wikipedia.org/wiki/Color"; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Choose a colour from the palette."; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "random colour"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Choose a colour at random."; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_BLUE"] = "blue"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_GREEN"] = "green"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_RED"] = "red"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_TITLE"] = "colour with"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "break out of loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "continue with next iteration of loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Break out of the containing loop."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Skip the rest of this loop, and continue with the next iteration."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Warning: This block may only be used within a loop."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "for each item %1 in list %2"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "For each item in a list, set the variable '%1' to the item, and then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_TITLE"] = "count with %1 from %2 to %3 by %4"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Add a condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Add a final, catch-all condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "else"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "else if"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "if"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "If a value is true, then do some statements."; // untranslated
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "do"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "repeat %1 times"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Do some statements several times."; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "repeat until"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "repeat while"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "While a value is false, then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "While a value is true, then do some statements."; // untranslated
|
||||
Blockly.Msg["DELETE_ALL_BLOCKS"] = "%1 ያህል ብሎኮች ይሰረዙ?";
|
||||
Blockly.Msg["DELETE_BLOCK"] = "ብሎኩን ይሰርዙ";
|
||||
Blockly.Msg["DELETE_VARIABLE"] = "Delete the '%1' variable"; // untranslated
|
||||
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Delete %1 uses of the '%2' variable?"; // untranslated
|
||||
Blockly.Msg["DELETE_X_BLOCKS"] = "%1 ብሎኮች ይሰርዙ";
|
||||
Blockly.Msg["DIALOG_CANCEL"] = "ይቅር";
|
||||
Blockly.Msg["DIALOG_OK"] = "እሺ";
|
||||
Blockly.Msg["DISABLE_BLOCK"] = "ብሎኩን ለጊዜው ያጥፉ";
|
||||
Blockly.Msg["DUPLICATE_BLOCK"] = "ቅጂ";
|
||||
Blockly.Msg["DUPLICATE_COMMENT"] = "ማስታወሻውን ይቅዱ";
|
||||
Blockly.Msg["ENABLE_BLOCK"] = "ብሎኩን ደግመው ያስጀምሩ";
|
||||
Blockly.Msg["EXPAND_ALL"] = "የብሎኮቹን መረጃዎች ዳግም ያስረዝሙ";
|
||||
Blockly.Msg["EXPAND_BLOCK"] = "የብሎኩን መረጃ ዳግም ያስረዝሙ";
|
||||
Blockly.Msg["EXTERNAL_INPUTS"] = "የውጪ ግብዓቶች";
|
||||
Blockly.Msg["HELP"] = "እገዛ";
|
||||
Blockly.Msg["INLINE_INPUTS"] = "የውስጥ ግብዓቶች";
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this list block."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "create list with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Add an item to the list."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Create a list with any number of items."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "# from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET"] = "get"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "get and remove"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "random"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "remove"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Removes and returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Removes and returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Removes and returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Removes and returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Removes the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Removes the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Removes the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Removes a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "to # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "to #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "to last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "get sub-list from first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "get sub-list from # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "get sub-list from #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Creates a copy of the specified portion of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 is the last item."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 is the first item."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "find first occurrence of item"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "find last occurrence of item"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["LISTS_INLIST"] = "in list"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 is empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Returns true if the list is empty."; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TITLE"] = "length of %1"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Returns the length of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TITLE"] = "create list with item %1 repeated %2 times"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Creates a list consisting of the given value repeated the specified number of times."; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "as"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "insert at"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_SET"] = "set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Inserts the item at the start of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Inserts the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Append the item to the end of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Inserts the item randomly in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Sets the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Sets the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Sets the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Sets a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "ascending"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "descending"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TITLE"] = "sort %1 %2 %3"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Sort a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetic, ignore case"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "numeric"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "alphabetic"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "make list from text"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "make text from list"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Join a list of texts into one text, separated by a delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Split text into a list of texts, breaking at each delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "with delimiter"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "false"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Returns either true or false."; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "true"; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)"; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Return true if both inputs equal each other."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Return true if the first input is greater than the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Return true if the first input is greater than or equal to the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Return true if the first input is smaller than the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Return true if the first input is smaller than or equal to the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Return true if both inputs are not equal to each other."; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "not %1"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Returns true if the input is false. Returns false if the input is true."; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL"] = "null"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Returns null."; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_AND"] = "and"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_OR"] = "or"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Return true if both inputs are true."; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Return true if at least one of the inputs is true."; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "test"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "if false"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "if true"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://en.wikipedia.org/wiki/Arithmetic"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Return the sum of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Return the quotient of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Return the difference of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Return the product of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Return the first number raised to the power of the second number."; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Return the arctangent of point (X, Y) in degrees from -180 to 180."; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TITLE"] = "change %1 by %2"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Add a number to variable '%1'."; // untranslated
|
||||
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://en.wikipedia.org/wiki/Mathematical_constant"; // untranslated
|
||||
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)."; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "constrain %1 low %2 high %3"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Constrain a number to be between the specified limits (inclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated
|
||||
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "is divisible by"; // untranslated
|
||||
Blockly.Msg["MATH_IS_EVEN"] = "is even"; // untranslated
|
||||
Blockly.Msg["MATH_IS_NEGATIVE"] = "is negative"; // untranslated
|
||||
Blockly.Msg["MATH_IS_ODD"] = "is odd"; // untranslated
|
||||
Blockly.Msg["MATH_IS_POSITIVE"] = "is positive"; // untranslated
|
||||
Blockly.Msg["MATH_IS_PRIME"] = "is prime"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["MATH_IS_WHOLE"] = "is whole"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TITLE"] = "remainder of %1 ÷ %2"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Return the remainder from dividing the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://en.wikipedia.org/wiki/Number"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "A number."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "average of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "max of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "median of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "min of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "modes of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "random item of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "standard deviation of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "sum of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Return the average (arithmetic mean) of the numeric values in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Return the largest number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Return the median number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Return the smallest number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Return a list of the most common item(s) in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Return a random element from the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Return the standard deviation of the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Return the sum of all the numbers in the list."; // untranslated
|
||||
Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "random fraction"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "random integer from %1 to %2"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Return a random integer between the two specified limits, inclusive."; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "round"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "round down"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "round up"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Round a number up or down."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://en.wikipedia.org/wiki/Square_root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "absolute"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "square root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Return the absolute value of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Return e to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Return the natural logarithm of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Return the base 10 logarithm of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Return the negation of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Return 10 to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Return the square root of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ACOS"] = "acos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ASIN"] = "asin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ATAN"] = "atan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_COS"] = "cos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://en.wikipedia.org/wiki/Trigonometric_functions"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_SIN"] = "sin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TAN"] = "tan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Return the arccosine of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Return the arcsine of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Return the arctangent of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Return the cosine of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Return the sine of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Return the tangent of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Create colour variable..."; // untranslated
|
||||
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Create number variable..."; // untranslated
|
||||
Blockly.Msg["NEW_STRING_VARIABLE"] = "Create string variable..."; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE"] = "Create variable..."; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE_TITLE"] = "New variable name:"; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "New variable type:"; // untranslated
|
||||
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "allow statements"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "with:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Run the user-defined function '%1'."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Run the user-defined function '%1' and use its output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "with:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CREATE_DO"] = "Create '%1'"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Describe this function..."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "do something"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "to"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Creates a function with no output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "return"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Creates a function with an output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Warning: This function has duplicate parameters."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Highlight function definition"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "If a value is true, then return a second value."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Warning: This block may be used only within a function definition."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "input name:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Add an input to the function."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "inputs"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
Blockly.Msg["REDO"] = "ከእንደገና";
|
||||
Blockly.Msg["REMOVE_COMMENT"] = "ማስታወሻ ያጥፉ";
|
||||
Blockly.Msg["RENAME_VARIABLE"] = "Rename variable..."; // untranslated
|
||||
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Rename all '%1' variables to:"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TITLE"] = "to %1 append text %2"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Append some text to variable '%1'."; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "to lower case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "to Title Case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "to UPPER CASE"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Return a copy of the text in a different case."; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FIRST"] = "get first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "get letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "get letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_LAST"] = "get last letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "get random letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TITLE"] = "in text %1 %2"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Returns the letter at the specified position."; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Count how many times some text occurs within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Add an item to the text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "join"; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this text block."; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "to letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "to letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "to last letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "in text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "get substring from first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "get substring from letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "get substring from letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Returns a specified portion of the text."; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "find first occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "find last occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "in text %1 %2 %3"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 is empty"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Returns true if the provided text is empty."; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "create text with"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Create a piece of text by joining together any number of items."; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TITLE"] = "length of %1"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Returns the number of letters (including spaces) in the provided text."; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TITLE"] = "print %1"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Print the specified text, number or other value."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Prompt for user for a number."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Prompt for user for some text."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "prompt for number with message"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "prompt for text with message"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "replace %1 with %2 in %3"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text."; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)"; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "A letter, word, or line of text."; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "trim spaces from both sides of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "trim spaces from left side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "trim spaces from right side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Return a copy of the text with spaces removed from one or both ends."; // untranslated
|
||||
Blockly.Msg["TODAY"] = "ዛሬ";
|
||||
Blockly.Msg["UNDO"] = "ይቀልብሱ";
|
||||
Blockly.Msg["UNNAMED_KEY"] = "ያልተሰየመ";
|
||||
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "item"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Create 'set %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Returns the value of this variable."; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET"] = "set %1 to %2"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Create 'get %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Sets this variable to be equal to the input."; // untranslated
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "A variable named '%1' already exists."; // untranslated
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "A variable named '%1' already exists for another type: '%2'."; // untranslated
|
||||
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly Workspace"; // untranslated
|
||||
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Say something..."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
||||
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
||||
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
||||
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["MATH_HUE"] = "230";
|
||||
Blockly.Msg["LOOPS_HUE"] = "120";
|
||||
Blockly.Msg["LISTS_HUE"] = "260";
|
||||
Blockly.Msg["LOGIC_HUE"] = "210";
|
||||
Blockly.Msg["VARIABLES_HUE"] = "330";
|
||||
Blockly.Msg["TEXTS_HUE"] = "160";
|
||||
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
||||
Blockly.Msg["COLOUR_HUE"] = "20";
|
||||
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
||||
425
msg/js/ar.js
425
msg/js/ar.js
@@ -1,425 +0,0 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
var Blockly = Blockly || { Msg: Object.create(null) };
|
||||
|
||||
Blockly.Msg["ADD_COMMENT"] = "أضف تعليقًا";
|
||||
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "لايمكن حذف متغير \"%1\" بسبب انه جزء من الدالة \"%2\"";
|
||||
Blockly.Msg["CHANGE_VALUE_TITLE"] = "تغيير قيمة:";
|
||||
Blockly.Msg["CLEAN_UP"] = "تنظيف الكتل";
|
||||
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "الكتل المطوية تحتوي على تحذيرات.";
|
||||
Blockly.Msg["COLLAPSE_ALL"] = "انهيار الكتل";
|
||||
Blockly.Msg["COLLAPSE_BLOCK"] = "انهيار الكتلة";
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "اللون 1";
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "اللون 2";
|
||||
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_RATIO"] = "نسبة";
|
||||
Blockly.Msg["COLOUR_BLEND_TITLE"] = "دمج";
|
||||
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "دمج لونين ببعضهما البعض بنسبة (0.0 - 1.0).";
|
||||
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://ar.wikipedia.org/wiki/لون";
|
||||
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "اختر لون من اللوحة.";
|
||||
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "لون عشوائي";
|
||||
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "اختر لون بشكل عشوائي.";
|
||||
Blockly.Msg["COLOUR_RGB_BLUE"] = "أزرق";
|
||||
Blockly.Msg["COLOUR_RGB_GREEN"] = "أخضر";
|
||||
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_RED"] = "أحمر";
|
||||
Blockly.Msg["COLOUR_RGB_TITLE"] = "لون مع";
|
||||
Blockly.Msg["COLOUR_RGB_TOOLTIP"] = "إنشئ لون بالكمية المحددة من الأحمر, الأخضر والأزرق. بحيث يجب تكون كافة القيم بين 0 و 100.";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "اخرج من الحلقة";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "استمر ابتداءا من التكرار التالي من الحلقة";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "اخرج من الحلقة الحالية.";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "تخط ما تبقى من هذه الحلقة، واستمر ابتداءا من التكرار التالي.";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "تحذير: يمكن استخدام هذه القطعة فقط داخل حلقة.";
|
||||
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "لكل عنصر %1 في قائمة %2";
|
||||
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "لكل عنصر في قائمة ما، عين المتغير '%1' لهذا الغنصر، ومن ثم نفذ بعض الأوامر.";
|
||||
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_TITLE"] = "عد بـ %1 من %2 إلى %3 بمعدل %4";
|
||||
Blockly.Msg["CONTROLS_FOR_TOOLTIP"] = "اجعل المتغير %1 يأخذ القيم من رقم البداية الى رقم النهاية، وقم بالعد داخل المجال المحدد، وطبق أوامر القطع المحددة.";
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "إضف شرطا إلى القطعة الشرطية \"إذا\".";
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "أضف شرط \"نهاية، إجمع\" إلى القطعة الشرطية \"إذا\".";
|
||||
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "أضف, إزل, أو أعد ترتيب المقاطع لإعادة تكوين القطعة الشرطية \"إذا\".";
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "والا";
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "وإﻻ إذا";
|
||||
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "إذا";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "إذا كانت قيمة ما تساوي صحيح, إذن قم بتنفيذ أمر ما.";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_2"] = "إذا كانت قيمة ما تساوي \"صحيح\"، إذن قم بتنفيذ أول قطعة من الأوامر. والا ،قم بتنفيذ القطعة الثانية من الأوامر.";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_3"] = "إذا كانت القيمة الأولى تساوي \"صحيح\", إذن قم بتنفيذ القطعة الأولى من الأوامر. والا, إذا كانت القيمة الثانية تساوي \"صحيح\", قم بتنفيذ القطعة الثانية من الأوامر.";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_4"] = "إذا كانت القيمة الأولى تساوي \"صحيح\", إذن قم بتنفيذ القطعة الأولى من الأوامر. والا , إذا كانت القيمة الثانية تساوي \"صحيح\", قم بتنفيذ القطعة الثانية من الأوامر. إذا لم تكن هناك أي قيمة تساوي صحيح, قم بتنفيذ آخر قطعة من الأوامر.";
|
||||
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://ar.wikipedia.org/wiki/حلقة_تكرار";
|
||||
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "نفّذ";
|
||||
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "كرر %1 مرات";
|
||||
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "نفّذ بعض الأوامر عدة مرات.";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "اكرّر حتى";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "اكرّر طالما";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "بما ان القيمة خاطئة, نفّذ بعض الأوامر.";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "بما ان القيمة صحيحة, نفّذ بعض الأوامر.";
|
||||
Blockly.Msg["DELETE_ALL_BLOCKS"] = "حذف %1 كتلة؟";
|
||||
Blockly.Msg["DELETE_BLOCK"] = "حذف كتلة";
|
||||
Blockly.Msg["DELETE_VARIABLE"] = "حذف المتغير %1";
|
||||
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "حذف%1 1 استخدامات المتغير '%2'؟";
|
||||
Blockly.Msg["DELETE_X_BLOCKS"] = "احذف %1 كتلة";
|
||||
Blockly.Msg["DIALOG_CANCEL"] = "إلغاء";
|
||||
Blockly.Msg["DIALOG_OK"] = "موافق";
|
||||
Blockly.Msg["DISABLE_BLOCK"] = "عطّل كتلة";
|
||||
Blockly.Msg["DUPLICATE_BLOCK"] = "مكرر";
|
||||
Blockly.Msg["DUPLICATE_COMMENT"] = "تعليق مكرر";
|
||||
Blockly.Msg["ENABLE_BLOCK"] = "تمكين كتلة";
|
||||
Blockly.Msg["EXPAND_ALL"] = "وسٌّع الكتل";
|
||||
Blockly.Msg["EXPAND_BLOCK"] = "وسٌّع الكتلة";
|
||||
Blockly.Msg["EXTERNAL_INPUTS"] = "مدخلات خارجية";
|
||||
Blockly.Msg["HELP"] = "مساعدة";
|
||||
Blockly.Msg["INLINE_INPUTS"] = "مدخلات مضمنة";
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "إنشئ قائمة فارغة";
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "تقوم بإرجاع قائمة، طولها 0, لا تحتوي على أية سجلات البيانات";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "قائمة";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "أضف, إزل, أو أعد ترتيب المقاطع لإعادة تكوين القطعة قائمة القطع التالية.";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "أتشئ قائمة مع";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "أضف عنصرا إلى القائمة.";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "أنشىء قائمة من أي عدد من العناصر.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "أول";
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "# من نهاية";
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#";
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET"] = "احصل على";
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "احصل على و ازل";
|
||||
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "أخير";
|
||||
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "عشوائي";
|
||||
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "ازل";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "يرجع العنصر الأول في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "يقوم بإرجاع العنصر في الموضع المحدد في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "يرجع العنصر الأخير في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "يرجع عنصرا عشوائيا في قائمة.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "يزيل ويرجع العنصر الأول في قائمة.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "يزيل ويقوم بإرجاع العنصر في الموضع المحدد في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "يزيل ويرجع العنصر الأخير في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "يزيل و يرجع عنصرا عشوائيا في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "يزيل العنصر الأول في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "يزيل العنصر الموجود في الموضع المحدد في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "يزيل العنصر الأخير في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "يزيل عنصرا عشوائيا في قائمة ما.";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "إلى # من نهاية";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "إلى #";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "إلى الأخير";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "احصل على قائمة فرعية من الأول";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "احصل على قائمة فرعية من # من نهاية";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "احصل على قائمة فرعية من #";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "يقوم بإنشاء نسخة من الجزء المحدد من قائمة ما.";
|
||||
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 هو العنصر الأخير.";
|
||||
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 هو العنصر الأول.";
|
||||
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "ابحث على على التواجد الأول للعنصر";
|
||||
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "ابحث على التواجد الأخير للعنصر";
|
||||
Blockly.Msg["LISTS_INDEX_OF_TOOLTIP"] = "تقوم بإرجاع مؤشر التواجد الأول/الأخير في القائمة. تقوم بإرجاع %1 إذا لم يتم العثور على النص.";
|
||||
Blockly.Msg["LISTS_INLIST"] = "في قائمة";
|
||||
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 فارغ";
|
||||
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "يرجع \"صحيح\" إذا كانت القائمة فارغة.";
|
||||
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TITLE"] = "الطول من %1";
|
||||
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "تقوم بإرجاع طول قائمة.";
|
||||
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TITLE"] = "إنشئ قائمة مع العنصر %1 %2 مرات";
|
||||
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "انشئ قائمة تتألف من القيمة المعطاة متكررة لعدد محدد من المرات.";
|
||||
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "عكس %1";
|
||||
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "عكس نسخة من القائمة.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "مثل";
|
||||
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "أدخل في";
|
||||
Blockly.Msg["LISTS_SET_INDEX_SET"] = "تعيين";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "يقوم بإدراج هذا العنصر في بداية قائمة.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "يقوم بإدخال العنصر في الموضع المحدد في قائمة ما.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "ألصق هذا العنصر بنهاية قائمة.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "ادخل العنصر عشوائياً في القائمة.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "يحدد العنصر الأول في قائمة.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "يحدد العنصر في الموضع المحدد في قائمة ما.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "يحدد العنصر الأخير في قائمة.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "يحدد عنصرا عشوائيا في قائمة.";
|
||||
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "تصاعديا";
|
||||
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "تنازليا";
|
||||
Blockly.Msg["LISTS_SORT_TITLE"] = "رتب %1 %2 %3";
|
||||
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "فرز نسخة من القائمة.";
|
||||
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "أبجديا، وتجاهل الحالة";
|
||||
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "رقمي";
|
||||
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "أبجديًا";
|
||||
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "إعداد قائمة من النصوص";
|
||||
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "إعداد نص من القائمة";
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "ضم قائمة النصوص في نص واحد، مفصولة بواسطة محدد.";
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "تقسيم النص إلى قائمة من النصوص، وكسر في كل محدد";
|
||||
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "مع محدد";
|
||||
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "خاطئ";
|
||||
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "يرجع صحيح أو خاطئ.";
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "صحيح";
|
||||
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://ar.wikipedia.org/wiki/متباينة_(جبر)";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "يرجع صحيح إذا كان كلا المدخلات مساوية بعضها البعض.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "يرجع صحيح إذا كان الإدخال الأول أكبر من الإدخال الثاني.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "يرجع صحيح إذا كان الإدخال الأول أكبر من أو يساوي الإدخال الثاني.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "يرجع صحيح إذا كان الإدخال الأول أصغر من الإدخال الثاني.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "يرجع صحيح إذا كان الإدخال الأول أصغر من أو يساوي الإدخال الثاني.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "يرجع صحيح إذا كانت كلا المدخلات غير مساوية لبعضها البعض.";
|
||||
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "ليس %1";
|
||||
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "يرجع صحيح إذا كان الإدخال خاطئ . يرجع خاطئ إذا كان الإدخال صحيح.";
|
||||
Blockly.Msg["LOGIC_NULL"] = "فارغ";
|
||||
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "ترجع ملغى.";
|
||||
Blockly.Msg["LOGIC_OPERATION_AND"] = "و";
|
||||
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_OR"] = "أو";
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "ترجع صحيح إذا كان كلا المٌدخلات صحيح.";
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "ترجع صحيح إذا كان واحد على الأقل من المدخلات صحيح.";
|
||||
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "اختبار";
|
||||
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = ":https://ar.wikipedia.org/wiki/%3F";
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "إذا كانت العبارة خاطئة";
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "إذا كانت العبارة صحيحة";
|
||||
Blockly.Msg["LOGIC_TERNARY_TOOLTIP"] = "تحقق الشرط في 'الاختبار'. إذا كان الشرط صحيح، يقوم بإرجاع قيمة 'اذا كانت العبارة صحيحة'؛ خلاف ذلك يرجع قيمة 'اذا كانت العبارة خاطئة'.";
|
||||
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://ar.wikipedia.org/wiki/حسابيات";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "يرجع مجموع الرقمين.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "يرجع حاصل قسمة الرقمين.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "يرجع الفرق بين الرقمين.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "يرجع حاصل ضرب الرقمين.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "يرجع الرقم الأول مرفوع إلى تربيع الرقم الثاني.";
|
||||
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 من X:%1 Y:%2";
|
||||
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "عودة قوس ظل النقطة (س، ص) بالدرجات من -180 إلى 180.";
|
||||
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TITLE"] = "غير %1 بـ %2";
|
||||
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "إضف رقم إلى متغير '%1'.";
|
||||
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://ar.wikipedia.org/wiki/ثابت رياضي";
|
||||
Blockly.Msg["MATH_CONSTANT_TOOLTIP"] = "ير جع واحد من الثوابت الشائعة : π (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_(graphics)"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "تقيد %1 منخفض %2 مرتفع %3";
|
||||
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "تقييد العددليكون بين الحدود المحددة (ضمناً).";
|
||||
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated
|
||||
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "قابل للقسمة";
|
||||
Blockly.Msg["MATH_IS_EVEN"] = "هو زوجي";
|
||||
Blockly.Msg["MATH_IS_NEGATIVE"] = "هو سالب";
|
||||
Blockly.Msg["MATH_IS_ODD"] = "هو فرذي";
|
||||
Blockly.Msg["MATH_IS_POSITIVE"] = "هو موجب";
|
||||
Blockly.Msg["MATH_IS_PRIME"] = "هو أولي";
|
||||
Blockly.Msg["MATH_IS_TOOLTIP"] = "تحقق إذا كان عدد ما زوجيا، فرذيا, أوليا، صحيحا،موجبا أو سالبا، أو إذا كان قابلا للقسمة على عدد معين. يرجع صحيح أو خاطئ.";
|
||||
Blockly.Msg["MATH_IS_WHOLE"] = "هو صحيح";
|
||||
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://tr.wikipedia.org/wiki/عامل_قسمة_مع_باقي";
|
||||
Blockly.Msg["MATH_MODULO_TITLE"] = "باقي %1 ÷ %2";
|
||||
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "يرجع الباقي من قسمة الرقمين.";
|
||||
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://ar.wikipedia.org/wiki/%D8%B9%D8%AF%D8%AF";
|
||||
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "عدد ما.";
|
||||
Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "متوسط القائمة";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "الحد الأقصى لقائمة";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "متوسط القائمة";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "الحد الأدنى من قائمة";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "منوال القائمة";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "عنصر عشوائي من القائمة";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "الانحراف المعياري للقائمة";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "مجموع القائمة";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "يرجع المعدل (الوسط الحسابي) للقيم الرقمية في القائمة.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "يرجع أكبر عدد في القائمة.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "يرجع وسيط العدد في القائمة.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "يرجع أصغر رقم في القائمة.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "يرجع قائمة من العنصر أو العناصر الأكثر شيوعاً في القائمة.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "يرجع عنصر عشوائي من القائمة.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "يرجع الانحراف المعياري للقائمة.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "يرجع مجموع كافة الأرقام الموجودة في القائمة.";
|
||||
Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://ar.wikipedia.org/wiki/توليد_الأعداد_العشوائية";
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "كسر عشوائي";
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "يرجع جزء عشوائي بين 0.0 (ضمنياً) و 1.0 (خارجيا).";
|
||||
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://ar.wikipedia.org/wiki/توليد_الأعداد_العشوائية";
|
||||
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = " عدد صحيح عشوائي من %1 إلى %2";
|
||||
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "يرجع عدد صحيح عشوائي بين حدين محددين, ضمنيا.";
|
||||
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://ar.wikipedia.org/wiki/تقريب_(رياضيات)";
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "تقريب";
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "تقريب إلى اصغر عدد صحيح";
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "تقريب الى اكبر عدد صحيح";
|
||||
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "تقريب الى اكبر عدد صحيح أو الى اصغر عدد صحيح.";
|
||||
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://ar.wikipedia.org/wiki/جذر_تربيعي";
|
||||
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "مطلق";
|
||||
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "الجذر التربيعي";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "يرجع القيمة المطلقة لرقم.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "يرجع ه (e) مرفوعا لأس بقيمة الرقم المدخل.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "يرجع اللوغاريتم الطبيعي لرقم.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "يرجع لوغاريتم عدد معين للاساس 10.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "يرجع عدد سالب.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "يرجع مضروب الرقم 10 في نفسه .";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "يرجع الجذر التربيعي للرقم.";
|
||||
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ACOS"] = "acos";
|
||||
Blockly.Msg["MATH_TRIG_ASIN"] = "asin";
|
||||
Blockly.Msg["MATH_TRIG_ATAN"] = "atan";
|
||||
Blockly.Msg["MATH_TRIG_COS"] = "جيب تمام";
|
||||
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://ar.wikipedia.org/wiki/دوال_مثلثية";
|
||||
Blockly.Msg["MATH_TRIG_SIN"] = "جيب";
|
||||
Blockly.Msg["MATH_TRIG_TAN"] = "ظل";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "يرجع قوس جيب التمام لرقم.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "يرجع قوس الجيب للرقم.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "يرجع قوس الظل للرقم.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "يرجع جيب التمام لدرجة (لا زواية نصف قطرية).";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "يرجع جيب التمام لدرجة (لا زواية نصف قطرية).";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "يرجع الظل لدرجة (لا دائرة نصف قطرية).";
|
||||
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "انشاء متغير لوني...";
|
||||
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "انشاء متغير رقمي...";
|
||||
Blockly.Msg["NEW_STRING_VARIABLE"] = "انشاء متغير نصي...";
|
||||
Blockly.Msg["NEW_VARIABLE"] = "إنشاء متغير...";
|
||||
Blockly.Msg["NEW_VARIABLE_TITLE"] = "اسم المتغير الجديد:";
|
||||
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "نوع متغير جديد:";
|
||||
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "اسمح بالبيانات";
|
||||
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "مع:";
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://ar.wikipedia.org/wiki/دالة_(برمجة)";
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "تشغيل الدالة المعرفة من قبل المستخدم '%1'.";
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://ar.wikipedia.org/wiki/دالة_(برمجة)";
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "تشغيل الدالة المعرفة من قبل المستخدم %1 واستخدام مخرجاتها.";
|
||||
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "مع:";
|
||||
Blockly.Msg["PROCEDURES_CREATE_DO"] = "إنشئ '%1'";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "صف هذه الوظيفة...";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://ar.wikipedia.org/wiki/دالة_(برمجة)";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "القيام بشيء ما";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "إلى";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "انشئ دالة بدون مخرجات .";
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://tr.wikipedia.org/wiki/دالة_(برمجة)";
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "يرجع";
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "انشئ دالة مع المخرجات.";
|
||||
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "تحذير: هذه الدالة تحتوي على معلمات مكررة.";
|
||||
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "تسليط الضوء على تعريف الدالة";
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "إذا كانت القيمة صحيحة ، اذان قم بارجاع القيمة الثانية.";
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "تحذير:هذه القطعة تستخدم فقط داخل تعريف دالة.";
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "اسم الإدخال:";
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "أضف مدخلا إلى الوظيفة.";
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "المدخلات";
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "إضافة أو إزالة أو إعادة ترتيب المدخلات لهذه المهمة.";
|
||||
Blockly.Msg["REDO"] = "إعادة";
|
||||
Blockly.Msg["REMOVE_COMMENT"] = "أزل التعليق";
|
||||
Blockly.Msg["RENAME_VARIABLE"] = "إعادة تسمية المتغير...";
|
||||
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "إعادة تسمية كافة المتغيرات '%1' إلى:";
|
||||
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TITLE"] = "إلى %1 إلصق نص %2";
|
||||
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "إلصق جزءا من النص إلى متغير '%1'.";
|
||||
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "الى حروف صغيرة";
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "الى حروف العنوان";
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "الى حروف كبيرة";
|
||||
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "يرجع نسخة من النص في حالة مختلفة.";
|
||||
Blockly.Msg["TEXT_CHARAT_FIRST"] = "احصل على الحرف الأول";
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "الحصول على الحرف # من نهاية";
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "الحصول على الحرف #";
|
||||
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_LAST"] = "احصل على آخر حرف";
|
||||
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "الحصول على حرف عشوائي";
|
||||
Blockly.Msg["TEXT_CHARAT_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TITLE"] = "في النص %1 %2";
|
||||
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "يرجع حرف ما في الموضع المحدد.";
|
||||
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "العدد %1 في %2";
|
||||
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "احسب كم عدد بعض النصوص تتكرر ضمن نص اخر.";
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "إضف عنصر إلى النص.";
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "الانضمام إلى";
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "أضف, إحذف, أو أعد ترتيب المقاطع لإعادة تكوين النص من القطع التالية.";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "إلى حرف # من نهاية";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "إلى حرف #";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "إلى آخر حرف";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "في النص";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "الحصول على سلسلة فرعية من الحرف الأول";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "الحصول على سلسلة حروف فرعية من الحرف # من نهاية";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "الحصول على سلسلة حروف فرعية من الحرف #";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "يرجع جزء معين من النص.";
|
||||
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "ابحث عن التواجد الأول للنص";
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "ابحث عن التواجد الأخير للنص";
|
||||
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "في النص %1 %2 %3";
|
||||
Blockly.Msg["TEXT_INDEXOF_TOOLTIP"] = "تقوم بإرجاع مؤشر التواجد الأول/الأخير للنص الأول في النص الثاني. تقوم بإرجاع %1 إذا لم يتم العثور على النص.";
|
||||
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 فارغ";
|
||||
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "يرجع \"صحيح\" إذا كان النص المقدم فارغ.";
|
||||
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "انشئ نص مع";
|
||||
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "أنشئ جزء من النص بالصاق أي عدد من العناصر ببعضها البعض.";
|
||||
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TITLE"] = "طول %1";
|
||||
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "تقوم بإرجاع عدد الاحرف (بما في ذلك الفراغات) في النص المقدم.";
|
||||
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TITLE"] = "اطبع %1";
|
||||
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "اطبع النص المحدد أو العدد أو قيمة أخرى.";
|
||||
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "انتظر ادخال المستخذم لرقم ما.";
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "انتظر ادخال المستخدم لنص ما.";
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "انتظر ادخال المستخدم لرقم ما مع اظهار رسالة";
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "انتظر ادخال المستخدم لنص ما مع اظهار رسالة";
|
||||
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "بدل %1 ب %2 في %3";
|
||||
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "استبدل جميع حالات حدوث بعض النصوص داخل نص آخر.";
|
||||
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "عكس %1";
|
||||
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "يعكس ترتيب حروف النص";
|
||||
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://ar.wikipedia.org/wiki/سلسلة_(علم_الحاسوب)";
|
||||
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "حرف أو كلمة أو سطر من النص.";
|
||||
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "إزالة الفراغات من كلا الجانبين";
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "إزالة الفراغات من الجانب الأيسر من";
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "إزالة الفراغات من الجانب الأيمن من";
|
||||
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "يرجع نسخة من النص مع حذف من أحد أو كلا الفراغات من أطرافه.";
|
||||
Blockly.Msg["TODAY"] = "اليوم";
|
||||
Blockly.Msg["UNDO"] = "رجوع";
|
||||
Blockly.Msg["UNNAMED_KEY"] = "غير مسمى";
|
||||
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "البند";
|
||||
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "انشئ 'التعيين %1'";
|
||||
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "يرجع قيمة هذا المتغير.";
|
||||
Blockly.Msg["VARIABLES_SET"] = "تعيين %1 إلى %2";
|
||||
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "انشئ 'احصل على %1'";
|
||||
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "تعيين هذا المتغير لتكون مساوية للقيمة المدخلة.";
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "المتغير '%1' موجود بالفعل";
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "متغير بأسم '%1' معرف من نوع اخر : '%2'.";
|
||||
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "مساحة عمل بلوكلي";
|
||||
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "قل شيئا...";
|
||||
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
||||
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
||||
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
||||
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["MATH_HUE"] = "230";
|
||||
Blockly.Msg["LOOPS_HUE"] = "120";
|
||||
Blockly.Msg["LISTS_HUE"] = "260";
|
||||
Blockly.Msg["LOGIC_HUE"] = "210";
|
||||
Blockly.Msg["VARIABLES_HUE"] = "330";
|
||||
Blockly.Msg["TEXTS_HUE"] = "160";
|
||||
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
||||
Blockly.Msg["COLOUR_HUE"] = "20";
|
||||
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
||||
425
msg/js/ast.js
425
msg/js/ast.js
@@ -1,425 +0,0 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
var Blockly = Blockly || { Msg: Object.create(null) };
|
||||
|
||||
Blockly.Msg["ADD_COMMENT"] = "Add Comment"; // untranslated
|
||||
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'"; // untranslated
|
||||
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Change value:"; // untranslated
|
||||
Blockly.Msg["CLEAN_UP"] = "Clean up Blocks"; // untranslated
|
||||
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Collapsed blocks contain warnings."; // untranslated
|
||||
Blockly.Msg["COLLAPSE_ALL"] = "Collapse Blocks"; // untranslated
|
||||
Blockly.Msg["COLLAPSE_BLOCK"] = "Collapse Block"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "colour 1"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "colour 2"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_RATIO"] = "ratio"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_TITLE"] = "blend"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Blends two colours together with a given ratio (0.0 - 1.0)."; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://en.wikipedia.org/wiki/Color"; // untranslated
|
||||
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Choose a colour from the palette."; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "random colour"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Choose a colour at random."; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_BLUE"] = "blue"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_GREEN"] = "green"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_RED"] = "red"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_TITLE"] = "colour with"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "break out of loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "continue with next iteration of loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Break out of the containing loop."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Skip the rest of this loop, and continue with the next iteration."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Warning: This block may only be used within a loop."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "for each item %1 in list %2"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "For each item in a list, set the variable '%1' to the item, and then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_TITLE"] = "count with %1 from %2 to %3 by %4"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Add a condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Add a final, catch-all condition to the if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this if block."; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "else"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "else if"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "if"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "If a value is true, then do some statements."; // untranslated
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "do"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "repeat %1 times"; // untranslated
|
||||
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Do some statements several times."; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "repeat until"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "repeat while"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "While a value is false, then do some statements."; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "While a value is true, then do some statements."; // untranslated
|
||||
Blockly.Msg["DELETE_ALL_BLOCKS"] = "Delete all %1 blocks?"; // untranslated
|
||||
Blockly.Msg["DELETE_BLOCK"] = "Delete Block"; // untranslated
|
||||
Blockly.Msg["DELETE_VARIABLE"] = "Delete the '%1' variable"; // untranslated
|
||||
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Delete %1 uses of the '%2' variable?"; // untranslated
|
||||
Blockly.Msg["DELETE_X_BLOCKS"] = "Delete %1 Blocks"; // untranslated
|
||||
Blockly.Msg["DIALOG_CANCEL"] = "Encaboxar";
|
||||
Blockly.Msg["DIALOG_OK"] = "Aceutar";
|
||||
Blockly.Msg["DISABLE_BLOCK"] = "Disable Block"; // untranslated
|
||||
Blockly.Msg["DUPLICATE_BLOCK"] = "Duplicate"; // untranslated
|
||||
Blockly.Msg["DUPLICATE_COMMENT"] = "Duplicate Comment"; // untranslated
|
||||
Blockly.Msg["ENABLE_BLOCK"] = "Enable Block"; // untranslated
|
||||
Blockly.Msg["EXPAND_ALL"] = "Expand Blocks"; // untranslated
|
||||
Blockly.Msg["EXPAND_BLOCK"] = "Expand Block"; // untranslated
|
||||
Blockly.Msg["EXTERNAL_INPUTS"] = "External Inputs"; // untranslated
|
||||
Blockly.Msg["HELP"] = "Help"; // untranslated
|
||||
Blockly.Msg["INLINE_INPUTS"] = "Inline Inputs"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this list block."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "create list with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Add an item to the list."; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Create a list with any number of items."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "# from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET"] = "get"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "get and remove"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "random"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "remove"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Removes and returns the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Removes and returns the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Removes and returns the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Removes and returns a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Removes the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Removes the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Removes the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Removes a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "to # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "to #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "to last"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "get sub-list from first"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "get sub-list from # from end"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "get sub-list from #"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Creates a copy of the specified portion of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 is the last item."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 is the first item."; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "find first occurrence of item"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "find last occurrence of item"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["LISTS_INLIST"] = "in list"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 is empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Returns true if the list is empty."; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TITLE"] = "length of %1"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Returns the length of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TITLE"] = "create list with item %1 repeated %2 times"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Creates a list consisting of the given value repeated the specified number of times."; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "as"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "insert at"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_SET"] = "set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Inserts the item at the start of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Inserts the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Append the item to the end of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Inserts the item randomly in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Sets the first item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Sets the item at the specified position in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Sets the last item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Sets a random item in a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "ascending"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "descending"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TITLE"] = "sort %1 %2 %3"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Sort a copy of a list."; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetic, ignore case"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "numeric"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "alphabetic"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "make list from text"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "make text from list"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Join a list of texts into one text, separated by a delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Split text into a list of texts, breaking at each delimiter."; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "with delimiter"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "false"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Returns either true or false."; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "true"; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)"; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Return true if both inputs equal each other."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Return true if the first input is greater than the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Return true if the first input is greater than or equal to the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Return true if the first input is smaller than the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Return true if the first input is smaller than or equal to the second input."; // untranslated
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Return true if both inputs are not equal to each other."; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "not %1"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Returns true if the input is false. Returns false if the input is true."; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL"] = "null"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Returns null."; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_AND"] = "and"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_OR"] = "or"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Return true if both inputs are true."; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Return true if at least one of the inputs is true."; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "test"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "if false"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "if true"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://en.wikipedia.org/wiki/Arithmetic"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Return the sum of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Return the quotient of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Return the difference of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Return the product of the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Return the first number raised to the power of the second number."; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Return the arctangent of point (X, Y) in degrees from -180 to 180."; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TITLE"] = "change %1 by %2"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Add a number to variable '%1'."; // untranslated
|
||||
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://en.wikipedia.org/wiki/Mathematical_constant"; // untranslated
|
||||
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)."; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "constrain %1 low %2 high %3"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Constrain a number to be between the specified limits (inclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated
|
||||
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "is divisible by"; // untranslated
|
||||
Blockly.Msg["MATH_IS_EVEN"] = "is even"; // untranslated
|
||||
Blockly.Msg["MATH_IS_NEGATIVE"] = "is negative"; // untranslated
|
||||
Blockly.Msg["MATH_IS_ODD"] = "is odd"; // untranslated
|
||||
Blockly.Msg["MATH_IS_POSITIVE"] = "is positive"; // untranslated
|
||||
Blockly.Msg["MATH_IS_PRIME"] = "is prime"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["MATH_IS_WHOLE"] = "is whole"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TITLE"] = "remainder of %1 ÷ %2"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Return the remainder from dividing the two numbers."; // untranslated
|
||||
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://en.wikipedia.org/wiki/Number"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "A number."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "average of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "max of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "median of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "min of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "modes of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "random item of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "standard deviation of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "sum of list"; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Return the average (arithmetic mean) of the numeric values in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Return the largest number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Return the median number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Return the smallest number in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Return a list of the most common item(s) in the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Return a random element from the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Return the standard deviation of the list."; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Return the sum of all the numbers in the list."; // untranslated
|
||||
Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "random fraction"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive)."; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "random integer from %1 to %2"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Return a random integer between the two specified limits, inclusive."; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "round"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "round down"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "round up"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Round a number up or down."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://en.wikipedia.org/wiki/Square_root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "absolute"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "square root"; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Return the absolute value of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Return e to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Return the natural logarithm of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Return the base 10 logarithm of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Return the negation of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Return 10 to the power of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Return the square root of a number."; // untranslated
|
||||
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ACOS"] = "acos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ASIN"] = "asin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ATAN"] = "atan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_COS"] = "cos"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://en.wikipedia.org/wiki/Trigonometric_functions"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_SIN"] = "sin"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TAN"] = "tan"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Return the arccosine of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Return the arcsine of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Return the arctangent of a number."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Return the cosine of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Return the sine of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Return the tangent of a degree (not radian)."; // untranslated
|
||||
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Create colour variable..."; // untranslated
|
||||
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Create number variable..."; // untranslated
|
||||
Blockly.Msg["NEW_STRING_VARIABLE"] = "Create string variable..."; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE"] = "Create variable..."; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE_TITLE"] = "New variable name:"; // untranslated
|
||||
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "New variable type:"; // untranslated
|
||||
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "allow statements"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "with:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Run the user-defined function '%1'."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Run the user-defined function '%1' and use its output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "with:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CREATE_DO"] = "Create '%1'"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Describe this function..."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "do something"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "to"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Creates a function with no output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "return"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Creates a function with an output."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Warning: This function has duplicate parameters."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Highlight function definition"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "If a value is true, then return a second value."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Warning: This block may be used only within a function definition."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "input name:"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Add an input to the function."; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "inputs"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
Blockly.Msg["REDO"] = "Redo"; // untranslated
|
||||
Blockly.Msg["REMOVE_COMMENT"] = "Remove Comment"; // untranslated
|
||||
Blockly.Msg["RENAME_VARIABLE"] = "Rename variable..."; // untranslated
|
||||
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Rename all '%1' variables to:"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TITLE"] = "to %1 append text %2"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Append some text to variable '%1'."; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "to lower case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "to Title Case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "to UPPER CASE"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Return a copy of the text in a different case."; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FIRST"] = "get first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "get letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "get letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_LAST"] = "get last letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "get random letter"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TITLE"] = "in text %1 %2"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Returns the letter at the specified position."; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Count how many times some text occurs within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Add an item to the text."; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "join"; // untranslated
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this text block."; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "to letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "to letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "to last letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "in text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "get substring from first letter"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "get substring from letter # from end"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "get substring from letter #"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Returns a specified portion of the text."; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "find first occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "find last occurrence of text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "in text %1 %2 %3"; // untranslated
|
||||
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."; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 is empty"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Returns true if the provided text is empty."; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "create text with"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Create a piece of text by joining together any number of items."; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TITLE"] = "length of %1"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Returns the number of letters (including spaces) in the provided text."; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TITLE"] = "print %1"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Print the specified text, number or other value."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Prompt for user for a number."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Prompt for user for some text."; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "prompt for number with message"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "prompt for text with message"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "replace %1 with %2 in %3"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text."; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text."; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)"; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "A letter, word, or line of text."; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "trim spaces from both sides of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "trim spaces from left side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "trim spaces from right side of"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Return a copy of the text with spaces removed from one or both ends."; // untranslated
|
||||
Blockly.Msg["TODAY"] = "Today"; // untranslated
|
||||
Blockly.Msg["UNDO"] = "Undo"; // untranslated
|
||||
Blockly.Msg["UNNAMED_KEY"] = "unnamed"; // untranslated
|
||||
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "item"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Create 'set %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Returns the value of this variable."; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET"] = "set %1 to %2"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Create 'get %1'"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Sets this variable to be equal to the input."; // untranslated
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "A variable named '%1' already exists."; // untranslated
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "A variable named '%1' already exists for another type: '%2'."; // untranslated
|
||||
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly Workspace"; // untranslated
|
||||
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Say something..."; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
||||
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
||||
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
||||
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["MATH_HUE"] = "230";
|
||||
Blockly.Msg["LOOPS_HUE"] = "120";
|
||||
Blockly.Msg["LISTS_HUE"] = "260";
|
||||
Blockly.Msg["LOGIC_HUE"] = "210";
|
||||
Blockly.Msg["VARIABLES_HUE"] = "330";
|
||||
Blockly.Msg["TEXTS_HUE"] = "160";
|
||||
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
||||
Blockly.Msg["COLOUR_HUE"] = "20";
|
||||
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
||||
425
msg/js/az.js
425
msg/js/az.js
@@ -1,425 +0,0 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
var Blockly = Blockly || { Msg: Object.create(null) };
|
||||
|
||||
Blockly.Msg["ADD_COMMENT"] = "Şərh əlavə et";
|
||||
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "'%1' dəyişənini silmək mümkün deyil, çünki o '%2' funksiyasının təyin hissəsidir";
|
||||
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Qiyməti dəyiş:";
|
||||
Blockly.Msg["CLEAN_UP"] = "Blokları təmizlə";
|
||||
Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Collapsed blocks contain warnings."; // untranslated
|
||||
Blockly.Msg["COLLAPSE_ALL"] = "Blokları yığ";
|
||||
Blockly.Msg["COLLAPSE_BLOCK"] = "Bloku yığ";
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "rəng 1";
|
||||
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "rəng 2";
|
||||
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp"; // untranslated
|
||||
Blockly.Msg["COLOUR_BLEND_RATIO"] = "nisbət";
|
||||
Blockly.Msg["COLOUR_BLEND_TITLE"] = "qarışdır";
|
||||
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "İki rəngi verilmiş nisbətdə (0,0 - 1,0) qarışdırır.";
|
||||
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://az.wikipedia.org/wiki/Rəng";
|
||||
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Palitradan bir rəng seçin.";
|
||||
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated
|
||||
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "təsadüfi rəng";
|
||||
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Təsadüfi bir rəng seçin.";
|
||||
Blockly.Msg["COLOUR_RGB_BLUE"] = "mavi";
|
||||
Blockly.Msg["COLOUR_RGB_GREEN"] = "yaşıl";
|
||||
Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html"; // untranslated
|
||||
Blockly.Msg["COLOUR_RGB_RED"] = "qırmızı";
|
||||
Blockly.Msg["COLOUR_RGB_TITLE"] = "rənglə";
|
||||
Blockly.Msg["COLOUR_RGB_TOOLTIP"] = "Qırmızı, yaşıl və mavinin göstərilən miqdarı ilə bir rəng düzəlt. Bütün qiymətlər 0 ilə 100 arasında olmalıdır.";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "dövrdən çıx";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "dövrün növbəti addımından davam et";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Cari dövrdən çıx.";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Bu dövrün qalanını ötür və növbəti addımla davam et.";
|
||||
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Xəbərdarlıq: Bu blok ancaq dövr daxilində istifadə oluna bilər.";
|
||||
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "hər element üçün %1 siyahıda %2";
|
||||
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "Siyahıdakı hər element üçün \"%1\" dəyişənini elementə mənimsət və bundan sonra bəzi əmrləri yerinə yetir.";
|
||||
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
Blockly.Msg["CONTROLS_FOR_TITLE"] = "say: %1 %2 ilə başlayıb, %3 qiymətinə kimi %4 qədər dəyiş";
|
||||
Blockly.Msg["CONTROLS_FOR_TOOLTIP"] = "\"%1\" dəyişəni başlanğıc ədəddən son ədədə qədər göstərilən aralıqla qiymətlər aldıqca göstərilən blokları yerinə yetir.";
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "\"Əgər\" blokuna bir şərt əlavə et.";
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "\"Əgər\" blokuna qalan bütün halları əhatə edəb son bir şərt əlavə et.";
|
||||
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Bu \"əgər\" blokunu dəyişdirmək üçün bölümlərin yenisini əlavə et, sil və ya yerini dəyiş.";
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "əks halda";
|
||||
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "əks halda əgər";
|
||||
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "əgər";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "Əgər qiymət doğrudursa, onda bəzi əmrləri yerinə yetir.";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_2"] = "Əgər qiymət doğrudursa, onda birinci əmrlər blokunu yerinə yetir. Əks halda isə ikinci əmrlər blokunu yerinə yetir.";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_3"] = "Əgər birinci qiymət doğrudursa, onda birinci əmrlər blokunu yerinə yetir. Əks halda əgər ikinci qiymət doğrudursa, onda ikinci əmrlər blokunu yerinə yetir.";
|
||||
Blockly.Msg["CONTROLS_IF_TOOLTIP_4"] = "Əgər birinci qiymət doğrudursa, onda birinci əmrlər blokunu yerinə yetir. Əks halda əgər ikinci qiymət doğrudursa, onda ikinci əmrlər blokunu yerinə yetir. Əgər qiymətlərdən heç biri doğru deyilsə, onda axırıncı əmrlər blokunu yerinə yetir.";
|
||||
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://az.wikipedia.org/wiki/For_loop";
|
||||
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "icra et";
|
||||
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "%1 dəfə təkrar et";
|
||||
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Bəzi əmrləri bir neçə dəfə yerinə yetir.";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "təkrar et, ta ki";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "təkrar et, hələ ki";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "Hələ ki, qiymət \"yalan\"dır, bəzi əmrləri yerinə yetir.";
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "Hələ ki, qiymət \"doğru\"dur, bəzi əmrləri yerinə yetir.";
|
||||
Blockly.Msg["DELETE_ALL_BLOCKS"] = "Bütün %1 blok silinsin?";
|
||||
Blockly.Msg["DELETE_BLOCK"] = "Bloku sil";
|
||||
Blockly.Msg["DELETE_VARIABLE"] = "'%1' adlı dəyişəni sil";
|
||||
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "'%2' dəyişəninin %1 istifadəsini silək?";
|
||||
Blockly.Msg["DELETE_X_BLOCKS"] = "%1 bloku sil";
|
||||
Blockly.Msg["DIALOG_CANCEL"] = "Ləğv et";
|
||||
Blockly.Msg["DIALOG_OK"] = "TAMAM";
|
||||
Blockly.Msg["DISABLE_BLOCK"] = "Bloku söndür";
|
||||
Blockly.Msg["DUPLICATE_BLOCK"] = "Dublikat";
|
||||
Blockly.Msg["DUPLICATE_COMMENT"] = "Şərhin nüsxəsini yarat";
|
||||
Blockly.Msg["ENABLE_BLOCK"] = "Bloku aktivləşdir";
|
||||
Blockly.Msg["EXPAND_ALL"] = "Blokları aç";
|
||||
Blockly.Msg["EXPAND_BLOCK"] = "Bloku aç";
|
||||
Blockly.Msg["EXTERNAL_INPUTS"] = "Xarici girişlər";
|
||||
Blockly.Msg["HELP"] = "Kömək";
|
||||
Blockly.Msg["INLINE_INPUTS"] = "Sətiriçi girişlər";
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "boş siyahı düzəlt";
|
||||
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Heç bir verilən qeyd olunmamış, uzunluğu 0 olan bir siyahı verir";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "siyahı";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Bu siyahı blokunu yenidən konfigurasiya etmək üçün bölmələri əlavə edin, silin və ya yerlərini dəyişin.";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "bunlardan siyahı düzəlt";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Siyahıya element əlavə edin.";
|
||||
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "İstənilən ölçülü siyahı yaradın.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "birinci";
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "axırdan # nömrəli";
|
||||
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#";
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET"] = "götür";
|
||||
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "götür və sil";
|
||||
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "axırıncı";
|
||||
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "təsadüfi";
|
||||
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "yığışdır";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Siyahının ilk elementini qaytarır.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Siyahıdan təyin olunmuş indeksli elementi qaytarır.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Siyahının son elementini qaytarır.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Siyahıdan hər hansı təsadüfi elementi qaytarır.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Siyahıdan ilk elementi silir və qaytarır.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Siyahıdan təyin olunmuş indeksli elementi silir və qaytarır.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Siyahıdan son elementi silir və qaytarır.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Siyahıdan təsadufi elementi silir və qaytarır.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Siyahıdan ilk elementi silir.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Siyahıdan təyin olunmuş indeksli elementi silir.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Siyahıdan son elementi silir.";
|
||||
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Siyahıdan təsadüfi bir elementi silir.";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "sondan # nömrəliyə";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "# nömrəliyə";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "Sonuncuya";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "Birincidən alt-siyahını alın";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "# sonuncudan alt-siyahını alın";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "# - dən alt-siyahını alın";
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Siyahının təyin olunmuş hissəsinin surətini yaradın.";
|
||||
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 son elementdir.";
|
||||
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 ilk elementdir.";
|
||||
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "Element ilə ilk rastlaşma indeksini müəyyən edin";
|
||||
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "Element ilə son rastlaşma indeksini müəyyən edin";
|
||||
Blockly.Msg["LISTS_INDEX_OF_TOOLTIP"] = "Elementin siyahıda ilk/son rastlaşma indeksini qaytarır. Əgər siyahıda mətn tapılmadısa, %1 qaytarılır.";
|
||||
Blockly.Msg["LISTS_INLIST"] = "siyahıda";
|
||||
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 boşdur";
|
||||
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Siyahı boşdursa \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
Blockly.Msg["LISTS_LENGTH_TITLE"] = "%1 siyahısının uzunluğu";
|
||||
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Siyahının uzunluğunu verir.";
|
||||
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg["LISTS_REPEAT_TITLE"] = "%1 elementinin %2 dəfə təkrarlandığı siyahı düzəlt";
|
||||
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Təyin olunmuş elementin/qiymətin təyin olunmuş sayda təkrarlandığı siyahını yaradır.";
|
||||
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "əksinə dəyiş %1";
|
||||
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Siyahının nüsxəsini əksinə dəyiş.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "Kimi";
|
||||
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "daxil et";
|
||||
Blockly.Msg["LISTS_SET_INDEX_SET"] = "təyin et";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Elementi siyahının əvvəlinə daxil edir.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Elementi siyahıda göstərilən yerə daxil edir.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Elementi siyahının sonuna artırır.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Elementi siyahıda təsadüfi seçilmiş bir yerə atır.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Siyahıda birinci elementi təyin edir.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Siyahının göstərilən yerdəki elementini təyin edir.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Siyahının sonuncu elementini təyin edir.";
|
||||
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Siyahının təsadüfi seçilmiş bir elementini təyin edir.";
|
||||
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated
|
||||
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "artan üzrə";
|
||||
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "azalan üzrə";
|
||||
Blockly.Msg["LISTS_SORT_TITLE"] = "%1 %2 %3 sortlaşdır";
|
||||
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Siyahının nüsxəsini sortlaşdır.";
|
||||
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "əlifba üzrə, registrı nəzərə almadan";
|
||||
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "say üzrə";
|
||||
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "əlifba üzrə";
|
||||
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "mətndən siyahı düzəlt";
|
||||
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "siyahıdan mətn düzəlt";
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Mətnlər siyahısından ayırıcılarla birgə bir mətn yaradır.";
|
||||
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Mətni ayırıcılara görə bölərək mətnlər siyahısı yaradır.";
|
||||
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "ayırıcıyla";
|
||||
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "səhf";
|
||||
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "\"doğru\" və ya \"səhf\" cavanını qaytarır.";
|
||||
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "doğru";
|
||||
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://az.wikipedia.org/wiki/bərabərsizlik_(riyazi)";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Girişlər bir birinə bərabərdirsə \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Birinci giriş ikincidən böyükdürsə \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Birinci giriş ikincidən böyük və ya bərarbərdirsə \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Birinci giriş ikincidən kiçikdirsə \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Birinci giriş ikincidən kiçik və ya bərarbərdirsə \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Girişlər bərabər deyillərsə \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "%1 deyil";
|
||||
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Giriş \"yalan\"-dursa \"doğru\" cavabını qaytarır. Giriş \"doğru\"-dursa \"səhf\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_NULL"] = "boş";
|
||||
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Boş cavab qaytarır.";
|
||||
Blockly.Msg["LOGIC_OPERATION_AND"] = "və";
|
||||
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
Blockly.Msg["LOGIC_OPERATION_OR"] = "və ya";
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Hər iki giriş \"doğru\"-dursa \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Girişlərdən heç olmasa biri \"doğru\"-dursa \"doğru\" cavabını qaytarır.";
|
||||
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "test";
|
||||
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "əgər səhvdirsə";
|
||||
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "əgər doğrudursa";
|
||||
Blockly.Msg["LOGIC_TERNARY_TOOLTIP"] = "'Yoxla' əmrindəki şərtə nəzər yetirin. Əgər şərt \"doğru\"-dursa \"əgər doğru\", əks halda isə \"əgər yalan\" cavabını qaytarır.";
|
||||
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated
|
||||
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://az.wikipedia.org/wiki/Hesab";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "İki ədədin cəmini qaytarır.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "İki ədədin nisbətini qaytarır.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "İki ədədin fərqini qaytarır.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "İki ədədin hasilini verir.";
|
||||
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Birinci ədədin ikinci ədəd dərəcəsindən qüvvətini qaytarır.";
|
||||
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2"; // untranslated
|
||||
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "(X,Y) nöqtələrinin -180 - 180 dərəcədə arktangensini hesabla.";
|
||||
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; // untranslated
|
||||
Blockly.Msg["MATH_CHANGE_TITLE"] = "dəyiş: %1 buna: %2";
|
||||
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "'%1' dəyişəninin üzərinə bir ədəd artır.";
|
||||
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://az.wikipedia.org/wiki/Riyazi_sabitlər";
|
||||
Blockly.Msg["MATH_CONSTANT_TOOLTIP"] = "Ümumi sabitlərdən birini qaytarır π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), və ya ∞ (sonsuzluq).";
|
||||
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
|
||||
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "%1 üçün ən aşağı %2, ən yuxarı %3 olmağı tələb et";
|
||||
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Bir ədədin verilmiş iki ədəd arasında olmasını tələb edir (sərhədlər də daxil olmaqla).";
|
||||
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated
|
||||
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "bölünür";
|
||||
Blockly.Msg["MATH_IS_EVEN"] = "cütdür";
|
||||
Blockly.Msg["MATH_IS_NEGATIVE"] = "mənfidir";
|
||||
Blockly.Msg["MATH_IS_ODD"] = "təkdir";
|
||||
Blockly.Msg["MATH_IS_POSITIVE"] = "müsbətdir";
|
||||
Blockly.Msg["MATH_IS_PRIME"] = "sadədir";
|
||||
Blockly.Msg["MATH_IS_TOOLTIP"] = "Bir ədədin cüt, tək, sadə, tam, müsbət, mənfi olmasını və ya müəyyən bir ədədə bölünməsini yoxlayır. \"Doğru\" və ya \"yalan\" qiymətini qaytarır.";
|
||||
Blockly.Msg["MATH_IS_WHOLE"] = "tamdır";
|
||||
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation"; // untranslated
|
||||
Blockly.Msg["MATH_MODULO_TITLE"] = "%1 ÷ %2 bölməsinin qalığı";
|
||||
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "İki ədədin nisbətindən alınan qalığı qaytarır.";
|
||||
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated
|
||||
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://az.wikipedia.org/wiki/Ədəd";
|
||||
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "Ədəd.";
|
||||
Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; // untranslated
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "siyahının ədədi ortası";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "siyahının maksimumu";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "siyahının medianı";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "siyahının minimumu";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "Siyahı modları( Ən çox rastlaşılan elementləri)";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "siyahıdan təsadüfi seçilmiş bir element";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "Siyahının standart deviasiyası";
|
||||
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "Siyahının cəmi";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Siyahıdaki ədədlərin ədədi ortasını qaytarır.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Siyahıdaki ən böyük elementi qaytarır.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Siyahının median elementini qaytarır.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Siyahıdaki ən kiçik ədədi qaytarır.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Siyahıdaki ən çox rastlanan element(lər)dən ibarət siyahı qaytarır.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Siyahıdan təsadüfi bir element qaytarır.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Siyahının standart deviasiyasını qaytarır.";
|
||||
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Siyahıdakı bütün ədədlərin cəmini qaytarır.";
|
||||
Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "təsadüfi kəsr";
|
||||
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "0.0 (daxil olmaqla) və 1.0 (daxil olmamaqla) ədədlərinin arasından təsadüfi bir kəsr ədəd qaytarır.";
|
||||
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation"; // untranslated
|
||||
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "%1 ilə %2 arasından təsadüfi tam ədəd";
|
||||
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Verilmiş iki ədəd arasından (ədədrlər də daxil olmaqla) təsadüfi bir tam ədəd qaytarır.";
|
||||
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding"; // untranslated
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "yuvarlaqlaşdır";
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "aşağı yuvarlaqlaşdır";
|
||||
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "yuxarı yuvarlaqlaşdır";
|
||||
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Ədədi aşağı və ya yuxari yuvarlaqşdır.";
|
||||
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://az.wikipedia.org/wiki/Kvadrat_kökləri";
|
||||
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "modul";
|
||||
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "kvadrat kök";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Ədədin modulunu qaytarır.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "e sabitinin verilmiş ədədə qüvvətini qaytarır.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Ədədin natural loqarifmini tapır.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Ədədin 10-cu dərəcədən loqarifmini tapır.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Ədədin əksini qaytarır.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "10-un verilmiş ədədə qüvvətini qaytarır.";
|
||||
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Ədədin kvadrat kökünü qaytarır.";
|
||||
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated
|
||||
Blockly.Msg["MATH_TRIG_ACOS"] = "arccos";
|
||||
Blockly.Msg["MATH_TRIG_ASIN"] = "arcsin";
|
||||
Blockly.Msg["MATH_TRIG_ATAN"] = "arctan";
|
||||
Blockly.Msg["MATH_TRIG_COS"] = "cos";
|
||||
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://az.wikipedia.org/wiki/Triqonometrik_funksiyalar";
|
||||
Blockly.Msg["MATH_TRIG_SIN"] = "sin";
|
||||
Blockly.Msg["MATH_TRIG_TAN"] = "tg";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Ədədin arccosinusunu qaytarır.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Ədədin arcsinusunu qaytarır.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Ədədin arctanqensini qaytarır.";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Dərəcənin kosinusunu qaytarır (radianın yox).";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Dərəcənin sinusunu qaytar (radianın yox).";
|
||||
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Dərəcənin tangensini qaytar (radianın yox).";
|
||||
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Yeni rəng dəyişəni...";
|
||||
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Yeni rəqəm dəyişəni...";
|
||||
Blockly.Msg["NEW_STRING_VARIABLE"] = "Yeni sətir dəyişəni...";
|
||||
Blockly.Msg["NEW_VARIABLE"] = "Yeni dəyişən...";
|
||||
Blockly.Msg["NEW_VARIABLE_TITLE"] = "Yeni dəyişənin adı:";
|
||||
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "Yeni dəyişənin tipi:";
|
||||
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "operatorlara icazə";
|
||||
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "ilə:";
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Yaradılmış '%1' funksiyasını çalışdır.";
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Yaradılmış '%1' funksiyasını çalışdır və nəticəni istifadə et.";
|
||||
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "ilə:";
|
||||
Blockly.Msg["PROCEDURES_CREATE_DO"] = "'%1' yarat";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Bu funksiyanı təsvir et";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "hansısa əməliyyat";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "icra et:";
|
||||
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Nəticəsi olmayan funksiya yaradır.";
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "qaytar";
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Nəticəsi olan funksiya yaradır.";
|
||||
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Xəbərdarlıq: Bu funksiyanın təkrar olunmuş parametrləri var.";
|
||||
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Funksiyanın təyinatını vurğula";
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "Əgər bir dəyər \"doğru\"-dursa onda ikinci dəyəri qaytar.";
|
||||
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Xəbərdarlıq: Bu blok ancaq bir funksiyanın təyinatı daxilində işlədilə bilər.";
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "Giriş adı:";
|
||||
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Funksiyaya giriş parametrləri əlavə et.";
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "girişlər";
|
||||
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Bu funksiyanın giriş parametrləri üçün əlavə et, sil, və ya yenilə.";
|
||||
Blockly.Msg["REDO"] = "İrəli";
|
||||
Blockly.Msg["REMOVE_COMMENT"] = "Şərhi sil";
|
||||
Blockly.Msg["RENAME_VARIABLE"] = "Dəyişənin adını dəyiş...";
|
||||
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Bütün '%1' dəyişənlərinin adını buna dəyiş:";
|
||||
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_APPEND_TITLE"] = "bu mətnin sonuna: %1 bu mətni əlavə et: %2";
|
||||
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "'%1' dəyişəninin sonuna nəsə əlavə et.";
|
||||
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "kiçik hərflərlə";
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "Baş Hərflərlə";
|
||||
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "BÖYÜK HƏRFLƏRLƏ";
|
||||
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Mətndə hərflərin böyük-kiçikliyini dəyiş.";
|
||||
Blockly.Msg["TEXT_CHARAT_FIRST"] = "birinci hərfi götür";
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "axırdan bu nömrəli hərfi götür";
|
||||
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "bu nömrəli hərfi götür";
|
||||
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_LAST"] = "axırıncı hərfi götür";
|
||||
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "təsadüfi hərf götür";
|
||||
Blockly.Msg["TEXT_CHARAT_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_CHARAT_TITLE"] = "mətndə %1 %2";
|
||||
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Göstərilən mövqedəki hərfi qaytarır.";
|
||||
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "%2 içindən %1 sayını hesabla";
|
||||
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Hesablayaq, mətnin bu hissəsi başqa mətndə neçə dəfə rast gəlinir.";
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Mətnə bir element əlavə et.";
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "birləşdir";
|
||||
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Bu mətn blokunu yenidən konfigurasiya etmək üçün bölmələri əlavə edin, silin və ya yerlərini dəyişin.";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "axırdan bu nömrəli hərfə qədər";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "bu nömrəli hərfə qədər";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "son hərfə qədər";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "mətndə";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "Mətnin surətini ilk hərfdən";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "Mətnin surətini sondan bu nömrəli # hərfdən";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "Mətnin surətini bu nömrəli hərfdən";
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated
|
||||
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Mətnin təyin olunmuş hissəsini qaytarır.";
|
||||
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "Bu mətn ilə ilk rastlaşmanı tap:";
|
||||
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "Bu mətn ilə son rastlaşmanı tap:";
|
||||
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "mətndə %1 %2 %3";
|
||||
Blockly.Msg["TEXT_INDEXOF_TOOLTIP"] = "Birinci mətnin ikinci mətndə ilk/son rastlaşma indeksini qaytarır. Əgər rastlaşma baş verməzsə, %1 qaytarır.";
|
||||
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 boşdur";
|
||||
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Verilmiş mətn boşdursa, doğru qiymətini qaytarır.";
|
||||
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
|
||||
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "Verilmişlərlə mətn yarat";
|
||||
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "İxtiyari sayda elementlərinin birləşməsi ilə mətn parçası yarat.";
|
||||
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg["TEXT_LENGTH_TITLE"] = "%1 - ın uzunluğu";
|
||||
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Verilmiş mətndəki hərflərin(sözlər arası boşluqlar sayılmaqla) sayını qaytarır.";
|
||||
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_PRINT_TITLE"] = "%1 - i çap elə";
|
||||
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Təyin olunmuş mətn, ədəd və ya hər hansı bir başqa elementi çap elə.";
|
||||
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "İstifadəçiyə ədəd daxil etməsi üçün sorğu/tələb göndərin.";
|
||||
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "İstifadəçiyə mətn daxil etməsi üçün sorğu/tələb göndərin.";
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "İstifadəçiyə ədəd daxil etməsi üçün sorğunu/tələbi ismarıc kimi göndərin";
|
||||
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "İstifadəçiyə mətn daxil etməsi üçün sorğunu/tələbi ismarıc ilə göndərin";
|
||||
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "%3 -də %1 əvəz et %2";
|
||||
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Bütün uyğunluqlu bəzi mətnlərin digər bəzi mətnlərə dəyişdirilməsi.";
|
||||
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "əksinə dəyiş %1";
|
||||
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Mətndəki simvolların ardıcıllığını əksinə dəyiş.";
|
||||
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)"; // untranslated
|
||||
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "Mətndəki hərf, söz və ya sətir.";
|
||||
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "boşluqları hər iki tərəfdən pozun";
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "boşluqlari yalnız sol tərəfdən pozun";
|
||||
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "boşluqları yalnız sağ tərəfdən pozun";
|
||||
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Mətnin hər iki və ya yalnız bir tərəfdən olan boşluqları pozulmuş surətini qaytarın.";
|
||||
Blockly.Msg["TODAY"] = "Bugün";
|
||||
Blockly.Msg["UNDO"] = "Geri";
|
||||
Blockly.Msg["UNNAMED_KEY"] = "adsız";
|
||||
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "element";
|
||||
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "'%1 - i təyin et' - i yarat";
|
||||
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Bu dəyişənin qiymətini qaytarır.";
|
||||
Blockly.Msg["VARIABLES_SET"] = "%1 - i bu qiymət ilə təyin et: %2";
|
||||
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "'%1 - i götür' - ü yarat";
|
||||
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Bu dəyişəni daxil edilmiş qiymətə bərabər edir.";
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "'%1' adlı dəyişən artıq mövcuddur.";
|
||||
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "'%1' adlı dəyişən artıq '%2': tipində istifadə edilir .";
|
||||
Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly Workspace"; // untranslated
|
||||
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Buraya nə isə yaz...";
|
||||
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
|
||||
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
|
||||
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
|
||||
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
|
||||
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
|
||||
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
|
||||
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
|
||||
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
|
||||
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["MATH_HUE"] = "230";
|
||||
Blockly.Msg["LOOPS_HUE"] = "120";
|
||||
Blockly.Msg["LISTS_HUE"] = "260";
|
||||
Blockly.Msg["LOGIC_HUE"] = "210";
|
||||
Blockly.Msg["VARIABLES_HUE"] = "330";
|
||||
Blockly.Msg["TEXTS_HUE"] = "160";
|
||||
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
||||
Blockly.Msg["COLOUR_HUE"] = "20";
|
||||
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user