From d9197d7e32a97f29829ffd4cf4371b1853e51fa2 Mon Sep 17 00:00:00 2001 From: Inverle Date: Fri, 8 Aug 2025 17:39:38 +0200 Subject: New JS attribute: `data-auto-leave-validation` (#7785) Instead of a repeating pattern like: ``, you can now put a `data-auto-leave-validation="1"` attribute on a `
` for example, and it will automatically set the `data-leave-validation` attributes inside the form elements. `data_auto_leave_validation(parent)` from `extra.js` is called on slider open and page load. --------- Co-authored-by: Alexandre Alapetite Co-authored-by: Frans de Jonge --- app/views/auth/index.phtml | 12 ++--- app/views/configure/archiving.phtml | 29 ++++------- app/views/configure/display.phtml | 70 ++++++++++--------------- app/views/configure/integration.phtml | 6 +-- app/views/configure/privacy.phtml | 5 +- app/views/configure/reading.phtml | 86 ++++++++++++------------------- app/views/configure/shortcut.phtml | 71 +++++++++----------------- app/views/configure/system.phtml | 21 +++----- app/views/helpers/category/update.phtml | 36 +++++-------- app/views/helpers/configure/query.phtml | 2 +- app/views/helpers/feed/update.phtml | 90 +++++++++++++-------------------- app/views/helpers/javascript_vars.phtml | 1 + app/views/importExport/index.phtml | 4 +- app/views/subscription/add.phtml | 2 +- app/views/tag/index.phtml | 2 +- app/views/tag/update.phtml | 2 +- app/views/user/details.phtml | 2 +- app/views/user/manage.phtml | 2 +- app/views/user/profile.phtml | 4 +- 19 files changed, 169 insertions(+), 278 deletions(-) (limited to 'app/views') diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml index c36134177..a0aa28256 100644 --- a/app/views/auth/index.phtml +++ b/app/views/auth/index.phtml @@ -5,13 +5,13 @@ ?>

- +
- auth_type, ['form', 'http_auth', 'none'], true)) { ?> @@ -29,7 +29,7 @@
@@ -40,7 +40,7 @@
@@ -51,7 +51,7 @@ @@ -63,7 +63,7 @@ diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 10f8774cd..2b4152a7e 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -7,13 +7,13 @@

- +
- archiving['keep_max']) ? '' : ' checked="checked"' ?> - data-leave-validation="archiving['keep_max']) ? 0 : 1 ?>"/> + empty(FreshRSS_Context::userConf()->archiving['keep_max']) ? '' : ' checked="checked"' ?> /> archiving['keep_max']) ? 200 : FreshRSS_Context::userConf()->archiving['keep_max']; ?> - +
@@ -55,12 +54,10 @@
@@ -88,8 +84,7 @@
@@ -99,8 +94,7 @@
@@ -110,8 +104,7 @@
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 995d54006..27231c2f0 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -6,13 +6,13 @@

- +
- @@ -24,7 +24,7 @@
- timezone, $timezones, true)) { @@ -53,8 +53,7 @@ } else { $checked = ''; } ?> - value="" - data-leave-validation="theme === $theme['id']) ? 1 : 0 ?>" /> + value="" />
  • @@ -89,7 +88,7 @@ - +
  • @@ -108,7 +107,7 @@
    - @@ -120,7 +119,7 @@
    - @@ -141,7 +140,7 @@
    - @@ -162,7 +161,7 @@
    - @@ -201,54 +200,39 @@ topline_read ? ' checked="checked"' : '' ?> - data-leave-validation="topline_read ?>" /> + FreshRSS_Context::userConf()->topline_read ? ' checked="checked"' : '' ?> /> topline_favorite ? ' checked="checked"' : '' ?> - data-leave-validation="topline_favorite ?>" /> + FreshRSS_Context::userConf()->topline_favorite ? ' checked="checked"' : '' ?> /> topline_myLabels ? ' checked="checked"' : '' ?> - data-leave-validation="topline_myLabels ?>" /> + FreshRSS_Context::userConf()->topline_myLabels ? ' checked="checked"' : '' ?> /> topline_sharing ? ' checked="checked"' : '' ?> - data-leave-validation="topline_sharing ?>" /> + FreshRSS_Context::userConf()->topline_sharing ? ' checked="checked"' : '' ?> /> topline_summary ? 'checked="checked"' : '' ?> - data-leave-validation="topline_summary ?>" /> + FreshRSS_Context::userConf()->topline_summary ? 'checked="checked"' : '' ?> /> topline_display_authors ? ' checked="checked"' : '' ?> - data-leave-validation="topline_display_authors ?>" /> + FreshRSS_Context::userConf()->topline_display_authors ? ' checked="checked"' : '' ?> /> topline_date ? ' checked="checked"' : '' ?> - data-leave-validation="topline_date ?>" /> - topline_link ? ' checked="checked"' : '' ?> - data-leave-validation="topline_link ?>" /> + FreshRSS_Context::userConf()->topline_date ? ' checked="checked"' : '' ?> /> + topline_link ? ' checked="checked"' : '' ?> /> bottomline_read ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_read ?>" /> + FreshRSS_Context::userConf()->bottomline_read ? ' checked="checked"' : '' ?> /> bottomline_favorite ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_favorite ?>" /> + FreshRSS_Context::userConf()->bottomline_favorite ? ' checked="checked"' : '' ?> /> bottomline_myLabels ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_myLabels ?>" /> + FreshRSS_Context::userConf()->bottomline_myLabels ? ' checked="checked"' : '' ?> /> bottomline_tags ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_tags ?>" /> + FreshRSS_Context::userConf()->bottomline_tags ? ' checked="checked"' : '' ?> /> bottomline_sharing ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_sharing ?>" /> + FreshRSS_Context::userConf()->bottomline_sharing ? ' checked="checked"' : '' ?> /> bottomline_date ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_date ?>" /> + FreshRSS_Context::userConf()->bottomline_date ? ' checked="checked"' : '' ?> /> bottomline_link ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_link ?>" /> + FreshRSS_Context::userConf()->bottomline_link ? ' checked="checked"' : '' ?> /> @@ -259,8 +243,7 @@
    + FreshRSS_Context::userConf()->html5_notif_timeout ?>" />
    @@ -268,8 +251,7 @@
    diff --git a/app/views/configure/integration.phtml b/app/views/configure/integration.phtml index 8368f916b..c45533214 100644 --- a/app/views/configure/integration.phtml +++ b/app/views/configure/integration.phtml @@ -77,8 +77,7 @@
    - +
    @@ -90,8 +89,7 @@
    - +

    diff --git a/app/views/configure/privacy.phtml b/app/views/configure/privacy.phtml index 6daf8a62b..b9bae1540 100644 --- a/app/views/configure/privacy.phtml +++ b/app/views/configure/privacy.phtml @@ -6,15 +6,14 @@

    - +
    retrieve_extension_list !== false ? ' checked="checked"' : '' ?> - data-leave-validation="retrieve_extension_list !== false ? 1 : 0 ?>"/> + FreshRSS_Context::userConf()->retrieve_extension_list !== false ? ' checked="checked"' : '' ?> />
    diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index c31cfda0b..e9a21839c 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -6,14 +6,14 @@

    - +
    - |null $viewModes */ @@ -34,7 +34,7 @@
    - @@ -47,8 +47,7 @@
    + FreshRSS_Context::userConf()->posts_per_page ?>" min="5" max="500" />

    @@ -57,8 +56,7 @@
    @@ -68,7 +66,7 @@
    - @@ -79,7 +77,7 @@
    - @@ -93,7 +91,7 @@
    -
    @@ -63,40 +60,35 @@
    - +
    - +
    - +
    - +
    - +
    @@ -105,16 +97,14 @@
    - +
    - +
    @@ -126,8 +116,7 @@

    - +
    @@ -136,24 +125,21 @@
    - +
    - +
    - +

    @@ -161,24 +147,21 @@
    - +
    - +
    - +
    @@ -189,32 +172,28 @@
    - +
    - +
    - +
    - +

    @@ -222,16 +201,14 @@
    - +
    - +
    diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml index 60c5b5362..6269b5c95 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -6,22 +6,20 @@

    - +
    - +
    - +

    @@ -47,24 +45,21 @@
    - +
    - +
    - +

    @@ -86,8 +81,7 @@
    - + (= )(= )
    @@ -120,7 +114,6 @@ id="force-email-validation" value="1" force_email_validation ? 'checked="checked"' : '' ?> - data-leave-validation="force_email_validation ?>" /> diff --git a/app/views/helpers/category/update.phtml b/app/views/helpers/category/update.phtml index 5b81b6737..3776ffd79 100644 --- a/app/views/helpers/category/update.phtml +++ b/app/views/helpers/category/update.phtml @@ -15,7 +15,7 @@
    - +
    @@ -82,12 +82,11 @@
    @@ -161,8 +160,7 @@
    @@ -170,23 +168,19 @@ @@ -548,8 +532,7 @@
    - +

    @@ -557,8 +540,7 @@
    - +

    @@ -566,16 +548,14 @@
    - +
    - +
    @@ -589,7 +569,7 @@
    - +

    @@ -599,7 +579,7 @@
    - +

    @@ -607,14 +587,14 @@
    - +
  • - +

    @@ -622,7 +602,7 @@
    - +

    @@ -630,7 +610,7 @@
    - +

    @@ -638,14 +618,14 @@
    - +
    - +

    @@ -653,7 +633,7 @@
    - +

    @@ -661,14 +641,14 @@
    - +
    - +
    @@ -686,8 +666,7 @@
    - +
    @@ -720,8 +699,7 @@
    - +

    diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 65846b001..831c67f89 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -68,6 +68,7 @@ echo json_encode([ ], 'i18n' => [ 'confirmation_default' => _t('gen.js.confirm_action'), + 'confirm_exit_slider' => _t('gen.js.confirm_exit_slider'), 'notif_title_articles' => _t('gen.js.feedback.title_new_articles'), 'notif_body_new_articles' => _t('gen.js.feedback.body_new_articles'), 'notif_body_unread_articles' => _t('gen.js.feedback.body_unread_articles'), diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml index 7a8e56b4a..60acee31b 100644 --- a/app/views/importExport/index.phtml +++ b/app/views/importExport/index.phtml @@ -16,7 +16,7 @@

    - +