diff options
author | Simon | 2011-04-14 14:40:07 +0200 |
---|---|---|
committer | Simon | 2011-04-14 14:40:07 +0200 |
commit | ddb047e19c5f44c37888fd726153d0188010a7dc (patch) | |
tree | 9c2ed9c8bc9ffed7aceaa0f49911523fca0ad4f0 | |
parent | Ticket #209 - Erster Eintrag wird selektiert und mit Enter gehts weiter (diff) | |
download | pbs2-ddb047e19c5f44c37888fd726153d0188010a7dc.tar.gz pbs2-ddb047e19c5f44c37888fd726153d0188010a7dc.tar.xz pbs2-ddb047e19c5f44c37888fd726153d0188010a7dc.zip |
Ticket #210 - Menueinträge mit Pfeiltasten navigierbar
-rw-r--r-- | application/modules/fbgui/controllers/IndexController.php | 4 | ||||
-rw-r--r-- | application/modules/fbgui/layouts/rz.phtml | 6 | ||||
-rw-r--r-- | application/modules/fbgui/views/scripts/index/index.phtml | 25 |
3 files changed, 30 insertions, 5 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index 2da3a6c..c27fb10 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -23,7 +23,9 @@ class Fbgui_IndexController extends Zend_Controller_Action public function indexAction() { - $_POST = $_SESSION['postdata']; + if(isset($_SESSION['postdata'])){ + $_POST = ($_SESSION['postdata']); + } if(isset($_POST['bootisoID']) || isset($_POST['serialnumber'])){ // Create a session $n = new Pbs_Session(); diff --git a/application/modules/fbgui/layouts/rz.phtml b/application/modules/fbgui/layouts/rz.phtml index 6ea324c..5945695 100644 --- a/application/modules/fbgui/layouts/rz.phtml +++ b/application/modules/fbgui/layouts/rz.phtml @@ -19,7 +19,7 @@ echo $this->headScript()."\n"; <script src='/media/js/jquery.mousewheel.js'></script> <script src='/media/js/jquery.keyboard.js'></script> -<script src='/media/js/jquery.keyboard.extension-typing.js'></script> +<script src='/media/js/jquery.keyboard.extension-typing.js'></script> <link href="/media/css/keyboard.css" media="screen" rel="stylesheet" type="text/css" /> <script type="text/javascript"> @@ -31,10 +31,10 @@ function toggleKeyboard(onoff){ } else{ $('#email').removeClass('qwerty ui-keyboard-input ui-widget-content ui-corner-all').unbind(); - $('#pass').removeClass('qwerty ui-keyboard-input ui-widget-content ui-corner-all').unbind(); - + $('#pass').removeClass('qwerty ui-keyboard-input ui-widget-content ui-corner-all').unbind(); } } + </script> </head> diff --git a/application/modules/fbgui/views/scripts/index/index.phtml b/application/modules/fbgui/views/scripts/index/index.phtml index 0c98c2f..f12e93c 100644 --- a/application/modules/fbgui/views/scripts/index/index.phtml +++ b/application/modules/fbgui/views/scripts/index/index.phtml @@ -1,5 +1,6 @@ <?php if(isset($this->entries)):?> <script type="text/javascript"> + var activeElement = 0; $(document).ready(function(){ $('.menu').click(function(){ $('.menu').removeClass('selected'); @@ -7,7 +8,7 @@ $("#selectedBootOs").val($(this).find('.id').val()); $("#startball").attr('src','/media/img/button-green.png'); }); - $('.menu').eq('0').click(); + $('.menu').eq(activeElement).click(); $('#startbutton').focus(); $('.menu').dblclick(function(){ $('.menu').removeClass('selected'); @@ -16,6 +17,28 @@ $("#startball").attr('src','/media/img/button-green.png'); start(); }); + + $(function() { + $(document).keyup(function (event) { + //console.log(activeElement); + if (event.keyCode == 38) { + // up + if(activeElement >=1) + activeElement = activeElement-1; + $('.menu').eq(activeElement).click(); + $('#startbutton').focus(); + + } else if (event.keyCode == 40) { + // Down + if(activeElement < $('.menu').length-1 ) + activeElement = activeElement+1; + $('.menu').eq(activeElement).click(); + $('#startbutton').focus(); + } + //console.log(activeElement); + }); + }); + }); function start(){ if($('#selectedBootOs').val() != ''){ |