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 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 var color = WebInspector.Color.parse(text); | 1949 var color = WebInspector.Color.parse(text); |
1950 | 1950 |
1951 // We can be called with valid non-color values of |text| (like 'none' f
rom border style) | 1951 // We can be called with valid non-color values of |text| (like 'none' f
rom border style) |
1952 if (!color) | 1952 if (!color) |
1953 return document.createTextNode(text); | 1953 return document.createTextNode(text); |
1954 | 1954 |
1955 var format = WebInspector.StylesSidebarPane._colorFormat(color); | 1955 var format = WebInspector.StylesSidebarPane._colorFormat(color); |
1956 var spectrumHelper = this.editablePane() && this.editablePane()._spectru
mHelper; | 1956 var spectrumHelper = this.editablePane() && this.editablePane()._spectru
mHelper; |
1957 var spectrum = spectrumHelper ? spectrumHelper.spectrum() : null; | 1957 var spectrum = spectrumHelper ? spectrumHelper.spectrum() : null; |
1958 | 1958 |
1959 var isEditable = !!(this._styleRule && this._styleRule.editable); | 1959 var isEditable = !!(this._styleRule && this._styleRule.editable !== fals
e); // |editable| is true by default. |
1960 var colorSwatch = new WebInspector.ColorSwatch(!isEditable); | 1960 var colorSwatch = new WebInspector.ColorSwatch(!isEditable); |
1961 colorSwatch.setColorString(text); | 1961 colorSwatch.setColorString(text); |
1962 colorSwatch.element.addEventListener("click", swatchClick.bind(this), fa
lse); | 1962 colorSwatch.element.addEventListener("click", swatchClick.bind(this), fa
lse); |
1963 | 1963 |
1964 var scrollerElement; | 1964 var scrollerElement; |
1965 var boundSpectrumChanged = spectrumChanged.bind(this); | 1965 var boundSpectrumChanged = spectrumChanged.bind(this); |
1966 var boundSpectrumHidden = spectrumHidden.bind(this); | 1966 var boundSpectrumHidden = spectrumHidden.bind(this); |
1967 | 1967 |
1968 /** | 1968 /** |
1969 * @param {!WebInspector.Event} e | 1969 * @param {!WebInspector.Event} e |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2989 return; | 2989 return; |
2990 } | 2990 } |
2991 | 2991 |
2992 var results = this._cssCompletions.startsWith(prefix); | 2992 var results = this._cssCompletions.startsWith(prefix); |
2993 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 2993 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
2994 completionsReadyCallback(results, selectedIndex); | 2994 completionsReadyCallback(results, selectedIndex); |
2995 }, | 2995 }, |
2996 | 2996 |
2997 __proto__: WebInspector.TextPrompt.prototype | 2997 __proto__: WebInspector.TextPrompt.prototype |
2998 } | 2998 } |
OLD | NEW |