function promptName(promptText, defaultText, callback) {
    Blockly.hideChaff();
    var newVar = Blockly.prompt(promptText, defaultText, function(newVar) {
      // Merge runs of whitespace.  Strip leading and trailing whitespace.
      // Beyond this, all names are legal.
      if (newVar) {
        newVar = newVar.replace(/[\s\xa0]+/g, ' ').replace(/^ | $/g, '');
        if (newVar == Blockly.Msg.RENAME_VARIABLE ||
            newVar == Blockly.Msg.NEW_VARIABLE) {
          // Ok, not ALL names are legal...
          newVar = null;
        }
      }
      callback(newVar);
    });
  }
Event handler for a change in variable name.
Special case the 'New variable...' and 'Rename variable...' options.
In both of these special cases, prompt the user for a new name.
@param {string} text The selected dropdown menu option.
@return {null|undefined|string} An acceptable new variable name, or null if
    change is to be either aborted (cancel button) or has been already
    handled (rename), or undefined if an existing variable was chosen.
@this {!Blockly.FieldVariable}