| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 WebInspector.ElementsPanel._elementsSidebarViewTitleSymbol = Symbol("title"); | 95 WebInspector.ElementsPanel._elementsSidebarViewTitleSymbol = Symbol("title"); |
| 96 | 96 |
| 97 WebInspector.ElementsPanel.prototype = { | 97 WebInspector.ElementsPanel.prototype = { |
| 98 /** | 98 /** |
| 99 * @param {!WebInspector.CSSProperty} cssProperty | 99 * @param {!WebInspector.CSSProperty} cssProperty |
| 100 */ | 100 */ |
| 101 _revealProperty: function(cssProperty) | 101 _revealProperty: function(cssProperty) |
| 102 { | 102 { |
| 103 var stylesSidebarPane = this.sidebarPanes.styles; | 103 var stylesSidebarPane = this.sidebarPanes.styles; |
| 104 this.sidebarPaneView.selectTab(stylesSidebarPane.title()); | 104 this.sidebarPaneView.selectTab(WebInspector.UIString("Styles")); |
| 105 stylesSidebarPane.revealProperty(/** @type {!WebInspector.CSSProperty} *
/(cssProperty)); | 105 stylesSidebarPane.revealProperty(/** @type {!WebInspector.CSSProperty} *
/(cssProperty)); |
| 106 return Promise.resolve(); | 106 return Promise.resolve(); |
| 107 }, | 107 }, |
| 108 | 108 |
| 109 /** | 109 /** |
| 110 * @param {!WebInspector.StylesSidebarPane} ssp | 110 * @param {!WebInspector.StylesSidebarPane} ssp |
| 111 * @return {!Element} | 111 * @return {!Element} |
| 112 */ | 112 */ |
| 113 _createStylesSidebarToolbar: function(ssp) | 113 _createStylesSidebarToolbar: function(ssp) |
| 114 { | 114 { |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 this.sidebarPanes.metrics.show(matchedStylePanesWrapper.element)
; | 895 this.sidebarPanes.metrics.show(matchedStylePanesWrapper.element)
; |
| 896 } | 896 } |
| 897 | 897 |
| 898 /** | 898 /** |
| 899 * @param {!WebInspector.Event} event | 899 * @param {!WebInspector.Event} event |
| 900 * @this {WebInspector.ElementsPanel} | 900 * @this {WebInspector.ElementsPanel} |
| 901 */ | 901 */ |
| 902 function tabSelected(event) | 902 function tabSelected(event) |
| 903 { | 903 { |
| 904 var tabId = /** @type {string} */ (event.data.tabId); | 904 var tabId = /** @type {string} */ (event.data.tabId); |
| 905 if (tabId === computedPane.title()) | 905 if (tabId === WebInspector.UIString("Computed")) |
| 906 showMetrics.call(this, true); | 906 showMetrics.call(this, true); |
| 907 else if (tabId === stylesPane.title()) | 907 else if (tabId === WebInspector.UIString("Styles")) |
| 908 showMetrics.call(this, false); | 908 showMetrics.call(this, false); |
| 909 } | 909 } |
| 910 | 910 |
| 911 this.sidebarPaneView = new WebInspector.SidebarTabbedPane(); | 911 this.sidebarPaneView = new WebInspector.SidebarTabbedPane(); |
| 912 this.sidebarPaneView.element.addEventListener("contextmenu", this._sideb
arContextMenuEventFired.bind(this), false); | 912 this.sidebarPaneView.element.addEventListener("contextmenu", this._sideb
arContextMenuEventFired.bind(this), false); |
| 913 if (this._popoverHelper) | 913 if (this._popoverHelper) |
| 914 this._popoverHelper.hidePopover(); | 914 this._popoverHelper.hidePopover(); |
| 915 this._popoverHelper = new WebInspector.PopoverHelper(this.sidebarPaneVie
w.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this)); | 915 this._popoverHelper = new WebInspector.PopoverHelper(this.sidebarPaneVie
w.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this)); |
| 916 this._popoverHelper.setTimeout(0); | 916 this._popoverHelper.setTimeout(0); |
| 917 | 917 |
| 918 if (horizontally) { | 918 if (horizontally) { |
| 919 this._splitWidget.installResizer(this.sidebarPaneView.headerElement(
)); | 919 this._splitWidget.installResizer(this.sidebarPaneView.headerElement(
)); |
| 920 | 920 |
| 921 var compositePane = new WebInspector.SidebarPane(this.sidebarPanes.s
tyles.title()); | 921 var compositePane = new WebInspector.SidebarPane(WebInspector.UIStri
ng("Styles")); |
| 922 compositePane.element.classList.add("composite"); | 922 compositePane.element.classList.add("composite"); |
| 923 compositePane.element.classList.add("fill"); | 923 compositePane.element.classList.add("fill"); |
| 924 | 924 |
| 925 var splitWidget = new WebInspector.SplitWidget(true, true, "stylesPa
neSplitViewState", 215); | 925 var splitWidget = new WebInspector.SplitWidget(true, true, "stylesPa
neSplitViewState", 215); |
| 926 splitWidget.show(compositePane.element); | 926 splitWidget.show(compositePane.element); |
| 927 | 927 |
| 928 splitWidget.setMainWidget(matchedStylesContainer); | 928 splitWidget.setMainWidget(matchedStylesContainer); |
| 929 splitWidget.setSidebarWidget(computedStylePanesWrapper); | 929 splitWidget.setSidebarWidget(computedStylePanesWrapper); |
| 930 | 930 |
| 931 computedPane.show(computedStylePanesWrapper.element); | 931 computedPane.show(computedStylePanesWrapper.element); |
| 932 this.sidebarPaneView.addPane(compositePane); | 932 this.sidebarPaneView.addPane(compositePane); |
| 933 } else { | 933 } else { |
| 934 var stylesPane = new WebInspector.SidebarPane(this.sidebarPanes.styl
es.title()); | 934 var stylesPane = new WebInspector.SidebarPane(WebInspector.UIString(
"Styles")); |
| 935 stylesPane.element.classList.add("composite", "fill", "metrics-and-s
tyles"); | 935 stylesPane.element.classList.add("composite", "fill", "metrics-and-s
tyles"); |
| 936 | 936 |
| 937 matchedStylesContainer.show(stylesPane.element); | 937 matchedStylesContainer.show(stylesPane.element); |
| 938 computedStylePanesWrapper.show(computedPane.element); | 938 computedStylePanesWrapper.show(computedPane.element); |
| 939 | 939 |
| 940 this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventT
ypes.TabSelected, tabSelected, this); | 940 this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventT
ypes.TabSelected, tabSelected, this); |
| 941 this.sidebarPaneView.addPane(stylesPane); | 941 this.sidebarPaneView.addPane(stylesPane); |
| 942 this.sidebarPaneView.addPane(computedPane); | 942 this.sidebarPaneView.addPane(computedPane); |
| 943 } | 943 } |
| 944 | 944 |
| 945 this.sidebarPanes.styles.show(matchedStylePanesWrapper.element); | 945 this.sidebarPanes.styles.show(matchedStylePanesWrapper.element); |
| 946 this.sidebarPanes.computedStyle.show(computedStylePanesWrapper.element); | 946 this.sidebarPanes.computedStyle.show(computedStylePanesWrapper.element); |
| 947 showMetrics.call(this, horizontally); | 947 showMetrics.call(this, horizontally); |
| 948 | 948 |
| 949 this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners); | 949 this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners); |
| 950 this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints); | 950 this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints); |
| 951 this.sidebarPaneView.addPane(this.sidebarPanes.properties); | 951 this.sidebarPaneView.addPane(this.sidebarPanes.properties); |
| 952 | 952 |
| 953 for (var sidebarViewWrapper of this._elementsSidebarViewWrappers) | 953 for (var sidebarViewWrapper of this._elementsSidebarViewWrappers) |
| 954 this.sidebarPaneView.addPane(sidebarViewWrapper); | 954 this.sidebarPaneView.addPane(sidebarViewWrapper); |
| 955 | 955 |
| 956 this._extensionSidebarPanesContainer = this.sidebarPaneView; | 956 this._extensionSidebarPanesContainer = this.sidebarPaneView; |
| 957 | 957 |
| 958 for (var i = 0; i < extensionSidebarPanes.length; ++i) | 958 for (var i = 0; i < extensionSidebarPanes.length; ++i) |
| 959 this._addExtensionSidebarPane(extensionSidebarPanes[i]); | 959 this._addExtensionSidebarPane(extensionSidebarPanes[i]); |
| 960 | 960 |
| 961 this._splitWidget.setSidebarWidget(this.sidebarPaneView); | 961 this._splitWidget.setSidebarWidget(this.sidebarPaneView); |
| 962 this.sidebarPanes.styles.expand(); | 962 this.sidebarPanes.styles.expandPane(); |
| 963 | 963 |
| 964 if (selectedTabId) | 964 if (selectedTabId) |
| 965 this.sidebarPaneView.selectTab(selectedTabId); | 965 this.sidebarPaneView.selectTab(selectedTabId); |
| 966 }, | 966 }, |
| 967 | 967 |
| 968 /** | 968 /** |
| 969 * @param {!WebInspector.Event} event | 969 * @param {!WebInspector.Event} event |
| 970 */ | 970 */ |
| 971 _extensionSidebarPaneAdded: function(event) | 971 _extensionSidebarPaneAdded: function(event) |
| 972 { | 972 { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 /** | 1180 /** |
| 1181 * @override | 1181 * @override |
| 1182 * @param {!WebInspector.DOMNode} node | 1182 * @param {!WebInspector.DOMNode} node |
| 1183 * @return {?{title: string, color: string}} | 1183 * @return {?{title: string, color: string}} |
| 1184 */ | 1184 */ |
| 1185 decorate: function(node) | 1185 decorate: function(node) |
| 1186 { | 1186 { |
| 1187 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; | 1187 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; |
| 1188 } | 1188 } |
| 1189 } | 1189 } |
| OLD | NEW |