Hi, hope this helps.
https://github.com/fustyles/webduino/blob/master/SpBlocklyJS/js/blockly_compressed.jsBlockly.Msg["NEW_VARIABLE"] = "Create variable...";
Blockly.Msg["NEW_VARIABLE_TITLE"] = "New variable name:";
module$exports$Blockly$internalConstants.ADD_VARIABLE_ID="ADD_VARIABLE_ID";
module$exports$Blockly$FieldVariable.FieldVariable.prototype.onItemSelected_=function(a,b){
a=b.getValue();
if(this.sourceBlock_&&this.sourceBlock_.workspace){
if(a===module$exports$Blockly$internalConstants.RENAME_VARIABLE_ID){
(0,$.module$exports$Blockly$Variables.renameVariable)(this.sourceBlock_.workspace,this.variable_);
return
}
if(a===module$exports$Blockly$internalConstants.DELETE_VARIABLE_ID){
this.sourceBlock_.workspace.deleteVariableById(this.variable_.getId());
return
}
if(a===module$exports$Blockly$internalConstants.ADD_VARIABLE_ID){
(0,$.module$exports$Blockly$Variables.createVariableButtonHandler)(this.sourceBlock_.workspace);
var v=this.sourceBlock_.workspace.getVariablesOfType("");
v.sort(Blockly.VariableModel.compareByName);
if(v.length>0)
this.setValue(v[v.length-1].id_);
return
}
}
this.setValue(a)
};
module$exports$Blockly$FieldVariable.FieldVariable.dropdownCreate=function(){
if(!this.variable_)throw Error("Tried to call dropdownCreate on a variable field with no variable selected.");
var a=this.getText(),b=[];
if(this.sourceBlock_&&this.sourceBlock_.workspace)
for(var c=this.getVariableTypes_(),d=0;d<c.length;d++){
var e=this.sourceBlock_.workspace.getVariablesOfType(c[d]);
b=b.concat(e)
}
b.sort(module$exports$Blockly$VariableModel.VariableModel.compareByName);
c=[];
for(d=0;d<b.length;d++)
c[d]=[b[d].name,b[d].getId()];
c.push([$.module$exports$Blockly$Msg.Msg.RENAME_VARIABLE,module$exports$Blockly$internalConstants.RENAME_VARIABLE_ID]);
$.module$exports$Blockly$Msg.Msg.DELETE_VARIABLE&&c.push([$.module$exports$Blockly$Msg.Msg.DELETE_VARIABLE.replace("%1",a),
module$exports$Blockly$internalConstants.DELETE_VARIABLE_ID]);
c.push([$.module$exports$Blockly$Msg.Msg.NEW_VARIABLE,module$exports$Blockly$internalConstants.ADD_VARIABLE_ID]);
return c
};
$.Blockly.ADD_VARIABLE_ID=module$exports$Blockly$internalConstants.ADD_VARIABLE_ID;
Best wishes
fu6...