| 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 * Creates a PageSettings object. This object encapsulates all settings and | 9 * Creates a PageSettings object. This object encapsulates all settings and |
| 10 * logic related to page selection. | 10 * logic related to page selection. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 */ | 146 */ |
| 147 setInvalidStateVisible_: function(validity) { | 147 setInvalidStateVisible_: function(validity) { |
| 148 if (validity !== PageRangeStatus.NO_ERROR) { | 148 if (validity !== PageRangeStatus.NO_ERROR) { |
| 149 var message; | 149 var message; |
| 150 if (validity === PageRangeStatus.LIMIT_ERROR) { | 150 if (validity === PageRangeStatus.LIMIT_ERROR) { |
| 151 if (this.pageRangeTicketItem_.getDocumentNumPages()) { | 151 if (this.pageRangeTicketItem_.getDocumentNumPages()) { |
| 152 message = loadTimeData.getStringF( | 152 message = loadTimeData.getStringF( |
| 153 'pageRangeLimitInstructionWithValue', | 153 'pageRangeLimitInstructionWithValue', |
| 154 this.pageRangeTicketItem_.getDocumentNumPages()); | 154 this.pageRangeTicketItem_.getDocumentNumPages()); |
| 155 } else { | 155 } else { |
| 156 message = loadTimeData.getString( | 156 message = loadTimeData.getString('pageRangeLimitInstruction'); |
| 157 'pageRangeLimitInstruction'); | |
| 158 } | 157 } |
| 159 } else { | 158 } else { |
| 160 message = loadTimeData.getStringF( | 159 message = loadTimeData.getStringF( |
| 161 'pageRangeSyntaxInstruction', | 160 'pageRangeSyntaxInstruction', |
| 162 loadTimeData.getString('examplePageRangeText')); | 161 loadTimeData.getString('examplePageRangeText')); |
| 163 } | 162 } |
| 164 this.customHintEl_.textContent = message; | 163 this.customHintEl_.textContent = message; |
| 165 this.customInput_.classList.add('invalid'); | 164 this.customInput_.classList.add('invalid'); |
| 166 fadeInElement(this.customHintEl_); | 165 fadeInElement(this.customHintEl_); |
| 167 } else { | 166 } else { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } else { | 264 } else { |
| 266 this.allRadio_.checked = true; | 265 this.allRadio_.checked = true; |
| 267 this.setInvalidStateVisible_(PageRangeStatus.NO_ERROR); | 266 this.setInvalidStateVisible_(PageRangeStatus.NO_ERROR); |
| 268 } | 267 } |
| 269 } | 268 } |
| 270 this.updateUiStateInternal(); | 269 this.updateUiStateInternal(); |
| 271 } | 270 } |
| 272 }; | 271 }; |
| 273 | 272 |
| 274 // Export | 273 // Export |
| 275 return { | 274 return {PageSettings: PageSettings}; |
| 276 PageSettings: PageSettings | |
| 277 }; | |
| 278 }); | 275 }); |
| OLD | NEW |