| 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 this._splitWidget = new WebInspector.SplitWidget(true, true, "elementsPanelS
plitViewState", 325, 325); | 42 this._splitWidget = new WebInspector.SplitWidget(true, true, "elementsPanelS
plitViewState", 325, 325); |
| 43 this._splitWidget.addEventListener(WebInspector.SplitWidget.Events.SidebarSi
zeChanged, this._updateTreeOutlineVisibleWidth.bind(this)); | 43 this._splitWidget.addEventListener(WebInspector.SplitWidget.Events.SidebarSi
zeChanged, this._updateTreeOutlineVisibleWidth.bind(this)); |
| 44 this._splitWidget.show(this.element); | 44 this._splitWidget.show(this.element); |
| 45 | 45 |
| 46 this._searchableView = new WebInspector.SearchableView(this); | 46 this._searchableView = new WebInspector.SearchableView(this); |
| 47 this._searchableView.setMinimumSize(25, 19); | 47 this._searchableView.setMinimumSize(25, 19); |
| 48 this._searchableView.setPlaceholder(WebInspector.UIString("Find by string, s
elector, or XPath")); | 48 this._searchableView.setPlaceholder(WebInspector.UIString("Find by string, s
elector, or XPath")); |
| 49 var stackElement = this._searchableView.element; | 49 var stackElement = this._searchableView.element; |
| 50 | 50 |
| 51 this._contentElement = createElement("div"); |
| 52 var crumbsContainer = createElement("div"); |
| 53 if (Runtime.experiments.isEnabled("materialDesign")) { |
| 54 this._toolbar = this._createElementsToolbar(); |
| 55 var toolbar = stackElement.createChild("div", "elements-topbar hbox"); |
| 56 toolbar.appendChild(crumbsContainer); |
| 57 toolbar.appendChild(this._toolbar.element); |
| 58 stackElement.appendChild(this._contentElement); |
| 59 } else { |
| 60 stackElement.appendChild(this._contentElement); |
| 61 stackElement.appendChild(crumbsContainer); |
| 62 } |
| 63 |
| 51 this._elementsPanelTreeOutilneSplit = new WebInspector.SplitWidget(false, tr
ue, "treeOutlineAnimationTimelineWidget", 300, 300); | 64 this._elementsPanelTreeOutilneSplit = new WebInspector.SplitWidget(false, tr
ue, "treeOutlineAnimationTimelineWidget", 300, 300); |
| 52 this._elementsPanelTreeOutilneSplit.hideSidebar(); | 65 this._elementsPanelTreeOutilneSplit.hideSidebar(); |
| 53 this._elementsPanelTreeOutilneSplit.setMainWidget(this._searchableView); | 66 this._elementsPanelTreeOutilneSplit.setMainWidget(this._searchableView); |
| 54 this._splitWidget.setMainWidget(this._elementsPanelTreeOutilneSplit); | 67 this._splitWidget.setMainWidget(this._elementsPanelTreeOutilneSplit); |
| 55 | 68 |
| 56 this._contentElement = stackElement.createChild("div"); | |
| 57 this._contentElement.id = "elements-content"; | 69 this._contentElement.id = "elements-content"; |
| 58 // FIXME: crbug.com/425984 | 70 // FIXME: crbug.com/425984 |
| 59 if (WebInspector.moduleSetting("domWordWrap").get()) | 71 if (WebInspector.moduleSetting("domWordWrap").get()) |
| 60 this._contentElement.classList.add("elements-wrap"); | 72 this._contentElement.classList.add("elements-wrap"); |
| 61 WebInspector.moduleSetting("domWordWrap").addChangeListener(this._domWordWra
pSettingChanged.bind(this)); | 73 WebInspector.moduleSetting("domWordWrap").addChangeListener(this._domWordWra
pSettingChanged.bind(this)); |
| 62 | 74 |
| 63 var crumbsContainer = stackElement.createChild("div"); | |
| 64 crumbsContainer.id = "elements-crumbs"; | 75 crumbsContainer.id = "elements-crumbs"; |
| 65 this._breadcrumbs = new WebInspector.ElementsBreadcrumbs(); | 76 this._breadcrumbs = new WebInspector.ElementsBreadcrumbs(); |
| 66 this._breadcrumbs.show(crumbsContainer); | 77 this._breadcrumbs.show(crumbsContainer); |
| 67 this._breadcrumbs.addEventListener(WebInspector.ElementsBreadcrumbs.Events.N
odeSelected, this._crumbNodeSelected, this); | 78 this._breadcrumbs.addEventListener(WebInspector.ElementsBreadcrumbs.Events.N
odeSelected, this._crumbNodeSelected, this); |
| 68 | 79 |
| 69 this.sidebarPanes = {}; | 80 this.sidebarPanes = {}; |
| 70 /** @type !Array<!WebInspector.ElementsSidebarViewWrapperPane> */ | 81 /** @type !Array<!WebInspector.ElementsSidebarViewWrapperPane> */ |
| 71 this._elementsSidebarViewWrappers = []; | 82 this._elementsSidebarViewWrappers = []; |
| 72 var sharedSidebarModel = new WebInspector.SharedSidebarModel(); | 83 var sharedSidebarModel = new WebInspector.SharedSidebarModel(); |
| 73 this.sidebarPanes.platformFonts = WebInspector.PlatformFontsWidget.createSid
ebarWrapper(sharedSidebarModel); | 84 this.sidebarPanes.platformFonts = WebInspector.PlatformFontsWidget.createSid
ebarWrapper(sharedSidebarModel); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 102 WebInspector.targetManager.observeTargets(this); | 113 WebInspector.targetManager.observeTargets(this); |
| 103 WebInspector.moduleSetting("showUAShadowDOM").addChangeListener(this._showUA
ShadowDOMChanged.bind(this)); | 114 WebInspector.moduleSetting("showUAShadowDOM").addChangeListener(this._showUA
ShadowDOMChanged.bind(this)); |
| 104 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec
tor.DOMModel.Events.DocumentUpdated, this._documentUpdatedEvent, this); | 115 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec
tor.DOMModel.Events.DocumentUpdated, this._documentUpdatedEvent, this); |
| 105 WebInspector.targetManager.addModelListener(WebInspector.CSSStyleModel, WebI
nspector.CSSStyleModel.Events.PseudoStateForced, this._pseudoStateForced, this); | 116 WebInspector.targetManager.addModelListener(WebInspector.CSSStyleModel, WebI
nspector.CSSStyleModel.Events.PseudoStateForced, this._pseudoStateForced, this); |
| 106 WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.E
vents.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); | 117 WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.E
vents.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); |
| 107 } | 118 } |
| 108 | 119 |
| 109 WebInspector.ElementsPanel._elementsSidebarViewTitleSymbol = Symbol("title"); | 120 WebInspector.ElementsPanel._elementsSidebarViewTitleSymbol = Symbol("title"); |
| 110 | 121 |
| 111 WebInspector.ElementsPanel.prototype = { | 122 WebInspector.ElementsPanel.prototype = { |
| 123 /** |
| 124 * @return {!WebInspector.Toolbar} |
| 125 */ |
| 126 _createElementsToolbar: function() |
| 127 { |
| 128 var toolbar = new WebInspector.ExtensibleToolbar("elements-toolbar"); |
| 129 toolbar.element.classList.add("elements-toolbar"); |
| 130 toolbar.appendToolbarItem(new WebInspector.ToolbarSeparator()); |
| 131 return toolbar; |
| 132 }, |
| 133 |
| 112 _loadSidebarViews: function() | 134 _loadSidebarViews: function() |
| 113 { | 135 { |
| 114 var extensions = self.runtime.extensions("@WebInspector.Widget"); | 136 var extensions = self.runtime.extensions("@WebInspector.Widget"); |
| 115 | 137 |
| 116 for (var i = 0; i < extensions.length; ++i) { | 138 for (var i = 0; i < extensions.length; ++i) { |
| 117 var descriptor = extensions[i].descriptor(); | 139 var descriptor = extensions[i].descriptor(); |
| 118 if (descriptor["location"] !== "elements-panel") | 140 if (descriptor["location"] !== "elements-panel") |
| 119 continue; | 141 continue; |
| 120 | 142 |
| 121 var title = WebInspector.UIString(descriptor["title"]); | 143 var title = WebInspector.UIString(descriptor["title"]); |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 WebInspector.ElementsPanelFactory.prototype = { | 1139 WebInspector.ElementsPanelFactory.prototype = { |
| 1118 /** | 1140 /** |
| 1119 * @override | 1141 * @override |
| 1120 * @return {!WebInspector.Panel} | 1142 * @return {!WebInspector.Panel} |
| 1121 */ | 1143 */ |
| 1122 createPanel: function() | 1144 createPanel: function() |
| 1123 { | 1145 { |
| 1124 return WebInspector.ElementsPanel.instance(); | 1146 return WebInspector.ElementsPanel.instance(); |
| 1125 } | 1147 } |
| 1126 } | 1148 } |
| OLD | NEW |