| Index: chrome/browser/resources/print_preview/print_preview_page.html
|
| diff --git a/chrome/browser/resources/print_preview/print_preview_page.html b/chrome/browser/resources/print_preview/print_preview_page.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e49974ee922b4f180a3896b583cf0493de5dfef6
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/print_preview/print_preview_page.html
|
| @@ -0,0 +1,107 @@
|
| +<!DOCTYPE html>
|
| +<head>
|
| +<style>
|
| + body {
|
| + margin: 0px;
|
| + }
|
| + .row {
|
| + display: table-row;
|
| + vertical-align: inherit;
|
| + }
|
| + #header, #footer {
|
| + display: table;
|
| + table-layout:fixed;
|
| + width: inherit;
|
| + }
|
| + #header {
|
| + vertical-align: top;
|
| + }
|
| + #footer {
|
| + vertical-align: bottom;
|
| + }
|
| + .text {
|
| + display: table-cell;
|
| + font-family: Sans;
|
| + padding-left: 0.5cm;
|
| + padding-right: 0.5cm;
|
| + vertical-align: inherit;
|
| + white-space: nowrap;
|
| + }
|
| + #page_number {
|
| + text-align: right;
|
| + }
|
| + #title {
|
| + text-align: center;
|
| + }
|
| + #title, #url {
|
| + overflow: hidden;
|
| + text-overflow: ellipsis;
|
| + }
|
| + #title, #date {
|
| + padding-bottom: 0cm;
|
| + padding-top: 0.5cm;
|
| + }
|
| + #page_number, #url {
|
| + padding-bottom: 0.5cm;
|
| + padding-top: 0cm;
|
| + }
|
| +</style>
|
| +<script>
|
| +
|
| +function pixels(value) {
|
| + return value + 'px';
|
| +}
|
| +
|
| +function setup(options) {
|
| + document.styleSheets[0].insertRule(
|
| + '.text { font-size: ' + pixels(options['fontSize']) + '; }');
|
| + var body = document.querySelector('body');
|
| + var header = document.querySelector('#header');
|
| + var content = document.querySelector('#content');
|
| + var footer = document.querySelector('#footer');
|
| +
|
| + body.style.width = pixels(options['width']);
|
| + body.style.height = pixels(options['height']);
|
| + header.style.height = pixels(options['topMargin']);
|
| + content.style.height = pixels(options['height'] - options['topMargin'] -
|
| + options['bottomMargin']);
|
| + footer.style.height = pixels(options['bottomMargin']);
|
| +
|
| + document.querySelector('#date span').innerText = options['date'];
|
| + document.querySelector('#title span').innerText = options['title'];
|
| + document.querySelector('#url span').innerText = options['url'];
|
| + document.querySelector('#page_number span').innerText = options['pageNumber'];
|
| +
|
| + // Reduce date and page number space to give more space to title and url.
|
| + document.querySelector('#date').style.width =
|
| + pixels(document.querySelector('#date span').offsetWidth);
|
| + document.querySelector('#page_number').style.width =
|
| + pixels(document.querySelector('#page_number span').offsetWidth);
|
| +
|
| + // Hide text if it doesn't fit into expected margins.
|
| + if (header.offsetHeight > options['topMargin'] + 1 ||
|
| + footer.offsetHeight > options['bottomMargin'] + 1) {
|
| + header.style.display = 'none';
|
| + footer.style.display = 'none';
|
| + }
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +<body>
|
| + <div id="header">
|
| + <div class="row">
|
| + <div id="date" class="text"><span/></div>
|
| + <div id="title" class="text"><span/></div>
|
| + </div>
|
| + </div>
|
| + <div id="content">
|
| + </div>
|
| + <div id="footer">
|
| + <div class="row">
|
| + <div id="url" class="text"><span/></div>
|
| + <div id="page_number" class="text"><span/></div>
|
| + </div>
|
| + </div>
|
| +</body>
|
| +</html>
|
|
|