File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ Blockly.Blocks['stepper_step'] = {
172172 this . setWarningText ( null ) ;
173173 } else {
174174 // Set a warning to select a valid stepper config
175- this . setWarningText ( Blockly . Msg . ARD_STEPPER_STEP_WARN1 ) ;
175+ this . setWarningText ( Blockly . Msg . ARD_COMPONENT_WARN1 . replace ( '%1' , Blockly . Msg . ARD_STEPPER_COMPONENT ) . replace ( '%1' , Blockly . Msg . ARD_STEPPER_COMPONENT ) ) ;
176176 }
177177 }
178178} ;
Original file line number Diff line number Diff line change @@ -40,11 +40,11 @@ goog.require('Blockly.Blocks');
4040 * @constructor
4141 */
4242Blockly . Blocks . ComponentFieldVariable = function ( varname , component_type , opt_validator ) {
43- Blockly . Blocks . ComponentFieldVariable [ ' component_type' ] = component_type
43+ this . component_type = component_type
4444 //override the dropdownCreate to use for this field
45- Blockly . FieldVariable . dropdownCreate = Blockly . Blocks . ComponentFieldVariable . dropdownCreateComponents ;
45+ this . dropdownCreate = Blockly . Blocks . ComponentFieldVariable . dropdownCreateComponents ;
4646 Blockly . Blocks . ComponentFieldVariable . superClass_ . constructor . call ( this ,
47- Blockly . Blocks . ComponentFieldVariable . dropdownCreateComponents , opt_validator ) ;
47+ varname , opt_validator ) ;
4848 this . setValue ( varname || '' ) ;
4949} ;
5050goog . inherits ( Blockly . Blocks . ComponentFieldVariable , Blockly . FieldVariable ) ;
@@ -106,7 +106,7 @@ Blockly.Blocks.ComponentFieldVariable.dropdownCreateComponents = function() {
106106 if ( this . sourceBlock_ && this . sourceBlock_ . workspace ) {
107107 var variableList =
108108 Blockly . Blocks . ComponentFieldVariable . ComponentVariables ( this . sourceBlock_ . workspace ,
109- Blockly . Blocks . ComponentFieldVariable [ ' component_type' ] ) ;
109+ this . component_type ) ;
110110 } else {
111111 var variableList = [ ] ;
112112 }
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ goog.require('goog.string');
4444 */
4545Blockly . FieldVariable = function ( varname , opt_validator ) {
4646 Blockly . FieldVariable . superClass_ . constructor . call ( this ,
47- Blockly . FieldVariable . dropdownCreate , opt_validator ) ;
47+ this . dropdownCreate , opt_validator ) ;
4848 this . setValue ( varname || '' ) ;
4949} ;
5050goog . inherits ( Blockly . FieldVariable , Blockly . FieldDropdown ) ;
@@ -124,7 +124,7 @@ Blockly.FieldVariable.prototype.setValue = function(newValue) {
124124 * @return {!Array.<string> } Array of variable names.
125125 * @this {!Blockly.FieldVariable}
126126 */
127- Blockly . FieldVariable . dropdownCreate = function ( ) {
127+ Blockly . FieldVariable . prototype . dropdownCreate = function ( ) {
128128 if ( this . sourceBlock_ && this . sourceBlock_ . workspace ) {
129129 var variableList =
130130 Blockly . Variables . allVariables ( this . sourceBlock_ . workspace ) ;
Original file line number Diff line number Diff line change 437437 "ARD_STEPPER_STEP" : " beweeg stappenmotor" ,
438438 "ARD_STEPPER_STEPS" : " stappen" ,
439439 "ARD_STEPPER_STEP_TIP" : " Draait de stappenmotor een opgegeven aantal stappen" ,
440- "ARD_STEPPER_STEP_WARN1" : " Een Stappenmotor Definieer blok met dezelfde stappenmotor naam moet toegevoegd worden om dit blok te gebruiken!" ,
440+ "ARD_STEPPER_COMPONENT" : " stappenmotor" ,
441+ "ARD_COMPONENT_WARN1" : " Een %1 Definieer blok met dezelfde %1 naam moet toegevoegd worden om dit blok te gebruiken!" ,
441442 "ARD_TIME_DELAY" : " wacht" ,
442443 "ARD_TIME_MS" : " milliseconden" ,
443444 "ARD_TIME_DELAY_TIP" : " Wacht de opgegeven tijd in milliseconden (duizendsten van een seconde)" ,
Original file line number Diff line number Diff line change @@ -1183,7 +1183,8 @@ Blockly.Msg.ARD_STEPPER_SETUP_TIP = 'Configures a stepper motor pinout and other
11831183Blockly . Msg . ARD_STEPPER_STEP = 'move stepper' ;
11841184Blockly . Msg . ARD_STEPPER_STEPS = 'steps' ;
11851185Blockly . Msg . ARD_STEPPER_STEP_TIP = 'Turns the stepper motor a specific number of steps.' ;
1186- Blockly . Msg . ARD_STEPPER_STEP_WARN1 = 'A STEPPER configuration block with the same stepper name must be added to use this block!' ;
1186+ Blockly . Msg . ARD_STEPPER_COMPONENT = 'stepper' ;
1187+ Blockly . Msg . ARD_COMPONENT_WARN1 = 'A %1 configuration block with the same %1 name must be added to use this block!' ;
11871188Blockly . Msg . ARD_TIME_DELAY = 'wait' ;
11881189Blockly . Msg . ARD_TIME_MS = 'milliseconds' ;
11891190Blockly . Msg . ARD_TIME_DELAY_TIP = 'Wait specific time in milliseconds' ;
You can’t perform that action at this time.
0 commit comments