diff --git a/static/edit.js b/static/edit.js index b40d45c..9f66562 100644 --- a/static/edit.js +++ b/static/edit.js @@ -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); diff --git a/static/edit.ts b/static/edit.ts index 49f885b..86a458c 100644 --- a/static/edit.ts +++ b/static/edit.ts @@ -975,4 +975,26 @@ function pageInit(){ saveButtonMain.onclick = saveWatch; } -document.addEventListener('DOMContentLoaded', pageInit, false); \ No newline at end of file +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); \ No newline at end of file diff --git a/static/script.js b/static/script.js index b8cdedf..e69de29 100644 --- a/static/script.js +++ b/static/script.js @@ -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); diff --git a/static/script.ts b/static/script.ts index a5c16ff..e69de29 100644 --- a/static/script.ts +++ b/static/script.ts @@ -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); \ No newline at end of file diff --git a/todo.md b/todo.md index 68d488b..2671279 100644 --- a/todo.md +++ b/todo.md @@ -8,5 +8,4 @@ - postgresql+apprise - postgresql+apprise+browserless - add kube yaml example? -- organize docs? -- move clearCacheButton to edit.ts \ No newline at end of file +- organize docs? \ No newline at end of file