projects
/
bookreader.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use modified dragscrollable plugin from http://github.com/raganwald/iGesture. Add...
[bookreader.git]
/
BookReaderIA
/
inc
/
BookReader.inc
diff --git
a/BookReaderIA/inc/BookReader.inc
b/BookReaderIA/inc/BookReader.inc
index
e768b1a
..
936cf69
100644
(file)
--- a/
BookReaderIA/inc/BookReader.inc
+++ b/
BookReaderIA/inc/BookReader.inc
@@
-73,7
+73,7
@@
class BookReader
{
// Set title to default if not set
if (!$title) {
{
// Set title to default if not set
if (!$title) {
- $title = 'Book
r
eader';
+ $title = 'Book
R
eader';
}
$id = $identifier;
}
$id = $identifier;
@@
-81,7
+81,12
@@
class BookReader
// manually update with Launchpad version number at each checkin so that browsers
// do not use old cached version
// see https://bugs.launchpad.net/gnubook/+bug/330748
// manually update with Launchpad version number at each checkin so that browsers
// do not use old cached version
// see https://bugs.launchpad.net/gnubook/+bug/330748
- $version = "r24";
+ $version = "r25";
+
+ if (BookReader::getDevHost($server)) {
+ // on dev host - add time to force reload
+ $version .= '_' . time();
+ }
if ("" == $id) {
echo "No identifier specified!";
if ("" == $id) {
echo "No identifier specified!";
@@
-94,6
+99,7
@@
class BookReader
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
+ <meta name="viewport" content="width=device-width, maximum-scale=1.0" />
<title><? echo $title; ?></title>
<!--[if lte IE 6]>
<meta http-equiv="refresh" content="2; URL=/bookreader/browserunsupported.php?id=<? echo($id); ?>">
<title><? echo $title; ?></title>
<!--[if lte IE 6]>
<meta http-equiv="refresh" content="2; URL=/bookreader/browserunsupported.php?id=<? echo($id); ?>">
@@
-101,9
+107,12
@@
class BookReader
<link rel="stylesheet" type="text/css" href="/bookreader/BookReader.css?v=<? echo($version); ?>">
<? if ($uiMode == "embed") { ?>
<link rel="stylesheet" type="text/css" href="/bookreader/BookReaderEmbed.css?v=<? echo($version); ?>">
<link rel="stylesheet" type="text/css" href="/bookreader/BookReader.css?v=<? echo($version); ?>">
<? if ($uiMode == "embed") { ?>
<link rel="stylesheet" type="text/css" href="/bookreader/BookReaderEmbed.css?v=<? echo($version); ?>">
+<? } elseif ($uiMode == "touch") { ?>
+ <link rel="stylesheet" type="text/css" href="/bookreader/touch/BookReaderTouch.css?v=<? echo($version); ?>">
<? } /* uiMode */ ?>
<? } /* uiMode */ ?>
- <script src="/includes/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script type="text/javascript" src="/bookreader/jquery.easing.1.3.js"></script>
+ <script src="/includes/jquery-1.4.2.min.js" type="text/javascript"></script>
+ <script type="text/javascript" src="/bookreader/jquery-ui-1.8.1.custom.min.js"></script>
+ <script type="text/javascript" src="/bookreader/dragscrollable.js"></script>
<script type="text/javascript" src="/bookreader/BookReader.js?v=<? echo($version); ?>"></script>
</head>
<body style="background-color: #FFFFFF;">
<script type="text/javascript" src="/bookreader/BookReader.js?v=<? echo($version); ?>"></script>
</head>
<body style="background-color: #FFFFFF;">
@@
-164,22
+173,31
@@
class BookReader
<?
exit;
}
<?
exit;
}
+
+ // Returns the user part of dev host from URL, or null
+ public static function getDevHost($server)
+ {
+ if (preg_match("/^www-(\w+)/", $_SERVER["SERVER_NAME"], $match)) {
+ return $match[1];
+ }
+
+ return null;
+ }
public static function serverBaseURL($server)
{
public static function serverBaseURL($server)
{
- // Check if we're on a dev vhost and point to JSIA in the user's public_html
- // on the datanode
- if (preg_match("/^www-(\w+)/", $_SERVER["SERVER_NAME"], $match)) {
+ // Check if we're on a dev vhost and point to JSIA in the user's public_html
+ // on the datanode
// $$$ the remapping isn't totally automatic yet and requires user to
// ln -s ~/petabox/www/datanode/BookReader ~/public_html/BookReader
// so we enable it only for known hosts
// $$$ the remapping isn't totally automatic yet and requires user to
// ln -s ~/petabox/www/datanode/BookReader ~/public_html/BookReader
// so we enable it only for known hosts
+ $devhost = BookReader::getDevHost($server);
$devhosts = array('mang', 'testflip', 'rkumar');
$devhosts = array('mang', 'testflip', 'rkumar');
- if (in_array($
match[1]
, $devhosts)) {
- $server = $server . "/~" . $
match[1]
;
+ if (in_array($
devhost
, $devhosts)) {
+ $server = $server . "/~" . $
devhost
;
}
}
- }
- return $server;
+ return $server;
}
}