OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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', function() { | 5 cr.define('options', function() { |
6 const OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
7 | 7 |
8 /** | 8 /** |
9 * AutoFillEditCreditCardOverlay class | 9 * AutoFillEditCreditCardOverlay class |
10 * Encapsulated handling of the 'Add Page' overlay page. | 10 * Encapsulated handling of the 'Add Page' overlay page. |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 self.setDefaultSelectOptions_(); | 35 self.setDefaultSelectOptions_(); |
36 }, | 36 }, |
37 | 37 |
38 /** | 38 /** |
39 * Clears any uncommited input, and dismisses the overlay. | 39 * Clears any uncommited input, and dismisses the overlay. |
40 * @private | 40 * @private |
41 */ | 41 */ |
42 dismissOverlay_: function() { | 42 dismissOverlay_: function() { |
43 $('fullName').value = ''; | 43 AutoFillEditCreditCardOverlay.clearInputFields(); |
44 $('companyName').value = ''; | |
45 $('addrLine1').value = ''; | |
46 $('addrLine2').value = ''; | |
47 $('city').value = ''; | |
48 $('state').value = ''; | |
49 $('zipCode').value = ''; | |
50 $('phone').value = ''; | |
51 $('fax').value = ''; | |
52 $('email').value = ''; | |
53 OptionsPage.clearOverlays(); | 44 OptionsPage.clearOverlays(); |
54 }, | 45 }, |
55 | 46 |
56 /** | 47 /** |
57 * Sets the default values of the options in the 'Billing address' and | 48 * Sets the default values of the options in the 'Billing address' and |
58 * 'Expiration date' select controls. | 49 * 'Expiration date' select controls. |
59 * @private | 50 * @private |
60 */ | 51 */ |
61 setDefaultSelectOptions_: function() { | 52 setDefaultSelectOptions_: function() { |
62 // Set the 'Billing address' default option. | 53 // Set the 'Billing address' default option. |
(...skipping 26 matching lines...) Expand all Loading... |
89 for (var i = 0; i < 10; ++i) { | 80 for (var i = 0; i < 10; ++i) { |
90 var text = parseInt(year) + i; | 81 var text = parseInt(year) + i; |
91 var option = document.createElement('option'); | 82 var option = document.createElement('option'); |
92 option.text = text; | 83 option.text = text; |
93 option.value = text; | 84 option.value = text; |
94 expirationYear.add(option, null); | 85 expirationYear.add(option, null); |
95 } | 86 } |
96 } | 87 } |
97 }; | 88 }; |
98 | 89 |
| 90 AutoFillEditCreditCardOverlay.clearInputFields = function(title) { |
| 91 $('nameOnCard').value = ''; |
| 92 $('billingAddress').value = ''; |
| 93 $('creditCardNumber').value = ''; |
| 94 $('expirationMonth').value = ''; |
| 95 $('expirationYear').value = ''; |
| 96 }; |
| 97 |
| 98 AutoFillEditCreditCardOverlay.setTitle = function(title) { |
| 99 $('autoFillCreditCardTitle').textContent = title; |
| 100 }; |
| 101 |
99 // Export | 102 // Export |
100 return { | 103 return { |
101 AutoFillEditCreditCardOverlay: AutoFillEditCreditCardOverlay | 104 AutoFillEditCreditCardOverlay: AutoFillEditCreditCardOverlay |
102 }; | 105 }; |
103 | 106 |
104 }); | 107 }); |
OLD | NEW |