OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('options.internet', function() { | 5 cr.define('options.internet', function() { |
6 /** @const */ var EditableTextField = options.EditableTextField; | 6 /** @const */ var EditableTextField = options.EditableTextField; |
7 | 7 |
8 /** | 8 /** |
9 * The regular expression that matches an IP address. String to match against | 9 * The regular expression that matches an IP address. String to match against |
10 * should have all whitespace stripped already. | 10 * should have all whitespace stripped already. |
11 * @const | 11 * @const |
12 * @type {RegExp} | 12 * @type {RegExp} |
13 */ | 13 */ |
14 var singleIp_ = /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/; | 14 var singleIp_ = /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/; |
15 | 15 |
16 /** | 16 /** |
17 * Creates a new field specifically for entering IP addresses. | 17 * Creates a new field specifically for entering IP addresses. |
18 * @constructor | 18 * @constructor |
| 19 * @extends {options.EditableTextField} |
19 */ | 20 */ |
20 function IPAddressField() { | 21 function IPAddressField() { |
21 var el = cr.doc.createElement('div'); | 22 var el = cr.doc.createElement('div'); |
22 IPAddressField.decorate(el); | 23 IPAddressField.decorate(el); |
23 return el; | 24 return el; |
24 } | 25 } |
25 | 26 |
26 /** | 27 /** |
27 * Decorates an element as a inline-editable list item. Note that this is | 28 * Decorates an element as a inline-editable list item. Note that this is |
28 * a subclass of IPAddressField. | 29 * a subclass of IPAddressField. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 result.push(parseInt(matches[i], 10)); | 103 result.push(parseInt(matches[i], 10)); |
103 } | 104 } |
104 return result.join('.'); | 105 return result.join('.'); |
105 }, | 106 }, |
106 }; | 107 }; |
107 | 108 |
108 return { | 109 return { |
109 IPAddressField: IPAddressField, | 110 IPAddressField: IPAddressField, |
110 }; | 111 }; |
111 }); | 112 }); |
OLD | NEW |