Add inital setup including 'go' command
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# Constants ############################################################################################################
|
||||
|
||||
RETURN_KEY = 13
|
||||
|
||||
|
||||
# Global Data ##########################################################################################################
|
||||
|
||||
$(document).ready ->
|
||||
$input = $("input.entry")
|
||||
$input.on "keydown", ->
|
||||
if event.which isnt RETURN_KEY then return
|
||||
STORY.interpret($input.val())
|
||||
$input.val("")
|
||||
|
||||
$log = $(".log")
|
||||
$logText = $("p.log-text")
|
||||
|
||||
STORY.log.onChange = (log)->
|
||||
$logText.html(log.content)
|
||||
$log.scrollTop($log[0].scrollHeight)
|
||||
|
||||
STORY.begin()
|
||||
$input.focus()
|
||||
Reference in New Issue
Block a user