Changeset 117064 in webkit


Ignore:
Timestamp:
May 15, 2012 7:15:57 AM (12 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: add show/hide debugger sidebar button.
https://bugs.webkit.org/show_bug.cgi?id=86478

Reviewed by Vsevolod Vlasov.

As with the navigator, but with no overlay. See the screenshot.

  • English.lproj/localizedStrings.js:
  • inspector/front-end/NavigatorOverlayController.js:

(WebInspector.NavigatorOverlayController.prototype.set _pinNavigator):

  • inspector/front-end/ScriptsPanel.js:

(WebInspector.ScriptsPanel.prototype._debuggerPaused):
(WebInspector.ScriptsPanel.prototype._debuggerResumed):
(WebInspector.ScriptsPanel.prototype._showJavaScriptOutlineDialog):
(WebInspector.ScriptsPanel.prototype._installDebuggerSidebarController.clickHandler):
(WebInspector.ScriptsPanel.prototype._showDebuggerSidebar):
(WebInspector.ScriptsPanel.prototype.set _hideDebuggerSidebar):

  • inspector/front-end/scriptsPanel.css:

(#scripts-editor-container-tabbed-pane .tabbed-pane-header-contents):
(button.status-bar-item.scripts-debugger-show-hide-button):
(.status-bar-item.scripts-debugger-show-hide-button > .glyph):
(.status-bar-item.scripts-debugger-show-hide-button.toggled-shown > .glyph):
(.status-bar-item.scripts-debugger-show-hide-button.toggled-hidden > .glyph):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117058 r117064  
     12012-05-15  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: add show/hide debugger sidebar button.
     4        https://bugs.webkit.org/show_bug.cgi?id=86478
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        As with the navigator, but with no overlay. See the screenshot.
     9
     10        * English.lproj/localizedStrings.js:
     11        * inspector/front-end/NavigatorOverlayController.js:
     12        (WebInspector.NavigatorOverlayController.prototype.set _pinNavigator):
     13        * inspector/front-end/ScriptsPanel.js:
     14        (WebInspector.ScriptsPanel.prototype._debuggerPaused):
     15        (WebInspector.ScriptsPanel.prototype._debuggerResumed):
     16        (WebInspector.ScriptsPanel.prototype._showJavaScriptOutlineDialog):
     17        (WebInspector.ScriptsPanel.prototype._installDebuggerSidebarController.clickHandler):
     18        (WebInspector.ScriptsPanel.prototype._showDebuggerSidebar):
     19        (WebInspector.ScriptsPanel.prototype.set _hideDebuggerSidebar):
     20        * inspector/front-end/scriptsPanel.css:
     21        (#scripts-editor-container-tabbed-pane .tabbed-pane-header-contents):
     22        (button.status-bar-item.scripts-debugger-show-hide-button):
     23        (.status-bar-item.scripts-debugger-show-hide-button > .glyph):
     24        (.status-bar-item.scripts-debugger-show-hide-button.toggled-shown > .glyph):
     25        (.status-bar-item.scripts-debugger-show-hide-button.toggled-hidden > .glyph):
     26
    1272012-05-15  Zoltan Herczeg  <zherczeg@webkit.org>
    228
  • trunk/Source/WebCore/inspector/front-end/NavigatorOverlayController.js

    r117055 r117064  
    4949    this._navigatorShowHideButton.state = "pinned";
    5050    this._navigatorShowHideButton.addEventListener("click", this._toggleNavigator, this);
    51     this._navigatorView.element.appendChild(this._navigatorShowHideButton.element);
     51    this._editorView.element.appendChild(this._navigatorShowHideButton.element);
    5252
    5353    WebInspector.settings.navigatorHidden = WebInspector.settings.createSetting("navigatorHidden", true);
     
    107107        this._editorView.element.removeStyleClass("navigator-hidden");
    108108        this._navigatorSidebarResizeWidgetElement.removeStyleClass("hidden");
     109        this._editorView.element.appendChild(this._navigatorShowHideButton.element);
    109110
    110111        this._innerHideNavigatorOverlay();
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r116843 r117064  
    3737    WebInspector.settings.pauseOnExceptionStateString = WebInspector.settings.createSetting("pauseOnExceptionStateString", WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
    3838    WebInspector.settings.navigatorWasOnceHidden = WebInspector.settings.createSetting("navigatorWasOnceHidden", false);
    39 
     39    WebInspector.settings.debuggerSidebarHidden = WebInspector.settings.createSetting("debuggerSidebarHidden", false);
     40   
    4041    this._presentationModel = presentationModel;
    4142    new WebInspector.PresentationConsoleMessageHelper();
     
    152153
    153154    this._debuggerEnabled = !Capabilities.debuggerCausesRecompilation;
     155    this._installDebuggerSidebarController();
    154156
    155157    this._sourceFramesByUISourceCode = new Map();
     
    318320        }
    319321
     322        this._showDebuggerSidebar();
     323        this._toggleDebuggerSidebarButton.disabled = true;
    320324        window.focus();
    321325        InspectorFrontendHost.bringToFront();
     
    329333
    330334        this._clearInterface();
     335        this._toggleDebuggerSidebarButton.disabled = false;
    331336    },
    332337
     
    928933    {
    929934         WebInspector.JavaScriptOutlineDialog.show(this.visibleView, this.visibleView);
     935    },
     936
     937    _installDebuggerSidebarController: function()
     938    {
     939        this._toggleDebuggerSidebarButton = new WebInspector.StatusBarButton(WebInspector.UIString("Hide debugger"), "scripts-debugger-show-hide-button", 3);
     940        this._toggleDebuggerSidebarButton.state = "shown";
     941        this._toggleDebuggerSidebarButton.addEventListener("click", clickHandler, this);
     942
     943        function clickHandler()
     944        {
     945            if (this._toggleDebuggerSidebarButton.state === "shown")
     946                this._hideDebuggerSidebar();
     947            else
     948                this._showDebuggerSidebar();
     949        }
     950        this.editorView.element.appendChild(this._toggleDebuggerSidebarButton.element);
     951
     952        if (WebInspector.settings.debuggerSidebarHidden.get())
     953            this._hideDebuggerSidebar();
     954
     955    },
     956
     957    _showDebuggerSidebar: function()
     958    {
     959        if (this._toggleDebuggerSidebarButton.state === "shown")
     960            return;
     961        this._toggleDebuggerSidebarButton.state = "shown";
     962        this._toggleDebuggerSidebarButton.title = WebInspector.UIString("Hide debugger");
     963        this.splitView.showSidebarElement();
     964        WebInspector.settings.debuggerSidebarHidden.set(false);
     965    },
     966
     967    _hideDebuggerSidebar: function()
     968    {
     969        if (this._toggleDebuggerSidebarButton.state === "hidden")
     970            return;
     971        this._toggleDebuggerSidebarButton.state = "hidden";
     972        this._toggleDebuggerSidebarButton.title = WebInspector.UIString("Show debugger");
     973        this.splitView.hideSidebarElement();
     974        WebInspector.settings.debuggerSidebarHidden.set(true);
    930975    }
    931976}
  • trunk/Source/WebCore/inspector/front-end/scriptsPanel.css

    r117055 r117064  
    175175}
    176176
    177 button.status-bar-item.scripts-navigator-show-hide-button.toggled-pinned,
    178177button.status-bar-item.scripts-navigator-show-hide-button.toggled-overlay
    179178{
     
    223222
    224223#scripts-editor-container-tabbed-pane .tabbed-pane-header-contents {
    225     margin-left: 1px;
    226     margin-right: 16px;
    227 }
    228 
    229 #scripts-editor-container-tabbed-pane.navigator-hidden .tabbed-pane-header-contents {
    230224    margin-left: 20px;
     225    margin-right: 36px;
    231226}
    232227
     
    249244    font-weight: bold;
    250245}
     246
     247button.status-bar-item.scripts-debugger-show-hide-button {
     248    position: absolute;
     249    top: 0;
     250    right: 16px;
     251    background-image: none;
     252    height: 16px;
     253    width: 16px;
     254    margin: 3px 2px 2px 2px;
     255}
     256
     257.status-bar-item.scripts-debugger-show-hide-button > .glyph {
     258    background-color: rgba(0, 0, 0, 0.5);
     259    -webkit-mask-position: 0 0;
     260    -webkit-mask-image: url(Images/navigatorShowHideButton.png);
     261}
     262
     263.status-bar-item.scripts-debugger-show-hide-button.toggled-shown > .glyph {
     264    -webkit-mask-position: 0 -16px;
     265}
     266
     267.status-bar-item.scripts-debugger-show-hide-button.toggled-hidden > .glyph {
     268    -webkit-mask-position: -16px -16px;
     269}
Note: See TracChangeset for help on using the changeset viewer.