moved js func to edit.ts to avoid console error on other pages
This commit is contained in:
parent
2bd8d03331
commit
fe0102ac09
5 changed files with 46 additions and 46 deletions
|
|
@ -989,3 +989,25 @@ function pageInit() {
|
||||||
saveButtonMain.onclick = saveWatch;
|
saveButtonMain.onclick = saveWatch;
|
||||||
}
|
}
|
||||||
document.addEventListener('DOMContentLoaded', pageInit, false);
|
document.addEventListener('DOMContentLoaded', pageInit, false);
|
||||||
|
function clearCache() {
|
||||||
|
var confirmed = confirm("Do you want to clear the URL cache?");
|
||||||
|
if (!confirmed) {
|
||||||
|
return; // do nothing
|
||||||
|
}
|
||||||
|
var data = new URLSearchParams();
|
||||||
|
fetch("/cache/clear", {
|
||||||
|
method: "POST"
|
||||||
|
}).then(function (response) {
|
||||||
|
if (response.ok) {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert("Could not clear cache");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function clearCacheButtonInit() {
|
||||||
|
var clearCacheButton = document.getElementById("clearCacheButton");
|
||||||
|
clearCacheButton.onclick = clearCache;
|
||||||
|
}
|
||||||
|
document.addEventListener('DOMContentLoaded', clearCacheButtonInit, false);
|
||||||
|
|
|
||||||
|
|
@ -975,4 +975,26 @@ function pageInit(){
|
||||||
saveButtonMain.onclick = saveWatch;
|
saveButtonMain.onclick = saveWatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', pageInit, false);
|
document.addEventListener('DOMContentLoaded', pageInit, false);
|
||||||
|
|
||||||
|
function clearCache(){
|
||||||
|
let confirmed = confirm("Do you want to clear the URL cache?");
|
||||||
|
if (!confirmed){
|
||||||
|
return // do nothing
|
||||||
|
}
|
||||||
|
let data = new URLSearchParams();
|
||||||
|
fetch("/cache/clear", {
|
||||||
|
method: "POST"
|
||||||
|
}).then((response) => {
|
||||||
|
if(response.ok){
|
||||||
|
window.location.reload()
|
||||||
|
} else {
|
||||||
|
alert("Could not clear cache");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function clearCacheButtonInit(){
|
||||||
|
let clearCacheButton = document.getElementById("clearCacheButton") as HTMLElement;
|
||||||
|
clearCacheButton.onclick = clearCache;
|
||||||
|
}
|
||||||
|
document.addEventListener('DOMContentLoaded', clearCacheButtonInit, false);
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
function clearCache() {
|
|
||||||
var confirmed = confirm("Do you want to clear the URL cache?");
|
|
||||||
if (!confirmed) {
|
|
||||||
return; // do nothing
|
|
||||||
}
|
|
||||||
var data = new URLSearchParams();
|
|
||||||
fetch("/cache/clear", {
|
|
||||||
method: "POST"
|
|
||||||
}).then(function (response) {
|
|
||||||
if (response.ok) {
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
alert("Could not clear cache");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function clearCacheButtonInit() {
|
|
||||||
var clearCacheButton = document.getElementById("clearCacheButton");
|
|
||||||
clearCacheButton.onclick = clearCache;
|
|
||||||
}
|
|
||||||
document.addEventListener('DOMContentLoaded', clearCacheButtonInit, false);
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
function clearCache(){
|
|
||||||
let confirmed = confirm("Do you want to clear the URL cache?");
|
|
||||||
if (!confirmed){
|
|
||||||
return // do nothing
|
|
||||||
}
|
|
||||||
let data = new URLSearchParams();
|
|
||||||
fetch("/cache/clear", {
|
|
||||||
method: "POST"
|
|
||||||
}).then((response) => {
|
|
||||||
if(response.ok){
|
|
||||||
window.location.reload()
|
|
||||||
} else {
|
|
||||||
alert("Could not clear cache");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function clearCacheButtonInit(){
|
|
||||||
let clearCacheButton = document.getElementById("clearCacheButton") as HTMLElement;
|
|
||||||
clearCacheButton.onclick = clearCache;
|
|
||||||
}
|
|
||||||
document.addEventListener('DOMContentLoaded', clearCacheButtonInit, false);
|
|
||||||
3
todo.md
3
todo.md
|
|
@ -8,5 +8,4 @@
|
||||||
- postgresql+apprise
|
- postgresql+apprise
|
||||||
- postgresql+apprise+browserless
|
- postgresql+apprise+browserless
|
||||||
- add kube yaml example?
|
- add kube yaml example?
|
||||||
- organize docs?
|
- organize docs?
|
||||||
- move clearCacheButton to edit.ts
|
|
||||||
Loading…
Add table
Reference in a new issue