OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 this.forwardButton.title = WebInspector.UIString("Show the next script resou
rce."); | 49 this.forwardButton.title = WebInspector.UIString("Show the next script resou
rce."); |
50 this.forwardButton.disabled = true; | 50 this.forwardButton.disabled = true; |
51 this.forwardButton.appendChild(document.createElement("img")); | 51 this.forwardButton.appendChild(document.createElement("img")); |
52 this.forwardButton.addEventListener("click", this._goForward.bind(this), fal
se); | 52 this.forwardButton.addEventListener("click", this._goForward.bind(this), fal
se); |
53 this.topStatusBar.appendChild(this.forwardButton); | 53 this.topStatusBar.appendChild(this.forwardButton); |
54 | 54 |
55 this.filesSelectElement = document.createElement("select"); | 55 this.filesSelectElement = document.createElement("select"); |
56 this.filesSelectElement.className = "status-bar-item"; | 56 this.filesSelectElement.className = "status-bar-item"; |
57 this.filesSelectElement.id = "scripts-files"; | 57 this.filesSelectElement.id = "scripts-files"; |
58 this.filesSelectElement.addEventListener("change", this._changeVisibleFile.b
ind(this), false); | 58 this.filesSelectElement.addEventListener("change", this._changeVisibleFile.b
ind(this), false); |
| 59 this.filesSelectElement.handleKeyEvent = this.handleKeyEvent.bind(this); |
59 this.topStatusBar.appendChild(this.filesSelectElement); | 60 this.topStatusBar.appendChild(this.filesSelectElement); |
60 | 61 |
61 this.functionsSelectElement = document.createElement("select"); | 62 this.functionsSelectElement = document.createElement("select"); |
62 this.functionsSelectElement.className = "status-bar-item"; | 63 this.functionsSelectElement.className = "status-bar-item"; |
63 this.functionsSelectElement.id = "scripts-functions"; | 64 this.functionsSelectElement.id = "scripts-functions"; |
64 | 65 |
65 // FIXME: append the functions select element to the top status bar when it
is implemented. | 66 // FIXME: append the functions select element to the top status bar when it
is implemented. |
66 // this.topStatusBar.appendChild(this.functionsSelectElement); | 67 // this.topStatusBar.appendChild(this.functionsSelectElement); |
67 | 68 |
68 this.sidebarButtonsElement = document.createElement("div"); | 69 this.sidebarButtonsElement = document.createElement("div"); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 this.topStatusBar.appendChild(this.sidebarResizeWidgetElement); | 126 this.topStatusBar.appendChild(this.sidebarResizeWidgetElement); |
126 | 127 |
127 this.sidebarPanes = {}; | 128 this.sidebarPanes = {}; |
128 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); | 129 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); |
129 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); | 130 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); |
130 this.sidebarPanes.breakpoints = new WebInspector.BreakpointsSidebarPane(); | 131 this.sidebarPanes.breakpoints = new WebInspector.BreakpointsSidebarPane(); |
131 | 132 |
132 for (var pane in this.sidebarPanes) | 133 for (var pane in this.sidebarPanes) |
133 this.sidebarElement.appendChild(this.sidebarPanes[pane].element); | 134 this.sidebarElement.appendChild(this.sidebarPanes[pane].element); |
134 | 135 |
135 // FIXME: remove the following line of code when the Breakpoints pane has co
ntent. | |
136 this.sidebarElement.removeChild(this.sidebarPanes.breakpoints.element); | |
137 | |
138 this.sidebarPanes.callstack.expanded = true; | 136 this.sidebarPanes.callstack.expanded = true; |
139 this.sidebarPanes.callstack.addEventListener("call frame selected", this._ca
llFrameSelected, this); | 137 this.sidebarPanes.callstack.addEventListener("call frame selected", this._ca
llFrameSelected, this); |
140 | 138 |
141 this.sidebarPanes.scopechain.expanded = true; | 139 this.sidebarPanes.scopechain.expanded = true; |
| 140 this.sidebarPanes.breakpoints.expanded = true; |
142 | 141 |
143 var panelEnablerHeading = WebInspector.UIString("You need to enable debuggin
g before you can use the Scripts panel."); | 142 var panelEnablerHeading = WebInspector.UIString("You need to enable debuggin
g before you can use the Scripts panel."); |
144 var panelEnablerDisclaimer = WebInspector.UIString("Enabling debugging will
make scripts run slower."); | 143 var panelEnablerDisclaimer = WebInspector.UIString("Enabling debugging will
make scripts run slower."); |
145 var panelEnablerButton = WebInspector.UIString("Enable Debugging"); | 144 var panelEnablerButton = WebInspector.UIString("Enable Debugging"); |
146 | 145 |
147 this.panelEnablerView = new WebInspector.PanelEnablerView("scripts", panelEn
ablerHeading, panelEnablerDisclaimer, panelEnablerButton); | 146 this.panelEnablerView = new WebInspector.PanelEnablerView("scripts", panelEn
ablerHeading, panelEnablerDisclaimer, panelEnablerButton); |
148 this.panelEnablerView.addEventListener("enable clicked", this._enableDebuggi
ng, this); | 147 this.panelEnablerView.addEventListener("enable clicked", this._enableDebuggi
ng, this); |
149 | 148 |
150 this.element.appendChild(this.panelEnablerView.element); | 149 this.element.appendChild(this.panelEnablerView.element); |
151 this.element.appendChild(this.viewsContainerElement); | 150 this.element.appendChild(this.viewsContainerElement); |
152 this.element.appendChild(this.sidebarElement); | 151 this.element.appendChild(this.sidebarElement); |
153 this.element.appendChild(this.sidebarResizeElement); | 152 this.element.appendChild(this.sidebarResizeElement); |
154 | 153 |
155 this.enableToggleButton = document.createElement("button"); | 154 this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggl
e-status-bar-item"); |
156 this.enableToggleButton.className = "enable-toggle-status-bar-item status-ba
r-item"; | |
157 this.enableToggleButton.addEventListener("click", this._toggleDebugging.bind
(this), false); | 155 this.enableToggleButton.addEventListener("click", this._toggleDebugging.bind
(this), false); |
158 | 156 |
159 this.pauseOnExceptionButton = document.createElement("button"); | 157 this.pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-
pause-on-exceptions-status-bar-item"); |
160 this.pauseOnExceptionButton.id = "scripts-pause-on-exceptions-status-bar-ite
m"; | |
161 this.pauseOnExceptionButton.className = "status-bar-item"; | |
162 this.pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExc
eptions.bind(this), false); | 158 this.pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExc
eptions.bind(this), false); |
163 | 159 |
164 this._breakpointsURLMap = {}; | 160 this._breakpointsURLMap = {}; |
165 | 161 |
| 162 this._shortcuts = {}; |
| 163 |
| 164 var isMac = InspectorController.platform().indexOf("mac-") === 0; |
| 165 var platformSpecificModifier = isMac ? WebInspector.KeyboardShortcut.Modifie
rs.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl; |
| 166 |
| 167 // Continue. |
| 168 var handler = this.pauseButton.click.bind(this.pauseButton); |
| 169 var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardSh
ortcut.KeyCodes.F8); |
| 170 this._shortcuts[shortcut] = handler; |
| 171 var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardSh
ortcut.KeyCodes.Slash, platformSpecificModifier); |
| 172 this._shortcuts[shortcut] = handler; |
| 173 |
| 174 // Step over. |
| 175 var handler = this.stepOverButton.click.bind(this.stepOverButton); |
| 176 var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardSh
ortcut.KeyCodes.F10); |
| 177 this._shortcuts[shortcut] = handler; |
| 178 var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardSh
ortcut.KeyCodes.SingleQuote, platformSpecificModifier); |
| 179 this._shortcuts[shortcut] = handler; |
| 180 |
| 181 // Step into. |
| 182 var handler = this.stepIntoButton.click.bind(this.stepIntoButton); |
| 183 var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardSh
ortcut.KeyCodes.F11); |
| 184 this._shortcuts[shortcut] = handler; |
| 185 var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardSh
ortcut.KeyCodes.Semicolon, platformSpecificModifier); |
| 186 this._shortcuts[shortcut] = handler; |
| 187 |
| 188 // Step out. |
| 189 var handler = this.stepOutButton.click.bind(this.stepOutButton); |
| 190 var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardSh
ortcut.KeyCodes.F11, WebInspector.KeyboardShortcut.Modifiers.Shift); |
| 191 this._shortcuts[shortcut] = handler; |
| 192 var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardSh
ortcut.KeyCodes.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift, platfo
rmSpecificModifier); |
| 193 this._shortcuts[shortcut] = handler; |
| 194 |
166 this.reset(); | 195 this.reset(); |
167 } | 196 } |
168 | 197 |
169 WebInspector.ScriptsPanel.prototype = { | 198 WebInspector.ScriptsPanel.prototype = { |
170 toolbarItemClass: "scripts", | 199 toolbarItemClass: "scripts", |
171 | 200 |
172 get toolbarItemLabel() | 201 get toolbarItemLabel() |
173 { | 202 { |
174 return WebInspector.UIString("Scripts"); | 203 return WebInspector.UIString("Scripts"); |
175 }, | 204 }, |
176 | 205 |
177 get statusBarItems() | 206 get statusBarItems() |
178 { | 207 { |
179 return [this.enableToggleButton, this.pauseOnExceptionButton]; | 208 return [this.enableToggleButton.element, this.pauseOnExceptionButton.ele
ment]; |
180 }, | 209 }, |
181 | 210 |
182 get paused() | 211 get paused() |
183 { | 212 { |
184 return this._paused; | 213 return this._paused; |
185 }, | 214 }, |
186 | 215 |
187 show: function() | 216 show: function() |
188 { | 217 { |
189 WebInspector.Panel.prototype.show.call(this); | 218 WebInspector.Panel.prototype.show.call(this); |
190 this.sidebarResizeElement.style.right = (this.sidebarElement.offsetWidth
- 3) + "px"; | 219 this.sidebarResizeElement.style.right = (this.sidebarElement.offsetWidth
- 3) + "px"; |
191 | 220 |
192 if (this.visibleView) { | 221 if (this.visibleView) { |
193 if (this.visibleView instanceof WebInspector.ResourceView) | 222 if (this.visibleView instanceof WebInspector.ResourceView) |
194 this.visibleView.headersVisible = false; | 223 this.visibleView.headersVisible = false; |
195 this.visibleView.show(this.viewsContainerElement); | 224 this.visibleView.show(this.viewsContainerElement); |
196 } | 225 } |
197 | 226 |
198 // Hide any views that are visible that are not this panel's current vis
ible view. | 227 // Hide any views that are visible that are not this panel's current vis
ible view. |
199 // This can happen when a ResourceView is visible in the Resources panel
then switched | 228 // This can happen when a ResourceView is visible in the Resources panel
then switched |
200 // to the this panel. | 229 // to the this panel. |
201 for (var sourceID in this._sourceIDMap) { | 230 for (var sourceID in this._sourceIDMap) { |
202 var scriptOrResource = this._sourceIDMap[sourceID]; | 231 var scriptOrResource = this._sourceIDMap[sourceID]; |
203 var view = this._sourceViewForScriptOrResource(scriptOrResource); | 232 var view = this._sourceViewForScriptOrResource(scriptOrResource); |
204 if (!view || view === this.visibleView) | 233 if (!view || view === this.visibleView) |
205 continue; | 234 continue; |
206 view.visible = false; | 235 view.visible = false; |
207 } | 236 } |
| 237 if (this._attachDebuggerWhenShown) { |
| 238 InspectorController.enableDebugger(false); |
| 239 delete this._attachDebuggerWhenShown; |
| 240 } |
208 }, | 241 }, |
209 | 242 |
210 get searchableViews() | 243 get searchableViews() |
211 { | 244 { |
212 var views = []; | 245 var views = []; |
213 | 246 |
214 const visibleView = this.visibleView; | 247 const visibleView = this.visibleView; |
215 if (visibleView && visibleView.performSearch) { | 248 if (visibleView && visibleView.performSearch) { |
216 visibleView.alreadySearching = true; | 249 visibleView.alreadySearching = true; |
217 views.push(visibleView); | 250 views.push(visibleView); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 } | 287 } |
255 } | 288 } |
256 } | 289 } |
257 | 290 |
258 if (sourceID) | 291 if (sourceID) |
259 this._sourceIDMap[sourceID] = (resource || script); | 292 this._sourceIDMap[sourceID] = (resource || script); |
260 | 293 |
261 this._addScriptToFilesMenu(script); | 294 this._addScriptToFilesMenu(script); |
262 }, | 295 }, |
263 | 296 |
| 297 scriptOrResourceForID: function(id) |
| 298 { |
| 299 return this._sourceIDMap[id]; |
| 300 }, |
| 301 |
264 addBreakpoint: function(breakpoint) | 302 addBreakpoint: function(breakpoint) |
265 { | 303 { |
266 this.sidebarPanes.breakpoints.addBreakpoint(breakpoint); | 304 this.sidebarPanes.breakpoints.addBreakpoint(breakpoint); |
267 | 305 |
268 var sourceFrame; | 306 var sourceFrame; |
269 if (breakpoint.url) { | 307 if (breakpoint.url) { |
270 if (!(breakpoint.url in this._breakpointsURLMap)) | 308 if (!(breakpoint.url in this._breakpointsURLMap)) |
271 this._breakpointsURLMap[breakpoint.url] = []; | 309 this._breakpointsURLMap[breakpoint.url] = []; |
272 this._breakpointsURLMap[breakpoint.url].unshift(breakpoint); | 310 this._breakpointsURLMap[breakpoint.url].unshift(breakpoint); |
273 | 311 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 343 |
306 if (breakpoint.sourceID && !sourceFrame) { | 344 if (breakpoint.sourceID && !sourceFrame) { |
307 var object = this._sourceIDMap[breakpoint.sourceID] | 345 var object = this._sourceIDMap[breakpoint.sourceID] |
308 sourceFrame = this._sourceFrameForScriptOrResource(object); | 346 sourceFrame = this._sourceFrameForScriptOrResource(object); |
309 } | 347 } |
310 | 348 |
311 if (sourceFrame) | 349 if (sourceFrame) |
312 sourceFrame.removeBreakpoint(breakpoint); | 350 sourceFrame.removeBreakpoint(breakpoint); |
313 }, | 351 }, |
314 | 352 |
315 evaluateInSelectedCallFrame: function(code, updateInterface) | 353 evaluateInSelectedCallFrame: function(code, updateInterface, callback) |
316 { | 354 { |
317 var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame; | 355 var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame; |
318 if (!this._paused || !selectedCallFrame) | 356 if (!this._paused || !selectedCallFrame) |
319 return; | 357 return; |
| 358 |
320 if (typeof updateInterface === "undefined") | 359 if (typeof updateInterface === "undefined") |
321 updateInterface = true; | 360 updateInterface = true; |
322 var result = selectedCallFrame.evaluate(code); | 361 |
323 if (updateInterface) | 362 var self = this; |
324 this.sidebarPanes.scopechain.update(selectedCallFrame); | 363 function updatingCallbackWrapper(result, exception) |
325 return result; | 364 { |
| 365 callback(result, exception); |
| 366 if (updateInterface) |
| 367 self.sidebarPanes.scopechain.update(selectedCallFrame); |
| 368 } |
| 369 this.doEvalInCallFrame(selectedCallFrame, code, updatingCallbackWrapper)
; |
326 }, | 370 }, |
327 | 371 |
328 variablesInScopeForSelectedCallFrame: function() | 372 doEvalInCallFrame: function(callFrame, code, callback) |
| 373 { |
| 374 function evalCallback(result) |
| 375 { |
| 376 if (result) |
| 377 callback(result.value, result.isException); |
| 378 } |
| 379 InspectorController.evaluateInCallFrame(callFrame.id, code, evalCallback
); |
| 380 }, |
| 381 |
| 382 variablesInSelectedCallFrame: function() |
329 { | 383 { |
330 var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame; | 384 var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame; |
331 if (!this._paused || !selectedCallFrame) | 385 if (!this._paused || !selectedCallFrame) |
332 return {}; | 386 return {}; |
333 | 387 |
334 var result = {}; | 388 var result = {}; |
335 var scopeChain = selectedCallFrame.scopeChain; | 389 var scopeChain = selectedCallFrame.scopeChain; |
336 for (var i = 0; i < scopeChain.length; ++i) { | 390 for (var i = 0; i < scopeChain.length; ++i) { |
337 var scopeObject = scopeChain[i]; | 391 var scopeObjectProperties = scopeChain[i].properties; |
338 for (var property in scopeObject) | 392 for (var j = 0; j < scopeObjectProperties.length; ++j) |
339 result[property] = true; | 393 result[scopeObjectProperties[j]] = true; |
340 } | 394 } |
341 | |
342 return result; | 395 return result; |
343 }, | 396 }, |
344 | 397 |
345 debuggerPaused: function() | 398 debuggerPaused: function() |
346 { | 399 { |
347 this._paused = true; | 400 this._paused = true; |
348 this._waitingToPause = false; | 401 this._waitingToPause = false; |
349 this._stepping = false; | 402 this._stepping = false; |
350 | 403 |
351 this._updateDebuggerButtons(); | 404 this._updateDebuggerButtons(); |
352 | 405 |
| 406 var self = this; |
353 var callStackPane = this.sidebarPanes.callstack; | 407 var callStackPane = this.sidebarPanes.callstack; |
354 var currentFrame = InspectorController.currentCallFrame(); | 408 function callback(callFrames) |
355 callStackPane.update(currentFrame, this._sourceIDMap); | 409 { |
356 callStackPane.selectedCallFrame = currentFrame; | 410 callStackPane.update(callFrames, self._sourceIDMap); |
| 411 callStackPane.selectedCallFrame = callFrames[0]; |
357 | 412 |
358 WebInspector.currentPanel = this; | 413 WebInspector.currentPanel = self; |
359 window.focus(); | 414 window.focus(); |
| 415 } |
| 416 InspectorController.getCallFrames(callback); |
360 }, | 417 }, |
361 | 418 |
362 debuggerResumed: function() | 419 debuggerResumed: function() |
363 { | 420 { |
364 this._paused = false; | 421 this._paused = false; |
365 this._waitingToPause = false; | 422 this._waitingToPause = false; |
366 this._stepping = false; | 423 this._stepping = false; |
367 | 424 |
368 this._clearInterface(); | 425 this._clearInterface(); |
369 }, | 426 }, |
370 | 427 |
| 428 attachDebuggerWhenShown: function() |
| 429 { |
| 430 if (this.element.parentElement) { |
| 431 InspectorController.enableDebugger(false); |
| 432 } else { |
| 433 this._attachDebuggerWhenShown = true; |
| 434 } |
| 435 }, |
| 436 |
371 debuggerWasEnabled: function() | 437 debuggerWasEnabled: function() |
372 { | 438 { |
373 this.reset(); | 439 this.reset(); |
374 }, | 440 }, |
375 | 441 |
376 debuggerWasDisabled: function() | 442 debuggerWasDisabled: function() |
377 { | 443 { |
378 this.reset(); | 444 this.reset(); |
379 }, | 445 }, |
380 | 446 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 this._showScriptOrResource(resource, line, true); | 513 this._showScriptOrResource(resource, line, true); |
448 }, | 514 }, |
449 | 515 |
450 showView: function(view) | 516 showView: function(view) |
451 { | 517 { |
452 if (!view) | 518 if (!view) |
453 return; | 519 return; |
454 this._showScriptOrResource((view.resource || view.script)); | 520 this._showScriptOrResource((view.resource || view.script)); |
455 }, | 521 }, |
456 | 522 |
| 523 handleKeyEvent: function(event) |
| 524 { |
| 525 var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(event); |
| 526 var handler = this._shortcuts[shortcut]; |
| 527 if (handler) { |
| 528 handler(event); |
| 529 event.preventDefault(); |
| 530 event.handled = true; |
| 531 } else { |
| 532 this.sidebarPanes.callstack.handleKeyEvent(event); |
| 533 } |
| 534 }, |
| 535 |
457 scriptViewForScript: function(script) | 536 scriptViewForScript: function(script) |
458 { | 537 { |
459 if (!script) | 538 if (!script) |
460 return null; | 539 return null; |
461 if (!script._scriptView) | 540 if (!script._scriptView) |
462 script._scriptView = new WebInspector.ScriptView(script); | 541 script._scriptView = new WebInspector.ScriptView(script); |
463 return script._scriptView; | 542 return script._scriptView; |
464 }, | 543 }, |
465 | 544 |
466 sourceFrameForScript: function(script) | 545 sourceFrameForScript: function(script) |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 this.sidebarResizeWidgetElement.style.right = newWidth + "px"; | 753 this.sidebarResizeWidgetElement.style.right = newWidth + "px"; |
675 this.sidebarResizeElement.style.right = (newWidth - 3) + "px"; | 754 this.sidebarResizeElement.style.right = (newWidth - 3) + "px"; |
676 | 755 |
677 event.preventDefault(); | 756 event.preventDefault(); |
678 }, | 757 }, |
679 | 758 |
680 _updatePauseOnExceptionsButton: function() | 759 _updatePauseOnExceptionsButton: function() |
681 { | 760 { |
682 if (InspectorController.pauseOnExceptions()) { | 761 if (InspectorController.pauseOnExceptions()) { |
683 this.pauseOnExceptionButton.title = WebInspector.UIString("Don't pau
se on exceptions."); | 762 this.pauseOnExceptionButton.title = WebInspector.UIString("Don't pau
se on exceptions."); |
684 this.pauseOnExceptionButton.addStyleClass("toggled-on"); | 763 this.pauseOnExceptionButton.toggled = true; |
685 } else { | 764 } else { |
686 this.pauseOnExceptionButton.title = WebInspector.UIString("Pause on
exceptions."); | 765 this.pauseOnExceptionButton.title = WebInspector.UIString("Pause on
exceptions."); |
687 this.pauseOnExceptionButton.removeStyleClass("toggled-on"); | 766 this.pauseOnExceptionButton.toggled = false; |
688 } | 767 } |
689 }, | 768 }, |
690 | 769 |
691 _updateDebuggerButtons: function() | 770 _updateDebuggerButtons: function() |
692 { | 771 { |
693 if (InspectorController.debuggerEnabled()) { | 772 if (InspectorController.debuggerEnabled()) { |
694 this.enableToggleButton.title = WebInspector.UIString("Debugging ena
bled. Click to disable."); | 773 this.enableToggleButton.title = WebInspector.UIString("Debugging ena
bled. Click to disable."); |
695 this.enableToggleButton.addStyleClass("toggled-on"); | 774 this.enableToggleButton.toggled = true; |
696 this.pauseOnExceptionButton.removeStyleClass("hidden"); | 775 this.pauseOnExceptionButton.visible = true; |
697 this.panelEnablerView.visible = false; | 776 this.panelEnablerView.visible = false; |
698 } else { | 777 } else { |
699 this.enableToggleButton.title = WebInspector.UIString("Debugging dis
abled. Click to enable."); | 778 this.enableToggleButton.title = WebInspector.UIString("Debugging dis
abled. Click to enable."); |
700 this.enableToggleButton.removeStyleClass("toggled-on"); | 779 this.enableToggleButton.toggled = false; |
701 this.pauseOnExceptionButton.addStyleClass("hidden"); | 780 this.pauseOnExceptionButton.visible = false; |
702 this.panelEnablerView.visible = true; | 781 this.panelEnablerView.visible = true; |
703 } | 782 } |
704 | 783 |
705 this._updatePauseOnExceptionsButton(); | 784 this._updatePauseOnExceptionsButton(); |
706 | 785 |
707 if (this._paused) { | 786 if (this._paused) { |
708 this.pauseButton.addStyleClass("paused"); | 787 this.pauseButton.addStyleClass("paused"); |
709 | 788 |
710 this.pauseButton.disabled = false; | 789 this.pauseButton.disabled = false; |
711 this.stepOverButton.disabled = false; | 790 this.stepOverButton.disabled = false; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 } | 843 } |
765 | 844 |
766 this._showScriptOrResource(this._backForwardList[++this._currentBackForw
ardIndex], null, false, true); | 845 this._showScriptOrResource(this._backForwardList[++this._currentBackForw
ardIndex], null, false, true); |
767 this._updateBackAndForwardButtons(); | 846 this._updateBackAndForwardButtons(); |
768 }, | 847 }, |
769 | 848 |
770 _enableDebugging: function() | 849 _enableDebugging: function() |
771 { | 850 { |
772 if (InspectorController.debuggerEnabled()) | 851 if (InspectorController.debuggerEnabled()) |
773 return; | 852 return; |
774 this._toggleDebugging(); | 853 this._toggleDebugging(this.panelEnablerView.alwaysEnabled); |
775 }, | 854 }, |
776 | 855 |
777 _toggleDebugging: function() | 856 _toggleDebugging: function(optionalAlways) |
778 { | 857 { |
779 this._paused = false; | 858 this._paused = false; |
780 this._waitingToPause = false; | 859 this._waitingToPause = false; |
781 this._stepping = false; | 860 this._stepping = false; |
782 | 861 |
783 if (InspectorController.debuggerEnabled()) | 862 if (InspectorController.debuggerEnabled()) |
784 InspectorController.disableDebugger(); | 863 InspectorController.disableDebugger(true); |
785 else | 864 else |
786 InspectorController.enableDebugger(); | 865 InspectorController.enableDebugger(!!optionalAlways); |
787 }, | 866 }, |
788 | 867 |
789 _togglePauseOnExceptions: function() | 868 _togglePauseOnExceptions: function() |
790 { | 869 { |
791 InspectorController.setPauseOnExceptions(!InspectorController.pauseOnExc
eptions()); | 870 InspectorController.setPauseOnExceptions(!InspectorController.pauseOnExc
eptions()); |
792 this._updatePauseOnExceptionsButton(); | 871 this._updatePauseOnExceptionsButton(); |
793 }, | 872 }, |
794 | 873 |
795 _togglePause: function() | 874 _togglePause: function() |
796 { | 875 { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 this._paused = false; | 911 this._paused = false; |
833 this._stepping = true; | 912 this._stepping = true; |
834 | 913 |
835 this._clearInterface(); | 914 this._clearInterface(); |
836 | 915 |
837 InspectorController.stepOutOfFunctionInDebugger(); | 916 InspectorController.stepOutOfFunctionInDebugger(); |
838 } | 917 } |
839 } | 918 } |
840 | 919 |
841 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype; | 920 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype; |
OLD | NEW |