function addInputByString(root) {
  const string =
      prompt(`Please describe the input in one of the following forms:
(1) [AMOUNT] of [NAME]
(2) [AMOUNT] of [CONCENTRATION] [SOLUTE] in [SOLVENT]`);
  if (!(string)) {
    return;
  }
  const xhr = new XMLHttpRequest();
  xhr.open('POST', '/resolve/input');
  xhr.responseType = 'arraybuffer';
  xhr.onload = () => {
    if (xhr.status == 409) {
      const decoder = new TextDecoder('utf-8');
      alert('Could not parse: ' + decoder.decode(xhr.response));
    } else {
      const bytes = new Uint8Array(xhr.response);
      const input = proto.ord.ReactionInput.deserializeBinary(bytes);
      if (input) {
        const input_node = loadInput(root, string, input);
        $('.edittext', input_node).trigger('blur');
      }
    }
  };
  xhr.send(string);
}
/**
 * Adds and populates a single reaction input section in the form according to
 * a short-hand string describing a stock solution.
 * @param {!Node} root Root node for the reaction input.
 */
Adds and populates a single reaction input section in the form according to
a short-hand string describing a stock solution.
@param {!Node} root Root node for the reaction input.
Adds and populates a single reaction input section in the form according to a short - hand string describing a stock solution . @param { !Node } root Root node for the reaction input .
function addInputByString(root) {
  const string =
      prompt(`Please describe the input in one of the following forms:
(1) [AMOUNT] of [NAME]
(2) [AMOUNT] of [CONCENTRATION] [SOLUTE] in [SOLVENT]`);
  if (!(string)) {
    return;
  }
  const xhr = new XMLHttpRequest();
  xhr.open('POST', '/resolve/input');
  xhr.responseType = 'arraybuffer';
  xhr.onload = () => {
    if (xhr.status == 409) {
      const decoder = new TextDecoder('utf-8');
      alert('Could not parse: ' + decoder.decode(xhr.response));
    } else {
      const bytes = new Uint8Array(xhr.response);
      const input = proto.ord.ReactionInput.deserializeBinary(bytes);
      if (input) {
        const input_node = loadInput(root, string, input);
        $('.edittext', input_node).trigger('blur');
      }
    }
  };
  xhr.send(string);
}
function addInputByString ( root ) { const string = prompt ( ` ` ) ; if ( ! ( string ) ) { return ; } const xhr = new XMLHttpRequest ( ) ; xhr . open ( 'POST' , '/resolve/input' ) ; xhr . responseType = 'arraybuffer' ; xhr . onload = ( ) => { if ( xhr . status == 409 ) { const decoder = new TextDecoder ( 'utf-8' ) ; alert ( 'Could not parse: ' + decoder . decode ( xhr . response ) ) ; } else { const bytes = new Uint8Array ( xhr . response ) ; const input = proto . ord . ReactionInput . deserializeBinary ( bytes ) ; if ( input ) { const input_node = loadInput ( root , string , input ) ; $ ( '.edittext' , input_node ) . trigger ( 'blur' ) ; } } } ; xhr . send ( string ) ; }
Adds and populates a single reaction input section in the form according to
 a short-hand string describing a stock solution.
Adds and populates a single reaction input section in the form according to a short - hand string describing a stock solution .