diff options
Diffstat (limited to 'application/modules/fbgui')
| -rw-r--r-- | application/modules/fbgui/controllers/IndexController.php | 1 | ||||
| -rw-r--r-- | application/modules/fbgui/views/scripts/index/index.phtml | 55 |
2 files changed, 54 insertions, 2 deletions
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 @@ <?php endif;?> <script type="text/javascript"> var activeElement = 0; + var abortStartcount = false; $(document).ready(function(){ $('.selectswitch').click(function(){ $('.selectswitch').removeClass('selected'); @@ -97,6 +121,9 @@ }); $(function() { + $(document).click(function(){ + abortStartcount = true; + }) $(document).keyup(function (event) { if (event.keyCode == 38) { // up @@ -112,10 +139,31 @@ // Down $('#startbutton').click(); } + abortStartcount = true; }); }); - + <?php if(count($this->entries) > 0): ?> + decreaseDown() + <?php endif; ?> }); + 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'){ @@ -132,6 +180,9 @@ } </script> <h1><?php echo $this->title;?></h1> + <?php if(count($this->entries) > 0): ?> + <div style='padding:5px;float:right;'>Starting in <span class='startcounter'><?php echo $this->startcounter; ?></span> seconds</div> + <?php endif; ?> <div class='bootmenu'> <?php $first = true; ?> @@ -149,7 +200,7 @@ <input type="hidden" class="id" value="<?php echo $entry->getID();?>"/> </div> <?php endforeach; ?> - </div> + </div> <input style="display:none;" type='text' id="selectedBootOs" /> <button onClick="start();" id='startbutton' class="fbguistart" style='font-size:16px;font-weight:bold;margin-bottom:5px;'> Start System |
