Changeset 188229 in webkit
- Timestamp:
- Aug 10, 2015 1:56:18 PM (9 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 30 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r188226 r188229 1 2015-08-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Add different types of non-numerical Visual editors for CSS properties 4 https://bugs.webkit.org/show_bug.cgi?id=147711 5 6 Added editors for keyword based CSS properties for use in the Visual style 7 details panel in the CSS sidebar. Also added images for keyword values that 8 are simple enough to be conveyed in an image. 9 10 Reviewed by Brian Burg. 11 12 * UserInterface/Images/ClearBoth.svg: Added. 13 * UserInterface/Images/ClearLeft.svg: Added. 14 * UserInterface/Images/ClearRight.svg: Added. 15 * UserInterface/Images/FloatLeft.svg: Added. 16 * UserInterface/Images/FloatRight.svg: Added. 17 * UserInterface/Images/FontStyleItalic.svg: Added. 18 * UserInterface/Images/FontStyleNormal.svg: Added. 19 * UserInterface/Images/FontVariantSmallCaps.svg: Added. 20 * UserInterface/Images/TextAlignCenter.svg: Added. 21 * UserInterface/Images/TextAlignJustify.svg: Added. 22 * UserInterface/Images/TextAlignLeft.svg: Added. 23 * UserInterface/Images/TextAlignRight.svg: Added. 24 * UserInterface/Images/TextDecorationLineThrough.svg: Added. 25 * UserInterface/Images/TextDecorationOverline.svg: Added. 26 * UserInterface/Images/TextDecorationUnderline.svg: Added. 27 * UserInterface/Images/TextTransformCapitalize.svg: Added. 28 * UserInterface/Images/TextTransformLowercase.svg: Added. 29 * UserInterface/Images/TextTransformUppercase.svg: Added. 30 * UserInterface/Images/VisualStyleNone.svg: Added. 31 * UserInterface/Views/CSSStyleDeclarationTextEditor.js: 32 (WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches.update): 33 (WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches): 34 Changed color swatch title. 35 36 * UserInterface/Views/Slider.js: 37 (WebInspector.Slider): 38 (WebInspector.Slider.prototype.set value): 39 (WebInspector.Slider.prototype.set knobX): 40 (WebInspector.Slider.prototype.get maxX): 41 If the given value is below 0, reset it to 0. 42 (WebInspector.Slider.prototype._handleMousedown): 43 (WebInspector.Slider.prototype._handleMousemove): 44 (WebInspector.Slider.prototype.get _maxX): Deleted. 45 46 * UserInterface/Views/VisualStyleColorPicker.css: Added. 47 (.visual-style-property-container.input-color-picker > .visual-style-property-value-container): 48 (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .visual-style-special-property-placeholder): 49 (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch): 50 (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch:hover): 51 (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch:active): 52 (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch > span): 53 (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > input): 54 (.visual-style-property-container.input-color-picker.multiple > .visual-style-property-value-container > .visual-style-multiple-property-placeholder): 55 56 * UserInterface/Views/VisualStyleColorPicker.js: Added. 57 (WebInspector.VisualStyleColorPicker): 58 (WebInspector.VisualStyleColorPicker.prototype.get value): 59 (WebInspector.VisualStyleColorPicker.prototype.set value): 60 (WebInspector.VisualStyleColorPicker.prototype.get placeholder): 61 (WebInspector.VisualStyleColorPicker.prototype.set placeholder): 62 (WebInspector.VisualStyleColorPicker.prototype.get synthesizedValue): 63 (WebInspector.VisualStyleColorPicker.prototype.get hasCompletions): 64 (WebInspector.VisualStyleColorPicker.prototype.set completions): 65 (WebInspector.VisualStyleColorPicker.prototype._updateColorSwatch): 66 (WebInspector.VisualStyleColorPicker.prototype._colorSwatchClicked): 67 (WebInspector.VisualStyleColorPicker.prototype._colorPickerColorDidChange): 68 (WebInspector.VisualStyleColorPicker.prototype._completionClicked): 69 (WebInspector.VisualStyleColorPicker.prototype._textInputKeyDown): 70 (WebInspector.VisualStyleColorPicker.prototype._textInputKeyUp): 71 (WebInspector.VisualStyleColorPicker.prototype._showCompletionsIfAble): 72 (WebInspector.VisualStyleColorPicker.prototype._hideCompletions): 73 (WebInspector.VisualStyleColorPicker.prototype._toggleTabbingOfSelectableElements): 74 75 * UserInterface/Views/VisualStyleKeywordCheckbox.css: Added. 76 (.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container): 77 (.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container > input): 78 (.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container > div): 79 80 * UserInterface/Views/VisualStyleKeywordCheckbox.js: Added. 81 (WebInspector.VisualStyleKeywordCheckbox): 82 (WebInspector.VisualStyleKeywordCheckbox.prototype.get value): 83 (WebInspector.VisualStyleKeywordCheckbox.prototype.set value): 84 (WebInspector.VisualStyleKeywordCheckbox.prototype.get synthesizedValue): 85 (WebInspector.VisualStyleKeywordCheckbox.prototype._toggleTabbingOfSelectableElements): 86 87 * UserInterface/Views/VisualStyleKeywordIconList.css: Added. 88 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container): 89 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container): 90 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon): 91 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:first-child): 92 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:last-child): 93 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:matches(.computed, .selected)): 94 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected): 95 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected svg .stroked): 96 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected svg .filled): 97 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:matches(.computed, .selected) + .keyword-icon): 98 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon > div): 99 (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:not(.selected) > div): 100 101 * UserInterface/Views/VisualStyleKeywordIconList.js: Added. 102 (WebInspector.VisualStyleKeywordIconList.dashToCapital): 103 (WebInspector.VisualStyleKeywordIconList.createListItem): 104 (WebInspector.VisualStyleKeywordIconList): 105 (WebInspector.VisualStyleKeywordIconList.prototype.get value): 106 (WebInspector.VisualStyleKeywordIconList.prototype.set value): 107 (WebInspector.VisualStyleKeywordIconList.prototype.get synthesizedValue): 108 (WebInspector.VisualStyleKeywordIconList.prototype._handleKeywordChanged): 109 110 * UserInterface/Views/VisualStyleKeywordPicker.js: Added. 111 (WebInspector.VisualStyleKeywordPicker): 112 (WebInspector.VisualStyleKeywordPicker.prototype.get value): 113 (WebInspector.VisualStyleKeywordPicker.prototype.set value): 114 (WebInspector.VisualStyleKeywordPicker.prototype.set placeholder): 115 (WebInspector.VisualStyleKeywordPicker.prototype.get synthesizedValue): 116 (WebInspector.VisualStyleKeywordPicker.prototype.updateEditorValues): 117 (WebInspector.VisualStyleKeywordPicker.prototype._handleKeywordChanged): 118 (WebInspector.VisualStyleKeywordPicker.prototype._keywordSelectMouseDown): 119 (WebInspector.VisualStyleKeywordPicker.prototype._addValues): 120 (WebInspector.VisualStyleKeywordPicker.prototype._addAdvancedValues): 121 (WebInspector.VisualStyleKeywordPicker.prototype._removeAdvancedValues): 122 (WebInspector.VisualStyleKeywordPicker.prototype._toggleTabbingOfSelectableElements): 123 124 * UserInterface/Views/VisualStylePropertyNameInput.js: Added. 125 (WebInspector.VisualStylePropertyNameInput): 126 (WebInspector.VisualStylePropertyNameInput.prototype.get value): 127 (WebInspector.VisualStylePropertyNameInput.prototype.set value): 128 (WebInspector.VisualStylePropertyNameInput.prototype.get synthesizedValue): 129 (WebInspector.VisualStylePropertyNameInput.prototype.get hasCompletions): 130 (WebInspector.VisualStylePropertyNameInput.prototype.set completions): 131 (WebInspector.VisualStylePropertyNameInput.prototype._completionClicked): 132 (WebInspector.VisualStylePropertyNameInput.prototype._inputKeyDown): 133 (WebInspector.VisualStylePropertyNameInput.prototype._inputKeyUp): 134 (WebInspector.VisualStylePropertyNameInput.prototype._hideCompletions): 135 (WebInspector.VisualStylePropertyNameInput.prototype._toggleTabbingOfSelectableElements): 136 137 * UserInterface/Views/VisualStyleURLInput.js: Added. 138 (WebInspector.VisualStyleURLInput): 139 (WebInspector.VisualStyleURLInput.prototype.set get value): 140 (WebInspector.VisualStyleURLInput.prototype.parseValue): 141 142 * UserInterface/Views/VisualStyleUnitSlider.css: Added. 143 (.visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider): 144 (.visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider > img): 145 (.visual-style-property-container.unit-slider.opacity > .visual-style-property-value-container > .slider): 146 147 * UserInterface/Views/VisualStyleUnitSlider.js: Added. 148 (WebInspector.VisualStyleUnitSlider): 149 (WebInspector.VisualStyleUnitSlider.prototype.set value): 150 (WebInspector.VisualStyleUnitSlider.prototype.get value): 151 (WebInspector.VisualStyleUnitSlider.prototype.get synthesizedValue): 152 (WebInspector.VisualStyleUnitSlider.prototype.sliderValueDidChange): 153 1 154 2015-08-10 Devin Rousso <drousso@apple.com> 2 155 -
trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
r188028 r188229 881 881 createCodeMirrorColorTextMarkers(this._codeMirror, range, function(marker, color, colorString) { 882 882 var swatchElement = document.createElement("span"); 883 swatchElement.title = WebInspector.UIString("Click to open a colorpicker. Shift-click to change color format.");883 swatchElement.title = WebInspector.UIString("Click to select a color. Shift-click to switch color formats."); 884 884 swatchElement.className = WebInspector.CSSStyleDeclarationTextEditor.ColorSwatchElementStyleClassName; 885 885 swatchElement.addEventListener("click", this._colorSwatchClicked.bind(this)); -
trunk/Source/WebInspectorUI/UserInterface/Views/Slider.js
r182040 r188229 37 37 this._value = 0; 38 38 this._knobX = 0; 39 this._ _maxX = 0;39 this._maxX = 0; 40 40 41 41 this._element.addEventListener("mousedown", this); … … 61 61 return; 62 62 63 this._value = value; 64 65 this._knobX = Math.round(value * this._maxX); 66 this._knob.style.webkitTransform = "translate3d(" + this._knobX + "px, 0, 0)"; 63 this.knobX = value; 67 64 68 65 if (this.delegate && typeof this.delegate.sliderValueDidChange === "function") 69 66 this.delegate.sliderValueDidChange(this, value); 67 } 68 69 set knobX(value) 70 { 71 this._value = value; 72 this._knobX = Math.round(value * this.maxX); 73 this._knob.style.webkitTransform = "translate3d(" + this._knobX + "px, 0, 0)"; 74 } 75 76 get maxX() 77 { 78 if (this._maxX <= 0 && document.body.contains(this._element)) 79 this._maxX = Math.max(this._element.offsetWidth - Math.ceil(WebInspector.Slider.KnobWidth / 2), 0); 80 81 return this._maxX; 70 82 } 71 83 … … 92 104 { 93 105 if (event.target !== this._knob) 94 this.value = (this._localPointForEvent(event).x - 3) / this. _maxX;106 this.value = (this._localPointForEvent(event).x - 3) / this.maxX; 95 107 96 108 this._startKnobX = this._knobX; … … 106 118 { 107 119 var dx = this._localPointForEvent(event).x - this._startMouseX; 108 var x = Math.max(Math.min(this._startKnobX + dx, this. _maxX), 0);120 var x = Math.max(Math.min(this._startKnobX + dx, this.maxX), 0); 109 121 110 this.value = x / this. _maxX;122 this.value = x / this.maxX; 111 123 } 112 124 … … 125 137 return window.webkitConvertPointFromPageToNode(this._element, new WebKitPoint(event.pageX, event.pageY)); 126 138 } 127 128 get _maxX()129 {130 if (this.__maxX === 0 && document.body.contains(this._element))131 this.__maxX = this._element.offsetWidth - Math.ceil(WebInspector.Slider.KnobWidth / 2);132 133 return this.__maxX;134 }135 139 }; 136 140
Note: See TracChangeset
for help on using the changeset viewer.