| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Brian Grinstead All rights reserved. | 2 * Copyright (C) 2011 Brian Grinstead All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 this.slideHelper = this._sliderElement.createChild("div", "spectrum-slider")
; | 49 this.slideHelper = this._sliderElement.createChild("div", "spectrum-slider")
; |
| 50 | 50 |
| 51 var rangeContainer = this.element.createChild("div", "spectrum-range-contain
er"); | 51 var rangeContainer = this.element.createChild("div", "spectrum-range-contain
er"); |
| 52 var alphaLabel = rangeContainer.createChild("label"); | 52 var alphaLabel = rangeContainer.createChild("label"); |
| 53 alphaLabel.textContent = WebInspector.UIString("\u03B1:"); | 53 alphaLabel.textContent = WebInspector.UIString("\u03B1:"); |
| 54 | 54 |
| 55 this._alphaElement = rangeContainer.createChild("input", "spectrum-range"); | 55 this._alphaElement = rangeContainer.createChild("input", "spectrum-range"); |
| 56 this._alphaElement.setAttribute("type", "range"); | 56 this._alphaElement.setAttribute("type", "range"); |
| 57 this._alphaElement.setAttribute("min", "0"); | 57 this._alphaElement.setAttribute("min", "0"); |
| 58 this._alphaElement.setAttribute("max", "100"); | 58 this._alphaElement.setAttribute("max", "100"); |
| 59 this._alphaElement.addEventListener("input", alphaDrag.bind(this), false); |
| 59 this._alphaElement.addEventListener("change", alphaDrag.bind(this), false); | 60 this._alphaElement.addEventListener("change", alphaDrag.bind(this), false); |
| 60 | 61 |
| 61 var swatchElement = document.createElement("span"); | 62 var swatchElement = document.createElement("span"); |
| 62 swatchElement.className = "swatch"; | 63 swatchElement.className = "swatch"; |
| 63 this._swatchInnerElement = swatchElement.createChild("span", "swatch-inner")
; | 64 this._swatchInnerElement = swatchElement.createChild("span", "swatch-inner")
; |
| 64 | 65 |
| 65 var displayContainer = this.element.createChild("div"); | 66 var displayContainer = this.element.createChild("div"); |
| 66 displayContainer.appendChild(swatchElement); | 67 displayContainer.appendChild(swatchElement); |
| 67 this._displayElement = displayContainer.createChild("span", "source-code spe
ctrum-display-value"); | 68 this._displayElement = displayContainer.createChild("span", "source-code spe
ctrum-display-value"); |
| 68 | 69 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 443 |
| 443 WebInspector.ColorSwatch.prototype = { | 444 WebInspector.ColorSwatch.prototype = { |
| 444 /** | 445 /** |
| 445 * @param {string} colorString | 446 * @param {string} colorString |
| 446 */ | 447 */ |
| 447 setColorString: function(colorString) | 448 setColorString: function(colorString) |
| 448 { | 449 { |
| 449 this._swatchInnerElement.style.backgroundColor = colorString; | 450 this._swatchInnerElement.style.backgroundColor = colorString; |
| 450 } | 451 } |
| 451 } | 452 } |
| OLD | NEW |