Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Issue 5803: link logged-events with event target

  • Loading branch information...
commit e78df6a40cf28bdd13c3db988c8d6a0cddb29ba4 1 parent 49b5d9e
Jan Odvarko authored August 13, 2012
32  extension/content/firebug/chrome/reps.js
@@ -1588,14 +1588,27 @@ FirebugReps.Window = domplate(Firebug.Rep,
1588 1588
 
1589 1589
 FirebugReps.Event = domplate(Firebug.Rep,
1590 1590
 {
1591  
-    tag: TAG("$copyEventTag", {object: "$object|copyEvent"}),
  1591
+    className: "event",
  1592
+
  1593
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  1594
+
  1595
+    tag:
  1596
+        TAG("$copyEventTag", {object: "$object|copyEvent"}),
1592 1597
 
1593 1598
     copyEventTag:
1594  
-        OBJECTLINK("$object|summarizeEvent"),
  1599
+        SPAN(
  1600
+            OBJECTLINK("$object|summarizeEvent"),
  1601
+            SPAN("&nbsp"),
  1602
+            SPAN("»"),
  1603
+            SPAN("&nbsp"),
  1604
+            TAG("$object|getTargetTag", {object: "$object|getTarget"})
  1605
+        ),
  1606
+
  1607
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1595 1608
 
1596 1609
     summarizeEvent: function(event)
1597 1610
     {
1598  
-        var info = [event.type, ' '];
  1611
+        var info = [event.type, " "];
1599 1612
 
1600 1613
         var eventFamily = Events.getEventFamily(event.type);
1601 1614
         if (eventFamily == "mouse")
@@ -1606,6 +1619,17 @@ FirebugReps.Event = domplate(Firebug.Rep,
1606 1619
         return info.join("");
1607 1620
     },
1608 1621
 
  1622
+    getTarget: function(event)
  1623
+    {
  1624
+        return event.target;
  1625
+    },
  1626
+
  1627
+    getTargetTag: function(event)
  1628
+    {
  1629
+        var rep = Firebug.getRep(event.target);
  1630
+        return rep.shortTag ? rep.shortTag : rep.tag;
  1631
+    },
  1632
+
1609 1633
     copyEvent: function(event)
1610 1634
     {
1611 1635
         return new Dom.EventCopy(event);
@@ -1613,8 +1637,6 @@ FirebugReps.Event = domplate(Firebug.Rep,
1613 1637
 
1614 1638
     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1615 1639
 
1616  
-    className: "object",
1617  
-
1618 1640
     supportsObject: function(object, type)
1619 1641
     {
1620 1642
         return object instanceof window.Event || object instanceof Dom.EventCopy;
29  extension/content/firebug/console/eventMonitor.js
@@ -52,7 +52,12 @@ Firebug.EventMonitor = Obj.extend(Firebug.Module,
52 52
         if (object && object.addEventListener)
53 53
         {
54 54
             if (!context.onMonitorEvent)
55  
-                context.onMonitorEvent = function(event) { Firebug.Console.log(event, context); };
  55
+            {
  56
+                var self = this;
  57
+                context.onMonitorEvent = function(event) {
  58
+                    self.onMonitorEvent(event, context);
  59
+                };
  60
+            }
56 61
 
57 62
             if (!context.eventsMonitored)
58 63
                 context.eventsMonitored = [];
@@ -88,7 +93,7 @@ Firebug.EventMonitor = Obj.extend(Firebug.Module,
88 93
                 if (eventsMonitored[j].object == object && eventsMonitored[j].type == eventTypes[i])
89 94
                 {
90 95
                     eventsMonitored.splice(j, 1);
91  
-    
  96
+
92 97
                     Events.removeEventListener(object, eventTypes[i], context.onMonitorEvent, false);
93 98
                     break;
94 99
                 }
@@ -127,18 +132,32 @@ Firebug.EventMonitor = Obj.extend(Firebug.Module,
127 132
             if (!monitored)
128 133
             {
129 134
                 if (FBTrace.DBG_EVENTS)
130  
-                    FBTrace.sysout("EventMonitor.areEventsMonitored - Events not monitored for '"+eventTypes[i]+"'");
131  
-                
  135
+                {
  136
+                    FBTrace.sysout("EventMonitor.areEventsMonitored - Events not monitored for '" +
  137
+                        eventTypes[i] + "'");
  138
+                }
  139
+
132 140
                 return false;
133 141
             }
134 142
             else
135 143
             {
136 144
                 if (FBTrace.DBG_EVENTS)
137  
-                    FBTrace.sysout("EventMonitor.areEventsMonitored - Events monitored for '"+eventTypes[i]+"'");
  145
+                {
  146
+                    FBTrace.sysout("EventMonitor.areEventsMonitored - Events monitored for '" +
  147
+                        eventTypes[i] + "'");
  148
+                }
138 149
             }
139 150
         }
140 151
 
141 152
         return true;
  153
+    },
  154
+
  155
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  156
+    // Logging
  157
+
  158
+    onMonitorEvent: function(event, context)
  159
+    {
  160
+        Firebug.Console.log(event, context);
142 161
     }
143 162
 });
144 163
 
2  extension/skin/classic/console.css
... ...
@@ -1,4 +1,3 @@
1  
-/* See license.txt for terms of usage */
2 1
 
3 2
 .panelNode-console {
4 3
     overflow-x: hidden;
@@ -448,6 +447,7 @@
448 447
 
449 448
 /*************************************************************************************************/
450 449
 
  450
+.objectLink-event,
451 451
 .objectLink-regexp,
452 452
 .objectLink-Storage,
453 453
 .objectLink-object,

0 notes on commit e78df6a

Please sign in to comment.
Something went wrong with that request. Please try again.