| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind
(this)); | 39 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind
(this)); |
| 40 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update
.bind(this)); | 40 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update
.bind(this)); |
| 41 | 41 |
| 42 var hbox = this.element.createChild("div", "hbox styles-sidebar-pane-toolbar
"); | 42 var hbox = this.element.createChild("div", "hbox styles-sidebar-pane-toolbar
"); |
| 43 var filterContainerElement = hbox.createChild("div", "styles-sidebar-pane-fi
lter-box"); | 43 var filterContainerElement = hbox.createChild("div", "styles-sidebar-pane-fi
lter-box"); |
| 44 this._filterInput = WebInspector.StylesSidebarPane.createPropertyFilterEleme
nt(WebInspector.UIString("Filter"), hbox, this._onFilterChanged.bind(this)); | 44 this._filterInput = WebInspector.StylesSidebarPane.createPropertyFilterEleme
nt(WebInspector.UIString("Filter"), hbox, this._onFilterChanged.bind(this)); |
| 45 filterContainerElement.appendChild(this._filterInput); | 45 filterContainerElement.appendChild(this._filterInput); |
| 46 | 46 |
| 47 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar
", hbox); | 47 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar
", hbox); |
| 48 if (Runtime.experiments.isEnabled("layoutEditor") && !Runtime.queryParam("re
moteFrontend")) { |
| 49 this._layoutEditorButton = new WebInspector.ToolbarButton(WebInspector.U
IString("Toggle Layout Editor"), "layout-editor-toolbar-item"); |
| 50 toolbar.appendToolbarItem(this._layoutEditorButton); |
| 51 this._layoutEditorButton.addEventListener("click", this._toggleLayoutEdi
tor, this); |
| 52 toolbar.appendSeparator(); |
| 53 } |
| 54 |
| 48 toolbar.element.classList.add("styles-pane-toolbar", "toolbar-gray-toggled")
; | 55 toolbar.element.classList.add("styles-pane-toolbar", "toolbar-gray-toggled")
; |
| 49 this._currentToolbarPane = null; | 56 this._currentToolbarPane = null; |
| 50 | 57 |
| 51 var toolbarPaneContainer = this.element.createChild("div", "styles-sidebar-t
oolbar-pane-container"); | 58 var toolbarPaneContainer = this.element.createChild("div", "styles-sidebar-t
oolbar-pane-container"); |
| 52 this._toolbarPaneElement = toolbarPaneContainer.createChild("div", "styles-s
idebar-toolbar-pane"); | 59 this._toolbarPaneElement = toolbarPaneContainer.createChild("div", "styles-s
idebar-toolbar-pane"); |
| 53 this._sectionsContainer = this.element.createChild("div"); | 60 this._sectionsContainer = this.element.createChild("div"); |
| 54 | 61 |
| 55 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper(); | 62 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper(); |
| 56 | 63 |
| 57 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa
ultCSSFormatter()); | 64 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa
ultCSSFormatter()); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // IE hack. | 136 // IE hack. |
| 130 if (value.endsWith("\9")) | 137 if (value.endsWith("\9")) |
| 131 return true; | 138 return true; |
| 132 if (hasUnknownVendorPrefix(value)) | 139 if (hasUnknownVendorPrefix(value)) |
| 133 return true; | 140 return true; |
| 134 | 141 |
| 135 return false; | 142 return false; |
| 136 } | 143 } |
| 137 | 144 |
| 138 WebInspector.StylesSidebarPane.prototype = { | 145 WebInspector.StylesSidebarPane.prototype = { |
| 146 _toggleLayoutEditor: function() |
| 147 { |
| 148 this._showLayoutEditor = !this._showLayoutEditor; |
| 149 this._layoutEditorButton.setToggled(this._showLayoutEditor); |
| 150 var targets = WebInspector.targetManager.targets(); |
| 151 |
| 152 if (this._showLayoutEditor) |
| 153 WebInspector.inspectElementModeController.disable(); |
| 154 else |
| 155 WebInspector.inspectElementModeController.enable(); |
| 156 |
| 157 var mode = this._showLayoutEditor ? DOMAgent.InspectMode.ShowLayoutEdito
r : DOMAgent.InspectMode.None; |
| 158 for (var domModel of WebInspector.DOMModel.instances()) |
| 159 domModel.setInspectMode(mode); |
| 160 }, |
| 161 |
| 139 onUndoOrRedoHappened: function() | 162 onUndoOrRedoHappened: function() |
| 140 { | 163 { |
| 141 this.setNode(this.node()); | 164 this.setNode(this.node()); |
| 142 }, | 165 }, |
| 143 | 166 |
| 144 /** | 167 /** |
| 145 * @param {!WebInspector.Event} event | 168 * @param {!WebInspector.Event} event |
| 146 */ | 169 */ |
| 147 _onAddButtonLongClick: function(event) | 170 _onAddButtonLongClick: function(event) |
| 148 { | 171 { |
| (...skipping 3034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3183 | 3206 |
| 3184 /** | 3207 /** |
| 3185 * @override | 3208 * @override |
| 3186 * @return {?WebInspector.ToolbarItem} | 3209 * @return {?WebInspector.ToolbarItem} |
| 3187 */ | 3210 */ |
| 3188 item: function() | 3211 item: function() |
| 3189 { | 3212 { |
| 3190 return this._button; | 3213 return this._button; |
| 3191 } | 3214 } |
| 3192 } | 3215 } |
| OLD | NEW |