[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14804 - gauger
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14804 - gauger |
Date: |
Thu, 31 Mar 2011 17:47:51 +0200 |
Author: bartpolot
Date: 2011-03-31 17:47:51 +0200 (Thu, 31 Mar 2011)
New Revision: 14804
Modified:
gauger/template.php
gauger/template_menu.php
Log:
Fix empty set of hosts and metrics on f5 reload
Modified: gauger/template.php
===================================================================
--- gauger/template.php 2011-03-31 15:35:00 UTC (rev 14803)
+++ gauger/template.php 2011-03-31 15:47:51 UTC (rev 14804)
@@ -39,6 +39,7 @@
var inst_search;
var last_search = "";
var field_search;
+ var search_prompt = "Search...";
$(document).ready(function() {
$( ".slider-range" ).slider({
@@ -307,7 +308,7 @@
}
});
$( ".instant_search" ).focus(function(){
- if(this.value=="Search..."){
+ if(this.value==search_prompt){
this.value="";
}
field_search = this;
@@ -316,20 +317,22 @@
});
$( ".instant_search" ).blur(function(){
if(this.value==""){
- this.value="Search...";
+ this.value=search_prompt;
}
clearInterval(inst_search);
});
$( ".instant_search" ).each(function(){
- if($.cookie(this.id)){
- this.value = $.cookie(this.id);
+ value = $.cookie(this.id);
+ if(value && value != search_prompt){
+ this.value = value;
field_search = this;
monitor_search();
} else {
last_search = " ";
field_search = this;
monitor_search();
- this.value = "Search...";
+ this.value = search_prompt;
+ $.cookie(this.id, null);
}
});
$("#metrics ul").each(function(){
@@ -338,7 +341,6 @@
$(this).parents(".metric").find("img").attr("src",
"images/expand.png");
}
});
-
});
function get_command(element) {
@@ -349,6 +351,7 @@
function monitor_search() {
text = $( field_search ).val();
if(text == last_search) return;
+ if(text == search_prompt) text = '';
last_search = text;
$.cookie(field_search.id, text);
if(!$.browser.msie) { /* SORRY, BUT IE IS *SLOW* WITH JQUERY */
@@ -376,6 +379,12 @@
$( "#debug" ).html($( "#debug" ).html() + param + ' ');
}
+ function reset_session() {
+ $.cookie('instant_search_hosts', null);
+ $.cookie('instant_search_metrics', null);
+ document.location = '?logout=1';
+ }
+
</script>
</head>
Modified: gauger/template_menu.php
===================================================================
--- gauger/template_menu.php 2011-03-31 15:35:00 UTC (rev 14803)
+++ gauger/template_menu.php 2011-03-31 15:47:51 UTC (rev 14804)
@@ -50,5 +50,5 @@
<div class="right-range"><?php echo
get_session('png_y_size', '480') ?></div>
<div class="slider" id="change_size_y_slider"></div>
</div> |
- <a href="?logout=1">Reset Session</a>
+ <a href="#" onclick="reset_session(); return false;">Reset
Session</a>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14804 - gauger,
gnunet <=