Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// sendToInput.js

(function () {
  /*global adventurejs A*/

  var p = adventurejs.Display.prototype;

  /**
   * Takes a string and writes it to the input field
   * without submitting it to the parser.
   * @memberOf adventurejs.Display
   * @method adventurejs.Display#sendToInput
   */
  p.sendToInput = function Display_sendToInput(value) {
    if (this.inputEl.value.length) this.inputEl.value += " ";
    this.inputEl.value += value;
    this.clearBtn.classList.add("active");
  };
})();