diff --git a/changedetectionio/static/js/settings.js b/changedetectionio/static/js/settings.js deleted file mode 100644 index 9ce51d07..00000000 --- a/changedetectionio/static/js/settings.js +++ /dev/null @@ -1,13 +0,0 @@ -window.addEventListener("load", (event) => { - // just an example for now - function toggleVisible(elem) { - // theres better ways todo this - var x = document.getElementById(elem); - if (x.style.display === "block") { - x.style.display = "none"; - } else { - x.style.display = "block"; - } - } -}); - diff --git a/changedetectionio/static/js/watch-settings.js b/changedetectionio/static/js/watch-settings.js new file mode 100644 index 00000000..c7f070fe --- /dev/null +++ b/changedetectionio/static/js/watch-settings.js @@ -0,0 +1,14 @@ +$(document).ready(function() { + function toggle() { + if ($('input[name="fetch_backend"]:checked').val() != 'html_requests') { + $('#requests-override-options').hide(); + } else { + $('#requests-override-options').show(); + } + } + $('input[name="fetch_backend"]').click(function (e) { + toggle(); + }); + toggle(); + +}); diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 07af9c4d..87590fb3 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -9,6 +9,7 @@ const email_notification_prefix=JSON.parse('{{ emailprefix|tojson }}'); {% endif %} +