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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 option.value = WebInspector.StylesSidebarPane.ColorFormat.RGB; | 52 option.value = WebInspector.StylesSidebarPane.ColorFormat.RGB; |
53 option.label = WebInspector.UIString("RGB Colors"); | 53 option.label = WebInspector.UIString("RGB Colors"); |
54 this.settingsSelectElement.appendChild(option); | 54 this.settingsSelectElement.appendChild(option); |
55 | 55 |
56 option = document.createElement("option"); | 56 option = document.createElement("option"); |
57 option.value = WebInspector.StylesSidebarPane.ColorFormat.HSL; | 57 option.value = WebInspector.StylesSidebarPane.ColorFormat.HSL; |
58 option.label = WebInspector.UIString("HSL Colors"); | 58 option.label = WebInspector.UIString("HSL Colors"); |
59 this.settingsSelectElement.appendChild(option); | 59 this.settingsSelectElement.appendChild(option); |
60 | 60 |
61 // Prevent section from collapsing. | 61 // Prevent section from collapsing. |
62 var muteEventListener = function(event) { event.consume(); }; | 62 var muteEventListener = function(event) { event.consume(true); }; |
63 | 63 |
64 this.settingsSelectElement.addEventListener("click", muteEventListener, true
); | 64 this.settingsSelectElement.addEventListener("click", muteEventListener, true
); |
65 this.settingsSelectElement.addEventListener("change", this._changeSetting.bi
nd(this), false); | 65 this.settingsSelectElement.addEventListener("change", this._changeSetting.bi
nd(this), false); |
66 this._updateColorFormatFilter(); | 66 this._updateColorFormatFilter(); |
67 | 67 |
68 this.titleElement.appendChild(this.settingsSelectElement); | 68 this.titleElement.appendChild(this.settingsSelectElement); |
69 | 69 |
70 this._elementStateButton = document.createElement("button"); | 70 this._elementStateButton = document.createElement("button"); |
71 this._elementStateButton.className = "pane-title-button element-state"; | 71 this._elementStateButton.className = "pane-title-button element-state"; |
72 this._elementStateButton.title = WebInspector.UIString("Toggle Element State
"); | 72 this._elementStateButton.title = WebInspector.UIString("Toggle Element State
"); |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 event.consume(); | 1250 event.consume(); |
1251 return; | 1251 return; |
1252 } | 1252 } |
1253 this.expand(); | 1253 this.expand(); |
1254 this.addNewBlankProperty().startEditing(); | 1254 this.addNewBlankProperty().startEditing(); |
1255 }, | 1255 }, |
1256 | 1256 |
1257 _handleSelectorClick: function(event) | 1257 _handleSelectorClick: function(event) |
1258 { | 1258 { |
1259 this._startEditingOnMouseEvent(); | 1259 this._startEditingOnMouseEvent(); |
1260 event.consume(); | 1260 event.consume(true); |
1261 }, | 1261 }, |
1262 | 1262 |
1263 _startEditingOnMouseEvent: function() | 1263 _startEditingOnMouseEvent: function() |
1264 { | 1264 { |
1265 if (!this.editable) | 1265 if (!this.editable) |
1266 return; | 1266 return; |
1267 | 1267 |
1268 if (!this.rule && this.propertiesTreeOutline.children.length === 0) { | 1268 if (!this.rule && this.propertiesTreeOutline.children.length === 0) { |
1269 this.expand(); | 1269 this.expand(); |
1270 this.addNewBlankProperty().startEditing(); | 1270 this.addNewBlankProperty().startEditing(); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 | 1798 |
1799 if (visible) { | 1799 if (visible) { |
1800 spectrum.displayText = color.toString(format); | 1800 spectrum.displayText = color.toString(format); |
1801 self._parentPane._isEditingStyle = true; | 1801 self._parentPane._isEditingStyle = true; |
1802 spectrum.addEventListener(WebInspector.Spectrum.Even
ts.ColorChanged, spectrumChanged); | 1802 spectrum.addEventListener(WebInspector.Spectrum.Even
ts.ColorChanged, spectrumChanged); |
1803 spectrum.addEventListener(WebInspector.Spectrum.Even
ts.Hidden, spectrumHidden); | 1803 spectrum.addEventListener(WebInspector.Spectrum.Even
ts.Hidden, spectrumHidden); |
1804 | 1804 |
1805 scrollerElement.addEventListener("scroll", repositio
nSpectrum, false); | 1805 scrollerElement.addEventListener("scroll", repositio
nSpectrum, false); |
1806 } | 1806 } |
1807 } | 1807 } |
1808 e.consume(); | 1808 e.consume(true); |
1809 } | 1809 } |
1810 | 1810 |
1811 function getFormat() | 1811 function getFormat() |
1812 { | 1812 { |
1813 var format; | 1813 var format; |
1814 var formatSetting = WebInspector.settings.colorFormat.get(); | 1814 var formatSetting = WebInspector.settings.colorFormat.get(); |
1815 if (formatSetting === cf.Original) | 1815 if (formatSetting === cf.Original) |
1816 format = cf.Original; | 1816 format = cf.Original; |
1817 else if (color.nickname) | 1817 else if (color.nickname) |
1818 format = cf.Nickname; | 1818 format = cf.Nickname; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 return; | 2018 return; |
2019 | 2019 |
2020 this.nameElement = document.createElement("span"); | 2020 this.nameElement = document.createElement("span"); |
2021 this.nameElement.className = "webkit-css-property"; | 2021 this.nameElement.className = "webkit-css-property"; |
2022 this.nameElement.textContent = ""; | 2022 this.nameElement.textContent = ""; |
2023 this.listItemElement.insertBefore(this.nameElement, this.listItemElement
.firstChild); | 2023 this.listItemElement.insertBefore(this.nameElement, this.listItemElement
.firstChild); |
2024 }, | 2024 }, |
2025 | 2025 |
2026 _mouseClick: function(event) | 2026 _mouseClick: function(event) |
2027 { | 2027 { |
2028 event.consume(); | 2028 event.consume(true); |
2029 | 2029 |
2030 if (event.target === this.listItemElement) { | 2030 if (event.target === this.listItemElement) { |
2031 if (!this.section.editable) | 2031 if (!this.section.editable) |
2032 return; | 2032 return; |
2033 | 2033 |
2034 if (this.section._checkWillCancelEditing()) | 2034 if (this.section._checkWillCancelEditing()) |
2035 return; | 2035 return; |
2036 this.section.addNewBlankProperty(this.property.index + 1).startEditi
ng(); | 2036 this.section.addNewBlankProperty(this.property.index + 1).startEditi
ng(); |
2037 return; | 2037 return; |
2038 } | 2038 } |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2614 var prefix = wordRange.toString().toLowerCase(); | 2614 var prefix = wordRange.toString().toLowerCase(); |
2615 if (!prefix && !force) | 2615 if (!prefix && !force) |
2616 return; | 2616 return; |
2617 | 2617 |
2618 var results = this._cssCompletions.startsWith(prefix); | 2618 var results = this._cssCompletions.startsWith(prefix); |
2619 completionsReadyCallback(results); | 2619 completionsReadyCallback(results); |
2620 } | 2620 } |
2621 } | 2621 } |
2622 | 2622 |
2623 WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype.__proto__ = WebInspec
tor.TextPrompt.prototype; | 2623 WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype.__proto__ = WebInspec
tor.TextPrompt.prototype; |
OLD | NEW |