.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Captain ALM 2022-07-30 22:29:49 +01:00
parent 2e7595d639
commit 37221989f6
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1
1 changed files with 18 additions and 9 deletions

View File

@ -9,7 +9,6 @@ var SortOrderBStateI = true
var SortOrderEnabled = false
var SortValue = ""
var OrderValue = ""
var ReplaceNeeded = true
function SetupJS() {
SetupIndexArray()
SetupJSTheme()
@ -75,22 +74,31 @@ function SetupJSTheme() {
th.onclick = ToggleTheme
}
}
function cReplaceHistory() {
ReplaceHistory(window.location.href)
}
function ReplaceHistory(url) {
if (window.history) {
if (window.history.replaceState) {
window.history.replaceState({
light: !!document.getElementById("so-theme"),
order: document.getElementById("so-order").value,
sort: document.getElementById("so-sort").value
}, "", url);
console.log("REPLACE")
}
}
}
function PushHistory(url) {
var s = true
if (window.history) {
if (window.history.pushState) {
var objectData = {
window.history.pushState({
light: !!document.getElementById("so-theme"),
order: document.getElementById("so-order").value,
sort: document.getElementById("so-sort").value
};
if (ReplaceNeeded) {
window.history.replaceState(objectData, "", url);
ReplaceNeeded = false
}
window.history.pushState(objectData, "", url);
}, "", url);
console.log("PUSH")
console.log(objectData)
s = false
}
}
@ -134,6 +142,7 @@ function ToggleTheme() {
function SetupJSHPL(){
if (window.history) {
if (window.history.pushState) {
window.addEventListener("load", cReplaceHistory)
window.addEventListener("popstate", HandleHistoryPop)
}
}