| 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 13 matching lines...) Expand all Loading... |
| 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * @constructor | 31 * @constructor |
| 32 * @extends {WebInspector.SidebarPane} | 32 * @extends {WebInspector.SidebarPane} |
| 33 * @param {!WebInspector.ComputedStyleSidebarPane} computedStylePane | 33 * @param {!WebInspector.ComputedStyleSidebarPane} computedStylePane |
| 34 * @param {function(!DOMAgent.NodeId, string, boolean)} setPseudoClassCallback | 34 * @param {function(!WebInspector.DOMNode, string, boolean)=} setPseudoClassCall
back |
| 35 */ | 35 */ |
| 36 WebInspector.StylesSidebarPane = function(computedStylePane, setPseudoClassCallb
ack) | 36 WebInspector.StylesSidebarPane = function(computedStylePane, setPseudoClassCallb
ack) |
| 37 { | 37 { |
| 38 WebInspector.SidebarPane.call(this, WebInspector.UIString("Styles")); | 38 WebInspector.SidebarPane.call(this, WebInspector.UIString("Styles")); |
| 39 | 39 |
| 40 this._elementStateButton = document.createElement("button"); | 40 this._elementStateButton = document.createElement("button"); |
| 41 this._elementStateButton.className = "pane-title-button element-state"; | 41 this._elementStateButton.className = "pane-title-button element-state"; |
| 42 this._elementStateButton.title = WebInspector.UIString("Toggle Element State
"); | 42 this._elementStateButton.title = WebInspector.UIString("Toggle Element State
"); |
| 43 this._elementStateButton.addEventListener("click", this._toggleElementStateP
ane.bind(this), false); | 43 this._elementStateButton.addEventListener("click", this._toggleElementStateP
ane.bind(this), false); |
| 44 this.titleElement.appendChild(this._elementStateButton); | 44 this.titleElement.appendChild(this._elementStateButton); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 function searchHandler(regex) | 204 function searchHandler(regex) |
| 205 { | 205 { |
| 206 this._filterRegex = regex; | 206 this._filterRegex = regex; |
| 207 } | 207 } |
| 208 | 208 |
| 209 return filterInput; | 209 return filterInput; |
| 210 }, | 210 }, |
| 211 | 211 |
| 212 get _forcedPseudoClasses() | 212 get _forcedPseudoClasses() |
| 213 { | 213 { |
| 214 return this.node ? (this.node.getUserProperty("pseudoState") || undefine
d) : undefined; | 214 return this.node ? (this.node.getUserProperty(WebInspector.CSSStyleModel
.PseudoStatePropertyName) || undefined) : undefined; |
| 215 }, | 215 }, |
| 216 | 216 |
| 217 _updateForcedPseudoStateInputs: function() | 217 _updateForcedPseudoStateInputs: function() |
| 218 { | 218 { |
| 219 if (!this.node) | 219 if (!this.node) |
| 220 return; | 220 return; |
| 221 | 221 |
| 222 var hasPseudoType = !!this.node.pseudoType(); | 222 var hasPseudoType = !!this.node.pseudoType(); |
| 223 this._elementStateButton.classList.toggle("hidden", hasPseudoType); | 223 this._elementStateButton.classList.toggle("hidden", hasPseudoType); |
| 224 this._elementStatePane.classList.toggle("expanded", !hasPseudoType && th
is._elementStateButton.classList.contains("toggled")); | 224 this._elementStatePane.classList.toggle("expanded", !hasPseudoType && th
is._elementStateButton.classList.contains("toggled")); |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 | 813 |
| 814 /** | 814 /** |
| 815 * @param {?Event} event | 815 * @param {?Event} event |
| 816 * @this {WebInspector.StylesSidebarPane} | 816 * @this {WebInspector.StylesSidebarPane} |
| 817 */ | 817 */ |
| 818 function clickListener(event) | 818 function clickListener(event) |
| 819 { | 819 { |
| 820 var node = this._validateNode(); | 820 var node = this._validateNode(); |
| 821 if (!node) | 821 if (!node) |
| 822 return; | 822 return; |
| 823 this._setPseudoClassCallback(node.id, event.target.state, event.targ
et.checked); | 823 this._setPseudoClassCallback(node, event.target.state, event.target.
checked); |
| 824 } | 824 } |
| 825 | 825 |
| 826 /** | 826 /** |
| 827 * @param {string} state | 827 * @param {string} state |
| 828 * @return {!Element} | 828 * @return {!Element} |
| 829 * @this {WebInspector.StylesSidebarPane} | 829 * @this {WebInspector.StylesSidebarPane} |
| 830 */ | 830 */ |
| 831 function createCheckbox(state) | 831 function createCheckbox(state) |
| 832 { | 832 { |
| 833 var td = document.createElement("td"); | 833 var td = document.createElement("td"); |
| (...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3239 return; | 3239 return; |
| 3240 } | 3240 } |
| 3241 | 3241 |
| 3242 var results = this._cssCompletions.startsWith(prefix); | 3242 var results = this._cssCompletions.startsWith(prefix); |
| 3243 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 3243 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
| 3244 completionsReadyCallback(results, selectedIndex); | 3244 completionsReadyCallback(results, selectedIndex); |
| 3245 }, | 3245 }, |
| 3246 | 3246 |
| 3247 __proto__: WebInspector.TextPrompt.prototype | 3247 __proto__: WebInspector.TextPrompt.prototype |
| 3248 } | 3248 } |
| OLD | NEW |