From 620663cae566153ce658be2063a6f2644f6efe3e Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 3 Feb 2010 15:41:13 -0700 Subject: [PATCH] Mozilla print fixes Fix layout of header DIV in print HTML on Mozilla Make headers size constant - or else formatting in the page will make it too large/small. --- imp/print.php | 7 ++++++- imp/templates/print/headers.html | 6 +++--- imp/themes/screen.css | 7 +++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/imp/print.php b/imp/print.php index 9f780d0e2..213b041cf 100644 --- a/imp/print.php +++ b/imp/print.php @@ -98,6 +98,11 @@ case 'headers': $elt->removeAttribute('class'); + /* Need to wrap headers in another DIV. */ + $newdiv = new DOMDocument(); + $div = $newdiv->createElement('div'); + $div->appendChild($newdiv->importNode($elt, true)); + // Fall-through case 'content': @@ -111,7 +116,7 @@ case 'headers': libxml_use_internal_errors(true); $doc = DOMDocument::loadHTML($render[$key]['data']); $bodyelt = $doc->getElementsByTagName('body')->item(0); - $bodyelt->insertBefore($doc->importNode($elt, true), $bodyelt->firstChild); + $bodyelt->insertBefore($doc->importNode($div, true), $bodyelt->firstChild); echo $doc->saveHTML(); } else { echo $render[$key]['data']; diff --git a/imp/templates/print/headers.html b/imp/templates/print/headers.html index 61021913a..5d0035c6c 100644 --- a/imp/templates/print/headers.html +++ b/imp/templates/print/headers.html @@ -3,10 +3,10 @@ -
- +
+
:
-
+
diff --git a/imp/themes/screen.css b/imp/themes/screen.css index f8913e2d0..4baaabc18 100644 --- a/imp/themes/screen.css +++ b/imp/themes/screen.css @@ -592,6 +592,12 @@ div.mimeStatusMessage, div.mimePartInfo { border-color: #ffd0af; } +.mimeHeadersPrint { + /* Must be pixel size to properly work with Mozilla on print page. */ + font-size: 12px; +} + +/* Other images. */ .downloadAtc, .downloadZipAtc, .saveImgAtc, .printAtc, .closeImg, .deleteImg, .foldersImg, .searchuiImg, .reloadImg { display: -moz-inline-stack; display: inline-block; @@ -627,6 +633,7 @@ div.mimeStatusMessage, div.mimePartInfo { background-image: url("graphics/reload.png"); } +/* ITIP styles. */ #itipconflicts tr.itipcollision { background-color: #f00; color: #fff; -- 2.11.0