Commit 92eb7195 authored by Citronalco's avatar Citronalco
Browse files

some cleanup

add missing jquery file
parent 3e24352d
...@@ -171,12 +171,18 @@ div .bookcover { ...@@ -171,12 +171,18 @@ div .bookcover {
} }
.bookdata .title li { .bookdata .title li {
font-size: 160%; font-size: 160%;
cursor: pointer;
} }
.bookdata .author li { .bookdata .author li {
color: #43b49e; color: #43b49e;
cursor: pointer; cursor: pointer;
font-size: 120%;
margin-bottom: 20px; margin-bottom: 20px;
} }
.bookdata .author li:not(:last-child):after {
content: ", ";
}
.bookdata .year li { .bookdata .year li {
color: #43b49e; color: #43b49e;
cursor: pointer; cursor: pointer;
......
...@@ -21,34 +21,34 @@ ...@@ -21,34 +21,34 @@
<div class="bookdata"> <div class="bookdata">
<a class="download" href="{{{url}}}">Download {{format}}</a> <a class="download" href="{{{url}}}">Download {{format}}</a>
<div class="title"> <div class="title">
<ul>{{{title}}}</ul> {{{title_output}}}
</div> </div>
<div class="series">{{{series}}}</div> <div class="series">{{{series}}}</div>
<div class="author"> <div class="author">
<ul>{{{authors}}}</ul> {{{author}}}
</div> </div>
<div class="language"> <div class="language">
<label>Sprache:</label> <label>Sprache:</label>
<ul>{{{languages}}}</ul> {{{language}}}
</div> </div>
<div class="identifier"> <div class="identifier">
<label>Kennungen:</label> <label>Kennungen:</label>
<ul>{{{identifiers}}}</ul> {{{identifier}}}
</div> </div>
<div class="tag"> <div class="tag">
<label>Schlagwörter:</label> <label>Schlagwörter:</label>
<ul>{{{tags}}}</ul> {{{tag}}}
</div> </div>
<div class="publisher"> <div class="publisher">
<label>Herausgeber:</label> <label>Herausgeber:</label>
<ul>{{{publisher}}}</ul> {{{publisher}}}
</div> </div>
<div class="year"> <div class="year">
<label>Erscheinungsdatum:</label> <label>Erscheinungsdatum:</label>
<ul>{{{year}}}</ul> {{{year}}}
</div> </div>
<div class="description"> <div class="description">
<label>Beschreibung:</label> <label>Beschreibung:</label>
...@@ -138,45 +138,9 @@ ...@@ -138,45 +138,9 @@
coverurl = calibre_url_prefix + '/' + val['path'] + '/' + val['coverfile']; coverurl = calibre_url_prefix + '/' + val['path'] + '/' + val['coverfile'];
} }
// Book Title
var booktitle = '<li>' + htmlEncode(val['title_output']) + '</li>';
// Book Format // Book Format
var bookformat = val['filetype'].toUpperCase(); var bookformat = val['filetype'].toUpperCase();
// Book Author
var bookauthors='';
if (val['author']) {
for (var i=0;i<val['author'].length;i++) {
bookauthors += '<li>' + htmlEncode(val['author'][i]) + '</li>';
}
}
// Book Tags
var booktags='';
if (val['tag']) {
for (var i=0;i<val['tag'].length;i++) {
booktags += '<li>' + htmlEncode(val['tag'][i]) + '</li>';
}
}
// Book Identifiers
var bookidentifiers='';
if (val['identifier']) {
for (var i=0;i<val['identifier'].length;i++) {
if (val['identifier'][i].substr(0,5)=='uuid:') { continue; } // skip calibre uuid
bookidentifiers += '<li>' + htmlEncode(val['identifier'][i]) + '</li>';
}
}
// Book Languages
var booklanguages='';
if (val['language']) {
for (var i=0;i<val['language'].length;i++) {
booklanguages += '<li>' + htmlEncode(val['language'][i]) + '</li>';
}
}
// Book Series // Book Series
var bookseries=''; var bookseries='';
if (val['series']) { if (val['series']) {
...@@ -192,28 +156,32 @@ ...@@ -192,28 +156,32 @@
bookdescription=val['abstract_output']; bookdescription=val['abstract_output'];
} }
// Year
var bookyear = '<li>' + htmlEncode(val['year']) + '</li>';
// Publisher
var bookpublisher = '<li>' + htmlEncode(val['publisher']) + '</li>';
// stick everything in a array for Mustache to fill the Template // stick everything in a array for Mustache to fill the Template
var bookdata = { var bookdata = {
num: cnt++, num: cnt++,
url: bookurl, url: bookurl,
format: bookformat, format: bookformat,
coverurl: coverurl, coverurl: coverurl,
title: booktitle,
authors: bookauthors,
tags: booktags,
identifiers: bookidentifiers,
series: bookseries, series: bookseries,
year: bookyear,
publisher: bookpublisher,
languages: booklanguages,
description: bookdescription description: bookdescription
}; };
['title_output','author','language','publisher','year','identifier','tag'].map(function(key) {
var output='';
if (val[key]) {
if (Array.isArray(val[key])) {
for (var i=0; i<val[key].length; i++) {
output += '<li>' + htmlEncode(val[key][i]) + '</li>';
}
output = '<ul>' + output + '</ul>';
}
else {
output = '<ul><li>' + val[key] + '</li></ul>';
}
}
bookdata[key] = output;
});
var bookdetails = Mustache.render(template,bookdata); // fill template with values var bookdetails = Mustache.render(template,bookdata); // fill template with values
$('#booklist').append(bookdetails).children(':last').hide().fadeIn(1000); // append book to booklist $('#booklist').append(bookdetails).children(':last').hide().fadeIn(1000); // append book to booklist
...@@ -297,8 +265,6 @@ ...@@ -297,8 +265,6 @@
// mark search form as "irrelevant" if solr query gets changed // mark search form as "irrelevant" if solr query gets changed
$('#solr_query').bind('init change keyup paste',function() { $('#solr_query').bind('init change keyup paste',function() {
console.log("solr__query_init");
if ($('input#solr_query').val() != build_query()) { if ($('input#solr_query').val() != build_query()) {
$('#searchfields').addClass('irrelevant'); $('#searchfields').addClass('irrelevant');
$('#searchbar-top').addClass('irrelevant'); $('#searchbar-top').addClass('irrelevant');
...@@ -436,7 +402,7 @@ ...@@ -436,7 +402,7 @@
<input type="text" name="tag" id="search_tag" /> <input type="text" name="tag" id="search_tag" />
</div> </div>
<div id="language"> <div id="language">
<label for="search_lang_0">Sprache</label> <label for="search_lang_any">Sprache</label>
<input type="radio" name="language" id="search_lang_any" value="" /><label for="search_lang_any" class="radio">Egal</label> <input type="radio" name="language" id="search_lang_any" value="" /><label for="search_lang_any" class="radio">Egal</label>
<input type="radio" name="language" id="search_lang_deu" value="deu" /><label for="search_lang_deu" class="radio">Deutsch</label> <input type="radio" name="language" id="search_lang_deu" value="deu" /><label for="search_lang_deu" class="radio">Deutsch</label>
<input type="radio" name="language" id="search_lang_eng" value="eng" /><label for="search_lang_eng" class="radio">Englisch</label> <input type="radio" name="language" id="search_lang_eng" value="eng" /><label for="search_lang_eng" class="radio">Englisch</label>
...@@ -449,7 +415,7 @@ ...@@ -449,7 +415,7 @@
</div> </div>
<div id="searchbar-bottom-readonly"> <div id="searchbar-bottom-readonly">
<label for="solr_query">Query:</label> <label for="solr_query">Query:</label>
<span id="solr_query_readonly"/> <span id="solr_query_readonly"></span>
</div> </div>
</div> </div>
<div id="booklist"></div> <div id="booklist"></div>
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment