Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue 5803: link logged-events with event target

  • Loading branch information...
commit e78df6a40cf28bdd13c3db988c8d6a0cddb29ba4 1 parent 49b5d9e
Jan Odvarko janodvarko authored
32 extension/content/firebug/chrome/reps.js
View
@@ -1588,14 +1588,27 @@ FirebugReps.Window = domplate(Firebug.Rep,
FirebugReps.Event = domplate(Firebug.Rep,
{
- tag: TAG("$copyEventTag", {object: "$object|copyEvent"}),
+ className: "event",
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ tag:
+ TAG("$copyEventTag", {object: "$object|copyEvent"}),
copyEventTag:
- OBJECTLINK("$object|summarizeEvent"),
+ SPAN(
+ OBJECTLINK("$object|summarizeEvent"),
+ SPAN("&nbsp"),
+ SPAN("»"),
+ SPAN("&nbsp"),
+ TAG("$object|getTargetTag", {object: "$object|getTarget"})
+ ),
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
summarizeEvent: function(event)
{
- var info = [event.type, ' '];
+ var info = [event.type, " "];
var eventFamily = Events.getEventFamily(event.type);
if (eventFamily == "mouse")
@@ -1606,6 +1619,17 @@ FirebugReps.Event = domplate(Firebug.Rep,
return info.join("");
},
+ getTarget: function(event)
+ {
+ return event.target;
+ },
+
+ getTargetTag: function(event)
+ {
+ var rep = Firebug.getRep(event.target);
+ return rep.shortTag ? rep.shortTag : rep.tag;
+ },
+
copyEvent: function(event)
{
return new Dom.EventCopy(event);
@@ -1613,8 +1637,6 @@ FirebugReps.Event = domplate(Firebug.Rep,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
- className: "object",
-
supportsObject: function(object, type)
{
return object instanceof window.Event || object instanceof Dom.EventCopy;
29 extension/content/firebug/console/eventMonitor.js
View
@@ -52,7 +52,12 @@ Firebug.EventMonitor = Obj.extend(Firebug.Module,
if (object && object.addEventListener)
{
if (!context.onMonitorEvent)
- context.onMonitorEvent = function(event) { Firebug.Console.log(event, context); };
+ {
+ var self = this;
+ context.onMonitorEvent = function(event) {
+ self.onMonitorEvent(event, context);
+ };
+ }
if (!context.eventsMonitored)
context.eventsMonitored = [];
@@ -88,7 +93,7 @@ Firebug.EventMonitor = Obj.extend(Firebug.Module,
if (eventsMonitored[j].object == object && eventsMonitored[j].type == eventTypes[i])
{
eventsMonitored.splice(j, 1);
-
+
Events.removeEventListener(object, eventTypes[i], context.onMonitorEvent, false);
break;
}
@@ -127,18 +132,32 @@ Firebug.EventMonitor = Obj.extend(Firebug.Module,
if (!monitored)
{
if (FBTrace.DBG_EVENTS)
- FBTrace.sysout("EventMonitor.areEventsMonitored - Events not monitored for '"+eventTypes[i]+"'");
-
+ {
+ FBTrace.sysout("EventMonitor.areEventsMonitored - Events not monitored for '" +
+ eventTypes[i] + "'");
+ }
+
return false;
}
else
{
if (FBTrace.DBG_EVENTS)
- FBTrace.sysout("EventMonitor.areEventsMonitored - Events monitored for '"+eventTypes[i]+"'");
+ {
+ FBTrace.sysout("EventMonitor.areEventsMonitored - Events monitored for '" +
+ eventTypes[i] + "'");
+ }
}
}
return true;
+ },
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Logging
+
+ onMonitorEvent: function(event, context)
+ {
+ Firebug.Console.log(event, context);
}
});
2  extension/skin/classic/console.css
View
@@ -1,4 +1,3 @@
-/* See license.txt for terms of usage */
.panelNode-console {
overflow-x: hidden;
@@ -448,6 +447,7 @@
/*************************************************************************************************/
+.objectLink-event,
.objectLink-regexp,
.objectLink-Storage,
.objectLink-object,
Please sign in to comment.
Something went wrong with that request. Please try again.