| 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 // require: cr/ui/print_preview_cloud.js | 5 // require: cr/ui/print_preview_cloud.js |
| 6 | 6 |
| 7 var localStrings = new LocalStrings(); | 7 var localStrings = new LocalStrings(); |
| 8 | 8 |
| 9 // If useCloudPrint is true we attempt to connect to cloud print | 9 // If useCloudPrint is true we attempt to connect to cloud print |
| 10 // and populate the list of printers with cloud print printers. | 10 // and populate the list of printers with cloud print printers. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 copiesSettings = print_preview.CopiesSettings.getInstance(); | 135 copiesSettings = print_preview.CopiesSettings.getInstance(); |
| 136 layoutSettings = print_preview.LayoutSettings.getInstance(); | 136 layoutSettings = print_preview.LayoutSettings.getInstance(); |
| 137 marginSettings = print_preview.MarginSettings.getInstance(); | 137 marginSettings = print_preview.MarginSettings.getInstance(); |
| 138 headerFooterSettings = print_preview.HeaderFooterSettings.getInstance(); | 138 headerFooterSettings = print_preview.HeaderFooterSettings.getInstance(); |
| 139 colorSettings = print_preview.ColorSettings.getInstance(); | 139 colorSettings = print_preview.ColorSettings.getInstance(); |
| 140 $('printer-list').onchange = updateControlsWithSelectedPrinterCapabilities; | 140 $('printer-list').onchange = updateControlsWithSelectedPrinterCapabilities; |
| 141 | 141 |
| 142 previewArea.showLoadingAnimation(); | 142 previewArea.showLoadingAnimation(); |
| 143 chrome.send('getInitiatorTabTitle'); | 143 chrome.send('getInitiatorTabTitle'); |
| 144 chrome.send('getDefaultPrinter'); | 144 chrome.send('getDefaultPrinter'); |
| 145 chrome.send('getNumberFormatAndMeasurementSystem'); |
| 145 } | 146 } |
| 146 | 147 |
| 147 /** | 148 /** |
| 148 * Disables the input elements in the sidebar. | 149 * Disables the input elements in the sidebar. |
| 149 */ | 150 */ |
| 150 function disableInputElementsInSidebar() { | 151 function disableInputElementsInSidebar() { |
| 151 var els = $('sidebar').querySelectorAll('input, button, select'); | 152 var els = $('sidebar').querySelectorAll('input, button, select'); |
| 152 for (var i = 0; i < els.length; i++) { | 153 for (var i = 0; i < els.length; i++) { |
| 153 if (els[i] == printHeader.cancelButton) | 154 if (els[i] == printHeader.cancelButton) |
| 154 continue; | 155 continue; |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 * @param {KeyboardEvent} e The keyboard event. | 1050 * @param {KeyboardEvent} e The keyboard event. |
| 1050 */ | 1051 */ |
| 1051 function onKeyDown(e) { | 1052 function onKeyDown(e) { |
| 1052 // Escape key closes the dialog. | 1053 // Escape key closes the dialog. |
| 1053 if (e.keyCode == 27 && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) { | 1054 if (e.keyCode == 27 && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) { |
| 1054 printHeader.disableCancelButton(); | 1055 printHeader.disableCancelButton(); |
| 1055 closePrintPreviewTab(); | 1056 closePrintPreviewTab(); |
| 1056 } | 1057 } |
| 1057 } | 1058 } |
| 1058 | 1059 |
| 1060 function setNumberFormatAndMeasurementSystem( |
| 1061 numberFormat, measurementSystem) { |
| 1062 print_preview.MarginSettings.setNumberFormatAndMeasurementSystem( |
| 1063 numberFormat, measurementSystem); |
| 1064 } |
| 1065 |
| 1059 window.addEventListener('DOMContentLoaded', onLoad); | 1066 window.addEventListener('DOMContentLoaded', onLoad); |
| 1060 window.onkeydown = onKeyDown; | 1067 window.onkeydown = onKeyDown; |
| 1061 | 1068 |
| 1062 /// Pull in all other scripts in a single shot. | 1069 /// Pull in all other scripts in a single shot. |
| 1063 <include src="print_preview_animations.js"/> | 1070 <include src="print_preview_animations.js"/> |
| 1064 <include src="print_preview_cloud.js"/> | 1071 <include src="print_preview_cloud.js"/> |
| 1065 <include src="print_preview_utils.js"/> | 1072 <include src="print_preview_utils.js"/> |
| 1066 <include src="print_header.js"/> | 1073 <include src="print_header.js"/> |
| 1067 <include src="page_settings.js"/> | 1074 <include src="page_settings.js"/> |
| 1068 <include src="copies_settings.js"/> | 1075 <include src="copies_settings.js"/> |
| 1069 <include src="header_footer_settings.js"/> | 1076 <include src="header_footer_settings.js"/> |
| 1070 <include src="layout_settings.js"/> | 1077 <include src="layout_settings.js"/> |
| 1071 <include src="color_settings.js"/> | 1078 <include src="color_settings.js"/> |
| 1072 <include src="margin_settings.js"/> | 1079 <include src="margin_settings.js"/> |
| 1073 <include src="margin_textbox.js"/> | 1080 <include src="margin_textbox.js"/> |
| 1074 <include src="margin_utils.js"/> | 1081 <include src="margin_utils.js"/> |
| 1075 <include src="margins_ui.js"/> | 1082 <include src="margins_ui.js"/> |
| 1076 <include src="margins_ui_pair.js"/> | 1083 <include src="margins_ui_pair.js"/> |
| 1077 <include src="preview_area.js"/> | 1084 <include src="preview_area.js"/> |
| OLD | NEW |