| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-users-add-user-dialog' is the dialog shown for adding new allowed | 7 * 'settings-users-add-user-dialog' is the dialog shown for adding new allowed |
| 8 * users to a ChromeOS device. | 8 * users to a ChromeOS device. |
| 9 */ | 9 */ |
| 10 (function() { | 10 (function() { |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * Regular expression for adding a user where the string provided is just | 13 * Regular expression for adding a user where the string provided is just |
| 14 * the part before the "@". | 14 * the part before the "@". |
| 15 * Email alias only, assuming it's a gmail address. | 15 * Email alias only, assuming it's a gmail address. |
| 16 * e.g. 'john' | 16 * e.g. 'john' |
| 17 * @const {!RegExp} | 17 * @const {!RegExp} |
| 18 */ | 18 */ |
| 19 var NAME_ONLY_REGEX = new RegExp( | 19 var NAME_ONLY_REGEX = |
| 20 '^\\s*([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+)\\s*$'); | 20 new RegExp('^\\s*([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+)\\s*$'); |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * Regular expression for adding a user where the string provided is a full | 23 * Regular expression for adding a user where the string provided is a full |
| 24 * email address. | 24 * email address. |
| 25 * e.g. 'john@chromium.org' | 25 * e.g. 'john@chromium.org' |
| 26 * @const {!RegExp} | 26 * @const {!RegExp} |
| 27 */ | 27 */ |
| 28 var EMAIL_REGEX = new RegExp( | 28 var EMAIL_REGEX = new RegExp( |
| 29 '^\\s*([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+)@' + | 29 '^\\s*([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+)@' + |
| 30 '([A-Za-z0-9\-]{2,63}\\..+)\\s*$'); | 30 '([A-Za-z0-9\-]{2,63}\\..+)\\s*$'); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 chrome.usersPrivate.addWhitelistedUser( | 83 chrome.usersPrivate.addWhitelistedUser( |
| 84 userEmail, | 84 userEmail, |
| 85 /* callback */ function(success) {}); | 85 /* callback */ function(success) {}); |
| 86 this.$.addUserInput.value = ''; | 86 this.$.addUserInput.value = ''; |
| 87 this.$.dialog.close(); | 87 this.$.dialog.close(); |
| 88 }, | 88 }, |
| 89 }); | 89 }); |
| 90 | 90 |
| 91 })(); | 91 })(); |
| OLD | NEW |