Changeset 183332 in webkit
- Timestamp:
- Apr 25, 2015, 6:21:38 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r183331 r183332 1 2015-04-23 Timothy Hatcher <timothy@apple.com> 2 3 Web Inspector: Make Console work in a tab world 4 https://bugs.webkit.org/show_bug.cgi?id=144112 5 6 Reviewed by Joseph Pecoraro. 7 8 * UserInterface/Base/Main.js: 9 (WebInspector.contentLoaded): 10 (WebInspector.isShowingConsoleTab): 11 (WebInspector.UIString): 12 (WebInspector.toggleNavigationSidebar): 13 (WebInspector.toggleDetailsSidebar): 14 (WebInspector.tabContentViewClassForRepresentedObject): 15 (WebInspector.linkifyStringAsFragment): 16 * UserInterface/Images/Console.svg: Added. 17 * UserInterface/Protocol/InspectorFrontendAPI.js: 18 (InspectorFrontendAPI.showConsole): 19 * UserInterface/Views/ConsoleTabContentView.js: Added. 20 (WebInspector.ConsoleTabContentView): 21 (WebInspector.ConsoleTabContentView.prototype.shown): 22 (WebInspector.ConsoleTabContentView.prototype.showRepresentedObject): 23 (WebInspector.ConsoleTabContentView.prototype.canShowRepresentedObject): 24 (WebInspector.ConsoleTabContentView.prototype.get supportsSplitContentBrowser): 25 * UserInterface/Views/DefaultDashboardView.js: 26 (WebInspector.DefaultDashboardView.prototype._consoleItemWasClicked): 27 * UserInterface/Views/LogContentView.js: 28 (WebInspector.LogContentView): 29 (WebInspector.LogContentView.prototype.get navigationItems): 30 (WebInspector.LogContentView.prototype.shown): 31 (WebInspector.LogContentView.prototype.didAppendConsoleMessageView): 32 (WebInspector.LogContentView.prototype._showConsoleTab): 33 * UserInterface/Views/LogIcon.css: 34 (.log-icon .icon): 35 * UserInterface/Views/Main.css: 36 (#split-content-browser .hierarchical-path-component.log-icon .icon): 37 (#split-content-browser .hierarchical-path-component.log-icon .title): 38 (#split-content-browser .hierarchical-path-component.log-icon select): 39 1 40 2015-04-23 Timothy Hatcher <timothy@apple.com> 2 41 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r183331 r183332 228 228 this._consoleRepresentedObject = new WebInspector.LogObject; 229 229 this._consoleTreeElement = new WebInspector.LogTreeElement(this._consoleRepresentedObject); 230 this.consoleContentView = WebInspector. contentBrowser.contentViewForRepresentedObject(this._consoleRepresentedObject);230 this.consoleContentView = WebInspector.splitContentBrowser.contentViewForRepresentedObject(this._consoleRepresentedObject); 231 231 this.consoleLogViewController = this.consoleContentView.logViewController; 232 232 … … 251 251 this._reloadPageIgnoringCacheKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "R", this._reloadPageIgnoringCache.bind(this)); 252 252 253 this._consoleKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Option | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "C", this. toggleConsoleView.bind(this));253 this._consoleKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Option | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "C", this._showConsoleTab.bind(this)); 254 254 255 255 this._inspectModeKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "C", this._toggleInspectMode.bind(this)); … … 428 428 { 429 429 // The console does not have a sidebar, so return a tree element here so something is shown. 430 if (representedObject instanceof WebInspector.LogObject)430 if (representedObject === this._consoleRepresentedObject) 431 431 return this._consoleTreeElement; 432 433 var sidebarPanel = this.sidebarPanelForRepresentedObject(representedObject);434 if (sidebarPanel)435 return sidebarPanel.treeElementForRepresentedObject(representedObject);436 432 return null; 437 433 }; … … 576 572 }; 577 573 578 WebInspector. currentViewSupportsSplitContentBrowser = function()579 { 580 var currentContentView = this. contentBrowser.currentContentView;574 WebInspector.doesCurrentTabSupportSplitContentBrowser = function() 575 { 576 var currentContentView = this.tabBrowser.selectedTabContentView; 581 577 return !currentContentView || currentContentView.supportsSplitContentBrowser; 582 578 }; … … 584 580 WebInspector.toggleSplitConsole = function() 585 581 { 586 if (!this. currentViewSupportsSplitContentBrowser()) {587 this. toggleConsoleView();582 if (!this.doesCurrentTabSupportSplitContentBrowser()) { 583 this.showConsoleTab(); 588 584 return; 589 585 } … … 597 593 WebInspector.showSplitConsole = function() 598 594 { 599 if (!this. currentViewSupportsSplitContentBrowser()) {600 this.show FullHeightConsole();595 if (!this.doesCurrentTabSupportSplitContentBrowser()) { 596 this.showConsoleTab(); 601 597 return; 602 598 } … … 607 603 608 604 if (this.splitContentBrowser.currentContentView !== this.consoleContentView) { 609 var wasShowingFullConsole = this.isShowingConsoleView(); 610 611 // Be sure to close any existing log view in the main content browser before showing it in the 605 // Be sure to close the view in the tab content browser before showing it in the 612 606 // split content browser. We can only show a content view in one browser at a time. 613 this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.LogContentView); 607 if (this.consoleContentView.parentContainer) 608 this.consoleContentView.parentContainer.closeContentView(this.consoleContentView); 614 609 this.splitContentBrowser.showContentView(this.consoleContentView); 615 616 if (wasShowingFullConsole && !this.contentBrowser.currentContentView)617 this.resourceSidebarPanel.showDefaultContentView();618 610 } else { 619 611 // This causes the view to know it was shown and focus the prompt. 620 this.splitContentBrowser. contentViewContainer.shown();612 this.splitContentBrowser.shown(); 621 613 } 622 614 … … 626 618 WebInspector.hideSplitConsole = function() 627 619 { 620 if (!this.isShowingSplitConsole()) 621 return; 622 628 623 this.splitContentBrowser.element.classList.add("hidden"); 629 624 … … 631 626 632 627 // This causes the view to know it was hidden. 633 this.splitContentBrowser. contentViewContainer.hidden();628 this.splitContentBrowser.hidden(); 634 629 635 630 this.quickConsole.consoleLogVisibilityChanged(false); 636 631 }; 637 632 638 WebInspector.showFullHeightConsole = function(requestedScope) 639 { 640 this.splitContentBrowser.element.classList.add("hidden"); 641 642 this._showingSplitConsoleSetting.value = false; 633 WebInspector.showConsoleTab = function(requestedScope) 634 { 635 this.hideSplitConsole(); 643 636 644 637 var scope = requestedScope || WebInspector.LogContentView.Scopes.All; 645 638 646 639 // If the requested scope is already selected and the console is showing, then switch back to All. 647 if (this.isShowingConsole View() && this.consoleContentView.scopeBar.item(scope).selected)640 if (this.isShowingConsoleTab() && this.consoleContentView.scopeBar.item(scope).selected) 648 641 scope = WebInspector.LogContentView.Scopes.All; 649 642 … … 651 644 this.consoleContentView.scopeBar.item(scope).selected = true; 652 645 653 if (!this.contentBrowser.currentContentView || this.contentBrowser.currentContentView !== this.consoleContentView) { 654 // Be sure to close any existing log view in the split content browser before showing it in the 655 // main content browser. We can only show a content view in one browser at a time. 656 this.splitContentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.LogContentView); 657 this.contentBrowser.showContentView(this.consoleContentView); 658 } 659 660 console.assert(this.isShowingConsoleView()); 661 console.assert(this._consoleToolbarButton.activated); 662 663 this.quickConsole.consoleLogVisibilityChanged(true); 664 }; 665 666 WebInspector.isShowingConsoleView = function() 667 { 668 return this.contentBrowser.currentContentView instanceof WebInspector.LogContentView; 669 }; 670 671 WebInspector.showConsoleView = function(scope) 672 { 673 this.showFullHeightConsole(scope); 674 }; 675 676 WebInspector.toggleConsoleView = function() 677 { 678 if (this.isShowingConsoleView()) { 679 if (this.contentBrowser.canGoBack()) 680 this.contentBrowser.goBack(); 681 else 682 this.resourceSidebarPanel.showDefaultContentView(); 683 } else 684 this.showFullHeightConsole(); 646 this.showRepresentedObject(this._consoleRepresentedObject); 647 648 console.assert(this.isShowingConsoleTab()); 649 }; 650 651 WebInspector.isShowingConsoleTab = function() 652 { 653 return this.tabBrowser.selectedTabContentView instanceof WebInspector.ConsoleTabContentView; 685 654 }; 686 655 … … 1662 1631 }; 1663 1632 1633 WebInspector._showConsoleTab = function(event) 1634 { 1635 this.showConsoleTab(); 1636 }; 1637 1664 1638 WebInspector._focusedContentView = function() 1665 1639 { -
trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js
r183331 r183332 64 64 showConsole: function() 65 65 { 66 WebInspector.showConsole View();66 WebInspector.showConsoleTab(); 67 67 68 68 WebInspector.quickConsole.prompt.focus(); -
trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js
r183328 r183332 123 123 _consoleItemWasClicked(scope) 124 124 { 125 WebInspector.showConsole View(scope);125 WebInspector.showConsoleTab(scope); 126 126 } 127 127 -
trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js
r183326 r183332 80 80 this._clearLogOnReloadSetting = new WebInspector.Setting("clear-log-on-reload", true); 81 81 82 var toolTip = WebInspector.UIString("Show split console"); 83 var altToolTip = WebInspector.UIString("Show full-height console"); 84 85 this._toggleSplitNavigationItem = new WebInspector.ToggleButtonNavigationItem("split-toggle", toolTip, altToolTip, platformImagePath("SplitToggleDown.svg"), platformImagePath("SplitToggleUp.svg"), 16, 16); 86 this._toggleSplitNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleSplit, this); 87 this._toggleSplitNavigationItem.toggled = WebInspector.isShowingSplitConsole(); 82 var toolTip = WebInspector.UIString("Show console tab"); 83 this._showConsoleTabNavigationItem = new WebInspector.ButtonNavigationItem("show-tab", toolTip, platformImagePath("SplitToggleUp.svg"), 16, 16); 84 this._showConsoleTabNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._showConsoleTab, this); 88 85 89 86 this.messagesElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), false); … … 119 116 get navigationItems() 120 117 { 121 return [this._searchBar, this._scopeBar, this._clearLogNavigationItem, this._toggleSplitNavigationItem]; 118 var navigationItems = [this._searchBar, this._scopeBar, this._clearLogNavigationItem]; 119 if (WebInspector.isShowingSplitConsole()) 120 navigationItems.push(this._showConsoleTabNavigationItem); 121 return navigationItems; 122 122 }, 123 123 … … 141 141 shown: function() 142 142 { 143 this._toggleSplitNavigationItem.toggled = WebInspector.isShowingSplitConsole();144 145 143 this.prompt.focus(); 146 144 }, … … 205 203 return; 206 204 207 if (!WebInspector.isShowingConsole View())205 if (!WebInspector.isShowingConsoleTab()) 208 206 WebInspector.showSplitConsole(); 209 207 … … 640 638 }, 641 639 642 _toggleSplit: function() 643 { 644 if (WebInspector.isShowingSplitConsole()) 645 WebInspector.showFullHeightConsole(); 646 else 647 WebInspector.showSplitConsole(); 640 _showConsoleTab: function() 641 { 642 WebInspector.showConsoleTab(); 648 643 }, 649 644 -
trunk/Source/WebInspectorUI/UserInterface/Views/LogIcon.css
r164543 r183332 25 25 26 26 .log-icon .icon { 27 content: -webkit-image-set(url(../Images/Log.png) 1x, url(../Images/Log@2x.png) 2x);27 content: url(../Images/Console.svg); 28 28 } -
trunk/Source/WebInspectorUI/UserInterface/Views/Main.css
r182976 r183332 175 175 } 176 176 177 #split-content-browser .hierarchical-path-component.log-icon .icon { 178 margin-left: 6px; 179 margin-right: 6px; 180 opacity: 0.7; 181 } 182 183 #split-content-browser .hierarchical-path-component.log-icon .title { 184 color: rgba(0, 0, 0, 0.75); 185 } 186 187 #split-content-browser .hierarchical-path-component.log-icon select { 188 display: none; 189 } 190 177 191 #details-sidebar { 178 192 width: 300px;
Note:
See TracChangeset
for help on using the changeset viewer.