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;
|
||||
}
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -976,3 +976,25 @@ function pageInit(){
|
|||
}
|
||||
|
||||
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);
|
||||
1
todo.md
1
todo.md
|
|
@ -9,4 +9,3 @@
|
|||
- postgresql+apprise+browserless
|
||||
- add kube yaml example?
|
||||
- organize docs?
|
||||
- move clearCacheButton to edit.ts
|
||||
Loading…
Add table
Reference in a new issue