notbenh / next.notbenh.info

I build a silly terminal as my webpage thinggie
1 stars 0 forks source link

build a better terminal object to abstract away the ugly code #4

Closed notbenh closed 11 years ago

notbenh commented 11 years ago

Currently the dispatch for taking a verb is a bit weird, simple but weird. To make #3 extra useful it would be nice to have a single terminal object that just gets handed an action object on creation so that we can further abstract away the code so that the page just becomes something like:


var t = new Terminal(
  id: '#terminal',
  name: 'myTerm',
  actions: new ActionClass,
  greeting: 'hello...',
  prompt: '>'
) // all done
notbenh commented 11 years ago

Not quite as clean though terminal.coffee is 80% of what I wanted and still 100% of what is needed.