dbus-vis: fix errors and clean up preload.js

This change fixes two errors and does some clean-up:

1. After updating Electron to 11.5.0, "enableRemoteModule: true" is
needed for require('electron').remote to work.

2. Add handler for stderr in parsing output

Sometimes when a Malformed packet is encountered, the error message does
not get out and the parsing process gets stuck. Adding the handlers can
enable the processes to continue executing in these situations.

3. Removed the unused "preload.js" file.

4. Now clicking the time line after panning the time axis will not cause
an accidental zoom-in to an interval starting with -999.

The cause of this bug is due to HighlightedRegion.t1 being set to the
current mouse location by the OnMouseMove function. This can be
fixed by ensuring that MouseState.hoveredSide must be "timeline".

Signed-off-by: Sui Chen <suichen@google.com>
Change-Id: Ib07cf7a33591ee506ab502b206f0351063ef6eea
diff --git a/dbus-vis/ipmi_timeline_vis.js b/dbus-vis/ipmi_timeline_vis.js
index 64af5fc..0b3aa74 100644
--- a/dbus-vis/ipmi_timeline_vis.js
+++ b/dbus-vis/ipmi_timeline_vis.js
@@ -575,7 +575,12 @@
   x: 0,
   y: 0,
   hoveredVisibleLineIndex: -999,
-  hoveredSide: undefined
+  hoveredSide: undefined,
+  IsHoveredOverHorizontalScrollbar: function() {
+    if (this.hoveredSide == "top_horizontal_scrollbar") return true;
+    else if (this.hoveredSide == "bottom_horizontal_scrollbar") return true;
+    else return false;
+  }
 };
 let Canvas = document.getElementById('my_canvas_ipmi');
 
@@ -583,7 +588,8 @@
   const v = ipmi_timeline_view;
   v.MouseState.x = event.pageX - this.offsetLeft;
   v.MouseState.y = event.pageY - this.offsetTop;
-  if (v.MouseState.pressed == true) {  // Update highlighted area
+  if (v.MouseState.pressed == true &&
+      v.MouseState.hoveredSide == 'timeline') {  // Update highlighted area
     v.HighlightedRegion.t1 = v.MouseXToTimestamp(v.MouseState.x);
   }
   v.OnMouseMove();
@@ -592,7 +598,8 @@
   v.linked_views.forEach(function(u) {
     u.MouseState.x = event.pageX - Canvas.offsetLeft;
     u.MouseState.y = 0;                  // Do not highlight any entry
-    if (u.MouseState.pressed == true) {  // Update highlighted area
+    if (u.MouseState.pressed == true &&
+        u.MouseState.hoveredSide == 'timeline') {  // Update highlighted area
       u.HighlightedRegion.t1 = u.MouseXToTimestamp(u.MouseState.x);
     }
     u.OnMouseMove();