From 684e96f5f14d347446f00cce1ae5d7a9f7d9ad1d Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 28 Nov 2023 17:31:08 +0100 Subject: [PATCH] UI - Tidy-up for advanced settings under watch edit, HTML validation fixes (#2011) --- changedetectionio/static/images/bell-off.svg | 2 +- .../static/images/brightdata.svg | 2 +- changedetectionio/static/images/copy.svg | 2 +- changedetectionio/static/images/email.svg | 2 +- changedetectionio/static/images/notice.svg | 2 +- changedetectionio/static/images/oxylabs.svg | 2 +- changedetectionio/static/images/pause.svg | 1 - changedetectionio/static/images/play.svg | 1 - .../static/images/spread-white.svg | 2 +- changedetectionio/static/images/spread.svg | 2 +- changedetectionio/static/js/vis.js | 7 +++ .../static/styles/scss/styles.scss | 4 +- changedetectionio/static/styles/styles.css | 2 +- .../templates/_common_fields.jinja | 2 +- changedetectionio/templates/base.html | 3 +- changedetectionio/templates/edit.html | 56 +++++++++++-------- .../templates/svgs/search-icon.svg | 2 +- 17 files changed, 53 insertions(+), 41 deletions(-) diff --git a/changedetectionio/static/images/bell-off.svg b/changedetectionio/static/images/bell-off.svg index f12f9c3d..e2447987 100644 --- a/changedetectionio/static/images/bell-off.svg +++ b/changedetectionio/static/images/bell-off.svg @@ -1,4 +1,4 @@ - + diff --git a/changedetectionio/static/images/brightdata.svg b/changedetectionio/static/images/brightdata.svg index 938ba594..5ac7e2bb 100644 --- a/changedetectionio/static/images/brightdata.svg +++ b/changedetectionio/static/images/brightdata.svg @@ -10,7 +10,7 @@ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" - xmlns:svg="http://www.w3.org/2000/svg"> + > + > + > + > - + diff --git a/changedetectionio/static/js/vis.js b/changedetectionio/static/js/vis.js index b3c036ff..6a11904f 100644 --- a/changedetectionio/static/js/vis.js +++ b/changedetectionio/static/js/vis.js @@ -4,6 +4,7 @@ $(document).ready(function () { $('[data-visible-for]').hide(); $(':radio').on('keyup keypress blur change click', function (e) { $('[data-visible-for]').hide(); + $('.advanced-options').hide(); var n = $(this).attr('name') + "=" + $(this).val(); if (n === 'fetch_backend=system') { n = "fetch_backend=" + default_system_fetch_backend; @@ -12,4 +13,10 @@ $(document).ready(function () { }); $(':radio:checked').change(); + + + // Show advanced + $('.show-advanced').click(function (e) { + $(this).closest('.tab-pane-inner').find('.advanced-options').toggle(); + }); }); \ No newline at end of file diff --git a/changedetectionio/static/styles/scss/styles.scss b/changedetectionio/static/styles/scss/styles.scss index ed98a1c6..1db13eae 100644 --- a/changedetectionio/static/styles/scss/styles.scss +++ b/changedetectionio/static/styles/scss/styles.scss @@ -944,10 +944,8 @@ ul { @import "parts/_visualselector"; -#webdriver-override-options { - input[type="number"] { +#webdriver_delay { width: 5em; - } } #api-key { diff --git a/changedetectionio/static/styles/styles.css b/changedetectionio/static/styles/styles.css index c1865879..9fd9bef9 100644 --- a/changedetectionio/static/styles/styles.css +++ b/changedetectionio/static/styles/styles.css @@ -1065,7 +1065,7 @@ ul { #selector-current-xpath { font-size: 80%; } -#webdriver-override-options input[type="number"] { +#webdriver_delay { width: 5em; } #api-key:hover { diff --git a/changedetectionio/templates/_common_fields.jinja b/changedetectionio/templates/_common_fields.jinja index 84a7b067..cb27476e 100644 --- a/changedetectionio/templates/_common_fields.jinja +++ b/changedetectionio/templates/_common_fields.jinja @@ -13,7 +13,7 @@
-

The more popular changedetection.io is, the more time we can dedicate to adding amazing features!

diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 8a0d3172..ff3769ab 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -126,7 +126,8 @@
{% endif %} -
+ +
{{ render_field(form.webdriver_delay) }}
@@ -139,23 +140,40 @@
+
-
- {% if not playwright_enabled %} -
- Request override is currently only used by the Basic fast Plaintext/HTTP Client method. + +
+ +
+ + - -
-
- {{ render_field(form.body, rows=5, placeholder="Example -{ - \"name\":\"John\", - \"age\":30, - \"car\":null -}") }}
-
-
+
+ +
+
{% if playwright_enabled %}
diff --git a/changedetectionio/templates/svgs/search-icon.svg b/changedetectionio/templates/svgs/search-icon.svg index 7112c238..d1e3248c 100644 --- a/changedetectionio/templates/svgs/search-icon.svg +++ b/changedetectionio/templates/svgs/search-icon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file