| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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> |
| OLD | NEW |