OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 var fieldset = document.createElement("fieldset"); | 88 var fieldset = document.createElement("fieldset"); |
89 fieldset.disabled = !setting.get(); | 89 fieldset.disabled = !setting.get(); |
90 setting.addChangeListener(settingChanged); | 90 setting.addChangeListener(settingChanged); |
91 return fieldset; | 91 return fieldset; |
92 | 92 |
93 function settingChanged() | 93 function settingChanged() |
94 { | 94 { |
95 fieldset.disabled = !setting.get(); | 95 fieldset.disabled = !setting.get(); |
96 } | 96 } |
97 } | 97 } |
98 | |
99 /** | |
100 * @param {string} text | |
101 * @return {?string} | |
102 */ | |
103 WebInspector.SettingsUI.regexValidator = function(text) | |
104 { | |
105 var regex; | |
106 try { | |
107 regex = new RegExp(text); | |
108 } catch (e) { | |
109 } | |
110 return regex ? null : WebInspector.UIString("Invalid pattern"); | |
111 } | |
112 | |
113 /** | |
114 * @constructor | |
115 */ | |
116 WebInspector.UISettingDelegate = function() | |
117 { | |
118 } | |
119 | |
120 WebInspector.UISettingDelegate.prototype = { | |
pfeldman
2014/03/27 15:27:14
Let users return elements instead.
apavlov
2014/03/28 10:21:23
Done.
| |
121 /** | |
122 * @param {!WebInspector.Event} event | |
123 */ | |
124 settingChanged: function(event) | |
125 { | |
126 }, | |
127 | |
128 /** | |
129 * @return {!Array.<*>|undefined} | |
130 */ | |
131 titleTemplateArguments: function() | |
132 { | |
133 return undefined; | |
134 } | |
135 } | |
136 | |
137 /** | |
138 * @constructor | |
139 * @extends {WebInspector.UISettingDelegate} | |
140 */ | |
141 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.
| |
142 { | |
143 WebInspector.UISettingDelegate.call(this); | |
144 } | |
145 | |
146 WebInspector.SelectUISettingDelegate.prototype = { | |
147 /** | |
148 * @return {!Array.<!Array.<*>>} | |
149 */ | |
150 settingOptions: function() | |
151 { | |
152 throw "Not implemented"; | |
153 }, | |
154 | |
155 __proto__: WebInspector.UISettingDelegate.prototype | |
156 } | |
157 | |
158 /** | |
159 * @constructor | |
160 * @extends {WebInspector.UISettingDelegate} | |
161 */ | |
162 WebInspector.InputUISettingDelegate = function() | |
pfeldman
2014/03/27 15:27:14
Ditto
apavlov
2014/03/28 10:21:23
Done.
| |
163 { | |
164 WebInspector.UISettingDelegate.call(this); | |
165 } | |
166 | |
167 WebInspector.InputUISettingDelegate.prototype = { | |
168 /** | |
169 * @param {string} value | |
170 * @return {?string} | |
171 */ | |
172 validateInput: function(value) | |
173 { | |
174 return null; | |
175 }, | |
176 | |
177 __proto__: WebInspector.UISettingDelegate.prototype | |
178 } | |
179 | |
180 /** | |
181 * @interface | |
182 */ | |
183 WebInspector.ConfigurableUISettingDelegate = function() | |
184 { | |
185 } | |
186 | |
187 WebInspector.ConfigurableUISettingDelegate.prototype = { | |
188 /** | |
189 * @param {!Element} settingElement | |
190 * @param {!Element} containerElement | |
191 */ | |
192 configure: function(settingElement, containerElement) {} | |
193 } | |
OLD | NEW |