| 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 // TODO(rltoscano): Move data/* into print_preview.data namespace | 5 // TODO(rltoscano): Move data/* into print_preview.data namespace |
| 6 | 6 |
| 7 var localStrings = new LocalStrings(templateData); | 7 var localStrings = new LocalStrings(templateData); |
| 8 | 8 |
| 9 <include src="component.js"/> | 9 <include src="component.js"/> |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 /** | 109 /** |
| 110 * Component that renders the copies settings. | 110 * Component that renders the copies settings. |
| 111 * @type {!print_preview.CopiesSettings} | 111 * @type {!print_preview.CopiesSettings} |
| 112 * @private | 112 * @private |
| 113 */ | 113 */ |
| 114 this.copiesSettings_ = new print_preview.CopiesSettings( | 114 this.copiesSettings_ = new print_preview.CopiesSettings( |
| 115 this.printTicketStore_.copies, this.printTicketStore_.collate); | 115 this.printTicketStore_.copies, this.printTicketStore_.collate); |
| 116 this.addChild(this.copiesSettings_); | 116 this.addChild(this.copiesSettings_); |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * Component that renders the media size settings. |
| 120 * @type {!print_preview.MediaSizeSettings} |
| 121 * @private |
| 122 */ |
| 123 this.mediaSizeSettings_ = |
| 124 new print_preview.MediaSizeSettings(this.printTicketStore_.mediaSize); |
| 125 this.addChild(this.mediaSizeSettings_); |
| 126 |
| 127 /** |
| 119 * Component that renders the layout settings. | 128 * Component that renders the layout settings. |
| 120 * @type {!print_preview.LayoutSettings} | 129 * @type {!print_preview.LayoutSettings} |
| 121 * @private | 130 * @private |
| 122 */ | 131 */ |
| 123 this.layoutSettings_ = | 132 this.layoutSettings_ = |
| 124 new print_preview.LayoutSettings(this.printTicketStore_.landscape); | 133 new print_preview.LayoutSettings(this.printTicketStore_.landscape); |
| 125 this.addChild(this.layoutSettings_); | 134 this.addChild(this.layoutSettings_); |
| 126 | 135 |
| 127 /** | 136 /** |
| 128 * Component that renders the color options. | 137 * Component that renders the color options. |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 this.onNoDestinationsPromoClick_.bind(this)); | 384 this.onNoDestinationsPromoClick_.bind(this)); |
| 376 }, | 385 }, |
| 377 | 386 |
| 378 /** @override */ | 387 /** @override */ |
| 379 decorateInternal: function() { | 388 decorateInternal: function() { |
| 380 this.printHeader_.decorate($('print-header')); | 389 this.printHeader_.decorate($('print-header')); |
| 381 this.destinationSearch_.decorate($('destination-search')); | 390 this.destinationSearch_.decorate($('destination-search')); |
| 382 this.destinationSettings_.decorate($('destination-settings')); | 391 this.destinationSettings_.decorate($('destination-settings')); |
| 383 this.pageSettings_.decorate($('page-settings')); | 392 this.pageSettings_.decorate($('page-settings')); |
| 384 this.copiesSettings_.decorate($('copies-settings')); | 393 this.copiesSettings_.decorate($('copies-settings')); |
| 394 this.mediaSizeSettings_.decorate($('media-size-settings')); |
| 385 this.layoutSettings_.decorate($('layout-settings')); | 395 this.layoutSettings_.decorate($('layout-settings')); |
| 386 this.colorSettings_.decorate($('color-settings')); | 396 this.colorSettings_.decorate($('color-settings')); |
| 387 this.marginSettings_.decorate($('margin-settings')); | 397 this.marginSettings_.decorate($('margin-settings')); |
| 388 this.otherOptionsSettings_.decorate($('other-options-settings')); | 398 this.otherOptionsSettings_.decorate($('other-options-settings')); |
| 389 this.previewArea_.decorate($('preview-area')); | 399 this.previewArea_.decorate($('preview-area')); |
| 390 | 400 |
| 391 setIsVisible($('open-pdf-in-preview-link'), cr.isMac); | 401 setIsVisible($('open-pdf-in-preview-link'), cr.isMac); |
| 392 }, | 402 }, |
| 393 | 403 |
| 394 /** | 404 /** |
| 395 * Sets whether the controls in the print preview are enabled. | 405 * Sets whether the controls in the print preview are enabled. |
| 396 * @param {boolean} isEnabled Whether the controls in the print preview are | 406 * @param {boolean} isEnabled Whether the controls in the print preview are |
| 397 * enabled. | 407 * enabled. |
| 398 * @private | 408 * @private |
| 399 */ | 409 */ |
| 400 setIsEnabled_: function(isEnabled) { | 410 setIsEnabled_: function(isEnabled) { |
| 401 $('system-dialog-link').disabled = !isEnabled; | 411 $('system-dialog-link').disabled = !isEnabled; |
| 402 $('cloud-print-dialog-link').disabled = !isEnabled; | 412 $('cloud-print-dialog-link').disabled = !isEnabled; |
| 403 $('open-pdf-in-preview-link').disabled = !isEnabled; | 413 $('open-pdf-in-preview-link').disabled = !isEnabled; |
| 404 this.printHeader_.isEnabled = isEnabled; | 414 this.printHeader_.isEnabled = isEnabled; |
| 405 this.destinationSettings_.isEnabled = isEnabled; | 415 this.destinationSettings_.isEnabled = isEnabled; |
| 406 this.pageSettings_.isEnabled = isEnabled; | 416 this.pageSettings_.isEnabled = isEnabled; |
| 407 this.copiesSettings_.isEnabled = isEnabled; | 417 this.copiesSettings_.isEnabled = isEnabled; |
| 418 this.mediaSizeSettings_.isEnabled = isEnabled; |
| 408 this.layoutSettings_.isEnabled = isEnabled; | 419 this.layoutSettings_.isEnabled = isEnabled; |
| 409 this.colorSettings_.isEnabled = isEnabled; | 420 this.colorSettings_.isEnabled = isEnabled; |
| 410 this.marginSettings_.isEnabled = isEnabled; | 421 this.marginSettings_.isEnabled = isEnabled; |
| 411 this.otherOptionsSettings_.isEnabled = isEnabled; | 422 this.otherOptionsSettings_.isEnabled = isEnabled; |
| 412 }, | 423 }, |
| 413 | 424 |
| 414 /** | 425 /** |
| 415 * Prints the document or launches a pdf preview on the local system. | 426 * Prints the document or launches a pdf preview on the local system. |
| 416 * @param {boolean} isPdfPreview Whether to launch the pdf preview. | 427 * @param {boolean} isPdfPreview Whether to launch the pdf preview. |
| 417 * @private | 428 * @private |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 <include src="data/app_state.js"/> | 992 <include src="data/app_state.js"/> |
| 982 | 993 |
| 983 <include src="data/ticket_items/ticket_item.js"/> | 994 <include src="data/ticket_items/ticket_item.js"/> |
| 984 | 995 |
| 985 <include src="data/ticket_items/custom_margins.js"/> | 996 <include src="data/ticket_items/custom_margins.js"/> |
| 986 <include src="data/ticket_items/collate.js"/> | 997 <include src="data/ticket_items/collate.js"/> |
| 987 <include src="data/ticket_items/color.js"/> | 998 <include src="data/ticket_items/color.js"/> |
| 988 <include src="data/ticket_items/copies.js"/> | 999 <include src="data/ticket_items/copies.js"/> |
| 989 <include src="data/ticket_items/duplex.js"/> | 1000 <include src="data/ticket_items/duplex.js"/> |
| 990 <include src="data/ticket_items/header_footer.js"/> | 1001 <include src="data/ticket_items/header_footer.js"/> |
| 1002 <include src="data/ticket_items/media_size.js"/> |
| 991 <include src="data/ticket_items/landscape.js"/> | 1003 <include src="data/ticket_items/landscape.js"/> |
| 992 <include src="data/ticket_items/margins_type.js"/> | 1004 <include src="data/ticket_items/margins_type.js"/> |
| 993 <include src="data/ticket_items/page_range.js"/> | 1005 <include src="data/ticket_items/page_range.js"/> |
| 994 <include src="data/ticket_items/fit_to_page.js"/> | 1006 <include src="data/ticket_items/fit_to_page.js"/> |
| 995 <include src="data/ticket_items/css_background.js"/> | 1007 <include src="data/ticket_items/css_background.js"/> |
| 996 <include src="data/ticket_items/selection_only.js"/> | 1008 <include src="data/ticket_items/selection_only.js"/> |
| 997 | 1009 |
| 998 <include src="native_layer.js"/> | 1010 <include src="native_layer.js"/> |
| 999 <include src="print_preview_animations.js"/> | 1011 <include src="print_preview_animations.js"/> |
| 1000 <include src="cloud_print_interface.js"/> | 1012 <include src="cloud_print_interface.js"/> |
| 1001 <include src="print_preview_utils.js"/> | 1013 <include src="print_preview_utils.js"/> |
| 1002 <include src="print_header.js"/> | 1014 <include src="print_header.js"/> |
| 1003 <include src="metrics.js"/> | 1015 <include src="metrics.js"/> |
| 1004 | 1016 |
| 1005 <include src="settings/page_settings.js"/> | 1017 <include src="settings/page_settings.js"/> |
| 1006 <include src="settings/copies_settings.js"/> | 1018 <include src="settings/copies_settings.js"/> |
| 1019 <include src="settings/media_size_settings.js"/> |
| 1007 <include src="settings/layout_settings.js"/> | 1020 <include src="settings/layout_settings.js"/> |
| 1008 <include src="settings/color_settings.js"/> | 1021 <include src="settings/color_settings.js"/> |
| 1009 <include src="settings/margin_settings.js"/> | 1022 <include src="settings/margin_settings.js"/> |
| 1010 <include src="settings/destination_settings.js"/> | 1023 <include src="settings/destination_settings.js"/> |
| 1011 <include src="settings/other_options_settings.js"/> | 1024 <include src="settings/other_options_settings.js"/> |
| 1012 | 1025 |
| 1013 <include src="previewarea/margin_control.js"/> | 1026 <include src="previewarea/margin_control.js"/> |
| 1014 <include src="previewarea/margin_control_container.js"/> | 1027 <include src="previewarea/margin_control_container.js"/> |
| 1015 <include src="../pdf/pdf_scripting_api.js" /> | 1028 <include src="../pdf/pdf_scripting_api.js" /> |
| 1016 <include src="previewarea/preview_area.js"/> | 1029 <include src="previewarea/preview_area.js"/> |
| 1017 <include src="preview_generator.js"/> | 1030 <include src="preview_generator.js"/> |
| 1018 | 1031 |
| 1019 <include src="search/destination_list.js"/> | 1032 <include src="search/destination_list.js"/> |
| 1020 <include src="search/cloud_destination_list.js"/> | 1033 <include src="search/cloud_destination_list.js"/> |
| 1021 <include src="search/recent_destination_list.js"/> | 1034 <include src="search/recent_destination_list.js"/> |
| 1022 <include src="search/destination_list_item.js"/> | 1035 <include src="search/destination_list_item.js"/> |
| 1023 <include src="search/destination_search.js"/> | 1036 <include src="search/destination_search.js"/> |
| 1024 <include src="search/search_box.js"/> | 1037 <include src="search/search_box.js"/> |
| 1025 <include src="search/fedex_tos.js"/> | 1038 <include src="search/fedex_tos.js"/> |
| 1026 | 1039 |
| 1027 window.addEventListener('DOMContentLoaded', function() { | 1040 window.addEventListener('DOMContentLoaded', function() { |
| 1028 printPreview = new print_preview.PrintPreview(); | 1041 printPreview = new print_preview.PrintPreview(); |
| 1029 printPreview.initialize(); | 1042 printPreview.initialize(); |
| 1030 }); | 1043 }); |
| OLD | NEW |