[rhmessaging-commits] rhmessaging commits: r3265 - mgmt/trunk/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Apr 3 16:17:48 EDT 2009


Author: eallen
Date: 2009-04-03 16:17:47 -0400 (Fri, 03 Apr 2009)
New Revision: 3265

Modified:
   mgmt/trunk/cumin/python/cumin/visualizations.strings
Log:
Job related fixes

Modified: mgmt/trunk/cumin/python/cumin/visualizations.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/visualizations.strings	2009-04-03 18:21:45 UTC (rev 3264)
+++ mgmt/trunk/cumin/python/cumin/visualizations.strings	2009-04-03 20:17:47 UTC (rev 3265)
@@ -188,7 +188,7 @@
 
         this.zoom_in_slots = function (posxy) {
             if (slot_zoom >= get_max_zoom()) return;
-            var click_info = get_index(posxy.x, posxy.y);
+            var click_info = vis.get_index(posxy.x, posxy.y);
             slot_center_index = click_info.index;
             do_zoom(slot_zoom + 1);
         }
@@ -199,6 +199,18 @@
             do_info_request(index);
         }
 
+        this.get_index = function (x, y) {
+            var width = slot_map_info.size;
+            var pngrow = Math.floor((y - slot_clip_top) / width);
+            var pngcol = Math.floor((x - slot_clip_left) / width);
+            if ((pngcol < slot_map_info.cols) && (pngrow < slot_map_info.rows)) {
+                var index = pngrow * slot_map_info.cols + pngcol;
+                if (index < slot_map_info.count)
+                    return {"index": index, "row": pngrow, "col": pngcol};
+            }
+            return null;
+        }
+
     }
 
     function slot_zoom_to(e) {
@@ -467,28 +479,15 @@
     }
 
     function hide_info() {
-        oInfo = get_slot_info_elem();
+        oInfo = $(slot_info_id);
         if (oInfo) {
             oInfo.style.visibility = "hidden";
         }
         slot_last_index = -1;
     }
 
-    function get_index(x, y) {
-        var width = slot_map_info.size;
-        var pngrow = Math.floor((y - slot_clip_top) / width);
-        var pngcol = Math.floor((x - slot_clip_left) / width);
-        if ((pngcol < slot_map_info.cols) && (pngrow < slot_map_info.rows)) {
-            var index = pngrow * slot_map_info.cols + pngcol;
-            if (index < slot_map_info.count)
-                return {"index": index, "row": pngrow, "col": pngcol};
-        }
-        return null;
-    }
-
     function get_slot_info(rx, ry) {
-
-        var click_info = get_index(rx, ry);
+        var click_info = vis.get_index(rx, ry);
         if (click_info) {
             if (click_info.index != slot_last_index) {
                 if (slot_info_timer) {
@@ -501,7 +500,7 @@
                 }
                 slot_info_timer = setTimeout( function() { vis.fire_slot_info(click_info.index) }, 500);
                 animate_hover(0, click_info.row, click_info.col);
-                oInfo = get_slot_info_elem();
+                oInfo = $(slot_info_id);
                 if (oInfo) {
                     oInfo.style.display = "none";
                 }
@@ -554,10 +553,6 @@
         }
     }
 
-    function get_slot_info_elem() {
-        return document.getElementById(slot_info_id);
-    }
-
     function refire_info() {
         if (slot_last_index > -1) {
             do_info_request(slot_last_index)
@@ -573,7 +568,7 @@
 
     function got_slot_info(xhtml, args) {
         if (slot_last_index == -1) return;
-        var oInfo = get_slot_info_elem();
+        var oInfo = $(slot_info_id);
         var for_jid = null;
         if (oInfo) {
             oInfo.style.display = "none";
@@ -583,7 +578,7 @@
             }
         }
         wooly.updatePage(xhtml);
-        var oInfo = get_slot_info_elem();
+        var oInfo = $(slot_info_id);
         if (oInfo) {
             oInfo.click_index = args.index;
             oInfo.for_jid = null;
@@ -615,13 +610,13 @@
                     // position popup above clicked slot
                     top = (abs_pos.y + y) - oInfo.offsetHeight - Math.floor(slot_map_info.size * .5);
                 }
-                
+
                 // if off the top of the page
                 if (top < 0) {
                     // revert to under the item
                     top = topUnder;
                 }
-                
+
                 oInfo.style.top = top + "px";
                 oInfo.style.left = abs_pos.x + "px";
             }
@@ -650,10 +645,10 @@
                if (hadDoubleClick()) return false;
                // Otherwise set timer to act.  It may be preempted by a doubleclick.
                d = new Date();
-               this.click_when = d.getTime();
+               clicks.click_when = d.getTime();
                 var rpos = get_relative_event_pos(e);
                 if (rpos) {
-                    this.click_handle = setTimeout( function() {clicks.doClick(rpos.x, rpos.y)}, 250);
+                    clicks.click_handle = setTimeout( function() {clicks.doClick(rpos.x, rpos.y)}, 250);
                     break;
                 }
              case "dblclick":
@@ -675,8 +670,8 @@
                     return false;
                 }
             }
-            var click_info = get_index(x, y);
-            var oInfo = get_slot_info_elem();
+            var click_info = vis.get_index(x, y);
+            var oInfo = $(slot_info_id);
             if (oInfo && click_info) {
                 if ((typeof oInfo.click_index != "undefined") &&
                     (oInfo.click_index == click_info.index)) {




More information about the rhmessaging-commits mailing list