/*{
  "id":"gsms",
	"scope":["server"],
	"desc":"google voice sms interface"
}*/

var stream = require('stream')
, inherits = require('inherits')

function Console (template) {
  if (!(this instanceof Console)) return new Console(template)
  stream.Stream.call(this)
  this.readable = true
  this.writable = true
  this._buffer = []
  var self = this

  this.write = function (chunk, enc, next) {
    console.log(chunk)
  }

  this._read = function (size) {}

  this.end = function () {}

  render(template)

  function render (html) {
    console.log(html)
    var container = document.getElementById('container')
    , log = document.createElement('div')
    log.innerHTML = html
    container.appendChild(log)
    var form = document.getElementById('x')
    , prompt = form.querySelector('.console')

    form.onsubmit = function (e) {
      e.preventDefault()
      var cmd = e.target[0].value
      self.emit('data', JSON.stringify({cmd:cmd}))
      prompt.blur()
    }

    prompt.onfocus = function () {
      prompt.value = ''
    }

    prompt.onblur = function () {
      prompt.value = ''
    }
  }
}

inherits(Console,stream.Stream)
module.exports = Console

@@ -143,91 +143,48 @@
 s')%0A
-%0Afunction Console (template) %7B%0A  if (!(this instanceof Console)) return new Console
+, gsms = require('gsms')%0A%0Afunction Gsms 
 (tem
@@ -189,16 +189,18 @@
 emplate)
+ %7B
 %0A  strea
@@ -1074,23 +1074,20 @@
 nherits(
-Console
+Gsms
 ,stream.
@@ -1115,12 +1115,9 @@
 s = 
-Console
+Gsms
 %0A

remove instanceof