Pass in book title and page names to use as title
authorMichael Ang <mang@archive.org>
Wed, 23 Sep 2009 02:19:36 +0000 (02:19 +0000)
committerMichael Ang <mang@archive.org>
Wed, 23 Sep 2009 02:19:36 +0000 (02:19 +0000)
GnuBook/GnuBook.js
GnuBookIA/www/print.php

index 24c8df3..1e94b11 100644 (file)
@@ -2471,6 +2471,9 @@ GnuBook.prototype.getPrintURI = function() {
     if (this.constMode2up == this.mode) {
         options += '&index2=' + this.leafMap[this.twoPage.currentIndexR] + '&width2=' + this.getPageWidth(this.twoPage.currentIndexR);
         options += '&height2=' + this.getPageHeight(this.twoPage.currentIndexR);
+        options += '&title=' + escape(this.shortTitle(30) + ' - Pages ' + this.getPageNum(this.twoPage.currentIndexL) + ', ' + this.getPageNum(this.twoPage.currentIndexR));
+    } else {
+        options += '&title=' + escape(this.shortTitle(30) + ' - Page ' + this.getPageNum(indexToPrint));
     }
 
     return '/bookreader/print.php?' + options;
index c704fc8..a06037c 100644 (file)
@@ -29,6 +29,7 @@ $format = $_REQUEST['format'];
 //$imgAspect = $_REQUEST['aspect'];
 $width = $_REQUEST['width'];
 $height = $_REQUEST['height'];
+$title = $_REQUEST['title'];
 
 // $$$ escape the values
 
@@ -86,7 +87,7 @@ echo "    if (agent.indexOf('safari') != -1) { doPrint = false; }";
 echo "    if (doPrint) { print(); }";
 echo "  }";
 echo "</script>";
-echo "<title>" . $id . "</title><body onload='print(); return false;'>";
+echo "<title>" . $title . "</title><body onload='print(); return false;'>";
 echo   "<p class='noprint' style='text-align: right'>";
 echo     "<button class='GBicon rollover print' title='Print' onclick='conditionalPrint(); return false;'></button> <a href='#' onclick='print(); return false;'>Print</a></p>";
 echo   "<p style='text-align:center;'>";