Mozilla print fixes
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 3 Feb 2010 22:41:13 +0000 (15:41 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 3 Feb 2010 23:29:14 +0000 (16:29 -0700)
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
imp/templates/print/headers.html
imp/themes/screen.css

index 9f780d0..213b041 100644 (file)
@@ -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'];
index 6102191..5d0035c 100644 (file)
@@ -3,10 +3,10 @@
  <tag:css />
  <head></head>
  <body>
-  <div id="headerblock" class="fixed mimeHeaders">
-  <loop:headers>
+  <div id="headerblock" class="fixed mimeHeaders mimeHeadersPrint">
+<loop:headers>
    <div><strong><tag:headers.header />:</strong> <tag:headers.value /></div>
-  </loop:headers>
+</loop:headers>
   </div>
  </body>
 </html>
index f8913e2..4baaabc 100644 (file)
@@ -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;