From b48d3a6dd3728e75d1a98a9a67d81455978e3741 Mon Sep 17 00:00:00 2001 From: Halit Anil Donmez Date: Wed, 7 Oct 2020 14:07:35 -0400 Subject: [PATCH] add new typed variable (#4352) * add new typed variable * add typed variables to the prompt message --- demos/blockfactory/standard_categories.js | 5 +++++ demos/blockfactory/workspacefactory/wfactory_controller.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/demos/blockfactory/standard_categories.js b/demos/blockfactory/standard_categories.js index 4bb3d1f6f..3f25fe950 100644 --- a/demos/blockfactory/standard_categories.js +++ b/demos/blockfactory/standard_categories.js @@ -362,6 +362,11 @@ StandardCategories.categoryMap['variables'] = StandardCategories.categoryMap['variables'].hue = 330; StandardCategories.categoryMap['variables'].custom = 'VARIABLE'; +StandardCategories.categoryMap['typedvariables'] = + new ListElement(ListElement.TYPE_CATEGORY, 'TypedVariables'); +StandardCategories.categoryMap['typedvariables'].custom = 'VARIABLE_DYNAMIC'; +StandardCategories.categoryMap['typedvariables'].hue = 290; + // All standard block types in provided in Blockly core. StandardCategories.coreBlockTypes = ["controls_if", "logic_compare", "logic_operation", "logic_negate", "logic_boolean", "logic_null", diff --git a/demos/blockfactory/workspacefactory/wfactory_controller.js b/demos/blockfactory/workspacefactory/wfactory_controller.js index 6d243ca15..f71d984e0 100644 --- a/demos/blockfactory/workspacefactory/wfactory_controller.js +++ b/demos/blockfactory/workspacefactory/wfactory_controller.js @@ -550,7 +550,8 @@ WorkspaceFactoryController.prototype.loadCategory = function() { // Prompt user for the name of the standard category to load. do { var name = prompt('Enter the name of the category you would like to import ' - + '(Logic, Loops, Math, Text, Lists, Colour, Variables, or Functions)'); + + '(Logic, Loops, Math, Text, Lists, Colour, Variables, TypedVariables ' + + 'or Functions)'); if (!name) { return; // Exit if cancelled. }