From 624cbcae5c9b5bcedf03c77460b07eb20fbb2366 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 20 Apr 2011 13:08:33 +0200 Subject: Automatischer Start nach x Sekunden hinzugefügt --- .../modules/fbgui/controllers/IndexController.php | 1 + .../modules/fbgui/views/scripts/index/index.phtml | 55 +++++++++++++++++++++- .../user/controllers/BootmenuController.php | 2 +- application/modules/user/forms/Bootmenu.php | 8 ++++ .../user/views/scripts/bootmenu/index.phtml | 3 +- 5 files changed, 65 insertions(+), 4 deletions(-) (limited to 'application/modules') diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index 17d9337..150f1c5 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -117,6 +117,7 @@ class Fbgui_IndexController extends Zend_Controller_Action $bootmenuMapper = new Application_Model_BootMenuMapper(); $bm = $bootmenuMapper->find($bootmenuID); $this->view->title = $bm->getTitle(); + $this->view->startcounter = $bm->getStartcounter(); $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper(); $res = $bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID),false); diff --git a/application/modules/fbgui/views/scripts/index/index.phtml b/application/modules/fbgui/views/scripts/index/index.phtml index 2454d45..8a5f0e6 100644 --- a/application/modules/fbgui/views/scripts/index/index.phtml +++ b/application/modules/fbgui/views/scripts/index/index.phtml @@ -26,6 +26,9 @@ }); $(function() { + $(document).click(function(){ + abortStartcount = true; + }) $(document).keyup(function (event) { if (event.keyCode == 38) { // up @@ -41,9 +44,29 @@ // Down $('#startbutton').click(); } + abortStartcount = true; }); }); + decreaseDown(); }); + function decreaseDown(){ + var act = parseInt($('.startcounter').html()); + if(act == 0){ + start(); + return; + } + var next = act-1; + $('.startcounter').html(next); + if(next == 0){ + start(); + } + if(next > 0 && abortStartcount == false){ + setTimeout('decreaseDown()',1000); + } + if(abortStartcount == true){ + $('.startcounter').parent().fadeOut(); + } + } function start(){ if($('#selectedBootOs').val() != ''){ if($('#selectedBootOs').val() == 'login'){ @@ -79,6 +102,7 @@