mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 20:00:10 +00:00
added keyboard handling...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
82f2669b8a
commit
9ab65ee8b6
@ -56,6 +56,8 @@
|
||||
|
||||
<script src="../lib/jli.js"></script>
|
||||
|
||||
<script src="../ext-lib/require.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
var TREE = {
|
||||
@ -74,6 +76,7 @@ var TREE = {
|
||||
file: 'this is a file',
|
||||
}
|
||||
|
||||
|
||||
function skipFiles(e, v){
|
||||
return typeof(v) != typeof('str')
|
||||
}
|
||||
@ -270,6 +273,32 @@ function prev(browser){
|
||||
return select('prev', browser)
|
||||
}
|
||||
|
||||
var KB = {
|
||||
'*':{
|
||||
F5: function(){ window.location.reload() },
|
||||
|
||||
Up: prev,
|
||||
Down: next,
|
||||
Left: pop,
|
||||
Right: push,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
requirejs(['../lib/keyboard'], function(m){
|
||||
keyboard = m
|
||||
|
||||
// setup base keyboard for devel, in case something breaks...
|
||||
$(document)
|
||||
.keydown(
|
||||
keyboard.makeKeyboardHandler(
|
||||
KB,
|
||||
function(k){
|
||||
console.log(k)
|
||||
}))
|
||||
|
||||
})
|
||||
|
||||
$(function(){
|
||||
var browser = make()
|
||||
@ -277,6 +306,7 @@ $(function(){
|
||||
.empty()
|
||||
.append(browser)
|
||||
showPath(browser, '/', TREE)
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user