1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-01 05:49:58 +00:00

Merge branch 'master' into development

This commit is contained in:
Ozzie Isaacs 2021-01-30 17:55:45 +01:00
commit ff16afbf0b
5 changed files with 67 additions and 114 deletions

View File

@ -2119,8 +2119,7 @@ body > div.container-fluid > div > div.col-sm-10 > div.discover > div.container
transition: all 0s transition: all 0s
} }
.well > form > .btn {
.book-meta > .bookinfo > .tags .btn-info, .well > form > .btn {
vertical-align: middle; vertical-align: middle;
-o-transition: background-color .2s, color .2s -o-transition: background-color .2s, color .2s
} }
@ -2957,46 +2956,35 @@ body > div.container-fluid > div > div.col-sm-10 > div > div > div.col-sm-3.col-
margin-top: 24px margin-top: 24px
} }
.book-meta > .bookinfo > .publishers > span:first-of-type, .book-meta > .bookinfo > .publishing-date > span:first-of-type { .book-meta > .bookinfo > .languages > span:first-of-type,
.book-meta > .bookinfo > .publishers > span:first-of-type,
.book-meta > .bookinfo > .publishing-date > span:first-of-type,
.real_custom_columns > span:first-of-type {
color: hsla(0, 0%, 100%, .45); color: hsla(0, 0%, 100%, .45);
text-transform: uppercase; text-transform: uppercase;
font-family: Open Sans Bold, Helvetica Neue, Helvetica, Arial, sans-serif font-family: Open Sans Bold, Helvetica Neue, Helvetica, Arial, sans-serif;
width: 200px;
display: inline-block
} }
.book-meta > .bookinfo > .publishers > span:last-of-type, .book-meta > .bookinfo > .publishing-date > span:last-of-type { .book-meta > .bookinfo > .languages > span:last-of-type,
.book-meta > .bookinfo > .publishers > span:last-of-type,
.book-meta > .bookinfo > .publishing-date > span:last-of-type,
.real_custom_columns > span:last-of-type {
font-family: Open Sans Semibold, Helvetica Neue, Helvetica, Arial, sans-serif; font-family: Open Sans Semibold, Helvetica Neue, Helvetica, Arial, sans-serif;
color: #fff; color: #fff;
font-size: 15px; font-size: 15px;
-webkit-font-smoothing: antialiased -webkit-font-smoothing: antialiased
} }
.book-meta > .bookinfo > .publishers > span:last-of-type { .book-meta > .bookinfo > .languages > span > a,
padding-left: 90px .book-meta > .bookinfo > .publishers > span > a,
.book-meta > .bookinfo > .publishing-date > span > a,
.real_custom_columns > span > a {
color: #fff
} }
.real_custom_columns > span:last-of-type { .book-meta > h2, body.book .author {
padding-left: 90px
}
.book-meta > .bookinfo > .publishing-date > span:last-of-type {
padding-left: 90px
}
.book-meta > .bookinfo > .languages > span:first-of-type {
color: hsla(0, 0%, 100%, .45);
text-transform: uppercase;
font-family: Open Sans Bold, Helvetica Neue, Helvetica, Arial, sans-serif
}
.book-meta > .bookinfo > .languages > span:last-of-type {
font-size: 15px;
font-family: Open Sans Semibold, Helvetica Neue, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
color: #fff;
padding-left: 85px
}
.book-meta > .bookinfo > .tags .btn-info, .book-meta > h2, body.book .author {
font-family: Open Sans Bold, Helvetica Neue, Helvetica, Arial, sans-serif font-family: Open Sans Bold, Helvetica Neue, Helvetica, Arial, sans-serif
} }
@ -3077,34 +3065,10 @@ body.book .author {
background-color: rgba(0, 0, 0, .3) background-color: rgba(0, 0, 0, .3)
} }
.book-meta > .bookinfo > .identifiers > p > .btn-success, .book-meta > .bookinfo > .tags .btn-info {
overflow: hidden;
text-align: center;
white-space: nowrap;
margin: 2px 3px 0 0;
padding: 0 10px
}
.book-meta > .bookinfo > .tags .btn-info {
background-color: rgba(0, 0, 0, .15);
color: hsla(0, 0%, 100%, .7);
font-size: 13px;
display: inline-block;
border-radius: 4px;
-webkit-transition: background-color .2s, color .2s;
transition: background-color .2s, color .2s;
text-transform: none
}
.dropdown-menu, .tooltip.in { .dropdown-menu, .tooltip.in {
-webkit-transition: opacity .15s ease-out, -webkit-transform .15s cubic-bezier(.6, .4, .2, 1.4) -webkit-transition: opacity .15s ease-out, -webkit-transform .15s cubic-bezier(.6, .4, .2, 1.4)
} }
.book-meta > .bookinfo > .tags .btn-info:hover {
color: #fff;
text-decoration: underline
}
.book-meta > .bookinfo > .identifiers, .book-meta > .bookinfo > .tags { .book-meta > .bookinfo > .identifiers, .book-meta > .bookinfo > .tags {
padding-left: 40px; padding-left: 40px;
margin: 10px 0 margin: 10px 0
@ -3345,7 +3309,8 @@ div.btn-group[role=group][aria-label="Download, send to Kindle, reading"] .dropd
box-shadow: none box-shadow: none
} }
.book-meta > .bookinfo > .identifiers > p > .btn-success { .book-meta > .bookinfo .btn-info,
.book-meta > .bookinfo .btn-success {
background-color: rgba(0, 0, 0, .15); background-color: rgba(0, 0, 0, .15);
color: hsla(0, 0%, 100%, .7); color: hsla(0, 0%, 100%, .7);
font-size: 13px; font-size: 13px;
@ -3359,11 +3324,21 @@ div.btn-group[role=group][aria-label="Download, send to Kindle, reading"] .dropd
text-transform: none text-transform: none
} }
.book-meta > .bookinfo > .identifiers > p > .btn-success:hover { .book-meta > .bookinfo .btn-info:hover,
.book-meta > .bookinfo .btn-success:hover {
color: #fff; color: #fff;
text-decoration: underline text-decoration: underline
} }
.book-meta > .bookinfo .btn-info,
.book-meta > .bookinfo .btn-success {
overflow: hidden;
text-align: center;
white-space: nowrap;
margin: 2px 3px 0 0;
padding: 0 10px
}
#bookDetailsModal .book-meta { #bookDetailsModal .book-meta {
color: hsla(0, 0%, 100%, .7); color: hsla(0, 0%, 100%, .7);
height: calc(100% - 120px); height: calc(100% - 120px);
@ -6970,16 +6945,12 @@ body.edituser.admin > div.container-fluid > div.row-fluid > div.col-sm-10 > div.
margin: 45px margin: 45px
} }
.book-meta > .bookinfo > .publishing-date > span:last-of-type { .book-meta > .bookinfo > .languages > span:first-of-type,
padding-left: 25px .book-meta > .bookinfo > .publishers > span:first-of-type,
} .book-meta > .bookinfo > .publishing-date > span:first-of-type,
.real_custom_columns > span:first-of-type {
.book-meta > .bookinfo > .publishers > span:last-of-type { width: 50%;
padding-left: 70px max-width: 200px;
}
.book-meta > .bookinfo > .languages > span:last-of-type {
padding-left: 65px
} }
.book-meta > .bookinfo .publishers { .book-meta > .bookinfo .publishers {

View File

@ -145,44 +145,16 @@ if ($("body.book").length > 0) {
$(".blur-wrapper") $(".blur-wrapper")
.prepend('<div><img alt="Blurred cover" class="bg-blur" src="' + cover + '"></div>'); .prepend('<div><img alt="Blurred cover" class="bg-blur" src="' + cover + '"></div>');
// Fix-up book detail headings // Metadata Fields - Publishers, Published, Languages and Custom
publisher = $(".publishers p span").text().split(":"); $('.publishers, .publishing-date, .real_custom_columns, .languages').each(function () {
$(".publishers p span").remove(); var splitText = $(this).text().split(':');
$.each(publisher, function (i, val) { var label = splitText.shift().trim();
$(".publishers").append("<span>" + publisher[i] + "</span>"); var value = splitText.join(':').trim();
}); // Preserve Links
$(".publishers span:nth-child(3)").text(function () { if ($(this).find('a').length) {
return $(this).text().replace(/^\s+|^\t+|\t+|\s+$/g, ""); value = $(this).find('a').first().removeClass();
});
// Fix-up book custom colums headings
// real_custom_column = $( '.real_custom_columns' ).text().split( ':' );
real_custom_column = $(".real_custom_columns");
// $( ".real_custom_columns" ).remove();
$.each(real_custom_column, function (i, val) {
var split = $(this).text().split(":");
real_cc_key = split.shift();
real_cc_value = split.join(":");
$(this).text("");
if (real_cc_value != "") {
$(this).append("<span>" + real_cc_key + "</span><span>" + real_cc_value + "</span>");
} }
}); $(this).html('<span>' + label + '</span><span></span>').find('span').last().append(value);
//$( '.real_custom_columns:nth-child(3)' ).text(function() {
//return $(this).text().replace(/^\s+|^\t+|\t+|\s+$/g, "");
//});
published = $(".publishing-date p")
.text().split(": ");
$(".publishing-date p").remove();
$.each(published, function (i, val) {
$(".publishing-date").append("<span>" + published[i] + "</span>");
});
languages = $(".languages p span").text().split(": ");
$(".languages p span").remove();
$.each(languages, function (i, val) {
$(".languages").append("<span>" + languages[i] + "</span>");
}); });
$(".book-meta h2:first").clone() $(".book-meta h2:first").clone()
@ -246,11 +218,6 @@ if ($("body.book").length > 0) {
$("#add-to-shelves").toggle(); $("#add-to-shelves").toggle();
}); });
// Fix formatting error on book detail languages
if (!$(".book-meta > .bookinfo > .languages > span:last-of-type").text().startsWith(" ")) {
$(".book-meta > .bookinfo > .languages > span:last-of-type").prepend(" ");
}
//Work to reposition dropdowns. Does not currently solve for //Work to reposition dropdowns. Does not currently solve for
//screen resizing //screen resizing
function dropdownToggle() { function dropdownToggle() {

View File

@ -141,9 +141,24 @@ var createURLFromArray = function(array, mimeType) {
kthoom.ImageFile = function(file) { kthoom.ImageFile = function(file) {
this.filename = file.filename; this.filename = file.filename;
var fileExtension = file.filename.split(".").pop().toLowerCase(); var fileExtension = file.filename.split(".").pop().toLowerCase();
this.mimeType = fileExtension === "png" ? "image/png" : switch (fileExtension) {
(fileExtension === "jpg" || fileExtension === "jpeg") ? "image/jpeg" : case "jpg":
fileExtension === "gif" ? "image/gif" : fileExtension === "svg" ? "image/xml+svg" : undefined; case "jpeg":
this.mimeType = "image/jpeg";
break;
case "gif":
this.mimeType = "iamge/gif";
break;
case "svg":
this.mimeType = "image/svg+xml";
break;
case "webp":
this.mimeType = "image/webp";
break;
default:
this.mimeType = undefined;
break;
}
if ( this.mimeType !== undefined) { if ( this.mimeType !== undefined) {
this.dataURI = createURLFromArray(file.fileData, this.mimeType); this.dataURI = createURLFromArray(file.fileData, this.mimeType);
this.data = file; this.data = file;
@ -331,7 +346,7 @@ function setImage(url) {
$("#mainText").innerHTML("<iframe style=\"width:100%;height:700px;border:0\" src=\"data:text/html," + escape(xhr.responseText) + "\"></iframe>"); $("#mainText").innerHTML("<iframe style=\"width:100%;height:700px;border:0\" src=\"data:text/html," + escape(xhr.responseText) + "\"></iframe>");
}; };
xhr.send(null); xhr.send(null);
} else if (!/(jpg|jpeg|png|gif)$/.test(imageFiles[currentImage].filename) && imageFiles[currentImage].data.uncompressedSize < 10 * 1024) { } else if (!/(jpg|jpeg|png|gif|webp)$/.test(imageFiles[currentImage].filename) && imageFiles[currentImage].data.uncompressedSize < 10 * 1024) {
xhr.open("GET", url, true); xhr.open("GET", url, true);
xhr.onload = function() { xhr.onload = function() {
$("#mainText").css("display", ""); $("#mainText").css("display", "");

View File

@ -89,7 +89,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<h2 id="title">{{entry.title|shortentitle(40)}}</h2> <h2 id="title">{{entry.title}}</h2>
<p class="author"> <p class="author">
{% for author in entry.authors %} {% for author in entry.authors %}
<a href="{{url_for('web.books_list', data='author', sort_param='new', book_id=author.id ) }}">{{author.name.replace('|',',')}}</a> <a href="{{url_for('web.books_list', data='author', sort_param='new', book_id=author.id ) }}">{{author.name.replace('|',',')}}</a>

View File

@ -264,7 +264,7 @@ def get_comic_book(book_id, book_format, page):
else: else:
b64 = extract(page).encode('base64') b64 = extract(page).encode('base64')
ext = names[page].rpartition('.')[-1] ext = names[page].rpartition('.')[-1]
if ext not in ('png', 'gif', 'jpg', 'jpeg'): if ext not in ('png', 'gif', 'jpg', 'jpeg', 'webp'):
ext = 'png' ext = 'png'
extractedfile="data:image/" + ext + ";base64," + b64 extractedfile="data:image/" + ext + ";base64," + b64
fileData={"name": names[page], "page":page, "last":len(names)-1, "content": extractedfile} fileData={"name": names[page], "page":page, "last":len(names)-1, "content": extractedfile}