projects
/
bookreader.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fc2077f
)
Don't immediately print on Safari -- give the user a chance to resize the window
author
Michael Ang
<mang@archive.org>
Wed, 23 Sep 2009 01:53:19 +0000
(
01:53
+0000)
committer
Michael Ang
<mang@archive.org>
Wed, 23 Sep 2009 01:53:19 +0000
(
01:53
+0000)
GnuBookIA/www/print.php
patch
|
blob
|
history
diff --git
a/GnuBookIA/www/print.php
b/GnuBookIA/www/print.php
index
fd21f42
..
c704fc8
100644
(file)
--- a/
GnuBookIA/www/print.php
+++ b/
GnuBookIA/www/print.php
@@
-79,8
+79,16
@@
echo '<link rel="stylesheet" type="text/css" href="GnuBook.css" />';
echo "<style type='text/css'>";
echo " @media print { .noprint { font-size: 40pt; display: none; } }";
echo "</style>";
echo "<style type='text/css'>";
echo " @media print { .noprint { font-size: 40pt; display: none; } }";
echo "</style>";
+echo "<script type='text/javascript'>";
+echo " function conditionalPrint() {";
+echo " var doPrint = true; var agent = navigator.userAgent.toLowerCase();";
+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>" . $id . "</title><body onload='print(); return false;'>";
-echo "<p class='noprint' style='text-align: right'><button class='GBicon rollover print' title='Print' onclick='print(); return false;'></button> <a href='#' onclick='print(); return false;'>Print</a></p>";
+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;'>";
echo imageURL($paperAspect, $index, $format, $width, $height);
echo "</p>";
echo "<p style='text-align:center;'>";
echo imageURL($paperAspect, $index, $format, $width, $height);
echo "</p>";