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('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Widget that renders a terms-of-service agreement for using the FedEx Office | 9 * Widget that renders a terms-of-service agreement for using the FedEx Office |
10 * print destination. | 10 * print destination. |
(...skipping 23 matching lines...) Expand all Loading... |
34 this.getElement().style.height = heightHelperEl.offsetHeight + 'px'; | 34 this.getElement().style.height = heightHelperEl.offsetHeight + 'px'; |
35 } else { | 35 } else { |
36 this.getElement().style.height = 0; | 36 this.getElement().style.height = 0; |
37 } | 37 } |
38 }, | 38 }, |
39 | 39 |
40 /** @override */ | 40 /** @override */ |
41 createDom: function() { | 41 createDom: function() { |
42 this.setElementInternal(this.cloneTemplateInternal('fedex-tos-template')); | 42 this.setElementInternal(this.cloneTemplateInternal('fedex-tos-template')); |
43 var tosTextEl = this.getElement().querySelector('.tos-text'); | 43 var tosTextEl = this.getElement().querySelector('.tos-text'); |
44 tosTextEl.innerHTML = localStrings.getStringF( | 44 tosTextEl.innerHTML = loadTimeData.getStringF( |
45 'fedexTos', | 45 'fedexTos', |
46 '<a href="http://www.fedex.com/us/office/copyprint/online/' + | 46 '<a href="http://www.fedex.com/us/office/copyprint/online/' + |
47 'googlecloudprint/termsandconditions">', | 47 'googlecloudprint/termsandconditions">', |
48 '</a>'); | 48 '</a>'); |
49 }, | 49 }, |
50 | 50 |
51 /** @override */ | 51 /** @override */ |
52 enterDocument: function() { | 52 enterDocument: function() { |
53 var agreeCheckbox = this.getElement().querySelector('.agree-checkbox'); | 53 var agreeCheckbox = this.getElement().querySelector('.agree-checkbox'); |
54 this.tracker.add( | 54 this.tracker.add( |
55 agreeCheckbox, 'click', this.onAgreeCheckboxClick_.bind(this)); | 55 agreeCheckbox, 'click', this.onAgreeCheckboxClick_.bind(this)); |
56 }, | 56 }, |
57 | 57 |
58 /** | 58 /** |
59 * Called when the agree checkbox is clicked. Dispatches a AGREE event. | 59 * Called when the agree checkbox is clicked. Dispatches a AGREE event. |
60 * @private | 60 * @private |
61 */ | 61 */ |
62 onAgreeCheckboxClick_: function() { | 62 onAgreeCheckboxClick_: function() { |
63 cr.dispatchSimpleEvent(this, FedexTos.EventType.AGREE); | 63 cr.dispatchSimpleEvent(this, FedexTos.EventType.AGREE); |
64 } | 64 } |
65 }; | 65 }; |
66 | 66 |
67 // Export | 67 // Export |
68 return { | 68 return { |
69 FedexTos: FedexTos | 69 FedexTos: FedexTos |
70 }; | 70 }; |
71 }); | 71 }); |
OLD | NEW |