From: Guillaume Cottenceau Date: Fri, 1 Jan 2010 14:17:09 +0000 (+0100) Subject: let space key toggle video in fullscreen X-Git-Tag: 0.9.3~23 X-Git-Url: http://git.zarb.org/?p=booh;a=commitdiff_plain;h=7d19c93e240f9a0d69e21aa863b0029d73876aa3 let space key toggle video in fullscreen --- diff --git a/data/booh/themes/cardu/root/booh.js b/data/booh/themes/cardu/root/booh.js index 4cf353b..241bb5c 100644 --- a/data/booh/themes/cardu/root/booh.js +++ b/data/booh/themes/cardu/root/booh.js @@ -337,6 +337,17 @@ function last() { display_current(); } +function toggle_video() { + if (types[current] == 'video' && dbltilda_flowplayer_active == 'true') { + var player = flowplayer('player'); + if (player.isLoaded()) { + player.toggle(); + } else { + player.play(); + } + } +} + function keyDownEvent(key) { if (!key) { key = event; @@ -346,6 +357,9 @@ function keyDownEvent(key) { return; } switch (key.which) { + case 32: // space + toggle_video(); + break; case 36: // home first(); break; diff --git a/data/booh/themes/dark/root/booh.js b/data/booh/themes/dark/root/booh.js index 4f130be..c50f3d9 100644 --- a/data/booh/themes/dark/root/booh.js +++ b/data/booh/themes/dark/root/booh.js @@ -328,6 +328,17 @@ function last() { display_current(); } +function toggle_video() { + if (types[current] == 'video' && dbltilda_flowplayer_active == 'true') { + var player = flowplayer('player'); + if (player.isLoaded()) { + player.toggle(); + } else { + player.play(); + } + } +} + function keyDownEvent(key) { if (!key) { key = event; @@ -337,6 +348,9 @@ function keyDownEvent(key) { return; } switch (key.which) { + case 32: // space + toggle_video(); + break; case 36: // home first(); break; diff --git a/data/booh/themes/sbs/root/booh.js b/data/booh/themes/sbs/root/booh.js index 5eecd28..66b0f90 100644 --- a/data/booh/themes/sbs/root/booh.js +++ b/data/booh/themes/sbs/root/booh.js @@ -328,6 +328,17 @@ function last() { display_current(); } +function toggle_video() { + if (types[current] == 'video' && dbltilda_flowplayer_active == 'true') { + var player = flowplayer('player'); + if (player.isLoaded()) { + player.toggle(); + } else { + player.play(); + } + } +} + function keyDownEvent(key) { if (!key) { key = event; @@ -337,6 +348,9 @@ function keyDownEvent(key) { return; } switch (key.which) { + case 32: // space + toggle_video(); + break; case 36: // home first(); break; diff --git a/data/booh/themes/simple/root/booh.js b/data/booh/themes/simple/root/booh.js index 4f130be..c50f3d9 100644 --- a/data/booh/themes/simple/root/booh.js +++ b/data/booh/themes/simple/root/booh.js @@ -328,6 +328,17 @@ function last() { display_current(); } +function toggle_video() { + if (types[current] == 'video' && dbltilda_flowplayer_active == 'true') { + var player = flowplayer('player'); + if (player.isLoaded()) { + player.toggle(); + } else { + player.play(); + } + } +} + function keyDownEvent(key) { if (!key) { key = event; @@ -337,6 +348,9 @@ function keyDownEvent(key) { return; } switch (key.which) { + case 32: // space + toggle_video(); + break; case 36: // home first(); break;