mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
/browse: Make the top level page more semantic and pentadactyl firendly
This commit is contained in:
parent
b7ac30b890
commit
d3814a3a5a
@ -208,6 +208,8 @@ h2.library_name {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.toplevel li a { text-decoration: none; }
|
||||||
|
|
||||||
.toplevel li img {
|
.toplevel li img {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
|
@ -116,7 +116,7 @@ function toplevel() {
|
|||||||
$(".sort_select").hide();
|
$(".sort_select").hide();
|
||||||
|
|
||||||
$(".toplevel li").click(function() {
|
$(".toplevel li").click(function() {
|
||||||
var href = $(this).children("span.url").text();
|
var href = $(this).children("a").attr('href');
|
||||||
window.location = href;
|
window.location = href;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -24,6 +24,10 @@ class Server(Command):
|
|||||||
self.rebuild_monocole()
|
self.rebuild_monocole()
|
||||||
p = subprocess.Popen(['calibre-server', '--develop'],
|
p = subprocess.Popen(['calibre-server', '--develop'],
|
||||||
stderr=subprocess.STDOUT, stdout=log)
|
stderr=subprocess.STDOUT, stdout=log)
|
||||||
|
time.sleep(0.2)
|
||||||
|
if p.poll() is not None:
|
||||||
|
print 'Starting server failed'
|
||||||
|
raise SystemExit(1)
|
||||||
return p
|
return p
|
||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
@ -38,9 +42,11 @@ class Server(Command):
|
|||||||
try:
|
try:
|
||||||
raw_input('Press Enter to kill/restart server. Ctrl+C to quit: ')
|
raw_input('Press Enter to kill/restart server. Ctrl+C to quit: ')
|
||||||
except:
|
except:
|
||||||
|
if p.poll() is None:
|
||||||
|
p.kill()
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
while p.returncode is None:
|
while p.poll() is None:
|
||||||
p.terminate()
|
p.terminate()
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
p.kill()
|
p.kill()
|
||||||
|
@ -335,9 +335,10 @@ class BrowseServer(object):
|
|||||||
icon = 'blank.png'
|
icon = 'blank.png'
|
||||||
cats.append((meta['name'], category, icon))
|
cats.append((meta['name'], category, icon))
|
||||||
|
|
||||||
cats = [('<li title="{2} {0}"><img src="{3}{src}" alt="{0}" />'
|
cats = [('<li><a title="{2} {0}" href="/browse/category/{1}"> </a>'
|
||||||
|
'<img src="{3}{src}" alt="{0}" />'
|
||||||
'<span class="label">{0}</span>'
|
'<span class="label">{0}</span>'
|
||||||
'<span class="url">{3}/browse/category/{1}</span></li>')
|
'</li>')
|
||||||
.format(xml(x, True), xml(quote(y)), xml(_('Browse books by')),
|
.format(xml(x, True), xml(quote(y)), xml(_('Browse books by')),
|
||||||
self.opts.url_prefix, src='/browse/icon/'+z)
|
self.opts.url_prefix, src='/browse/icon/'+z)
|
||||||
for x, y, z in cats]
|
for x, y, z in cats]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user