Dark theme, pdf meta, de-serialize bugfix

This commit is contained in:
2019-10-30 21:48:58 -04:00
parent 130fb78787
commit 5661573b06
18 changed files with 542 additions and 251 deletions

View File

@@ -197,7 +197,7 @@ function createDocCard(hit) {
let contentHl = getContentHighlight(hit);
if (contentHl !== undefined) {
let contentDiv = document.createElement("div");
contentDiv.setAttribute("class", "content-div bg-light");
contentDiv.setAttribute("class", "content-div");
contentDiv.insertAdjacentHTML('afterbegin', contentHl);
docCard.appendChild(contentDiv);
}
@@ -257,7 +257,7 @@ function makePreloader() {
function makePageIndicator(searchResult) {
let pageIndicator = document.createElement("div");
pageIndicator.setAttribute("class", "page-indicator shadow-sm bg-light font-weight-light");
pageIndicator.setAttribute("class", "page-indicator shadow-sm font-weight-light");
const totalHits = searchResult["hits"]["total"].hasOwnProperty("value")
? searchResult["hits"]["total"]["value"] : searchResult["hits"]["total"];
pageIndicator.appendChild(document.createTextNode(docCount + " / " + totalHits));

View File

@@ -21,6 +21,17 @@ jQuery["jsonPost"] = function (url, data) {
});
};
window.onload = () => {
$("#theme").on("click", () => {
if (!document.cookie.includes("sist")) {
document.cookie = "sist=dark";
} else {
document.cookie = "sist=; Max-Age=-99999999;";
}
window.location.reload();
})
};
function toggleSearchBar() {
searchDebounced();
}