Merge remote-tracking branch 'caliblur/master'

This commit is contained in:
Ozzieisaacs 2020-05-15 21:01:08 +02:00
commit 8e9b5d7e50
2 changed files with 8472 additions and 474 deletions

File diff suppressed because one or more lines are too long

View File

@ -23,6 +23,8 @@ $("body.uiconfig").addClass("admin");
$("body.advsearch").addClass("advanced_search"); $("body.advsearch").addClass("advanced_search");
$("body.newuser").addClass("admin"); $("body.newuser").addClass("admin");
$("body.mailset").addClass("admin"); $("body.mailset").addClass("admin");
$("body > div.container-fluid > div > div.col-sm-10 > div.filterheader").attr("style","margin: 40px 0 !important; padding: 0 10px 0 40px !important;");
// Back button // Back button
curHref = window.location.href.split("/"); curHref = window.location.href.split("/");
@ -106,15 +108,15 @@ if ( $("body.book").length > 0 ) {
if (description.context != undefined) { if (description.context != undefined) {
newdesc = description.text() newdesc = description.text()
.replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, "").split(/\n/); .replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, "").split(/\n/);
} } else {
else {
newdesc = description.text(); newdesc = description.text();
} }
doc = nlp(newdesc.toString()); doc = nlp(newdesc.toString());
sentences = doc.map((m) => m.out("text")); sentences = doc.map((m) => m.out("text"));
sentences[0] = sentences[0].replace(",", ""); sentences[0] = sentences[0].replace(",", "");
$(".comments p").remove(); $(".comments p").remove();
let size = 3; let sentenceChunks = []; let size = 3;
let sentenceChunks = [];
for (var i = 0; i < sentences.length; i += size) { for (var i = 0; i < sentences.length; i += size) {
sentenceChunks.push(sentences.slice(i, i + size)); sentenceChunks.push(sentences.slice(i, i + size));
} }
@ -127,8 +129,7 @@ if ( $("body.book").length > 0 ) {
output += "<p>" + preOutput + "</p>"; output += "<p>" + preOutput + "</p>";
}); });
$("div.comments").append(output); $("div.comments").append(output);
} } else {
else {
$.each(description, function (i, val) { $.each(description, function (i, val) {
// $( description[i].outerHTML ).appendTo( ".comments" ); // $( description[i].outerHTML ).appendTo( ".comments" );
$("div.comments :empty").remove(); $("div.comments :empty").remove();
@ -304,6 +305,7 @@ if ( $("body.book").length > 0 ) {
} }
} }
} }
dropdownToggle(); dropdownToggle();
$(window).on("resize", function () { $(window).on("resize", function () {
@ -335,13 +337,10 @@ $(document).mouseup(function (e) {
if (!$(value).is(e.target) // if the target of the click isn't the container... if (!$(value).is(e.target) // if the target of the click isn't the container...
&& $(value).has(e.target).length === 0) // ... nor a descendant of the container && $(value).has(e.target).length === 0) // ... nor a descendant of the container
{ {
if ( $(value).hasClass("dropdown-menu") ) if ($(value).hasClass("dropdown-menu")) {
{
$(value).hide(); $(value).hide();
} else } else {
{ if ($(value).hasClass("collapse")) {
if ( $(value).hasClass("collapse") )
{
$(value).collapse("toggle"); $(value).collapse("toggle");
} }
} }
@ -510,19 +509,22 @@ if ( $( "body.shelf" ).length > 0 ) {
$(".delete-shelf-btn").attr({ $(".delete-shelf-btn").attr({
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"title": $(".delete-shelf-btn").text(), // "Delete Shelf" "title": $(".delete-shelf-btn").text(), // "Delete Shelf"
"data-placement": "bottom" }) "data-placement": "bottom"
})
.addClass("delete-btn-tooltip"); .addClass("delete-btn-tooltip");
$(".edit-shelf-btn").attr({ $(".edit-shelf-btn").attr({
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"title": $(".edit-shelf-btn").text(), // "Edit Shelf" "title": $(".edit-shelf-btn").text(), // "Edit Shelf"
"data-placement": "bottom" }) "data-placement": "bottom"
})
.addClass("edit-btn-tooltip"); .addClass("edit-btn-tooltip");
$(".order-shelf-btn").attr({ $(".order-shelf-btn").attr({
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"title": $(".order-shelf-btn").text(), //"Reorder Shelf" "title": $(".order-shelf-btn").text(), //"Reorder Shelf"
"data-placement": "bottom" }) "data-placement": "bottom"
})
.addClass("order-btn-tooltip"); .addClass("order-btn-tooltip");
} }
@ -530,83 +532,95 @@ if ( $( "body.shelf" ).length > 0 ) {
$(".home-btn > a").attr({ $(".home-btn > a").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $(document.body).attr("data-text"), // Home "title": $(document.body).attr("data-text"), // Home
"data-placement": "bottom" }) "data-placement": "bottom"
})
.addClass("home-btn-tooltip"); .addClass("home-btn-tooltip");
$(".plexBack > a").attr({ $(".plexBack > a").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $(document.body).attr("data-textback"), // Back "title": $(document.body).attr("data-textback"), // Back
"data-placement": "bottom" }) "data-placement": "bottom"
})
.addClass("back-btn-tooltip"); .addClass("back-btn-tooltip");
$("#top_tasks").attr({ $("#top_tasks").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#top_tasks").text(), // "Tasks" "title": $("#top_tasks").text(), // "Tasks"
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": "#main-nav" }) "data-viewport": "#main-nav"
})
.addClass("tasks-btn-tooltip"); .addClass("tasks-btn-tooltip");
$("#top_admin").attr({ $("#top_admin").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#top_admin").attr("data-text"), // Settings "title": $("#top_admin").attr("data-text"), // Settings
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": "#main-nav" }) "data-viewport": "#main-nav"
})
.addClass("admin-btn-tooltip"); .addClass("admin-btn-tooltip");
$(".profileDrop").attr({ $(".profileDrop").attr({
"title": $("#top_user").attr("data-text"), //Account "title": $("#top_user").attr("data-text"), //Account
"data-placement": "bottom", "data-placement": "bottom",
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"data-viewport": "#main-nav" }) "data-viewport": "#main-nav"
})
.addClass("send-btn-tooltip dropdown"); .addClass("send-btn-tooltip dropdown");
$("#btn-upload").attr({ $("#btn-upload").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#btn-upload").parent().text(), // "Upload" "title": $("#btn-upload").parent().text(), // "Upload"
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": "#main-nav" }) "data-viewport": "#main-nav"
})
.addClass("upload-btn-tooltip"); .addClass("upload-btn-tooltip");
$("#add-to-shelf").attr({ $("#add-to-shelf").attr({
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"title": $("#add-to-shelf").text(), // "Add to Shelf" "title": $("#add-to-shelf").text(), // "Add to Shelf"
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("addtoshelf-btn-tooltip"); .addClass("addtoshelf-btn-tooltip");
$("#have_read_cb").attr({ $("#have_read_cb").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#have_read_cb").attr("data-unchecked"), "title": $("#have_read_cb").attr("data-unchecked"),
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("readunread-btn-tooltip"); .addClass("readunread-btn-tooltip");
$("#have_read_cb:checked").attr({ $("#have_read_cb:checked").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#have_read_cb").attr("data-checked"), "title": $("#have_read_cb").attr("data-checked"),
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("readunread-btn-tooltip"); .addClass("readunread-btn-tooltip");
$("#archived_cb").attr({ $("#archived_cb").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#archived_cb").attr("data-unchecked"), "title": $("#archived_cb").attr("data-unchecked"),
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("readunread-btn-tooltip"); .addClass("readunread-btn-tooltip");
$("#archived_cb:checked").attr({ $("#archived_cb:checked").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#archived_cb").attr("data-checked"), "title": $("#archived_cb").attr("data-checked"),
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("readunread-btn-tooltip"); .addClass("readunread-btn-tooltip");
$("button#delete").attr({ $("button#delete").attr({
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"title": $("button#delete").text(), //"Delete" "title": $("button#delete").text(), //"Delete"
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("delete-book-btn-tooltip"); .addClass("delete-book-btn-tooltip");
$("#have_read_cb").click(function () { $("#have_read_cb").click(function () {
@ -629,35 +643,40 @@ $('.btn-group[aria-label="Edit/Delete book"] a').attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#edit_book").text(), // "Edit" "title": $("#edit_book").text(), // "Edit"
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("edit-btn-tooltip"); .addClass("edit-btn-tooltip");
$("#sendbtn").attr({ $("#sendbtn").attr({
"data-toggle": "tooltip", "data-toggle": "tooltip",
"title": $("#sendbtn").attr("data-text"), "title": $("#sendbtn").attr("data-text"),
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("send-btn-tooltip"); .addClass("send-btn-tooltip");
$("#sendbtn2").attr({ $("#sendbtn2").attr({
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"title": $("#sendbtn2").text(), // "Send to Kindle", "title": $("#sendbtn2").text(), // "Send to Kindle",
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }) "data-viewport": ".btn-toolbar"
})
.addClass("send-btn-tooltip"); .addClass("send-btn-tooltip");
$("#read-in-browser").attr({ $("#read-in-browser").attr({
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"title": $("#read-in-browser").text(), "title": $("#read-in-browser").text(),
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar"}) "data-viewport": ".btn-toolbar"
})
.addClass("send-btn-tooltip"); .addClass("send-btn-tooltip");
$("#btnGroupDrop1").attr({ $("#btnGroupDrop1").attr({
"data-toggle-two": "tooltip", "data-toggle-two": "tooltip",
"title": $("#btnGroupDrop1").text(), "title": $("#btnGroupDrop1").text(),
"data-placement": "bottom", "data-placement": "bottom",
"data-viewport": ".btn-toolbar" }); "data-viewport": ".btn-toolbar"
});
if ($("body.epub").length === 0) { if ($("body.epub").length === 0) {
$(document).ready(function () { $(document).ready(function () {
@ -736,7 +755,9 @@ $.each(deleteButtons, function(i, val) {
}); });
// Turn off bootstrap animations // Turn off bootstrap animations
$(function() { $.support.transition = false; }) $(function () {
$.support.transition = false;
})
mobileSupport(); mobileSupport();
@ -747,3 +768,4 @@ $(window).on("resize",function() {
// id = setTimeout(mobileSupport, 500); // id = setTimeout(mobileSupport, 500);
mobileSupport(); mobileSupport();
}); });