Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/browser/resources/print_preview/print_header.js

Issue 7891016: Print Preview: Adding UI for margin settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing tests again. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Creates a PrintHeader object. This object encapsulates all the elements 9 * Creates a PrintHeader object. This object encapsulates all the elements
10 * and logic related to the top part of the left pane in print_preview.html. 10 * and logic related to the top part of the left pane in print_preview.html.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 updateSummary_: function() { 93 updateSummary_: function() {
94 var printToPDF = getSelectedPrinterName() == PRINT_TO_PDF; 94 var printToPDF = getSelectedPrinterName() == PRINT_TO_PDF;
95 var copies = printToPDF ? 1 : copiesSettings.numberOfCopies; 95 var copies = printToPDF ? 1 : copiesSettings.numberOfCopies;
96 96
97 if ((!printToPDF && !copiesSettings.isValid()) || 97 if ((!printToPDF && !copiesSettings.isValid()) ||
98 !pageSettings.isPageSelectionValid()) { 98 !pageSettings.isPageSelectionValid()) {
99 this.summary_.innerHTML = ''; 99 this.summary_.innerHTML = '';
100 return; 100 return;
101 } 101 }
102 102
103 if (!marginSettings.areMarginSettingsValid()) {
104 this.summary_.innerHTML = '';
105 return;
106 }
107
103 var pageSet = pageSettings.selectedPagesSet; 108 var pageSet = pageSettings.selectedPagesSet;
104 var numOfSheets = pageSet.length; 109 var numOfSheets = pageSet.length;
105 var summaryLabel = 110 var summaryLabel =
106 localStrings.getString('printPreviewSheetsLabelSingular'); 111 localStrings.getString('printPreviewSheetsLabelSingular');
107 var numOfPagesText = ''; 112 var numOfPagesText = '';
108 var pagesLabel = localStrings.getString('printPreviewPageLabelPlural'); 113 var pagesLabel = localStrings.getString('printPreviewPageLabelPlural');
109 114
110 if (printToPDF) 115 if (printToPDF)
111 summaryLabel = localStrings.getString('printPreviewPageLabelSingular'); 116 summaryLabel = localStrings.getString('printPreviewPageLabelSingular');
112 117
(...skipping 22 matching lines...) Expand all
135 // Removing extra spaces from within the string. 140 // Removing extra spaces from within the string.
136 html = html.replace(/\s{2,}/g, ' '); 141 html = html.replace(/\s{2,}/g, ' ');
137 this.summary_.innerHTML = html; 142 this.summary_.innerHTML = html;
138 }, 143 },
139 }; 144 };
140 145
141 return { 146 return {
142 PrintHeader: PrintHeader, 147 PrintHeader: PrintHeader,
143 }; 148 };
144 }); 149 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/preview_area.js ('k') | chrome/browser/resources/print_preview/print_preview.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698