Skip to content

Commit 551cdfa

Browse files
author
Chris K
committed
Added event listener sidepanel.
1 parent f43682d commit 551cdfa

File tree

9 files changed

+347
-57
lines changed

9 files changed

+347
-57
lines changed

src/build-application/build_ecmascript_debugger_6_0.js

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
window.app.builders.EcmascriptDebugger || (window.app.builders.EcmascriptDebugger = {});
44

55
/**
6-
* @param {Object} service. The service description of
6+
* @param {Object} service. The service description of
77
* the according service on the host side.
88
*/
99

@@ -41,15 +41,15 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
4141
/* ECMA object inspection */
4242
var BaseView = new namespace.InspectionBaseView();
4343
namespace.InspectionView.prototype = BaseView;
44-
new namespace.InspectionView('inspection',
45-
ui_strings.M_VIEW_LABEL_FRAME_INSPECTION,
44+
new namespace.InspectionView('inspection',
45+
ui_strings.M_VIEW_LABEL_FRAME_INSPECTION,
4646
'scroll mono');
4747
namespace.InspectionView.create_ui_widgets();
4848

4949
/* DOM object inspection */
5050
namespace.DOMAttrsView.prototype = BaseView;
51-
new namespace.DOMAttrsView('dom_attrs',
52-
ui_strings.M_VIEW_LABEL_DOM_ATTR,
51+
new namespace.DOMAttrsView('dom_attrs',
52+
ui_strings.M_VIEW_LABEL_DOM_ATTR,
5353
'scroll dom-attrs mono');
5454
namespace.DOMAttrsView.create_ui_widgets();
5555

@@ -65,42 +65,42 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
6565
new cls.CommandLineRuntimeSelect('cmd-runtime-select', 'cmd-line-runtimes');
6666

6767
cls.ReplView.create_ui_widgets();
68-
new cls.ReplView('command_line',
69-
ui_strings.M_VIEW_LABEL_COMMAND_LINE,
70-
'scroll console mono',
68+
new cls.ReplView('command_line',
69+
ui_strings.M_VIEW_LABEL_COMMAND_LINE,
70+
'scroll console mono',
7171
'', 'repl-focus');
7272

7373
/* JS source */
7474
window.simple_js_parser = new window.cls.SimpleJSParser();
75-
new cls.JsSourceView('js_source',
75+
new cls.JsSourceView('js_source',
7676
ui_strings.M_VIEW_LABEL_SOURCE,
7777
'scroll js-source mono');
7878
new cls.ScriptSelect('js-script-select', 'script-options');
7979
cls.JsSourceView.create_ui_widgets();
8080

8181
/* Watches */
8282
cls.WatchesView.prototype = ViewBase;
83-
new cls.WatchesView('watches',
83+
new cls.WatchesView('watches',
8484
ui_strings.M_VIEW_LABEL_WATCHES,
8585
'scroll mono');
86-
86+
8787
/* Runtime State */
88-
new cls.JSSidePanelView('scripts-side-panel',
88+
new cls.JSSidePanelView('scripts-side-panel',
8989
ui_strings.M_VIEW_LABEL_RUNTIME_STATE,
9090
['watches', 'callstack', 'inspection'],
9191
// default expanded flags for the view list
9292
[false, true, true]);
9393

9494
/* Callstack */
9595
cls.CallstackView.prototype = ViewBase;
96-
new cls.CallstackView('callstack',
97-
ui_strings.M_VIEW_LABEL_CALLSTACK,
96+
new cls.CallstackView('callstack',
97+
ui_strings.M_VIEW_LABEL_CALLSTACK,
9898
'scroll mono');
9999

100100
/* Threads */
101101
cls.ThreadsView.prototype = ViewBase;
102-
new cls.ThreadsView('threads',
103-
ui_strings.M_VIEW_LABEL_THREAD_LOG,
102+
new cls.ThreadsView('threads',
103+
ui_strings.M_VIEW_LABEL_THREAD_LOG,
104104
'scroll threads');
105105
//cls.ThreadsView.create_ui_widgets();
106106

@@ -122,14 +122,14 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
122122

123123
/* CSS inspector */
124124
cls.CSSInspectorView.prototype = ViewBase;
125-
new cls.CSSInspectorView('css-inspector',
126-
ui_strings.M_VIEW_LABEL_STYLES,
125+
new cls.CSSInspectorView('css-inspector',
126+
ui_strings.M_VIEW_LABEL_STYLES,
127127
'scroll css-inspector mono');
128128
new cls.CSSInspectorView.create_ui_widgets();
129-
129+
130130
cls.CSSInspectorCompStyleView.prototype = ViewBase;
131-
new cls.CSSInspectorCompStyleView('css-comp-style',
132-
ui_strings.M_VIEW_LABEL_COMPUTED_STYLE,
131+
new cls.CSSInspectorCompStyleView('css-comp-style',
132+
ui_strings.M_VIEW_LABEL_COMPUTED_STYLE,
133133
'scroll css-inspector mono');
134134

135135
cls.NewStyle.prototype = ViewBase;
@@ -139,7 +139,7 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
139139
new cls.CSSInspectorActions('css-inspector');
140140

141141
/* DOM sidepanel */
142-
new cls.DOMSidePanelView('dom-side-panel',
142+
new cls.DOMSidePanelView('dom-side-panel',
143143
ui_strings.M_VIEW_LABEL_STYLES,
144144
['css-comp-style', 'css-inspector', 'new-style'],
145145
// default expanded flags for the view list
@@ -149,12 +149,12 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
149149
/* Layout */
150150
window.element_layout = new cls.ElementLayout();
151151
cls.CSSLayoutView.prototype = ViewBase;
152-
new cls.CSSLayoutView('css-layout',
153-
ui_strings.M_VIEW_LABEL_LAYOUT,
152+
new cls.CSSLayoutView('css-layout',
153+
ui_strings.M_VIEW_LABEL_LAYOUT,
154154
'scroll css-layout');
155155

156156
/* Runtime State */
157-
new cls.JSSidePanelView('breakpoints-side-panel',
157+
new cls.JSSidePanelView('breakpoints-side-panel',
158158
ui_strings.M_VIEW_LABEL_BREAKPOINTS,
159159
['breakpoints', 'event-breakpoints'],
160160
// default expanded flags for the view list
@@ -163,32 +163,41 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
163163
/* Event Breakpoints */
164164
window.event_breakpoints = cls.EventBreakpoints.get_instance();
165165
cls.EventBreakpointsView.prototype = ViewBase;
166-
new cls.EventBreakpointsView('event-breakpoints',
167-
ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS,
166+
new cls.EventBreakpointsView('event-breakpoints',
167+
ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS,
168168
'scroll event-breakpoints');
169169
cls.EventBreakpointsView.create_ui_widgets();
170170

171171
/* Breakpoints */
172172
cls.BreakpointsView.prototype = ViewBase;
173-
new cls.BreakpointsView('breakpoints',
174-
ui_strings.M_VIEW_LABEL_BREAKPOINTS,
173+
new cls.BreakpointsView('breakpoints',
174+
ui_strings.M_VIEW_LABEL_BREAKPOINTS,
175175
'scroll breakpoints mono');
176176
cls.BreakpointsView.create_ui_widgets();
177177

178178
/* JS Search */
179179
cls.JSSearchView.prototype = ViewBase;
180-
new cls.JSSearchView('js-search',
181-
ui_strings.M_VIEW_LABEL_SEARCH,
180+
new cls.JSSearchView('js-search',
181+
ui_strings.M_VIEW_LABEL_SEARCH,
182182
'scroll js-search');
183183

184184
/* Listeners */
185185
if (service_interface.satisfies_version(6, 11))
186186
{
187-
new cls.EventListenersView("ev-listeners",
188-
ui_strings.M_VIEW_LABEL_EVENT_LISTENERS,
189-
"ev-listeners scroll");
187+
new cls.SelectedNodeListenersView("ev-listeners-selected-node",
188+
ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE,
189+
"ev-listeners-selected-node scroll");
190+
new cls.EventListenersView("ev-listeners-all",
191+
ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL,
192+
"ev-listeners-all scroll");
193+
new cls.EventListenerSidePanelView("ev-listeners-side-panel",
194+
ui_strings.M_VIEW_LABEL_EVENT_LISTENERS,
195+
["ev-listeners-selected-node", "ev-listeners-all"],
196+
// default expanded flags for the view list
197+
[true, true]);
198+
cls.EventListenerSidePanelView.create_ui_widgets();
190199
}
191-
200+
192201
/* adjust the base class */
193202

194203
var StorageDataBase = new namespace.StorageDataBase();
@@ -217,14 +226,14 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
217226
'cookies',
218227
ui_strings.M_VIEW_LABEL_COOKIES));
219228

220-
new cls.StorageView("local_storage",
221-
ui_strings.M_VIEW_LABEL_LOCAL_STORAGE,
229+
new cls.StorageView("local_storage",
230+
ui_strings.M_VIEW_LABEL_LOCAL_STORAGE,
222231
"scroll storage_view local_storage",
223232
"local_storage");
224233
new cls.StorageViewActions("local_storage");
225234

226235
new cls.StorageView("session_storage",
227-
ui_strings.M_VIEW_LABEL_SESSION_STORAGE,
236+
ui_strings.M_VIEW_LABEL_SESSION_STORAGE,
228237
"scroll storage_view session_storage",
229238
"session_storage");
230239
new cls.StorageViewActions("session_storage");
@@ -235,8 +244,8 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
235244
"cookies");
236245
new cls.StorageViewActions("cookies");
237246

238-
new cls.StorageView("widget_preferences",
239-
ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES,
247+
new cls.StorageView("widget_preferences",
248+
ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES,
240249
"scroll storage_view widget_preferences",
241250
"widget_preferences");
242251
new cls.StorageViewActions("widget_preferences");
@@ -245,8 +254,8 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
245254

246255
/* Environment */
247256
cls.EnvironmentView.prototype = ViewBase;
248-
new cls.EnvironmentView('environment',
249-
ui_strings.M_VIEW_LABEL_ENVIRONMENT,
257+
new cls.EnvironmentView('environment',
258+
ui_strings.M_VIEW_LABEL_ENVIRONMENT,
250259
'scroll');
251260
cls.EnvironmentView.create_ui_widgets();
252261

@@ -257,7 +266,7 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
257266

258267
/* Hostspotlighter */
259268
cls.HostSpotlightView.prototype = ViewBase;
260-
new cls.HostSpotlightView('host-spotlight',
269+
new cls.HostSpotlightView('host-spotlight',
261270
ui_strings.S_LABEL_SPOTLIGHT_TITLE);
262271
cls.HostSpotlightView.create_ui_widgets();
263272

src/client-en.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ window.load_screen_timeout = window.setTimeout(function()
428428
<script src="./ecma-debugger/eventlisteners/evlistenersview.js"/>
429429
<script src="./ecma-debugger/eventlisteners/evlistenertooltip.js"/>
430430
<script src="./ecma-debugger/eventlisteners/evlistenertemplates.js"/>
431+
<script src="./ecma-debugger/eventlisteners/selectednodelistenerview.js"/>
432+
<script src="./ecma-debugger/eventlisteners/evlistenersidepanel.js"/>
431433

432434
<script src="./searches/jssearchview.js"/>
433435

src/client/client.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ window.cls.Client = function()
235235
"<div class='info-box'>" + msg +
236236
(port ? "<p><span class='ui-button' handler='cancel-remote-debug' tabindex='1'>" +
237237
ui_strings.S_BUTTON_CANCEL_REMOTE_DEBUG +
238-
"</span></p>"
238+
"</span></p>"
239239
: "") +
240240
"</div>" +
241241
"</div>";
@@ -274,9 +274,9 @@ window.cls.Client = function()
274274
{
275275
if (confirm(ui_strings.S_CONFIRM_LOAD_COMPATIBLE_VERSION))
276276
{
277-
location = protocol +
278-
hostname + port +
279-
fallback_urls[type][version] +
277+
location = protocol +
278+
hostname + port +
279+
fallback_urls[type][version] +
280280
file_name + search;
281281
}
282282
}
@@ -291,7 +291,7 @@ window.cls.Client = function()
291291

292292
this.handle_fallback = function(version)
293293
{
294-
handle_fallback.call(new XMLHttpRequest(), version);
294+
handle_fallback.call(new XMLHttpRequest(), version);
295295
};
296296

297297
this.create_top_level_views = function(services)
@@ -477,7 +477,7 @@ window.cls.Client = function()
477477
}
478478
else
479479
this._show_last_selected_view(last_selected_view);
480-
480+
481481
window.messages.removeListener("profile-enabled", this._on_profile_enabled_cb);
482482

483483
};
@@ -548,9 +548,15 @@ ui_framework.layouts.dom_rough_layout =
548548
tabs: function(services)
549549
{
550550
if (services['ecmascript-debugger'].satisfies_version(6, 11))
551-
return ['dom-side-panel', 'dom_attrs', 'css-layout', 'dom-search', 'ev-listeners'];
551+
{
552+
return ['dom-side-panel',
553+
'dom_attrs',
554+
'css-layout',
555+
'dom-search',
556+
'ev-listeners-side-panel'];
557+
}
552558

553-
return ['dom-side-panel', 'dom_attrs', 'css-layout'];
559+
return ['dom-side-panel', 'dom_attrs', 'css-layout', 'dom-search'];
554560
}
555561
}
556562
]

src/ecma-debugger/eventlisteners/evlisteners.css

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
margin-top: -13px;
1515
}
1616

17+
.list-selected-node
18+
{
19+
margin-top: -5px;
20+
margin-bottom: 10px;
21+
}
22+
1723
.ev-missing-script:hover
1824
{
1925
border-radius: 2px;
@@ -44,12 +50,18 @@
4450
font: inherit;
4551
}
4652

47-
.ev-listener-tooltip .ev-type
53+
.ev-listener-tooltip .ev-type,
54+
.ev-listeners-selected-node .ev-type
4855
{
4956
background-color: hsla(0, 0%, 0%, 0.04);
5057
padding: 2px 8px;
51-
margin: 5px -8px 1px;
5258
border-width: 1px 0;
59+
margin: 5px 0px 1px;
60+
}
61+
62+
.ev-listener-tooltip .ev-type
63+
{
64+
margin: 5px -8px 1px;
5365
}
5466

5567
.ev-phase

0 commit comments

Comments
 (0)