From 6c2af9490927c3c5959b5cb07461b646f8b32f6c Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Fri, 21 May 2010 16:53:46 +0100 Subject: Merge WebKit at r59636: Initial merge by git Change-Id: I59b289c4e6b18425f06ce41cc9d34c522515de91 --- WebCore/inspector/front-end/ScriptsPanel.js | 84 +++++++++++++++++------------ 1 file changed, 49 insertions(+), 35 deletions(-) (limited to 'WebCore/inspector/front-end/ScriptsPanel.js') diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js index 6344554..31d37a1 100644 --- a/WebCore/inspector/front-end/ScriptsPanel.js +++ b/WebCore/inspector/front-end/ScriptsPanel.js @@ -165,37 +165,7 @@ WebInspector.ScriptsPanel = function() this._pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false); this._pauseOnExceptionButton.state = WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions; - this._shortcuts = {}; - var handler, shortcut; - var platformSpecificModifier = WebInspector.isMac() ? WebInspector.KeyboardShortcut.Modifiers.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl; - - // Continue. - handler = this.pauseButton.click.bind(this.pauseButton); - shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F8); - this._shortcuts[shortcut] = handler; - shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Slash, platformSpecificModifier); - this._shortcuts[shortcut] = handler; - - // Step over. - handler = this.stepOverButton.click.bind(this.stepOverButton); - shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F10); - this._shortcuts[shortcut] = handler; - shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.SingleQuote, platformSpecificModifier); - this._shortcuts[shortcut] = handler; - - // Step into. - handler = this.stepIntoButton.click.bind(this.stepIntoButton); - shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F11); - this._shortcuts[shortcut] = handler; - shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Semicolon, platformSpecificModifier); - this._shortcuts[shortcut] = handler; - - // Step out. - handler = this.stepOutButton.click.bind(this.stepOutButton); - shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F11, WebInspector.KeyboardShortcut.Modifiers.Shift); - this._shortcuts[shortcut] = handler; - shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift, platformSpecificModifier); - this._shortcuts[shortcut] = handler; + this._registerShortcuts(); this._debuggerEnabled = Preferences.debuggerAlwaysEnabled; if (Preferences.debuggerAlwaysEnabled) @@ -478,7 +448,7 @@ WebInspector.ScriptsPanel.prototype = { this.reset(true); }, - reset: function(preserveWorkers) + reset: function(preserveItems) { this.visibleView = null; @@ -511,11 +481,12 @@ WebInspector.ScriptsPanel.prototype = { } this._sourceIDMap = {}; - + this.sidebarPanes.watchExpressions.refreshExpressions(); - this.sidebarPanes.breakpoints.reset(); - if (!preserveWorkers) + if (!preserveItems) { + this.sidebarPanes.breakpoints.reset(); this.sidebarPanes.workers.reset(); + } }, get visibleView() @@ -1003,6 +974,49 @@ WebInspector.ScriptsPanel.prototype = { elementsToRestoreScrollPositionsFor: function() { return [ this.sidebarElement ]; + }, + + _registerShortcuts: function() + { + var section = WebInspector.shortcutsHelp.section("Scripts Panel"); + var handler, shortcut1, shortcut2; + var platformSpecificModifier = WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta; + + this._shortcuts = {}; + + // Continue. + handler = this.pauseButton.click.bind(this.pauseButton); + shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F8); + this._shortcuts[shortcut1.key] = handler; + shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Slash, platformSpecificModifier); + this._shortcuts[shortcut2.key] = handler; + section.addAlternateKeys([ shortcut1.name, shortcut2.name ], "Continue"); + + // Step over. + handler = this.stepOverButton.click.bind(this.stepOverButton); + shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F10); + this._shortcuts[shortcut1.key] = handler; + shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.SingleQuote, platformSpecificModifier); + this._shortcuts[shortcut2.key] = handler; + section.addAlternateKeys([ shortcut1.name, shortcut2.name ], "Step over"); + + // Step into. + handler = this.stepIntoButton.click.bind(this.stepIntoButton); + shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F11); + this._shortcuts[shortcut1.key] = handler; + shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Semicolon, platformSpecificModifier); + this._shortcuts[shortcut2.key] = handler; + section.addAlternateKeys([ shortcut1.name, shortcut2.name ], "Step into"); + + // Step out. + handler = this.stepOutButton.click.bind(this.stepOutButton); + shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F11, WebInspector.KeyboardShortcut.Modifiers.Shift); + this._shortcuts[shortcut1.key] = handler; + shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift, platformSpecificModifier); + this._shortcuts[shortcut2.key] = handler; + section.addAlternateKeys([ shortcut1.name, shortcut2.name ], "Step out"); + + this.sidebarPanes.callstack.registerShortcuts(section); } } -- cgit v1.1