Chromium Code Reviews| Index: Source/devtools/front_end/SettingsUI.js |
| diff --git a/Source/devtools/front_end/SettingsUI.js b/Source/devtools/front_end/SettingsUI.js |
| index 25a4f6bb05d2dbc50a1a2ddc8f9b75f56172a9fd..574b6a90b19028a6cb143fb07d7dc0f48afbd419 100644 |
| --- a/Source/devtools/front_end/SettingsUI.js |
| +++ b/Source/devtools/front_end/SettingsUI.js |
| @@ -95,3 +95,99 @@ WebInspector.SettingsUI.createSettingFieldset = function(setting) |
| fieldset.disabled = !setting.get(); |
| } |
| } |
| + |
| +/** |
| + * @param {string} text |
| + * @return {?string} |
| + */ |
| +WebInspector.SettingsUI.regexValidator = function(text) |
| +{ |
| + var regex; |
| + try { |
| + regex = new RegExp(text); |
| + } catch (e) { |
| + } |
| + return regex ? null : WebInspector.UIString("Invalid pattern"); |
| +} |
| + |
| +/** |
| + * @constructor |
| + */ |
| +WebInspector.UISettingDelegate = function() |
| +{ |
| +} |
| + |
| +WebInspector.UISettingDelegate.prototype = { |
|
pfeldman
2014/03/27 15:27:14
Let users return elements instead.
apavlov
2014/03/28 10:21:23
Done.
|
| + /** |
| + * @param {!WebInspector.Event} event |
| + */ |
| + settingChanged: function(event) |
| + { |
| + }, |
| + |
| + /** |
| + * @return {!Array.<*>|undefined} |
| + */ |
| + titleTemplateArguments: function() |
| + { |
| + return undefined; |
| + } |
| +} |
| + |
| +/** |
| + * @constructor |
| + * @extends {WebInspector.UISettingDelegate} |
| + */ |
| +WebInspector.SelectUISettingDelegate = function() |
|
pfeldman
2014/03/27 15:27:14
Lets either use elements or derive from descriptor
apavlov
2014/03/28 10:21:23
Done.
|
| +{ |
| + WebInspector.UISettingDelegate.call(this); |
| +} |
| + |
| +WebInspector.SelectUISettingDelegate.prototype = { |
| + /** |
| + * @return {!Array.<!Array.<*>>} |
| + */ |
| + settingOptions: function() |
| + { |
| + throw "Not implemented"; |
| + }, |
| + |
| + __proto__: WebInspector.UISettingDelegate.prototype |
| +} |
| + |
| +/** |
| + * @constructor |
| + * @extends {WebInspector.UISettingDelegate} |
| + */ |
| +WebInspector.InputUISettingDelegate = function() |
|
pfeldman
2014/03/27 15:27:14
Ditto
apavlov
2014/03/28 10:21:23
Done.
|
| +{ |
| + WebInspector.UISettingDelegate.call(this); |
| +} |
| + |
| +WebInspector.InputUISettingDelegate.prototype = { |
| + /** |
| + * @param {string} value |
| + * @return {?string} |
| + */ |
| + validateInput: function(value) |
| + { |
| + return null; |
| + }, |
| + |
| + __proto__: WebInspector.UISettingDelegate.prototype |
| +} |
| + |
| +/** |
| + * @interface |
| + */ |
| +WebInspector.ConfigurableUISettingDelegate = function() |
| +{ |
| +} |
| + |
| +WebInspector.ConfigurableUISettingDelegate.prototype = { |
| + /** |
| + * @param {!Element} settingElement |
| + * @param {!Element} containerElement |
| + */ |
| + configure: function(settingElement, containerElement) {} |
| +} |