mirror of
https://github.com/simon987/sist2.git
synced 2025-12-11 14:38:54 +00:00
Dark theme, pdf meta, de-serialize bugfix
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user