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

Side by Side Diff: chrome/browser/resources/print_preview/print_preview_page.html

Issue 30443003: Use JS Date().toLocaleDateString() to format date in header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/printing/printing_message_filter.cc ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <style> 3 <style>
4 body { 4 body {
5 margin: 0px; 5 margin: 0px;
6 width: 0px; 6 width: 0px;
7 } 7 }
8 .row { 8 .row {
9 display: table-row; 9 display: table-row;
10 vertical-align: inherit; 10 vertical-align: inherit;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 var content = document.querySelector('#content'); 66 var content = document.querySelector('#content');
67 var footer = document.querySelector('#footer'); 67 var footer = document.querySelector('#footer');
68 68
69 body.style.width = pixels(options['width']); 69 body.style.width = pixels(options['width']);
70 body.style.height = pixels(options['height']); 70 body.style.height = pixels(options['height']);
71 header.style.height = pixels(options['topMargin']); 71 header.style.height = pixels(options['topMargin']);
72 content.style.height = pixels(options['height'] - options['topMargin'] - 72 content.style.height = pixels(options['height'] - options['topMargin'] -
73 options['bottomMargin']); 73 options['bottomMargin']);
74 footer.style.height = pixels(options['bottomMargin']); 74 footer.style.height = pixels(options['bottomMargin']);
75 75
76 document.querySelector('#date span').innerText = options['date']; 76 document.querySelector('#date span').innerText =
77 new Date(options['date']).toLocaleDateString();
77 document.querySelector('#title span').innerText = options['title']; 78 document.querySelector('#title span').innerText = options['title'];
79
78 document.querySelector('#url span').innerText = options['url']; 80 document.querySelector('#url span').innerText = options['url'];
79 document.querySelector('#page_number span').innerText = options['pageNumber']; 81 document.querySelector('#page_number span').innerText = options['pageNumber'];
80 82
81 // Reduce date and page number space to give more space to title and url. 83 // Reduce date and page number space to give more space to title and url.
82 document.querySelector('#date').style.width = 84 document.querySelector('#date').style.width =
83 pixels(document.querySelector('#date span').offsetWidth); 85 pixels(document.querySelector('#date span').offsetWidth);
84 document.querySelector('#page_number').style.width = 86 document.querySelector('#page_number').style.width =
85 pixels(document.querySelector('#page_number span').offsetWidth); 87 pixels(document.querySelector('#page_number span').offsetWidth);
86 88
87 // Hide text if it doesn't fit into expected margins. 89 // Hide text if it doesn't fit into expected margins.
(...skipping 18 matching lines...) Expand all
106 <div id="content"> 108 <div id="content">
107 </div> 109 </div>
108 <div id="footer"> 110 <div id="footer">
109 <div class="row"> 111 <div class="row">
110 <div id="url" class="text"><span/></div> 112 <div id="url" class="text"><span/></div>
111 <div id="page_number" class="text"><span/></div> 113 <div id="page_number" class="text"><span/></div>
112 </div> 114 </div>
113 </div> 115 </div>
114 </body> 116 </body>
115 </html> 117 </html>
OLDNEW
« no previous file with comments | « chrome/browser/printing/printing_message_filter.cc ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698