mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
/old: Add support for --url-prefix
This commit is contained in:
parent
a348655fbd
commit
847b52e812
@ -40,7 +40,7 @@ function create_table_headers() {
|
|||||||
|
|
||||||
|
|
||||||
function format_url(format, id, title) {
|
function format_url(format, id, title) {
|
||||||
return 'get/'+format.toLowerCase() + '/'+encodeURIComponent(title) + '_' + id+'.'+format.toLowerCase();
|
return url_prefix + '/get/'+format.toLowerCase() + '/'+encodeURIComponent(title) + '_' + id+'.'+format.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_book(book) {
|
function render_book(book) {
|
||||||
@ -101,7 +101,7 @@ function render_book(book) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
title += '</span>'
|
title += '</span>'
|
||||||
title += '<img style="display:none" alt="" src="get/cover/{0}" /></span>'.format(id);
|
title += '<img style="display:none" alt="" src="{1}/get/cover/{0}" /></span>'.format(id, url_prefix);
|
||||||
title += '<div class="comments">{0}</div>'.format(comments)
|
title += '<div class="comments">{0}</div>'.format(comments)
|
||||||
// Render authors cell
|
// Render authors cell
|
||||||
var _authors = new Array();
|
var _authors = new Array();
|
||||||
|
@ -3,26 +3,27 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml" version="XHTML 1.1" xml:lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" version="XHTML 1.1" xml:lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>calibre library</title>
|
<title>calibre library</title>
|
||||||
<link rel="stylesheet" type="text/css" href="/static/gui.css" charset="utf-8" />
|
<script type="text/javascript">var url_prefix='{prefix}';</script>
|
||||||
<script type="text/javascript" src="/static/date.js" charset="utf-8"></script>
|
<link rel="stylesheet" type="text/css" href="{prefix}/static/gui.css" charset="utf-8" />
|
||||||
<script type="text/javascript" src="/static/jquery.js" charset="utf-8"></script>
|
<script type="text/javascript" src="{prefix}/static/date.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="/static/gui.js" charset="utf-8"></script>
|
<script type="text/javascript" src="{prefix}/static/jquery.js" charset="utf-8"></script>
|
||||||
|
<script type="text/javascript" src="{prefix}/static/gui.js" charset="utf-8"></script>
|
||||||
<link rel="icon" href="http://calibre-ebook.com/favicon.ico" type="image/x-icon" />
|
<link rel="icon" href="http://calibre-ebook.com/favicon.ico" type="image/x-icon" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="banner">
|
<div id="banner">
|
||||||
<a style="border: 0pt" href="http://calibre-ebook.com" alt="calibre" title="calibre"><img style="border:0pt" src="/static/calibre_banner.png" alt="calibre" /></a>
|
<a style="border: 0pt" href="http://calibre-ebook.com" alt="calibre" title="calibre"><img style="border:0pt" src="{prefix}/static/calibre_banner.png" alt="calibre" /></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="search_box">
|
<div id="search_box">
|
||||||
<form name="search_form" onsubmit="search();return false;" action="./" method="get" accept-charset="UTF-8">
|
<form name="search_form" onsubmit="search();return false;" action="{prefix}/old" method="get" accept-charset="UTF-8">
|
||||||
<input value="" id="s" type="text" />
|
<input value="" id="s" type="text" />
|
||||||
<input type="image" src="/static/btn_search_box.png" width="27" height="24" id="go" alt="Search" title="Search" />
|
<input type="image" src="{prefix}/static/btn_search_box.png" width="27" height="24" id="go" alt="Search" title="Search" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="count_bar">
|
<div id="count_bar">
|
||||||
<span id="left"><img src="/static/first.png" alt="Show first set of books" title="Show first set of books"/> <img src="/static/previous.png" alt="Show previous set of books" title="Show previous set of books"/> </span><span id="count"> </span> <span id="right"><img src="/static/next.png" alt="Show next set of books" title="Show next set of books"/> <img src="/static/last.png" alt="Show last set of books" title="Show last set of books" /></span>
|
<span id="left"><img src="{prefix}/static/first.png" alt="Show first set of books" title="Show first set of books"/> <img src="{prefix}/static/previous.png" alt="Show previous set of books" title="Show previous set of books"/> </span><span id="count"> </span> <span id="right"><img src="{prefix}/static/next.png" alt="Show next set of books" title="Show next set of books"/> <img src="{prefix}/static/last.png" alt="Show last set of books" title="Show last set of books" /></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
@ -38,7 +39,7 @@
|
|||||||
|
|
||||||
<div id="loading">
|
<div id="loading">
|
||||||
<div>
|
<div>
|
||||||
<img align="top" src="/static/loading.gif" alt="Loading..." title="Loading..."/> <span id="loading_msg">Loading…</span>
|
<img align="top" src="{prefix}/static/loading.gif" alt="Loading..." title="Loading..."/> <span id="loading_msg">Loading…</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -131,7 +131,8 @@ class ContentServer(object):
|
|||||||
return self.browse_toplevel()
|
return self.browse_toplevel()
|
||||||
|
|
||||||
def old(self, **kwargs):
|
def old(self, **kwargs):
|
||||||
return self.static('index.html')
|
return self.static('index.html').replace('{prefix}',
|
||||||
|
self.opts.url_prefix)
|
||||||
|
|
||||||
# Actually get content from the database {{{
|
# Actually get content from the database {{{
|
||||||
def get_cover(self, id, thumbnail=False, thumb_width=60, thumb_height=80):
|
def get_cover(self, id, thumbnail=False, thumb_width=60, thumb_height=80):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user