OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 var localStrings = new LocalStrings(); | 5 var localStrings = new LocalStrings(); |
6 var hasPDFPlugin = true; | 6 var hasPDFPlugin = true; |
7 var expectedPageCount = 0; | 7 var expectedPageCount = 0; |
8 var pageRangesInfo = []; | 8 var pageRangesInfo = []; |
9 var printJobTitle = ''; | 9 var printJobTitle = document.title; |
10 | 10 |
11 /** | 11 /** |
12 * Window onload handler, sets up the page. | 12 * Window onload handler, sets up the page. |
13 */ | 13 */ |
14 function load() { | 14 function load() { |
15 $('printer-list').disabled = true; | 15 $('printer-list').disabled = true; |
16 $('print-button').disabled = true; | 16 $('print-button').disabled = true; |
17 | 17 |
18 $('print-button').addEventListener('click', printFile); | 18 $('print-button').addEventListener('click', printFile); |
19 | 19 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 if (selectedPrinter >= 0) | 190 if (selectedPrinter >= 0) |
191 printerName = $('printer-list').options[selectedPrinter].textContent; | 191 printerName = $('printer-list').options[selectedPrinter].textContent; |
192 var printAll = $('all-pages').checked; | 192 var printAll = $('all-pages').checked; |
193 var twoSided = $('two-sided').checked; | 193 var twoSided = $('two-sided').checked; |
194 var copies = $('copies').value; | 194 var copies = $('copies').value; |
195 var collate = $('collate').checked; | 195 var collate = $('collate').checked; |
196 var landscape = isLandscape(); | 196 var landscape = isLandscape(); |
197 var color = isColor(); | 197 var color = isColor(); |
198 | 198 |
199 return JSON.stringify({'printerName': printerName, | 199 return JSON.stringify({'printerName': printerName, |
| 200 'printJobTitle': printJobTitle, |
200 'pageRange': pageRangesInfo, | 201 'pageRange': pageRangesInfo, |
201 'printAll': printAll, | 202 'printAll': printAll, |
202 'twoSided': twoSided, | 203 'twoSided': twoSided, |
203 'copies': copies, | 204 'copies': copies, |
204 'collate': collate, | 205 'collate': collate, |
205 'landscape': landscape, | 206 'landscape': landscape, |
206 'color': color}); | 207 'color': color}); |
207 } | 208 } |
208 | 209 |
209 /** | 210 /** |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 * Depending on the validity of 'copies' value, enables/disables the print | 376 * Depending on the validity of 'copies' value, enables/disables the print |
376 * button. | 377 * button. |
377 */ | 378 */ |
378 function updatePrintButtonState() { | 379 function updatePrintButtonState() { |
379 $('print-button').disabled = (!($('all-pages').checked || | 380 $('print-button').disabled = (!($('all-pages').checked || |
380 $('pages').checkValidity()) || | 381 $('pages').checkValidity()) || |
381 !$('copies').checkValidity()); | 382 !$('copies').checkValidity()); |
382 } | 383 } |
383 | 384 |
384 window.addEventListener('DOMContentLoaded', load); | 385 window.addEventListener('DOMContentLoaded', load); |
OLD | NEW |