helper for keyboard, change to 'on' instead of 'bind'
This commit is contained in:
parent
56fb44d1f8
commit
36409d1fa8
2 changed files with 21 additions and 21 deletions
|
|
@ -9,7 +9,8 @@
|
||||||
<script type="text/javascript" src="sahli.js"></script>
|
<script type="text/javascript" src="sahli.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
s = 5;
|
sahli = new Sahli;
|
||||||
|
Sahli.requestsahlifile('list.sahli')
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<link rel="stylesheet" href="sahli.css" type="text/css" media="screen" />
|
<link rel="stylesheet" href="sahli.css" type="text/css" media="screen" />
|
||||||
|
|
|
||||||
39
sahli.coffee
39
sahli.coffee
|
|
@ -136,27 +136,13 @@ class @Sahli
|
||||||
alert 'avatar', picdata, inserthere
|
alert 'avatar', picdata, inserthere
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@resizedrawbox = (height) ->
|
|
||||||
dbox1 = $('div#drawbox')
|
|
||||||
if 'undefined' == height
|
|
||||||
dbox1.height window.innerHeight - 2
|
|
||||||
else
|
|
||||||
dbox1.height height
|
|
||||||
dbox1.width window.innerWidth - 2
|
|
||||||
|
|
||||||
|
|
||||||
@requestsahlifile = (url) ->
|
@requestsahlifile = (url) ->
|
||||||
ref = this
|
@loadkeys()
|
||||||
$.getJSON url, (json) ->
|
$.getJSON url, (json) ->
|
||||||
ref.filedata = json.filedata
|
@filedata = json.filedata
|
||||||
ref.slides = json.slides
|
@slides = json.slides
|
||||||
ref.location = json.location
|
@location = json.location
|
||||||
ref.buildcompo()
|
alert "SAHLI READY TO GO\n#{@filedata.length} Entries"
|
||||||
|
|
||||||
@buildcompo = ->
|
|
||||||
# @resizedrawbox()
|
|
||||||
alert 'SAHLI READY TO GO'
|
|
||||||
|
|
||||||
@nextpic = ->
|
@nextpic = ->
|
||||||
@dbox.children().remove()
|
@dbox.children().remove()
|
||||||
|
|
@ -198,4 +184,17 @@ class @Sahli
|
||||||
$('h1#top').fadeToggle()
|
$('h1#top').fadeToggle()
|
||||||
@DEBUG = !@DEBUG
|
@DEBUG = !@DEBUG
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@keycode = (char) ->
|
||||||
|
char.toUpperCase().charCodeAt 0
|
||||||
|
|
||||||
|
@loadkeys = ->
|
||||||
|
$(document).on('keydown', (ev) =>
|
||||||
|
switch ev.which
|
||||||
|
when @keycode(' ')
|
||||||
|
alert "spaaaace"
|
||||||
|
when @keycode('s')
|
||||||
|
alert("not spaaaace")
|
||||||
|
else
|
||||||
|
console.log ev.which
|
||||||
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue