GUI -- TopoView - Implemented much of the node selection logic. (WIP)
- introduced topoSelect.js.

Change-Id: Ic843c7d8dc2249fe0cb8c33de60dce12c07aea44
diff --git a/web/gui/src/main/webapp/app/view/topo/topo.js b/web/gui/src/main/webapp/app/view/topo/topo.js
index a512704..a835d6b 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -66,7 +66,7 @@
 
             //E: [equalizeMasters, 'Equalize mastership roles'],
 
-            //esc: handleEscape,
+            esc: handleEscape,
 
             _helpFormat: [
                 ['O', 'I', 'D', '-', 'H', 'M', 'B', 'P' ],
@@ -85,12 +85,29 @@
         ];
     }
 
+    // --- Keystroke functions -------------------------------------------
 
     function toggleInstances() {
         tis.toggle();
         tfs.updateDeviceColors();
     }
 
+    function resetZoom() {
+        zoomer.reset();
+    }
+
+    function handleEscape() {
+        $log.debug("TODO: handle-ESCAPE...");
+        // if showingAffinity: cancelAffinity
+
+        // else if showingDetails: deselectAll
+
+        // else if oiBox visible: hide oiBox
+
+        // else if summary panel visible: cancel Summary
+
+        // else: hoverMode = hoverModeNone
+    }
 
     // --- Glyphs, Icons, and the like -----------------------------------
 
@@ -124,10 +141,6 @@
         });
     }
 
-    function resetZoom() {
-        zoomer.reset();
-    }
-
 
     // callback invoked when the SVG view has been resized..
     function svgResized(s) {