diff options
| author | Simon | 2011-04-20 13:08:33 +0200 |
|---|---|---|
| committer | Simon | 2011-04-20 13:08:33 +0200 |
| commit | 624cbcae5c9b5bcedf03c77460b07eb20fbb2366 (patch) | |
| tree | 8a768c4f55d982384982f3c541b1d4b8d319ca96 /application/modules/fbgui/views | |
| parent | Ticket #229 - Hilfetexte wurde bei den Bereichen, zu denen Benutzer zugriff h... (diff) | |
| download | pbs2-624cbcae5c9b5bcedf03c77460b07eb20fbb2366.tar.gz pbs2-624cbcae5c9b5bcedf03c77460b07eb20fbb2366.tar.xz pbs2-624cbcae5c9b5bcedf03c77460b07eb20fbb2366.zip | |
Automatischer Start nach x Sekunden hinzugefügt
Diffstat (limited to 'application/modules/fbgui/views')
| -rw-r--r-- | application/modules/fbgui/views/scripts/index/index.phtml | 55 |
1 files changed, 53 insertions, 2 deletions
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 |
