| 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 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2843 */ | 2843 */ |
| 2844 WebInspector.StylesSidebarPane.CSSPropertyPrompt = function(cssCompletions, tree
Element, isEditingName) | 2844 WebInspector.StylesSidebarPane.CSSPropertyPrompt = function(cssCompletions, tree
Element, isEditingName) |
| 2845 { | 2845 { |
| 2846 // Use the same callback both for applyItemCallback and acceptItemCallback. | 2846 // Use the same callback both for applyItemCallback and acceptItemCallback. |
| 2847 WebInspector.TextPrompt.call(this, this._buildPropertyCompletions.bind(this)
, WebInspector.StyleValueDelimiters); | 2847 WebInspector.TextPrompt.call(this, this._buildPropertyCompletions.bind(this)
, WebInspector.StyleValueDelimiters); |
| 2848 this.setSuggestBoxEnabled(true); | 2848 this.setSuggestBoxEnabled(true); |
| 2849 this._cssCompletions = cssCompletions; | 2849 this._cssCompletions = cssCompletions; |
| 2850 this._treeElement = treeElement; | 2850 this._treeElement = treeElement; |
| 2851 this._isEditingName = isEditingName; | 2851 this._isEditingName = isEditingName; |
| 2852 | 2852 |
| 2853 if (!isEditingName) | 2853 if (!isEditingName) { |
| 2854 this.disableDefaultSuggestionForEmptyInput(); | 2854 this.disableDefaultSuggestionForEmptyInput(); |
| 2855 |
| 2856 // If a CSS value is being edited that has a numeric or hex substring, h
int that precision modifier shortcuts are available. |
| 2857 if (treeElement && treeElement.valueElement) { |
| 2858 var cssValueText = treeElement.valueElement.textContent; |
| 2859 if (cssValueText.match(/#[\da-f]{3,6}$/i)) |
| 2860 this.setTitle(WebInspector.UIString("Increment/decrement with mo
usewheel or up/down keys. %s: R ±1, Shift: G ±1, Alt: B ±1", WebInspector.isMac(
) ? "Cmd" : "Ctrl")); |
| 2861 else if (cssValueText.match(/\d+/)) |
| 2862 this.setTitle(WebInspector.UIString("Increment/decrement with mo
usewheel or up/down keys. %s: ±100, Shift: ±10, Alt: ±0.1", WebInspector.isMac()
? "Cmd" : "Ctrl")); |
| 2863 } |
| 2864 |
| 2865 } |
| 2855 } | 2866 } |
| 2856 | 2867 |
| 2857 WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = { | 2868 WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = { |
| 2858 /** | 2869 /** |
| 2859 * @override | 2870 * @override |
| 2860 * @param {!Event} event | 2871 * @param {!Event} event |
| 2861 */ | 2872 */ |
| 2862 onKeyDown: function(event) | 2873 onKeyDown: function(event) |
| 2863 { | 2874 { |
| 2864 switch (event.keyIdentifier) { | 2875 switch (event.keyIdentifier) { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3112 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha
nged); | 3123 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha
nged); |
| 3113 onNodeChanged(); | 3124 onNodeChanged(); |
| 3114 return button; | 3125 return button; |
| 3115 | 3126 |
| 3116 function onNodeChanged() | 3127 function onNodeChanged() |
| 3117 { | 3128 { |
| 3118 var node = WebInspector.context.flavor(WebInspector.DOMNode); | 3129 var node = WebInspector.context.flavor(WebInspector.DOMNode); |
| 3119 button.setEnabled(!!node); | 3130 button.setEnabled(!!node); |
| 3120 } | 3131 } |
| 3121 } | 3132 } |
| OLD | NEW |