Title: [101160] trunk/Source/WebCore
Revision
101160
Author
[email protected]
Date
2011-11-25 02:33:14 -0800 (Fri, 25 Nov 2011)

Log Message

Web Inspector: Split scripts panel top status bar into debug toolbar and editor toolbar.
https://bugs.webkit.org/show_bug.cgi?id=73087

Reviewed by Pavel Feldman.

* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._reset):
(WebInspector.ScriptsPanel.prototype._createEditorToolbar):
(WebInspector.ScriptsPanel.prototype._createDebugToolbar):
(WebInspector.ScriptsPanel.prototype._createButtonAndRegisterShortcuts):
* inspector/front-end/scriptsPanel.css:
(#scripts-debug-toolbar):
(#scripts-editor-toolbar):
(#scripts-debug-sidebar-resizer-widget):
(.script-view):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (101159 => 101160)


--- trunk/Source/WebCore/ChangeLog	2011-11-25 10:06:55 UTC (rev 101159)
+++ trunk/Source/WebCore/ChangeLog	2011-11-25 10:33:14 UTC (rev 101160)
@@ -1,3 +1,21 @@
+2011-11-25  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Split scripts panel top status bar into debug toolbar and editor toolbar.
+        https://bugs.webkit.org/show_bug.cgi?id=73087
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._reset):
+        (WebInspector.ScriptsPanel.prototype._createEditorToolbar):
+        (WebInspector.ScriptsPanel.prototype._createDebugToolbar):
+        (WebInspector.ScriptsPanel.prototype._createButtonAndRegisterShortcuts):
+        * inspector/front-end/scriptsPanel.css:
+        (#scripts-debug-toolbar):
+        (#scripts-editor-toolbar):
+        (#scripts-debug-sidebar-resizer-widget):
+        (.script-view):
+
 2011-11-25  Leo Yang  <[email protected]>
 
         Upstream BlackBerry porting of platform/text

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (101159 => 101160)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-11-25 10:06:55 UTC (rev 101159)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-11-25 10:33:14 UTC (rev 101160)
@@ -43,54 +43,9 @@
     }
     WebInspector.GoToLineDialog.install(this, viewGetter.bind(this));
 
-    this.topStatusBar = document.createElement("div");
-    this.topStatusBar.className = "status-bar";
-    this.topStatusBar.id = "scripts-status-bar";
-    this.element.appendChild(this.topStatusBar);
+    this.editorToolbar = this._createEditorToolbar();
+    this.debugToolbar = this._createDebugToolbar();
 
-    this.backButton = document.createElement("button");
-    this.backButton.className = "status-bar-item";
-    this.backButton.id = "scripts-back";
-    this.backButton.title = WebInspector.UIString("Show the previous script resource.");
-    this.backButton.disabled = true;
-    this.backButton.appendChild(document.createElement("img"));
-    this.backButton.addEventListener("click", this._goBack.bind(this), false);
-    this.topStatusBar.appendChild(this.backButton);
-
-    this.forwardButton = document.createElement("button");
-    this.forwardButton.className = "status-bar-item";
-    this.forwardButton.id = "scripts-forward";
-    this.forwardButton.title = WebInspector.UIString("Show the next script resource.");
-    this.forwardButton.disabled = true;
-    this.forwardButton.appendChild(document.createElement("img"));
-    this.forwardButton.addEventListener("click", this._goForward.bind(this), false);
-    this.topStatusBar.appendChild(this.forwardButton);
-
-    this._filesSelectElement = document.createElement("select");
-    this._filesSelectElement.className = "status-bar-item";
-    this._filesSelectElement.id = "scripts-files";
-    this._filesSelectElement.addEventListener("change", this._filesSelectChanged.bind(this, true), false);
-    this._filesSelectElement.addEventListener("keyup", this._filesSelectChanged.bind(this, false), false);
-    this.topStatusBar.appendChild(this._filesSelectElement);
-
-    this.functionsSelectElement = document.createElement("select");
-    this.functionsSelectElement.className = "status-bar-item";
-    this.functionsSelectElement.id = "scripts-functions";
-
-    // FIXME: append the functions select element to the top status bar when it is implemented.
-    // this.topStatusBar.appendChild(this.functionsSelectElement);
-
-    this._createSidebarButtons();
-
-    this.toggleBreakpointsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Deactivate all breakpoints."), "toggle-breakpoints");
-    this.toggleBreakpointsButton.toggled = true;
-    this.toggleBreakpointsButton.addEventListener("click", this._toggleBreakpointsClicked, this);
-    this.sidebarButtonsElement.appendChild(this.toggleBreakpointsButton.element);
-
-    this.debuggerStatusElement = document.createElement("div");
-    this.debuggerStatusElement.id = "scripts-debugger-status";
-    this.sidebarButtonsElement.appendChild(this.debuggerStatusElement);
-
     const initialSidebarWidth = 225;
     const minimalViewsContainerWidthPercent = 34;
     this.createSplitView(this.element, WebInspector.SplitView.SidebarPosition.Right, initialSidebarWidth);
@@ -98,12 +53,15 @@
     this.splitView.minimalSidebarWidth = Preferences.minScriptsSidebarWidth;
     this.splitView.minimalMainWidthPercent = minimalViewsContainerWidthPercent;
 
+    this.splitView.sidebarElement.appendChild(this.debugToolbar);
+    this.splitView.mainElement.appendChild(this.editorToolbar);
+
     this.viewsContainerElement = this.splitView.mainElement;
 
-    this.sidebarResizeWidgetElement = document.createElement("div");
-    this.sidebarResizeWidgetElement.id = "scripts-sidebar-resizer-widget";
-    this.splitView.installResizer(this.sidebarResizeWidgetElement);
-    this.topStatusBar.appendChild(this.sidebarResizeWidgetElement);
+    this.debugSidebarResizeWidgetElement = document.createElement("div");
+    this.debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-widget";
+    this.splitView.installResizer(this.debugSidebarResizeWidgetElement);
+    this.editorToolbar.appendChild(this.debugSidebarResizeWidgetElement);
 
     this.sidebarPanes = {};
     this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSidebarPane();
@@ -550,7 +508,7 @@
         delete this._filesSelectElement.initialSelectionProcessed;
 
         this.functionsSelectElement.removeChildren();
-        this.viewsContainerElement.removeChildren();
+        this.visibleView = null;
 
         this.sidebarPanes.jsBreakpoints.reset();
         this.sidebarPanes.watchExpressions.reset();
@@ -773,14 +731,6 @@
             sourceFrame.focus();
     },
 
-    sidebarResized: function(event)
-    {
-        var width = event.data;
-
-        this.sidebarButtonsElement.style.width = width + "px";
-        this.sidebarResizeWidgetElement.style.right = width + "px";
-    },
-
     _setPauseOnExceptions: function(pauseOnExceptionsState)
     {
         pauseOnExceptionsState = pauseOnExceptionsState || WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions;
@@ -1003,12 +953,54 @@
             WebInspector.evaluateInConsole(selection.toString());
     },
 
-    _createSidebarButtons: function()
+    _createEditorToolbar: function()
     {
-        this.sidebarButtonsElement = document.createElement("div");
-        this.sidebarButtonsElement.id = "scripts-sidebar-buttons";
-        this.topStatusBar.appendChild(this.sidebarButtonsElement);
+        var editorToolbar = document.createElement("div");
+        editorToolbar.className = "status-bar";
+        editorToolbar.id = "scripts-editor-toolbar";
 
+        this.backButton = document.createElement("button");
+        this.backButton.className = "status-bar-item";
+        this.backButton.id = "scripts-back";
+        this.backButton.title = WebInspector.UIString("Show the previous script resource.");
+        this.backButton.disabled = true;
+        this.backButton.appendChild(document.createElement("img"));
+        this.backButton.addEventListener("click", this._goBack.bind(this), false);
+        editorToolbar.appendChild(this.backButton);
+
+        this.forwardButton = document.createElement("button");
+        this.forwardButton.className = "status-bar-item";
+        this.forwardButton.id = "scripts-forward";
+        this.forwardButton.title = WebInspector.UIString("Show the next script resource.");
+        this.forwardButton.disabled = true;
+        this.forwardButton.appendChild(document.createElement("img"));
+        this.forwardButton.addEventListener("click", this._goForward.bind(this), false);
+        editorToolbar.appendChild(this.forwardButton);
+
+        this._filesSelectElement = document.createElement("select");
+        this._filesSelectElement.className = "status-bar-item";
+        this._filesSelectElement.id = "scripts-files";
+        this._filesSelectElement.addEventListener("change", this._filesSelectChanged.bind(this, true), false);
+        this._filesSelectElement.addEventListener("keyup", this._filesSelectChanged.bind(this, false), false);
+        editorToolbar.appendChild(this._filesSelectElement);
+
+        this.functionsSelectElement = document.createElement("select");
+        this.functionsSelectElement.className = "status-bar-item";
+        this.functionsSelectElement.id = "scripts-functions";
+
+        // FIXME: append the functions select element to the top status bar when it
+        // is implemented.
+        // editorToolbar.appendChild(this.functionsSelectElement);
+        
+        return editorToolbar;
+    },
+
+    _createDebugToolbar: function()
+    {
+        var debugToolbar = document.createElement("div");
+        debugToolbar.className = "status-bar";
+        debugToolbar.id = "scripts-debug-toolbar";
+        
         var title, handler, shortcuts;
         var platformSpecificModifier = WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta;
 
@@ -1018,7 +1010,8 @@
         shortcuts = [];
         shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F8));
         shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Slash, platformSpecificModifier));
-        this.pauseButton = this._createSidebarButtonAndRegisterShortcuts("scripts-pause", title, handler, shortcuts, WebInspector.UIString("Pause/Continue"));
+        this.pauseButton = this._createButtonAndRegisterShortcuts("scripts-pause", title, handler, shortcuts, WebInspector.UIString("Pause/Continue"));
+        debugToolbar.appendChild(this.pauseButton);
 
         // Step over.
         title = WebInspector.UIString("Step over next function call (%s).");
@@ -1026,7 +1019,8 @@
         shortcuts = [];
         shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F10));
         shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.SingleQuote, platformSpecificModifier));
-        this.stepOverButton = this._createSidebarButtonAndRegisterShortcuts("scripts-step-over", title, handler, shortcuts, WebInspector.UIString("Step over"));
+        this.stepOverButton = this._createButtonAndRegisterShortcuts("scripts-step-over", title, handler, shortcuts, WebInspector.UIString("Step over"));
+        debugToolbar.appendChild(this.stepOverButton);
 
         // Step into.
         title = WebInspector.UIString("Step into next function call (%s).");
@@ -1034,7 +1028,8 @@
         shortcuts = [];
         shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F11));
         shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Semicolon, platformSpecificModifier));
-        this.stepIntoButton = this._createSidebarButtonAndRegisterShortcuts("scripts-step-into", title, handler, shortcuts, WebInspector.UIString("Step into"));
+        this.stepIntoButton = this._createButtonAndRegisterShortcuts("scripts-step-into", title, handler, shortcuts, WebInspector.UIString("Step into"));
+        debugToolbar.appendChild(this.stepIntoButton);
 
         // Step out.
         title = WebInspector.UIString("Step out of current function (%s).");
@@ -1042,10 +1037,22 @@
         shortcuts = [];
         shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F11, WebInspector.KeyboardShortcut.Modifiers.Shift));
         shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift | platformSpecificModifier));
-        this.stepOutButton = this._createSidebarButtonAndRegisterShortcuts("scripts-step-out", title, handler, shortcuts, WebInspector.UIString("Step out"));
+        this.stepOutButton = this._createButtonAndRegisterShortcuts("scripts-step-out", title, handler, shortcuts, WebInspector.UIString("Step out"));
+        debugToolbar.appendChild(this.stepOutButton);
+        
+        this.toggleBreakpointsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Deactivate all breakpoints."), "toggle-breakpoints");
+        this.toggleBreakpointsButton.toggled = true;
+        this.toggleBreakpointsButton.addEventListener("click", this._toggleBreakpointsClicked, this);
+        debugToolbar.appendChild(this.toggleBreakpointsButton.element);
+
+        this.debuggerStatusElement = document.createElement("div");
+        this.debuggerStatusElement.id = "scripts-debugger-status";
+        debugToolbar.appendChild(this.debuggerStatusElement);
+        
+        return debugToolbar;
     },
 
-    _createSidebarButtonAndRegisterShortcuts: function(buttonId, buttonTitle, handler, shortcuts, shortcutDescription)
+    _createButtonAndRegisterShortcuts: function(buttonId, buttonTitle, handler, shortcuts, shortcutDescription)
     {
         var button = document.createElement("button");
         button.className = "status-bar-item";
@@ -1054,7 +1061,6 @@
         button.disabled = true;
         button.appendChild(document.createElement("img"));
         button.addEventListener("click", handler, false);
-        this.sidebarButtonsElement.appendChild(button);
 
         var shortcutNames = [];
         for (var i = 0; i < shortcuts.length; ++i) {

Modified: trunk/Source/WebCore/inspector/front-end/scriptsPanel.css (101159 => 101160)


--- trunk/Source/WebCore/inspector/front-end/scriptsPanel.css	2011-11-25 10:06:55 UTC (rev 101159)
+++ trunk/Source/WebCore/inspector/front-end/scriptsPanel.css	2011-11-25 10:33:14 UTC (rev 101160)
@@ -47,11 +47,15 @@
     background-color: rgb(66, 129, 235);
 }
 
-#scripts-status-bar {
-    position: absolute;
-    top: -1px;
-    left: 0;
-    right: 0;
+#scripts-debug-toolbar {
+    position: relative;
+    margin-top: -1px;
+    height: 23px;
+}
+
+#scripts-editor-toolbar {
+    position: relative;
+    margin-top: -1px;
     height: 24px;
 }
 
@@ -116,11 +120,11 @@
     right: 8px;
 }
 
-#scripts-sidebar-resizer-widget {
+#scripts-debug-sidebar-resizer-widget {
     position: absolute;
     top: 0;
     bottom: 0;
-    right: 225px;
+    right: 0;
     width: 16px;
     cursor: ew-resize;
     background-image: url(Images/statusbarResizerHorizontal.png);
@@ -128,21 +132,11 @@
     background-position: center;
 }
 
-#scripts-sidebar-buttons {
-    position: absolute;
-    right: 0;
-    top: 0;
-    bottom: 0;
-    width: 225px;
-    overflow: hidden;
-    border-left: 1px solid rgb(64%, 64%, 64%);
-}
-
 .script-view {
     display: none;
     overflow: hidden;
     position: absolute;
-    top: 0;
+    top: 23px;
     left: 0;
     right: 0;
     bottom: 0;
@@ -152,10 +146,6 @@
     display: block;
 }
 
-#scripts-split-view {
-    top: 23px;
-}
-
 .dedicated-worker-item {
     margin: 5px 0px 5px 1px;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to