gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r15003 - in gauger: . css


From: gnunet
Subject: [GNUnet-SVN] r15003 - in gauger: . css
Date: Fri, 15 Apr 2011 17:59:53 +0200

Author: bartpolot
Date: 2011-04-15 17:59:53 +0200 (Fri, 15 Apr 2011)
New Revision: 15003

Modified:
   gauger/css/style.css
   gauger/template.php
   gauger/template_host.php
Log:
Fixed behavior in host view, when manipulating added metrics with same unit as 
main metric


Modified: gauger/css/style.css
===================================================================
--- gauger/css/style.css        2011-04-15 15:16:10 UTC (rev 15002)
+++ gauger/css/style.css        2011-04-15 15:59:53 UTC (rev 15003)
@@ -356,13 +356,18 @@
     margin:             5px 0px 5px 0px;
 }
 
+.add-metric {
+    width:              95px;
+    margin-bottom:      5px;
+}
+
 .same-unit-metric {
     background:         #0F0;
     color:              #000;
 }
 
 .second-unit-metric {
-    background:         #8F0;
+    background:         #AF0;
     color:              #000;
 }
 

Modified: gauger/template.php
===================================================================
--- gauger/template.php 2011-04-15 15:16:10 UTC (rev 15002)
+++ gauger/template.php 2011-04-15 15:59:53 UTC (rev 15003)
@@ -401,14 +401,17 @@
                             <a href="index.php?graph=' + x + '" title="[' + 
get_category(x) + '] ' + get_name(x) + '">' + get_name(x) + '</a>\
                         </li>'
                     );
+                    u0 = 
get_unit($(this).parents("tr").find("option.same-unit-metric").val());
+                    if(get_unit(x) != u0) {
+                        
$(this).parents("tr").find("option:not(.same-unit-metric)").each(function() {
+                            if(get_unit(this.value) == get_unit(x)) {
+                                $(this).addClass('second-unit-metric');
+                            } else {
+                                $(this).addClass('incompatible-unit-metric');
+                            }
+                        });
+                    }
                     $(this).parents("tr").find("option[value=" + x + 
"]").remove();
-                    
$(this).parents("tr").find("option:not(.same-unit-metric)").each(function() {
-                        if(get_unit(this.value) == get_unit(x)) {
-                            $(this).addClass('second-unit-metric');
-                        } else {
-                            $(this).addClass('incompatible-unit-metric');
-                        }
-                    });
                     $(this).parents("tr").find(".plot").each(function() {
                         this.src = this.src.replace(/(g=[^&]+)/g, '$1,'+x);
                     });
@@ -419,14 +422,20 @@
             var graphs = "";
             var sep = "";
             var x = null;
+            var x0 = null;
             var links = 
$(that).parents("ul").find(".added-metric:checked").parents("li").find("a").get().reverse();
             for(i in links) {
                 graph = "" + links[i];
                 graph = graph.replace(/.*graph=([^&]+).*/g, "$1");
                 graphs += sep + graph;
-                if(x == null && i != 0) {
-                    x = graph;
-                    debug(x);
+                if(x == null) {
+                    if(i == 0) {
+                        x0 = graph;
+                    } else {
+                        if(get_unit(graph) != get_unit(x0)) {
+                            x = graph;
+                        }
+                    }
                 }
                 sep = ",";
             }

Modified: gauger/template_host.php
===================================================================
--- gauger/template_host.php    2011-04-15 15:16:10 UTC (rev 15002)
+++ gauger/template_host.php    2011-04-15 15:59:53 UTC (rev 15003)
@@ -94,7 +94,7 @@
                     </option>
                     <?php endif; ?>
                 <?php endforeach; ?>
-                </select>
+                </select><br/>
                 <input type="button" value="Add" class="add-metric"></input>
                 <br/>
                 <p class="same-unit-metric">Same unit</p>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]