Bladeren bron

New JS attribute: `data-auto-leave-validation` (#7785)

Instead of a repeating pattern like: `<input type="text" value="something" data-leave-validation="something">`, you can now put a `data-auto-leave-validation="1"` attribute on a `<form>` 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 <alexandre@alapetite.fr>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Inverle 7 maanden geleden
bovenliggende
commit
d9197d7e32
50 gewijzigde bestanden met toevoegingen van 224 en 284 verwijderingen
  1. 1 0
      app/i18n/cs/gen.php
  2. 1 0
      app/i18n/de/gen.php
  3. 1 0
      app/i18n/el/gen.php
  4. 1 0
      app/i18n/en-us/gen.php
  5. 1 0
      app/i18n/en/gen.php
  6. 1 0
      app/i18n/es/gen.php
  7. 1 0
      app/i18n/fa/gen.php
  8. 1 0
      app/i18n/fi/gen.php
  9. 1 0
      app/i18n/fr/gen.php
  10. 1 0
      app/i18n/he/gen.php
  11. 1 0
      app/i18n/hu/gen.php
  12. 1 0
      app/i18n/id/gen.php
  13. 1 0
      app/i18n/it/gen.php
  14. 1 0
      app/i18n/ja/gen.php
  15. 1 0
      app/i18n/ko/gen.php
  16. 1 0
      app/i18n/lv/gen.php
  17. 1 0
      app/i18n/nl/gen.php
  18. 1 0
      app/i18n/oc/gen.php
  19. 1 0
      app/i18n/pl/gen.php
  20. 1 0
      app/i18n/pt-br/gen.php
  21. 1 0
      app/i18n/pt-pt/gen.php
  22. 1 0
      app/i18n/ru/gen.php
  23. 1 0
      app/i18n/sk/gen.php
  24. 1 0
      app/i18n/tr/gen.php
  25. 1 0
      app/i18n/zh-cn/gen.php
  26. 1 0
      app/i18n/zh-tw/gen.php
  27. 6 6
      app/views/auth/index.phtml
  28. 11 18
      app/views/configure/archiving.phtml
  29. 26 44
      app/views/configure/display.phtml
  30. 2 4
      app/views/configure/integration.phtml
  31. 2 3
      app/views/configure/privacy.phtml
  32. 33 53
      app/views/configure/reading.phtml
  33. 24 47
      app/views/configure/shortcut.phtml
  34. 7 14
      app/views/configure/system.phtml
  35. 13 23
      app/views/helpers/category/update.phtml
  36. 1 1
      app/views/helpers/configure/query.phtml
  37. 34 56
      app/views/helpers/feed/update.phtml
  38. 1 0
      app/views/helpers/javascript_vars.phtml
  39. 2 2
      app/views/importExport/index.phtml
  40. 1 1
      app/views/subscription/add.phtml
  41. 1 1
      app/views/tag/index.phtml
  42. 1 1
      app/views/tag/update.phtml
  43. 1 1
      app/views/user/details.phtml
  44. 1 1
      app/views/user/manage.phtml
  45. 2 2
      app/views/user/profile.phtml
  46. 1 1
      docs/i18n/flags/gen/fi.svg
  47. 2 2
      docs/i18n/flags/gen/sk.svg
  48. 1 1
      lib/core-extensions/UserCSS/configure.phtml
  49. 1 1
      lib/core-extensions/UserJS/configure.phtml
  50. 24 1
      p/scripts/extra.js

+ 1 - 0
app/i18n/cs/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Prázdná kategorie',
 		'confirm_action' => 'Opravdu chcete provést tuto akci? Toto nelze zrušit!',
 		'confirm_action_feed_cat' => 'Opravdu chcete provést tuto akci? Přijdete o související oblíbené položky a uživatelské dotazy. Toto nelze zrušit!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'Ve FreshRSS je %%d nových článků k přečtení.',
 			'body_unread_articles' => '(nepřečtené: %%d)',

+ 1 - 0
app/i18n/de/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Kategorie leeren',
 		'confirm_action' => 'Sind Sie sicher, dass Sie diese Aktion durchführen wollen? Diese Aktion kann nicht abgebrochen werden!',
 		'confirm_action_feed_cat' => 'Sind Sie sicher, dass Sie diese Aktion durchführen wollen? Sie werden zugehörige Favoriten und Benutzerabfragen verlieren. Dies kann nicht abgebrochen werden!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'Es gibt %%d neue Artikel zum Lesen auf FreshRSS.',
 			'body_unread_articles' => '(Ungelesen: %%d)',

+ 1 - 0
app/i18n/el/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Empty category',	// TODO
 		'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!',	// TODO
 		'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favourites and user queries. It cannot be cancelled!',	// TODO
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'There are %%d new articles to read on FreshRSS.',	// TODO
 			'body_unread_articles' => '(unread: %%d)',	// TODO

+ 1 - 0
app/i18n/en-us/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Empty category',	// IGNORE
 		'confirm_action' => 'Are you sure you want to perform this action? It cannot be canceled!',
 		'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be canceled!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// IGNORE
 		'feedback' => array(
 			'body_new_articles' => 'There are %%d new articles to read on FreshRSS.',	// IGNORE
 			'body_unread_articles' => '(unread: %%d)',	// IGNORE

+ 1 - 0
app/i18n/en/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Empty category',
 		'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!',
 		'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favourites and user queries. It cannot be cancelled!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',
 		'feedback' => array(
 			'body_new_articles' => 'There are %%d new articles to read on FreshRSS.',
 			'body_unread_articles' => '(unread: %%d)',

+ 1 - 0
app/i18n/es/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Vaciar categoría',
 		'confirm_action' => '¿Seguro que quieres hacerlo? No hay marcha atrás…',
 		'confirm_action_feed_cat' => '¿Seguro que quieres hacerlo? Perderás todos los favoritos relacionados y las peticiones de usuario. ¡Y no hay marcha atrás!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'Hay %%d nuevos artículos para leer en FreshRSS.',
 			'body_unread_articles' => '(No leídos: %%d)',

+ 1 - 0
app/i18n/fa/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => ' دسته خالی',
 		'confirm_action' => ' آیا مطمئن هستید که می خواهید این عمل را انجام دهید؟ نمی توان آن را لغو کرد!',
 		'confirm_action_feed_cat' => ' آیا مطمئن هستید که می خواهید این عمل را انجام دهید؟ موارد دلخواه و درخواست های کاربر مرتبط را از دست خواهید داد. نمی توان آن را لغو کرد!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => ' %%d مقاله جدید برای خواندن در FreshRSS وجود دارد.',
 			'body_unread_articles' => ' (خوانده نشده: %%d)',

+ 1 - 0
app/i18n/fi/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Tyhjennä luokka',
 		'confirm_action' => 'Haluatko varmasti toteuttaa toiminnon? Sitä ei voi peruuttaa!',
 		'confirm_action_feed_cat' => 'Haluatko varmasti toteuttaa toiminnon? Luokkaan kuuluvat suosikit ja kyselyt poistetaan. Tätä ei voi peruuttaa!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'FreshRSS-sovelluksessa on %%d uutta artikkelia luettavana.',
 			'body_unread_articles' => '(lukematta: %%d)',

+ 1 - 0
app/i18n/fr/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Catégorie vide',
 		'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !',
 		'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !',
+		'confirm_exit_slider' => 'Êtes-vous sûr de vouloir abandonner les paramètres non enregistrés ?',
 		'feedback' => array(
 			'body_new_articles' => 'Il y a %%d nouveaux articles à lire sur FreshRSS.',
 			'body_unread_articles' => '(non lus : %%d)',

+ 1 - 0
app/i18n/he/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Empty category',	// TODO
 		'confirm_action' => 'האם אתם בטוחים שברצונכם לבצע פעולה זו? אין אפשרות לבטל אותה!',
 		'confirm_action_feed_cat' => 'האם אתם בטוחים שברצוניכם לבצע פעולה זו? מועדפים ושאילתות עשויות לאבוד. אין אפשרות לבטל אותה!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'ישנם	\\d מאמרים חדשים לקרוא ב FreshRSS.',
 			'body_unread_articles' => '(unread: %%d)',	// TODO

+ 1 - 0
app/i18n/hu/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Üres kategória',
 		'confirm_action' => 'Biztos vagy benne hogy végrehajtod ezt a műveletet? A művelet nem megszakítható!',
 		'confirm_action_feed_cat' => 'Biztos hogy végrehajtod ezt a műveletet? Minden kapcsolódó kedvenc és lekérdezés törölve lesz. Nem lehet megszakítani!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => '%%d db új cikk olvasható a FreshRSS-ben.',
 			'body_unread_articles' => '(olvasatlan: %%d)',

+ 1 - 0
app/i18n/id/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Kategori kosong',
 		'confirm_action' => 'Apakah Anda yakin ingin melakukan ini? Ini tidak dapat dibatalkan!',
 		'confirm_action_feed_cat' => 'Apakah Anda yakin ingin melakukan ini? Anda akan kehilangan favorit dan pencarian pengguna terkait. Ini tidak dapat dibatalkan.',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'Ada %%d artikel baru untuk dibaca di FreshRSS.',
 			'body_unread_articles' => '(belum dibaca: %%d)',

+ 1 - 0
app/i18n/it/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Categoria vuota',
 		'confirm_action' => 'Sei sicuro di voler continuare?',
 		'confirm_action_feed_cat' => 'Sei sicuro di voler continuare? Verranno persi i preferiti e le ricerche utente correlate!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'Ci sono %%d nuovi articoli da leggere.',
 			'body_unread_articles' => '(non letti: %%d)',

+ 1 - 0
app/i18n/ja/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => '空白のカテゴリ',
 		'confirm_action' => '本当に実行してもいいですか?キャンセルはできません!',
 		'confirm_action_feed_cat' => '本当に実行してもいいですか? あなたは関連するお気に入りとユーザークエリを失います。キャンセルできません!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => '%%d の新規記事がFreshRSSにはあります。',
 			'body_unread_articles' => '(未読: %%d)',

+ 1 - 0
app/i18n/ko/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => '빈 카테고리',
 		'confirm_action' => '정말 이 작업을 수행하시겠습니까? 이 작업은 되돌릴 수 없습니다!',
 		'confirm_action_feed_cat' => '정말 이 작업을 수행하시겠습니까? 관련된 즐겨찾기와 사용자 쿼리가 삭제됩니다. 이 작업은 되돌릴 수 없습니다!!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => '%%d 개의 새 글이 FreshRSS에 있습니다.',
 			'body_unread_articles' => '(%%d 개 읽지 않음)',

+ 1 - 0
app/i18n/lv/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Tukša kategorija',
 		'confirm_action' => 'Vai esat pārliecināts, ka vēlaties veikt šo darbību? To nevar atcelt!',
 		'confirm_action_feed_cat' => 'Vai esat pārliecināts, ka vēlaties veikt šo darbību? Jūs zaudēsiet saistītos mīļākos rakstus un lietotāja pieprasījumus. To nevar atcelt!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'FreshRSS ir %%d jauni raksti lasīšanai.',
 			'body_unread_articles' => '(neizlasīti: %%d)',

+ 1 - 0
app/i18n/nl/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Lege categorie',
 		'confirm_action' => 'Weet u zeker dat u dit wilt doen? Het kan niet ongedaan worden gemaakt!',
 		'confirm_action_feed_cat' => 'Weet u zeker dat u dit wilt doen? U verliest alle gereleteerde favorieten en gebruikers informatie. Het kan niet ongedaan worden gemaakt!',
+		'confirm_exit_slider' => 'Weet u zeker dat u de niet opgeslagen instellingen wilt negeren?',
 		'feedback' => array(
 			'body_new_articles' => 'Er zijn %%d nieuwe artikelen om te lezen op FreshRSS.',
 			'body_unread_articles' => '(ongelezen: %%d)',

+ 1 - 0
app/i18n/oc/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Categoria voida',
 		'confirm_action' => 'Volètz vertadièrament contunhar ? Aquesta accion se pòt pas anullar !',
 		'confirm_action_feed_cat' => 'Volètz vertadièrament contunhar ? Perdretz los favorits e filtres ligats. Aquesta accion se pòt pas anullar !',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'I a %%d nòus articles per legir sus FreshRSS.',
 			'body_unread_articles' => '(unread: %%d)',	// TODO

+ 1 - 0
app/i18n/pl/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Pusta kategoria',
 		'confirm_action' => 'Czy jesteś pewien, że chcesz przeprowadzić daną operację? Nie można cofnąć jej rezultatów!',
 		'confirm_action_feed_cat' => 'Czy jesteś pewien, że chcesz przeprowadzić daną operację? Stracisz powiązane zapytania i ulubione wiadomości. Tych zmian nie można wycofać!',
+		'confirm_exit_slider' => 'Czy na pewno chcesz odrzucić niezapisane ustawienia?',
 		'feedback' => array(
 			'body_new_articles' => 'W FreshRSS znajduje się %%d wiadomości do przeczytania.',
 			'body_unread_articles' => '(Nieprzeczytane: %%d)',

+ 1 - 0
app/i18n/pt-br/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Categoria vazia',
 		'confirm_action' => 'Você tem certeza que deseja efetuar esta ação? Ela não poderá ser cancelada!',
 		'confirm_action_feed_cat' => 'Você tem certeza que deseja efetuar esta ação ? Você irá perder favoritos e queries de usuários. Não poderá ser cancelado!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'Há %%d novos artigos para ler no FreshRSS.',
 			'body_unread_articles' => '(não lido: %%d)',

+ 1 - 0
app/i18n/pt-pt/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Categoria vazia',
 		'confirm_action' => 'Tem certeza que deseja efetuar esta ação? Ela não poderá ser revertida!',
 		'confirm_action_feed_cat' => 'Tem certeza que deseja efetuar esta ação ? vai perder favoritos e pesquisas personalizadas. Não poderá ser revertida!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'Há %%d novos artigos para ler no FreshRSS.',
 			'body_unread_articles' => '(não lido: %%d)',

+ 1 - 0
app/i18n/ru/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Пустая категория',
 		'confirm_action' => 'Вы уверены, что хотите выполнить это действие? Это нельзя отменить!',
 		'confirm_action_feed_cat' => 'Вы уверены, что хотите выполнить это действие? Вы потеряете связанные избранные статьи и пользовательские запросы. Это нельзя отменить!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => '%%d новых статей в FreshRSS.',
 			'body_unread_articles' => '(Непрочитанные: %%d)',

+ 1 - 0
app/i18n/sk/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Prázdna kategória',
 		'confirm_action' => 'Určite chcete vykonať túto akciu? Zmeny budú nezvratné!',
 		'confirm_action_feed_cat' => 'Určite chcete vykonať túto akciu? Prídete o súvisiace obľúbené a používateľské dopyty. Zmeny budú nezvratné!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'Počet nových článkov v čítačke FreshRSS: %%d',
 			'body_unread_articles' => '(neprečítané: %%d)',

+ 1 - 0
app/i18n/tr/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => 'Boş kategori',
 		'confirm_action' => 'Bu eylemi gerçekleştirmek istediğinizden emin misiniz? Bu işlem geri alınamaz!',
 		'confirm_action_feed_cat' => 'Bu eylemi gerçekleştirmek istediğinizden emin misiniz? İlgili favoriler ve kullanıcı sorguları kaybolacak. Bu işlem geri alınamaz!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'FreshRSS’de okunacak %%d yeni makale var.',
 			'body_unread_articles' => '(okunmamış: %%d)',

+ 1 - 0
app/i18n/zh-cn/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => '清空分类',
 		'confirm_action' => '你确定要执行此操作吗?这将不可撤销!',
 		'confirm_action_feed_cat' => '你确定要执行此操作吗?你将丢失相关的收藏和自定义查询,这将不可撤销!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'FreshRSS 中有 %%d 篇文章等待阅读。',
 			'body_unread_articles' => '(未读: %%d)',

+ 1 - 0
app/i18n/zh-tw/gen.php

@@ -145,6 +145,7 @@ return array(
 		'category_empty' => '清空分類',
 		'confirm_action' => '你確定要執行此操作嗎?這將不可撤銷!',
 		'confirm_action_feed_cat' => '你確定要執行此操作嗎?你將丟失相關的收藏和自定義查詢。這將不可撤銷!',
+		'confirm_exit_slider' => 'Are you sure you want to discard unsaved settings?',	// TODO
 		'feedback' => array(
 			'body_new_articles' => 'FreshRSS 中有 %%d 篇文章等待閱讀。',
 			'body_unread_articles' => '(未讀: %%d)',

+ 6 - 6
app/views/auth/index.phtml

@@ -5,13 +5,13 @@
 ?>
 <main class="post">
 	<h1><?= _t('gen.menu.authentication') ?></h1>
-	<form method="post" action="<?= _url('auth', 'index') ?>">
+	<form method="post" action="<?= _url('auth', 'index') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 
 		<div class="form-group">
 			<label class="group-name" for="auth_type"><?= _t('admin.auth.type') ?></label>
 			<div class="group-controls">
-				<select id="auth_type" name="auth_type" required="required" data-leave-validation="<?= FreshRSS_Context::systemConf()->auth_type ?>">
+				<select id="auth_type" name="auth_type" required="required">
 					<?php if (!in_array(FreshRSS_Context::systemConf()->auth_type, ['form', 'http_auth', 'none'], true)) { ?>
 						<option selected="selected"></option>
 					<?php } ?>
@@ -29,7 +29,7 @@
 				<label class="checkbox" for="anon_access">
 					<input type="checkbox" name="anon_access" id="anon_access" value="1"<?=
 						FreshRSS_Context::systemConf()->allow_anonymous ? ' checked="checked"' : '',
-						FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> data-leave-validation="<?= FreshRSS_Context::systemConf()->allow_anonymous ?>"/>
+						FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
 					<?= _t('admin.auth.allow_anonymous', FreshRSS_Context::systemConf()->default_user) ?>
 				</label>
 			</div>
@@ -40,7 +40,7 @@
 				<label class="checkbox" for="anon_refresh">
 					<input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?=
 						FreshRSS_Context::systemConf()->allow_anonymous_refresh ? ' checked="checked"' : '',
-						FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> data-leave-validation="<?= FreshRSS_Context::systemConf()->allow_anonymous_refresh ?>"/>
+						FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
 					<?= _t('admin.auth.allow_anonymous_refresh') ?>
 				</label>
 			</div>
@@ -51,7 +51,7 @@
 				<label class="checkbox" for="unsafe_autologin">
 					<input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?=
 						FreshRSS_Context::systemConf()->unsafe_autologin_enabled ? ' checked="checked"' : '',
-						FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> data-leave-validation="<?= FreshRSS_Context::systemConf()->unsafe_autologin_enabled ?>"/>
+						FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
 					<?= _t('admin.auth.unsafe_autologin') ?>
 					<kbd><?= Minz_Url::display(['c' => 'auth', 'a' => 'login', 'params' => ['u' => 'alice', 'p' => '1234']], 'html', true) ?></kbd>
 				</label>
@@ -63,7 +63,7 @@
 				<label class="checkbox" for="api_enabled">
 					<input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?=
 						FreshRSS_Context::systemConf()->api_enabled ? ' checked="checked"' : '',
-						FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"' ?> data-leave-validation="<?= FreshRSS_Context::systemConf()->api_enabled ?>"/>
+						FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"' ?> />
 					<?= _t('admin.auth.api_enabled') ?>
 				</label>
 			</div>

+ 11 - 18
app/views/configure/archiving.phtml

@@ -7,13 +7,13 @@
 	<h1><?= _t('conf.archiving') ?></h1>
 	<p class="help"><?= _i('help') ?> <?= _t('conf.archiving.help') ?></p>
 
-	<form method="post" action="<?= _url('configure', 'archiving') ?>">
+	<form method="post" action="<?= _url('configure', 'archiving') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 
 		<div class="form-group">
 			<label class="group-name" for="ttl_default"><?= _t('conf.archiving.ttl') ?></label>
 			<div class="group-controls">
-				<select class="number" name="ttl_default" id="ttl_default" required="required" data-leave-validation="<?= FreshRSS_Context::userConf()->ttl_default ?>"><?php
+				<select class="number" name="ttl_default" id="ttl_default" required="required"><?php
 					$found = false;
 					foreach ([1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
 							3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h',
@@ -42,11 +42,10 @@
 			<div class="group-controls">
 				<label class="checkbox" for="enable_keep_max">
 					<input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?=
-						empty(FreshRSS_Context::userConf()->archiving['keep_max']) ? '' : ' checked="checked"' ?>
-						data-leave-validation="<?= empty(FreshRSS_Context::userConf()->archiving['keep_max']) ? 0 : 1 ?>"/>
+						empty(FreshRSS_Context::userConf()->archiving['keep_max']) ? '' : ' checked="checked"' ?> />
 					<?= _t('conf.archiving.keep_max') ?>
 					<?php $keepMax = empty(FreshRSS_Context::userConf()->archiving['keep_max']) ? 200 : FreshRSS_Context::userConf()->archiving['keep_max']; ?>
-					<input type="number" id="keep_max" name="keep_max" min="0" value="<?= $keepMax ?>" data-leave-validation="<?= $keepMax ?>"/>
+					<input type="number" id="keep_max" name="keep_max" min="0" value="<?= $keepMax ?>" />
 				</label>
 			</div>
 		</div>
@@ -55,12 +54,10 @@
 			<div class="group-controls">
 				<label class="checkbox" for="enable_keep_period">
 					<input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?=
-						empty(FreshRSS_Context::userConf()->volatile['enable_keep_period']) ? '' : ' checked="checked"' ?>
-						data-leave-validation="<?= empty(FreshRSS_Context::userConf()->volatile['enable_keep_period']) ? 0 : 1 ?>"/>
+						empty(FreshRSS_Context::userConf()->volatile['enable_keep_period']) ? '' : ' checked="checked"' ?> />
 					<?= _t('conf.archiving.keep_period') ?>
-					<input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= FreshRSS_Context::userConf()->volatile['keep_period_count'] ?>"
-						data-leave-validation="<?= FreshRSS_Context::userConf()->volatile['keep_period_count'] ?>"/>
-					<select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= FreshRSS_Context::userConf()->volatile['keep_period_unit'] ?>">
+					<input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= FreshRSS_Context::userConf()->volatile['keep_period_count'] ?>" />
+					<select class="number" name="keep_period_unit" id="keep_period_unit">
 						<option></option>
 						<option value="P1Y" <?= 'P1Y' === FreshRSS_Context::userConf()->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option>
 						<option value="P1M" <?= 'P1M' === FreshRSS_Context::userConf()->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option>
@@ -77,8 +74,7 @@
 			<div class="group-controls">
 				<label class="checkbox" for="keep_favourites">
 					<input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?=
-						FreshRSS_Context::userConf()->archiving['keep_favourites'] !== false ? ' checked="checked"' : '' ?>
-						data-leave-validation="<?= FreshRSS_Context::userConf()->archiving['keep_favourites'] !== false ? 1 : 0 ?>"/>
+						FreshRSS_Context::userConf()->archiving['keep_favourites'] !== false ? ' checked="checked"' : '' ?> "/>
 					<?= _t('conf.archiving.keep_favourites') ?>
 				</label>
 			</div>
@@ -88,8 +84,7 @@
 			<div class="group-controls">
 				<label class="checkbox" for="keep_labels">
 					<input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?=
-						FreshRSS_Context::userConf()->archiving['keep_labels'] !== false ? ' checked="checked"' : '' ?>
-						data-leave-validation="<?= FreshRSS_Context::userConf()->archiving['keep_labels'] !== false ? 1 : 0 ?>"/>
+						FreshRSS_Context::userConf()->archiving['keep_labels'] !== false ? ' checked="checked"' : '' ?> />
 					<?= _t('conf.archiving.keep_labels') ?>
 				</label>
 			</div>
@@ -99,8 +94,7 @@
 			<div class="group-controls">
 				<label class="checkbox" for="keep_unreads">
 					<input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?=
-						FreshRSS_Context::userConf()->archiving['keep_unreads'] ? ' checked="checked"' : '' ?>
-						data-leave-validation="<?= FreshRSS_Context::userConf()->archiving['keep_unreads'] ? 1 : 0 ?>"/>
+						FreshRSS_Context::userConf()->archiving['keep_unreads'] ? ' checked="checked"' : '' ?> />
 					<?= _t('conf.archiving.keep_unreads') ?>
 				</label>
 			</div>
@@ -110,8 +104,7 @@
 			<div class="group-controls">
 				<label for="keep_min_default"><?= _t('conf.archiving.keep_min_by_feed') ?>
 					<input type="number" id="keep_min_default" name="keep_min_default" min="0" value="<?=
-						FreshRSS_Context::userConf()->archiving['keep_min'] ?>"
-						data-leave-validation="<?= FreshRSS_Context::userConf()->archiving['keep_min'] ?>">
+						FreshRSS_Context::userConf()->archiving['keep_min'] ?>" />
 				</label>
 			</div>
 		</div>

+ 26 - 44
app/views/configure/display.phtml

@@ -6,13 +6,13 @@
 <main class="post">
 	<h1><?= _t('conf.display') ?></h1>
 
-	<form method="post" action="<?= _url('configure', 'display') ?>">
+	<form method="post" action="<?= _url('configure', 'display') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 
 		<div class="form-group">
 			<label class="group-name" for="language"><?= _t('conf.display.language') ?></label>
 			<div class="group-controls">
-				<select name="language" id="language" data-leave-validation="<?= FreshRSS_Context::userConf()->language ?>">
+				<select name="language" id="language">
 				<?php $languages = Minz_Translate::availableLanguages(); ?>
 				<?php foreach ($languages as $lang) { ?>
 				<option value="<?= $lang ?>"<?= FreshRSS_Context::userConf()->language === $lang ? ' selected="selected"' : '' ?>><?= _t('gen.lang.' . $lang) ?></option>
@@ -24,7 +24,7 @@
 		<div class="form-group">
 			<label class="group-name" for="timezone"><?= _t('conf.display.timezone') ?></label>
 			<div class="group-controls">
-				<select name="timezone" id="timezone" data-leave-validation="<?= FreshRSS_Context::userConf()->timezone ?>">
+				<select name="timezone" id="timezone">
 				<?php
 					$timezones = array_merge([''], DateTimeZone::listIdentifiers());
 					if (!in_array(FreshRSS_Context::userConf()->timezone, $timezones, true)) {
@@ -53,8 +53,7 @@
 						} else {
 							$checked = '';
 						} ?>
-						<input type="radio" name="theme" id="img-<?= $i ?>" <?= $checked ?> value="<?= $theme['id'] ?>"
-							data-leave-validation="<?= (FreshRSS_Context::userConf()->theme === $theme['id']) ? 1 : 0 ?>" />
+						<input type="radio" name="theme" id="img-<?= $i ?>" <?= $checked ?> value="<?= $theme['id'] ?>" />
 						<li class="preview-container">
 							<div class="preview">
 								<img src="<?= Minz_Url::display('/themes/' . $theme['id'] . '/thumbs/original.png') ?>" loading="lazy" />
@@ -89,7 +88,7 @@
 						<?php $i++ ?>
 					<?php } ?>
 					<?php if (!$themeAvailable) {?>
-						<input type="radio" name="theme" checked="checked" value="Origine" data-leave-validation="0" />
+						<input type="radio" name="theme" checked="checked" value="Origine" />
 						<li class="preview-container">
 							<div class="preview">
 							</div>
@@ -108,7 +107,7 @@
 		<div class="form-group">
 			<label class="group-name" for="darkMode"><?= _t('conf.display.darkMode') ?></label>
 			<div class="group-controls">
-				<select name="darkMode" id="darkMode" data-leave-validation="<?= FreshRSS_Context::userConf()->darkMode ?>">
+				<select name="darkMode" id="darkMode">
 					<option value="no"<?= FreshRSS_Context::userConf()->darkMode === 'no' ? ' selected' : '' ?>><?= _t('conf.display.darkMode.no') ?></option>
 					<option value="auto"<?= FreshRSS_Context::userConf()->darkMode === 'auto' ? ' selected' : '' ?>><?= _t('conf.display.darkMode.auto') ?></option>
 				</select>
@@ -120,7 +119,7 @@
 		<div class="form-group">
 			<label class="group-name" for="content_width"><?= _t('conf.display.width.content') ?></label>
 			<div class="group-controls">
-				<select name="content_width" id="content_width" required="" data-leave-validation="<?= $width ?>">
+				<select name="content_width" id="content_width" required="">
 					<option value="thin" <?= $width === 'thin' ? 'selected="selected"' : '' ?>>
 						<?= _t('conf.display.width.thin') ?>
 					</option>
@@ -141,7 +140,7 @@
 		<div class="form-group">
 			<label class="group-name" for="topline_website"><?= _t('conf.display.website.label') ?></label>
 			<div class="group-controls">
-				<select name="topline_website" id="topline_website" required="" data-leave-validation="<?= $topline_website ?>">
+				<select name="topline_website" id="topline_website" required="">
 					<option value="none" <?= $topline_website === 'none' ? 'selected="selected"' : '' ?>>
 						<?= _t('conf.display.website.none') ?>
 					</option>
@@ -162,7 +161,7 @@
 		<div class="form-group">
 			<label class="group-name" for="topline_thumbnail"><?= _t('conf.display.thumbnail.label') ?></label>
 			<div class="group-controls">
-				<select name="topline_thumbnail" id="topline_thumbnail" required="" data-leave-validation="<?= $topline_thumbnail ?>">
+				<select name="topline_thumbnail" id="topline_thumbnail" required="">
 					<option value="none" <?= $topline_thumbnail === 'none' ? 'selected="selected"' : '' ?>>
 						<?= _t('conf.display.thumbnail.none') ?>
 					</option>
@@ -201,54 +200,39 @@
 						<tr>
 							<th><?= _t('conf.display.icon.top_line') ?></th>
 							<td><input type="checkbox" name="topline_read" value="1"<?=
-								FreshRSS_Context::userConf()->topline_read ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->topline_read ?>" /></td>
+								FreshRSS_Context::userConf()->topline_read ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="topline_favorite" value="1"<?=
-								FreshRSS_Context::userConf()->topline_favorite ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->topline_favorite ?>" /></td>
+								FreshRSS_Context::userConf()->topline_favorite ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="topline_myLabels" value="1"<?=
-								FreshRSS_Context::userConf()->topline_myLabels ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->topline_myLabels ?>" /></td>
+								FreshRSS_Context::userConf()->topline_myLabels ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" disabled="disabled" /></td>
 							<td><input type="checkbox" name="topline_sharing" value="1"<?=
-								FreshRSS_Context::userConf()->topline_sharing ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->topline_sharing ?>" /></td>
+								FreshRSS_Context::userConf()->topline_sharing ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="topline_summary" value="1"<?=
-								FreshRSS_Context::userConf()->topline_summary ? 'checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->topline_summary ?>" /></td>
+								FreshRSS_Context::userConf()->topline_summary ? 'checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="topline_display_authors" value="1"<?=
-								FreshRSS_Context::userConf()->topline_display_authors ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->topline_display_authors ?>" /></td>
+								FreshRSS_Context::userConf()->topline_display_authors ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="topline_date" value="1"<?=
-								FreshRSS_Context::userConf()->topline_date ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->topline_date ?>" /></td>
-							<td><input type="checkbox" name="topline_link" value="1"<?= FreshRSS_Context::userConf()->topline_link ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->topline_link ?>" /></td>
+								FreshRSS_Context::userConf()->topline_date ? ' checked="checked"' : '' ?>  /></td>
+							<td><input type="checkbox" name="topline_link" value="1"<?= FreshRSS_Context::userConf()->topline_link ? ' checked="checked"' : '' ?> /></td>
 						</tr><tr>
 							<th><?= _t('conf.display.icon.bottom_line') ?></th>
 							<td><input type="checkbox" name="bottomline_read" value="1"<?=
-								FreshRSS_Context::userConf()->bottomline_read ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_read ?>" /></td>
+								FreshRSS_Context::userConf()->bottomline_read ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="bottomline_favorite" value="1"<?=
-								FreshRSS_Context::userConf()->bottomline_favorite ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_favorite ?>" /></td>
+								FreshRSS_Context::userConf()->bottomline_favorite ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="bottomline_myLabels" value="1"<?=
-								FreshRSS_Context::userConf()->bottomline_myLabels ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_myLabels ?>" /></td>
+								FreshRSS_Context::userConf()->bottomline_myLabels ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="bottomline_tags" value="1"<?=
-								FreshRSS_Context::userConf()->bottomline_tags ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_tags ?>" /></td>
+								FreshRSS_Context::userConf()->bottomline_tags ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="bottomline_sharing" value="1"<?=
-								FreshRSS_Context::userConf()->bottomline_sharing ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_sharing ?>" /></td>
+								FreshRSS_Context::userConf()->bottomline_sharing ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" disabled="disabled" /></td>
 							<td><input type="checkbox" disabled="disabled" /></td>
 							<td><input type="checkbox" name="bottomline_date" value="1"<?=
-								FreshRSS_Context::userConf()->bottomline_date ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_date ?>" /></td>
+								FreshRSS_Context::userConf()->bottomline_date ? ' checked="checked"' : '' ?> /></td>
 							<td><input type="checkbox" name="bottomline_link" value="1"<?=
-								FreshRSS_Context::userConf()->bottomline_link ? ' checked="checked"' : '' ?>
-								data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_link ?>" /></td>
+								FreshRSS_Context::userConf()->bottomline_link ? ' checked="checked"' : '' ?> /></td>
 						</tr>
 					</tbody>
 				</table>
@@ -259,8 +243,7 @@
 			<label class="group-name" for="html5_notif_timeout"><?= _t('conf.display.notif_html5.timeout') ?></label>
 			<div class="group-controls">
 				<input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?=
-					FreshRSS_Context::userConf()->html5_notif_timeout ?>"
-					data-leave-validation="<?= FreshRSS_Context::userConf()->html5_notif_timeout ?>" /> <?= _t('conf.display.notif_html5.seconds') ?>
+					FreshRSS_Context::userConf()->html5_notif_timeout ?>" /> <?= _t('conf.display.notif_html5.seconds') ?>
 			</div>
 		</div>
 
@@ -268,8 +251,7 @@
 			<div class="group-controls">
 				<label class="checkbox" for="show_nav_buttons">
 					<input type="checkbox" name="show_nav_buttons" id="show_nav_buttons" value="1"<?=
-						FreshRSS_Context::userConf()->show_nav_buttons ? ' checked="checked"' : '' ?>
-						data-leave-validation="<?= FreshRSS_Context::userConf()->show_nav_buttons ?>" />
+						FreshRSS_Context::userConf()->show_nav_buttons ? ' checked="checked"' : '' ?> />
 					<?= _t('conf.display.show_nav_buttons') ?>
 				</label>
 			</div>

+ 2 - 4
app/views/configure/integration.phtml

@@ -77,8 +77,7 @@
 					<?= _t('conf.sharing.share_name') ?>
 				</label>
 				<div class="group-controls">
-					<input type="text" id="share_<?= $key ?>_name" name="share[<?= $key ?>][name]" value="<?= $share->name() ?>"
-							data-leave-validation="<?= $share->name() ?>" />
+					<input type="text" id="share_<?= $key ?>_name" name="share[<?= $key ?>][name]" value="<?= $share->name() ?>" />
 				</div>
 			</div>
 
@@ -90,8 +89,7 @@
 
 					<div class="group-controls">
 						<div class="stick">
-							<input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="long" value="<?= $share->baseUrl() ?>"
-								data-leave-validation="<?= $share->baseUrl() ?>" required />
+							<input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="long" value="<?= $share->baseUrl() ?>" required="required" />
 							<a class="btn open-url" target="_blank" rel="noreferrer" href="<?= $share->baseUrl() ?>" title="<?= _t('gen.action.open_url') ?>" data-input="share_<?= $key ?>_url"><?= _i('link') ?></a>
 						</div>
 						<p class="help"><?= _i('help') ?> <a href="<?= $share->help() ?>" target="_blank" rel="noreferrer"><?= _t('conf.sharing.more_information') ?></a></p>

+ 2 - 3
app/views/configure/privacy.phtml

@@ -6,15 +6,14 @@
 <main class="post">
 	<h1><?= _t('conf.privacy') ?></h1>
 
-	<form method="post" action="<?= _url('configure', 'privacy') ?>">
+	<form method="post" action="<?= _url('configure', 'privacy') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 
 		<div class="form-group">
 			<label class="group-name" for="retrieve_extension_list"><?= _t('conf.privacy.retrieve_extension_list') ?></label>
 			<div class="group-controls">
 				<input type="checkbox" id="retrieve_extension_list" name="retrieve_extension_list" value="1"<?=
-					FreshRSS_Context::userConf()->retrieve_extension_list !== false ? ' checked="checked"' : '' ?>
-					data-leave-validation="<?= FreshRSS_Context::userConf()->retrieve_extension_list !== false ? 1 : 0 ?>"/>
+					FreshRSS_Context::userConf()->retrieve_extension_list !== false ? ' checked="checked"' : '' ?> />
 			</div>
 		</div>
 

+ 33 - 53
app/views/configure/reading.phtml

@@ -6,14 +6,14 @@
 <main class="post">
 	<h1><?= _t('conf.reading') ?></h1>
 
-	<form method="post" action="<?= _url('configure', 'reading') ?>">
+	<form method="post" action="<?= _url('configure', 'reading') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 		<fieldset>
 			<legend><?= _t('conf.reading.headline.view') ?></legend>
 			<div class="form-group">
 				<label class="group-name" for="view_mode"><?= _t('conf.reading.view.default') ?></label>
 				<div class="group-controls">
-					<select name="view_mode" id="view_mode" data-leave-validation="<?= FreshRSS_Context::userConf()->view_mode ?>">
+					<select name="view_mode" id="view_mode">
 						<?php
 						/** @var FreshRSS_View $this */
 						/** @var list<FreshRSS_ViewMode>|null $viewModes */
@@ -34,7 +34,7 @@
 			<div class="form-group">
 				<label class="group-name" for="default_view"><?= _t('conf.reading.show') ?></label>
 				<div class="group-controls">
-					<select name="default_view" id="default_view" data-leave-validation="<?= FreshRSS_Context::userConf()->default_view ?>">
+					<select name="default_view" id="default_view">
 						<option value="unread"<?= FreshRSS_Context::userConf()->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option>
 						<option value="adaptive"<?= FreshRSS_Context::userConf()->default_view === 'adaptive' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.adaptive') ?></option>
 						<option value="unread_or_favorite"<?= FreshRSS_Context::userConf()->default_view === 'unread_or_favorite' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread_or_favorite') ?></option>
@@ -47,8 +47,7 @@
 				<label class="group-name" for="posts_per_page"><?= _t('conf.reading.articles_per_page') ?></label>
 				<div class="group-controls">
 					<input type="number" id="posts_per_page" name="posts_per_page" value="<?=
-						FreshRSS_Context::userConf()->posts_per_page ?>" min="5" max="500"
-						data-leave-validation="<?= FreshRSS_Context::userConf()->posts_per_page ?>"/>
+						FreshRSS_Context::userConf()->posts_per_page ?>" min="5" max="500" />
 					<p class="help"><?= _i('help') ?> <?= _t('conf.reading.number_divided_when_reader') ?></p>
 				</div>
 			</div>
@@ -57,8 +56,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="auto_load_more">
 						<input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?=
-							FreshRSS_Context::userConf()->auto_load_more ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->auto_load_more ?>"/>
+							FreshRSS_Context::userConf()->auto_load_more ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.auto_load_more') ?>
 						<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
 					</label>
@@ -68,7 +66,7 @@
 			<div class="form-group">
 				<label class="group-name" for="mark_read_button"><?= _t('conf.mark_read_button') ?></label>
 				<div class="group-controls">
-					<select name="mark_read_button" id="mark_read_button" data-leave-validation="<?= FreshRSS_Context::userConf()->mark_read_button ?>">
+					<select name="mark_read_button" id="mark_read_button">
 						<option value="big"<?= FreshRSS_Context::userConf()->mark_read_button === 'big' ? ' selected="selected"' : '' ?>><?= _t('conf.mark_read_button.big') ?></option>
 						<option value="small"<?= FreshRSS_Context::userConf()->mark_read_button === 'small' ? ' selected="selected"' : '' ?>><?= _t('conf.mark_read_button.small') ?></option>
 						<option value="none"<?= FreshRSS_Context::userConf()->mark_read_button === 'none' ? ' selected="selected"' : '' ?>><?= _t('conf.mark_read_button.none') ?></option>
@@ -79,7 +77,7 @@
 			<div class="form-group">
 				<label class="group-name" for="sort_order"><?= _t('conf.reading.sort') ?></label>
 				<div class="group-controls">
-					<select name="sort_order" id="sort_order" data-leave-validation="<?= FreshRSS_Context::userConf()->sort_order ?>">
+					<select name="sort_order" id="sort_order">
 						<option value="DESC"<?= FreshRSS_Context::userConf()->sort_order === 'DESC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.newer_first') ?></option>
 						<option value="ASC"<?= FreshRSS_Context::userConf()->sort_order === 'ASC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.older_first') ?></option>
 					</select>
@@ -93,7 +91,7 @@
 			<div class="form-group">
 				<label class="group-name" for="display_categories"><?= _t('conf.reading.display_categories_unfolded') ?></label>
 				<div class="group-controls">
-					<select name="display_categories" id="display_categories" data-leave-validation="<?= FreshRSS_Context::userConf()->display_categories ?>">
+					<select name="display_categories" id="display_categories">
 						<option value="active"<?= FreshRSS_Context::userConf()->display_categories === 'active' ? ' selected="selected"' : '' ?>><?=
 							_t('conf.reading.show.active_category') ?></option>
 						<option value="remember"<?= FreshRSS_Context::userConf()->display_categories === 'remember' ? ' selected="selected"' : '' ?>><?=
@@ -110,8 +108,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="show_fav_unread">
 						<input type="checkbox" name="show_fav_unread" id="show_fav_unread" value="1"<?=
-							FreshRSS_Context::userConf()->show_fav_unread ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->show_fav_unread ?>"/>
+							FreshRSS_Context::userConf()->show_fav_unread ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.always_show_favorites') ?>
 						<p class="help"><?= _i('help') ?> <?= _t('conf.reading.show_fav_unread_help') ?></p>
 					</label>
@@ -122,8 +119,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="hide_read_feeds">
 						<input type="checkbox" name="hide_read_feeds" id="hide_read_feeds" value="1"<?=
-							FreshRSS_Context::userConf()->hide_read_feeds ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->hide_read_feeds ?>"/>
+							FreshRSS_Context::userConf()->hide_read_feeds ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.hide_read_feeds') ?>
 					</label>
 				</div>
@@ -135,7 +131,7 @@
 			<div class="form-group">
 				<label class="group-name" for="show_feed_name"><?= _t('conf.reading.article.feed_title') ?></label>
 				<div class="group-controls">
-					<select name="show_feed_name" id="show_feed_name" data-leave-validation="<?= FreshRSS_Context::userConf()->show_feed_name ?>">
+					<select name="show_feed_name" id="show_feed_name">
 						<option value="0"<?= FreshRSS_Context::userConf()->show_feed_name === '0' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.none') ?></option>
 						<option value="t"<?= FreshRSS_Context::userConf()->show_feed_name === 't' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.above_title') ?></option>
 						<option value="a"<?= FreshRSS_Context::userConf()->show_feed_name === 'a' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.with_authors') ?></option>
@@ -146,7 +142,7 @@
 			<div class="form-group">
 				<label class="group-name" for="show_author_date"><?= _t('conf.reading.article.authors_date') ?></label>
 				<div class="group-controls">
-					<select name="show_author_date" id="show_author_date" data-leave-validation="<?= FreshRSS_Context::userConf()->show_author_date ?>">
+					<select name="show_author_date" id="show_author_date">
 						<option value="0" <?= FreshRSS_Context::userConf()->show_author_date === '0' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.none') ?></option>
 						<option value="h" <?= FreshRSS_Context::userConf()->show_author_date === 'h' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.header') ?></option>
 						<option value="f" <?= FreshRSS_Context::userConf()->show_author_date === 'f' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.footer') ?></option>
@@ -157,7 +153,7 @@
 			<div class="form-group">
 				<label class="group-name" for="show_article_icons"><?= _t('conf.reading.article.icons') ?></label>
 				<div class="group-controls">
-					<select name="show_article_icons" id="show_article_icons" data-leave-validation="<?= FreshRSS_Context::userConf()->show_article_icons ?>">
+					<select name="show_article_icons" id="show_article_icons">
 						<option value="t" <?= FreshRSS_Context::userConf()->show_article_icons === 't' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.icons.above_title') ?></option>
 						<option value="a" <?= FreshRSS_Context::userConf()->show_article_icons === 'a' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.icons.with_authors') ?></option>
 					</select>
@@ -166,7 +162,7 @@
 			<div class="form-group">
 				<label class="group-name" for="show_tags"><?= _t('conf.reading.article.tags') ?></label>
 				<div class="group-controls">
-					<select class="select-input-changer" name="show_tags" id="show_tags" data-name="show_tags_max" data-leave-validation="<?= FreshRSS_Context::userConf()->show_tags ?>">
+					<select class="select-input-changer" name="show_tags" id="show_tags" data-name="show_tags_max">
 						<option value="0" <?= FreshRSS_Context::userConf()->show_tags === '0' ? ' selected="selected"' : '' ?> data-input-visible="false"><?= _t('conf.reading.article.tags.none') ?></option>
 						<option value="h" <?= FreshRSS_Context::userConf()->show_tags === 'h' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.header') ?></option>
 						<option value="f" <?= FreshRSS_Context::userConf()->show_tags === 'f' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.footer') ?></option>
@@ -178,7 +174,7 @@
 			<div class="form-group" id="show_tags_max-block">
 				<label class="group-name" for="show_tags_max"><?= _t('conf.reading.article.tags_max') ?></label>
 				<div class="group-controls">
-					<input type="number" id="show_tags_max" name="show_tags_max" value="<?= FreshRSS_Context::userConf()->show_tags_max ?>" min="0" data-leave-validation="<?= FreshRSS_Context::userConf()->show_tags_max ?>" data-number="2" />
+					<input type="number" id="show_tags_max" name="show_tags_max" value="<?= FreshRSS_Context::userConf()->show_tags_max ?>" min="0" data-number="2" />
 					<p class="help"><?= _i('help') ?> <?= _t('conf.reading.article.tags_max.help') ?></p>
 				</div>
 			</div>
@@ -190,8 +186,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="display_posts">
 						<input type="checkbox" name="display_posts" id="display_posts" value="1"<?=
-							FreshRSS_Context::userConf()->display_posts ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->display_posts ?>"/>
+							FreshRSS_Context::userConf()->display_posts ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.display_articles_unfolded') ?>
 						<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
 					</label>
@@ -202,8 +197,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="sticky_post">
 						<input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?=
-							FreshRSS_Context::userConf()->sticky_post ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->sticky_post ?>"/>
+							FreshRSS_Context::userConf()->sticky_post ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.sticky_post') ?>
 						<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
 					</label>
@@ -214,8 +208,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="sides_close_article">
 						<input type="checkbox" name="sides_close_article" id="sides_close_article" value="1"<?=
-							FreshRSS_Context::userConf()->sides_close_article ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->sides_close_article ?>"/>
+							FreshRSS_Context::userConf()->sides_close_article ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.sides_close_article') ?>
 						<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
 					</label>
@@ -229,8 +222,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="auto_remove_article">
 						<input type="checkbox" name="auto_remove_article" id="auto_remove_article" value="1"<?=
-							FreshRSS_Context::userConf()->auto_remove_article ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->auto_remove_article ?>"/>
+							FreshRSS_Context::userConf()->auto_remove_article ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.auto_remove_article') ?>
 						<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
 					</label>
@@ -241,8 +233,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="reading_confirm">
 						<input type="checkbox" name="reading_confirm" id="reading_confirm" value="1"<?=
-							FreshRSS_Context::userConf()->reading_confirm ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->reading_confirm ?>"/>
+							FreshRSS_Context::userConf()->reading_confirm ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.confirm_enabled') ?>
 						<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
 					</label>
@@ -254,8 +245,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="onread_jump_next">
 						<input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?=
-							FreshRSS_Context::userConf()->onread_jump_next ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->onread_jump_next ?>"/>
+							FreshRSS_Context::userConf()->onread_jump_next ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.jump_next') ?>
 					</label>
 				</div>
@@ -266,8 +256,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="check_open_article">
 						<input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?=
-							FreshRSS_Context::userConf()->mark_when['article'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['article'] ?>"/>
+							FreshRSS_Context::userConf()->mark_when['article'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.read.article_viewed') ?>
 					</label>
 				</div>
@@ -278,8 +267,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="check_open_site">
 						<input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?=
-							FreshRSS_Context::userConf()->mark_when['site'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['site'] ?>"/>
+							FreshRSS_Context::userConf()->mark_when['site'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.read.article_open_on_website') ?>
 					</label>
 				</div>
@@ -290,8 +278,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="check_scroll">
 						<input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?=
-							FreshRSS_Context::userConf()->mark_when['scroll'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['scroll'] ?>"/>
+							FreshRSS_Context::userConf()->mark_when['scroll'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.read.scroll') ?>
 					</label>
 				</div>
@@ -302,8 +289,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="check_focus">
 						<input type="checkbox" name="mark_focus" id="check_focus" value="1"<?=
-							FreshRSS_Context::userConf()->mark_when['focus'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['focus'] ?>" />
+							FreshRSS_Context::userConf()->mark_when['focus'] ? ' checked="checked"' : '' ?>  />
 						<?= _t('conf.reading.read.focus') ?>
 					</label>
 				</div>
@@ -316,8 +302,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="mark_updated_article_unread">
 						<input type="checkbox" name="mark_updated_article_unread" id="mark_updated_article_unread" value="1"<?=
-							FreshRSS_Context::userConf()->mark_updated_article_unread ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->mark_updated_article_unread ?>"/>
+							FreshRSS_Context::userConf()->mark_updated_article_unread ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.mark_updated_article_unread') ?>
 					</label>
 				</div>
@@ -328,12 +313,11 @@
 				<div class="group-controls">
 					<label class="checkbox" for="enable_read_when_same_title_in_feed">
 						<input type="checkbox" name="enable_read_when_same_title_in_feed" id="enable_read_when_same_title_in_feed" value="1"<?=
-							empty(FreshRSS_Context::userConf()->mark_when['same_title_in_feed']) ? '' : ' checked="checked"' ?>
-							data-leave-validation="<?= empty(FreshRSS_Context::userConf()->mark_when['same_title_in_feed']) ? 0 : 1 ?>"/>
+							empty(FreshRSS_Context::userConf()->mark_when['same_title_in_feed']) ? '' : ' checked="checked"' ?> />
 						<?= _t('conf.reading.read.when_same_title_in_feed') ?>
 						<?php $read_when_same_title_in_feed = empty(FreshRSS_Context::userConf()->mark_when['same_title_in_feed']) ? 25 : FreshRSS_Context::userConf()->mark_when['same_title_in_feed']; ?>
 						<input type="number" id="read_when_same_title_in_feed" name="read_when_same_title_in_feed" min="0"
-							value="<?= $read_when_same_title_in_feed ?>" data-leave-validation="<?= $read_when_same_title_in_feed ?>" />
+							value="<?= $read_when_same_title_in_feed ?>" />
 					</label>
 				</div>
 			</div>
@@ -343,8 +327,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="mark_upon_reception">
 						<input type="checkbox" name="mark_upon_reception" id="mark_upon_reception" value="1"<?=
-							FreshRSS_Context::userConf()->mark_when['reception'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['reception'] ?>"/>
+							FreshRSS_Context::userConf()->mark_when['reception'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.read.upon_reception') ?>
 					</label>
 				</div>
@@ -355,8 +338,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="read_upon_gone">
 						<input type="checkbox" name="read_upon_gone" id="read_upon_gone" value="1"<?=
-							FreshRSS_Context::userConf()->mark_when['gone'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['gone'] ?>"/>
+							FreshRSS_Context::userConf()->mark_when['gone'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.read.upon_gone') ?>
 					</label>
 				</div>
@@ -390,11 +372,10 @@
 				<div class="group-controls">
 					<label class="checkbox" for="keep_max_n_unread">
 						<input type="checkbox" name="enable_keep_max_n_unread" id="enable_keep_max_n_unread" value="1"<?=
-							empty(FreshRSS_Context::userConf()->mark_when['max_n_unread']) ? '' : ' checked="checked"' ?>
-							data-leave-validation="<?= empty(FreshRSS_Context::userConf()->mark_when['max_n_unread']) ? 0 : 1 ?>"/>
+							empty(FreshRSS_Context::userConf()->mark_when['max_n_unread']) ? '' : ' checked="checked"' ?> />
 						<?= _t('conf.reading.read.keep_max_n_unread') ?>
 						<?php $keep_max_n_unread = empty(FreshRSS_Context::userConf()->mark_when['max_n_unread']) ? 1000 : FreshRSS_Context::userConf()->mark_when['max_n_unread']; ?>
-						<input type="number" id="keep_max_n_unread" name="keep_max_n_unread" min="0" value="<?= $keep_max_n_unread ?>" data-leave-validation="<?= $keep_max_n_unread ?>" />
+						<input type="number" id="keep_max_n_unread" name="keep_max_n_unread" min="0" value="<?= $keep_max_n_unread ?>" />
 					</label>
 				</div>
 			</div>
@@ -406,8 +387,7 @@
 				<div class="group-controls">
 					<label class="checkbox" for="lazyload">
 						<input type="checkbox" name="lazyload" id="lazyload" value="1"<?=
-							FreshRSS_Context::userConf()->lazyload ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= FreshRSS_Context::userConf()->lazyload ?>"/>
+							FreshRSS_Context::userConf()->lazyload ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.img_with_lazyload') ?>
 						<noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
 					</label>

+ 24 - 47
app/views/configure/shortcut.phtml

@@ -22,7 +22,7 @@
 		</p>
 	<?php endif; ?>
 
-	<form method="post" action="<?= _url('configure', 'shortcut') ?>">
+	<form method="post" action="<?= _url('configure', 'shortcut') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 
 		<noscript><p class="alert alert-error"><?= _t('conf.shortcut.javascript') ?></p></noscript>
@@ -33,24 +33,21 @@
 			<div class="form-group">
 				<label class="group-name" for="normal_view_shortcut"><?= _t('conf.shortcut.normal_view') ?></label>
 				<div class="group-controls">
-					<input type="text" id="normal_view_shortcut" name="shortcuts[normal_view]" list="keys" value="<?= $s['normal_view'] ?>"
-						data-leave-validation="<?= $s['normal_view'] ?>"/>
+					<input type="text" id="normal_view_shortcut" name="shortcuts[normal_view]" list="keys" value="<?= $s['normal_view'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="global_view_shortcut"><?= _t('conf.shortcut.global_view') ?></label>
 				<div class="group-controls">
-					<input type="text" id="global_view_shortcut" name="shortcuts[global_view]" list="keys" value="<?= $s['global_view'] ?>"
-						data-leave-validation="<?= $s['global_view'] ?>"/>
+					<input type="text" id="global_view_shortcut" name="shortcuts[global_view]" list="keys" value="<?= $s['global_view'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="reading_view_shortcut"><?= _t('conf.shortcut.reading_view') ?></label>
 				<div class="group-controls">
-					<input type="text" id="reading_view_shortcut" name="shortcuts[reading_view]" list="keys" value="<?= $s['reading_view'] ?>"
-						data-leave-validation="<?= $s['reading_view'] ?>"/>
+					<input type="text" id="reading_view_shortcut" name="shortcuts[reading_view]" list="keys" value="<?= $s['reading_view'] ?>" />
 				</div>
 			</div>
 		</fieldset>
@@ -63,40 +60,35 @@
 			<div class="form-group">
 				<label class="group-name" for="next_entry"><?= _t('conf.shortcut.next_article') ?></label>
 				<div class="group-controls">
-					<input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?= $s['next_entry'] ?>"
-						data-leave-validation="<?= $s['next_entry'] ?>"/>
+					<input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?= $s['next_entry'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="next_unread_entry"><?= _t('conf.shortcut.next_unread_article') ?></label>
 				<div class="group-controls">
-					<input type="text" id="next_unread_entry" name="shortcuts[next_unread_entry]" list="keys" value="<?= $s['next_unread_entry'] ?>"
-						data-leave-validation="<?= $s['next_unread_entry'] ?>"/>
+					<input type="text" id="next_unread_entry" name="shortcuts[next_unread_entry]" list="keys" value="<?= $s['next_unread_entry'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="prev_entry"><?= _t('conf.shortcut.previous_article') ?></label>
 				<div class="group-controls">
-					<input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?= $s['prev_entry'] ?>"
-						data-leave-validation="<?= $s['prev_entry'] ?>"/>
+					<input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?= $s['prev_entry'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="first_entry"><?= _t('conf.shortcut.first_article') ?></label>
 				<div class="group-controls">
-					<input type="text" id="first_entry" name="shortcuts[first_entry]" list="keys" value="<?= $s['first_entry'] ?>"
-						data-leave-validation="<?= $s['first_entry'] ?>"/>
+					<input type="text" id="first_entry" name="shortcuts[first_entry]" list="keys" value="<?= $s['first_entry'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="last_entry"><?= _t('conf.shortcut.last_article') ?></label>
 				<div class="group-controls">
-					<input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?= $s['last_entry'] ?>"
-						data-leave-validation="<?= $s['last_entry'] ?>"/>
+					<input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?= $s['last_entry'] ?>" />
 				</div>
 			</div>
 
@@ -105,16 +97,14 @@
 			<div class="form-group">
 				<label class="group-name" for="skip_next_entry"><?= _t('conf.shortcut.skip_next_article') ?></label>
 				<div class="group-controls">
-					<input type="text" id="skip_next_entry" name="shortcuts[skip_next_entry]" list="keys" value="<?= $s['skip_next_entry'] ?>"
-						data-leave-validation="<?= $s['skip_next_entry'] ?>"/>
+					<input type="text" id="skip_next_entry" name="shortcuts[skip_next_entry]" list="keys" value="<?= $s['skip_next_entry'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="skip_prev_entry"><?= _t('conf.shortcut.skip_previous_article') ?></label>
 				<div class="group-controls">
-					<input type="text" id="skip_prev_entry" name="shortcuts[skip_prev_entry]" list="keys" value="<?= $s['skip_prev_entry'] ?>"
-						data-leave-validation="<?= $s['skip_prev_entry'] ?>"/>
+					<input type="text" id="skip_prev_entry" name="shortcuts[skip_prev_entry]" list="keys" value="<?= $s['skip_prev_entry'] ?>" />
 				</div>
 			</div>
 		</fieldset>
@@ -126,8 +116,7 @@
 				<p class="alert alert-warn"><?= _t('conf.shortcut.shift_for_all_read') ?></p>
 				<label class="group-name" for="mark_read"><?= _t('conf.shortcut.mark_read') ?></label>
 				<div class="group-controls">
-					<input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?= $s['mark_read'] ?>"
-						data-leave-validation="<?= $s['mark_read'] ?>"/>
+					<input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?= $s['mark_read'] ?>" />
 				</div>
 			</div>
 
@@ -136,24 +125,21 @@
 			<div class="form-group">
 				<label class="group-name" for="mark_favorite"><?= _t('conf.shortcut.mark_favorite') ?></label>
 				<div class="group-controls">
-					<input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?= $s['mark_favorite'] ?>"
-						data-leave-validation="<?= $s['mark_favorite'] ?>"/>
+					<input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?= $s['mark_favorite'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="go_website"><?= _t('conf.shortcut.see_on_website') ?></label>
 				<div class="group-controls">
-					<input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?= $s['go_website'] ?>"
-						data-leave-validation="<?= $s['go_website'] ?>"/>
+					<input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?= $s['go_website'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="auto_share_shortcut"><?= _t('conf.shortcut.auto_share') ?></label>
 				<div class="group-controls">
-					<input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?= $s['auto_share'] ?>"
-						data-leave-validation="<?= $s['auto_share'] ?>"/>
+					<input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?= $s['auto_share'] ?>" />
 						<p class="help"><?= _i('help') ?> <?= _t('conf.shortcut.auto_share_help') ?></p>
 				</div>
 			</div>
@@ -161,24 +147,21 @@
 			<div class="form-group">
 				<label class="group-name" for="mylabels_shortcut"><?= _t('index.menu.mylabels') ?></label>
 				<div class="group-controls">
-					<input type="text" id="mylabels_shortcut" name="shortcuts[mylabels]" list="keys" value="<?= $s['mylabels'] ?>"
-						data-leave-validation="<?= $s['mylabels'] ?>"/>
+					<input type="text" id="mylabels_shortcut" name="shortcuts[mylabels]" list="keys" value="<?= $s['mylabels'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="collapse_entry"><?= _t('conf.shortcut.collapse_article') ?></label>
 				<div class="group-controls">
-					<input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?= $s['collapse_entry'] ?>"
-						data-leave-validation="<?= $s['collapse_entry'] ?>"/>
+					<input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?= $s['collapse_entry'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="toggle_media"><?= _t('conf.shortcut.toggle_media') ?></label>
 				<div class="group-controls">
-					<input type="text" id="toggle_media" name="shortcuts[toggle_media]" list="keys" value="<?= $s['toggle_media'] ?>"
-						data-leave-validation="<?= $s['toggle_media'] ?>"/>
+					<input type="text" id="toggle_media" name="shortcuts[toggle_media]" list="keys" value="<?= $s['toggle_media'] ?>" />
 				</div>
 			</div>
 		</fieldset>
@@ -189,32 +172,28 @@
 			<div class="form-group">
 				<label class="group-name" for="actualize"><?= _t('gen.action.actualize') ?></label>
 				<div class="group-controls">
-					<input type="text" id="actualize" name="shortcuts[actualize]" list="keys" value="<?= $s['actualize'] ?>"
-						data-leave-validation="<?= $s['actualize'] ?>" />
+					<input type="text" id="actualize" name="shortcuts[actualize]" list="keys" value="<?= $s['actualize'] ?>"  />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="load_more_shortcut"><?= _t('conf.shortcut.load_more') ?></label>
 				<div class="group-controls">
-					<input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?= $s['load_more'] ?>"
-						data-leave-validation="<?= $s['load_more'] ?>"/>
+					<input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?= $s['load_more'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="focus_search_shortcut"><?= _t('conf.shortcut.focus_search') ?></label>
 				<div class="group-controls">
-					<input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?= $s['focus_search'] ?>"
-						data-leave-validation="<?= $s['focus_search'] ?>"/>
+					<input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?= $s['focus_search'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="user_filter_shortcut"><?= _t('conf.shortcut.user_filter') ?></label>
 				<div class="group-controls">
-					<input type="text" id="user_filter_shortcut" name="shortcuts[user_filter]" list="keys" value="<?= $s['user_filter'] ?>"
-						data-leave-validation="<?= $s['user_filter'] ?>"/>
+					<input type="text" id="user_filter_shortcut" name="shortcuts[user_filter]" list="keys" value="<?= $s['user_filter'] ?>" />
 						<p class="help"><?= _i('help') ?> <?= _t('conf.shortcut.user_filter_help') ?></p>
 				</div>
 			</div>
@@ -222,16 +201,14 @@
 			<div class="form-group">
 				<label class="group-name" for="close_dropdown_shortcut"><?= _t('conf.shortcut.close_dropdown') ?></label>
 				<div class="group-controls">
-					<input type="text" id="close_dropdown" name="shortcuts[close_dropdown]" list="keys" value="<?= $s['close_dropdown'] ?>"
-						data-leave-validation="<?= $s['close_dropdown'] ?>"/>
+					<input type="text" id="close_dropdown" name="shortcuts[close_dropdown]" list="keys" value="<?= $s['close_dropdown'] ?>" />
 				</div>
 			</div>
 
 			<div class="form-group">
 				<label class="group-name" for="help_shortcut"><?= _t('conf.shortcut.help') ?></label>
 				<div class="group-controls">
-					<input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?= $s['help'] ?>"
-						data-leave-validation="<?= $s['help'] ?>"/>
+					<input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?= $s['help'] ?>" />
 				</div>
 			</div>
 		</fieldset>

+ 7 - 14
app/views/configure/system.phtml

@@ -6,22 +6,20 @@
 <main class="post">
 	<h1><?= _t('admin.system') ?></h1>
 
-	<form method="post" action="<?= _url('configure', 'system') ?>">
+	<form method="post" action="<?= _url('configure', 'system') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 
 		<div class="form-group">
 			<label class="group-name" for="instance-name"><?= _t('admin.system.instance-name') ?></label>
 			<div class="group-controls">
-				<input type="text" id="instance-name" name="instance-name" value="<?= FreshRSS_Context::systemConf()->title ?>"
-					data-leave-validation="<?= FreshRSS_Context::systemConf()->title ?>"/>
+				<input type="text" id="instance-name" name="instance-name" value="<?= FreshRSS_Context::systemConf()->title ?>" />
 			</div>
 		</div>
 
 		<div class="form-group">
 			<label class="group-name" for="base-url"><?= _t('admin.system.base-url') ?></label>
 			<div class="group-controls">
-				<input type="text" id="base-url" name="base-url" value="<?= FreshRSS_Context::systemConf()->base_url ?>"
-					data-leave-validation="<?= FreshRSS_Context::systemConf()->base_url ?>" readonly="readonly" />
+				<input type="text" id="base-url" name="base-url" value="<?= FreshRSS_Context::systemConf()->base_url ?>" readonly="readonly" />
 					<p class="help"><?= _i('help') ?> <?= _t('admin.system.base-url.recommendation', dirname(Minz_Request::guessBaseUrl())) ?></p>
 					<p class="help"><?= _i('help') ?> <?= _t('admin.system.sensitive-parameter') ?></p>
 			</div>
@@ -47,24 +45,21 @@
 		<div class="form-group">
 			<label class="group-name" for="max-feeds"><?= _t('admin.system.max-feeds') ?></label>
 			<div class="group-controls">
-				<input type="number" id="max-feeds" name="max-feeds" value="<?= FreshRSS_Context::systemConf()->limits['max_feeds'] ?>" min="1"
-					data-leave-validation="<?= FreshRSS_Context::systemConf()->limits['max_feeds'] ?>"/>
+				<input type="number" id="max-feeds" name="max-feeds" value="<?= FreshRSS_Context::systemConf()->limits['max_feeds'] ?>" min="1" />
 			</div>
 		</div>
 
 		<div class="form-group">
 			<label class="group-name" for="max-categories"><?= _t('admin.system.max-categories') ?></label>
 			<div class="group-controls">
-				<input type="number" id="max-categories" name="max-categories" value="<?= FreshRSS_Context::systemConf()->limits['max_categories'] ?>" min="1"
-					data-leave-validation="<?= FreshRSS_Context::systemConf()->limits['max_categories'] ?>"/>
+				<input type="number" id="max-categories" name="max-categories" value="<?= FreshRSS_Context::systemConf()->limits['max_categories'] ?>" min="1" />
 			</div>
 		</div>
 
 		<div class="form-group">
 			<label class="group-name" for="cookie-duration"><?= _t('admin.system.cookie-duration.number') ?></label>
 			<div class="group-controls">
-				<input type="number" id="cookie-duration" name="cookie-duration" value="<?= FreshRSS_Context::systemConf()->limits['cookie_duration'] ?>" min="0"
-					data-leave-validation="<?= FreshRSS_Context::systemConf()->limits['cookie_duration'] ?>"/>
+				<input type="number" id="cookie-duration" name="cookie-duration" value="<?= FreshRSS_Context::systemConf()->limits['cookie_duration'] ?>" min="0" />
 				<p class="help"><?= _i('help') ?> <?= _t('admin.system.cookie-duration.help') ?></p>
 			</div>
 		</div>
@@ -86,8 +81,7 @@
 			<label class="group-name" for="max-registrations-input"><?= _t('admin.system.registration.number') ?></label>
 			<div class="group-controls">
 				<?php $number = count(listUsers()); ?>
-				<input type="number" id="max-registrations-input" name="" value="<?= FreshRSS_Context::systemConf()->limits['max_registrations'] > 1 ? FreshRSS_Context::systemConf()->limits['max_registrations'] : $number + 1; ?>" min="2"
-					data-leave-validation="<?= FreshRSS_Context::systemConf()->limits['max_registrations'] > 1 ? FreshRSS_Context::systemConf()->limits['max_registrations'] : $number + 1; ?>" data-number="<?= $number ?>"/>
+				 <input type="number" id="max-registrations-input" name="" value="<?= FreshRSS_Context::systemConf()->limits['max_registrations'] > 1 ? FreshRSS_Context::systemConf()->limits['max_registrations'] : $number + 1; ?>" min="2" data-number="<?= $number ?>"/>
 				<span id="max-registrations-status-disabled">(= <?= _t('admin.system.registration.status.disabled') ?>)</span><span id="max-registrations-status-enabled">(= <?= _t('admin.system.registration.status.enabled') ?>)</span>
 			</div>
 		</div>
@@ -120,7 +114,6 @@
 						id="force-email-validation"
 						value="1"
 						<?= FreshRSS_Context::systemConf()->force_email_validation ? 'checked="checked"' : '' ?>
-						data-leave-validation="<?= FreshRSS_Context::systemConf()->force_email_validation ?>"
 					/>
 					<?= _t('admin.system.force_email_validation') ?>
 				</label>

+ 13 - 23
app/views/helpers/category/update.phtml

@@ -15,7 +15,7 @@
 		<a href="<?= _url('index', 'index', 'get', 'c_' . $this->category->id()) ?>"><?= _i('link') ?> <?= _t('gen.action.filter') ?></a>
 	</div>
 
-	<form method="post" action="<?= _url('category', 'update', 'id', $this->category->id(), '#', 'slider') ?>" autocomplete="off">
+	<form method="post" action="<?= _url('category', 'update', 'id', $this->category->id(), '#', 'slider') ?>" autocomplete="off" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 		<fieldset>
 			<legend><?= _t('sub.category.information') ?></legend>
@@ -82,12 +82,11 @@
 				<div class="group-controls">
 					<label class="checkbox" for="enable_read_when_same_title_in_category">
 						<input type="checkbox" name="enable_read_when_same_title_in_category" id="enable_read_when_same_title_in_category" value="1"<?=
-							$this->category->hasAttribute('read_when_same_title_in_category') ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $this->category->hasAttribute('read_when_same_title_in_category') ? 1 : 0 ?>"/>
+							$this->category->hasAttribute('read_when_same_title_in_category') ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.reading.read.when_same_title_in_category') ?>
 						<?php $read_when_same_title_in_category = $this->category->hasAttribute('read_when_same_title_in_category') ? $this->category->attributeInt('read_when_same_title_in_category') : 25; ?>
 						<input type="number" id="read_when_same_title_in_category" name="read_when_same_title_in_category" min="0"
-							value="<?= $read_when_same_title_in_category ?>" data-leave-validation="<?= $read_when_same_title_in_category ?>" />
+							value="<?= $read_when_same_title_in_category ?>" />
 					</label>
 				</div>
 			</div>
@@ -161,8 +160,7 @@
 				<label class="group-name" for="use_default_purge_options"><?= _t('conf.archiving.policy') ?></label>
 				<div class="group-controls">
 					<label class="checkbox">
-						<input type="checkbox" name="use_default_purge_options" id="use_default_purge_options" value="1"<?= $archiving['default'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $archiving['default'] ? 1 : 0 ?>" />
+						<input type="checkbox" name="use_default_purge_options" id="use_default_purge_options" value="1"<?= $archiving['default'] ? ' checked="checked"' : '' ?> />
 						<?= _t('gen.short.by_default') ?>
 					</label>
 				</div>
@@ -170,23 +168,19 @@
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label class="checkbox" for="enable_keep_max">
-						<input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty($archiving['keep_max']) ? '' : ' checked="checked"' ?>
-							data-leave-validation="<?= empty($archiving['keep_max']) ? 0 : 1 ?>"/>
+						<input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty($archiving['keep_max']) ? '' : ' checked="checked"' ?> />
 						<?= _t('conf.archiving.keep_max') ?>
-						<input type="number" id="keep_max" name="keep_max" min="0" value="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"
-							data-leave-validation="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"/>
+						<input type="number" id="keep_max" name="keep_max" min="0" value="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>" />
 					</label>
 				</div>
 			</div>
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label class="checkbox" for="enable_keep_period">
-						<input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= $volatile['enable_keep_period'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $volatile['enable_keep_period'] ? 1 : 0 ?>"/>
+						<input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= $volatile['enable_keep_period'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.archiving.keep_period') ?>
-						<input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= $volatile['keep_period_count'] ?>"
-							data-leave-validation="<?= $volatile['keep_period_count'] ?>"/>
-						<select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= $volatile['keep_period_unit'] ?>">
+						<input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= $volatile['keep_period_count'] ?>" />
+						<select class="number" name="keep_period_unit" id="keep_period_unit">
 							<option></option>
 							<option value="P1Y" <?= 'P1Y' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option>
 							<option value="P1M" <?= 'P1M' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option>
@@ -201,8 +195,7 @@
 				<div class="group-name"><?= _t('conf.archiving.exception') ?></div>
 				<div class="group-controls">
 					<label class="checkbox" for="keep_favourites">
-						<input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= $archiving['keep_favourites'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $archiving['keep_favourites'] ? 1 : 0 ?>"/>
+						<input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= $archiving['keep_favourites'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.archiving.keep_favourites') ?>
 					</label>
 				</div>
@@ -210,8 +203,7 @@
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label class="checkbox" for="keep_labels">
-						<input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= $archiving['keep_labels'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $archiving['keep_labels'] ? 1 : 0 ?>"/>
+						<input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= $archiving['keep_labels'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.archiving.keep_labels') ?>
 					</label>
 				</div>
@@ -219,8 +211,7 @@
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label class="checkbox" for="keep_unreads">
-						<input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= $archiving['keep_unreads'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $archiving['keep_unreads'] ? 1 : 0 ?>"/>
+						<input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= $archiving['keep_unreads'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.archiving.keep_unreads') ?>
 					</label>
 				</div>
@@ -228,8 +219,7 @@
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label for="keep_min"><?= _t('sub.feed.keep_min') ?>
-						<input type="number" id="keep_min" name="keep_min" min="0" value="<?= $archiving['keep_min'] ?>"
-							data-leave-validation="<?= $archiving['keep_min'] ?>">
+						<input type="number" id="keep_min" name="keep_min" min="0" value="<?= $archiving['keep_min'] ?>" />
 					</label>
 				</div>
 			</div>

+ 1 - 1
app/views/helpers/configure/query.phtml

@@ -11,7 +11,7 @@
 		<a href="<?= $this->query->getUrl() ?>"><?= _i('link') ?> <?= _t('gen.action.filter') ?></a>
 	</div>
 
-	<form method="post" action="<?= _url('configure', 'query', 'id', $this->queryId, '#', 'slider') ?>" autocomplete="off">
+	<form method="post" action="<?= _url('configure', 'query', 'id', $this->queryId, '#', 'slider') ?>" autocomplete="off" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 
 		<div class="form-group">

+ 34 - 56
app/views/helpers/feed/update.phtml

@@ -35,7 +35,7 @@
 		}
 	}
 	?>
-	<form method="post" action="<?= $url ?>" autocomplete="off" enctype="multipart/form-data">
+	<form method="post" action="<?= $url ?>" autocomplete="off" enctype="multipart/form-data" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 		<fieldset>
 			<legend><?= _t('sub.feed.information') ?></legend>
@@ -313,7 +313,6 @@
 				<label class="group-name" for="keep_max_n_unread"><?= _t('conf.reading.read.keep_max_n_unread') ?></label>
 				<div class="group-controls">
 					<input type="number" name="keep_max_n_unread" id="keep_max_n_unread" class="w50" min="1" max="10000000"
-						data-leave-validation="<?= $this->feed->attributeInt('keep_max_n_unread') ?>"
 						value="<?= $this->feed->attributeInt('keep_max_n_unread') ?>"
 						placeholder="<?= _t('gen.short.by_default') ?>" />
 				</div>
@@ -383,8 +382,7 @@
 				<div class="group-name"><?= _t('conf.archiving.policy') ?></div>
 				<div class="group-controls">
 					<label class="checkbox">
-						<input type="checkbox" name="use_default_purge_options" id="use_default_purge_options" value="1"<?= $archiving['default'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $archiving['default'] ? 1 : 0 ?>" />
+						<input type="checkbox" name="use_default_purge_options" id="use_default_purge_options" value="1"<?= $archiving['default'] ? ' checked="checked"' : '' ?> />
 						<?= _t('gen.short.by_default') ?>
 					</label>
 				</div>
@@ -392,23 +390,19 @@
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label class="checkbox" for="enable_keep_max">
-						<input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty($archiving['keep_max']) ? '' : ' checked="checked"' ?>
-							data-leave-validation="<?= empty($archiving['keep_max']) ? 0 : 1 ?>"/>
+						<input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty($archiving['keep_max']) ? '' : ' checked="checked"' ?> />
 						<?= _t('conf.archiving.keep_max') ?>
-						<input type="number" id="keep_max" name="keep_max" min="0" value="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"
-							data-leave-validation="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"/>
+						<input type="number" id="keep_max" name="keep_max" min="0" value="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>" />
 					</label>
 				</div>
 			</div>
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label class="checkbox" for="enable_keep_period">
-						<input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= $volatile['enable_keep_period'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $volatile['enable_keep_period'] ? 1 : 0 ?>"/>
+						<input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= $volatile['enable_keep_period'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.archiving.keep_period') ?>
-						<input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= $volatile['keep_period_count'] ?>"
-							data-leave-validation="<?= $volatile['keep_period_count'] ?>"/>
-						<select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= $volatile['keep_period_unit'] ?>">
+						<input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= $volatile['keep_period_count'] ?>" />
+						<select class="number" name="keep_period_unit" id="keep_period_unit">
 							<option></option>
 							<option value="P1Y" <?= 'P1Y' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option>
 							<option value="P1M" <?= 'P1M' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option>
@@ -423,8 +417,7 @@
 				<div class="group-name"><?= _t('conf.archiving.exception') ?></div>
 				<div class="group-controls">
 					<label class="checkbox" for="keep_favourites">
-						<input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= $archiving['keep_favourites'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $archiving['keep_favourites'] ? 1 : 0 ?>"/>
+						<input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= $archiving['keep_favourites'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.archiving.keep_favourites') ?>
 					</label>
 				</div>
@@ -432,8 +425,7 @@
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label class="checkbox" for="keep_labels">
-						<input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= $archiving['keep_labels'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $archiving['keep_labels'] ? 1 : 0 ?>"/>
+						<input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= $archiving['keep_labels'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.archiving.keep_labels') ?>
 					</label>
 				</div>
@@ -441,8 +433,7 @@
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label class="checkbox" for="keep_unreads">
-						<input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= $archiving['keep_unreads'] ? ' checked="checked"' : '' ?>
-							data-leave-validation="<?= $archiving['keep_unreads'] ?>"/>
+						<input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= $archiving['keep_unreads'] ? ' checked="checked"' : '' ?> />
 						<?= _t('conf.archiving.keep_unreads') ?>
 					</label>
 				</div>
@@ -450,8 +441,7 @@
 			<div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
 				<div class="group-controls">
 					<label for="keep_min"><?= _t('sub.feed.keep_min') ?>
-						<input type="number" id="keep_min" name="keep_min" min="0" value="<?= $archiving['keep_min'] ?>"
-							data-leave-validation="<?= $archiving['keep_min'] ?>">
+						<input type="number" id="keep_min" name="keep_min" min="0" value="<?= $archiving['keep_min'] ?>" />
 					</label>
 				</div>
 			</div>
@@ -494,8 +484,7 @@
 				<label class="group-name" for="xPathItem"><small><?= _t('sub.feed.kind.html_xpath.xpath') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItem" id="xPathItem" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['item'] ?? '' ?>"><?= $xpath['item'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItem" id="xPathItem" rows="2" cols="64" spellcheck="false"><?= $xpath['item'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item.help') ?></p>
 				</div>
 			</div>
@@ -503,8 +492,7 @@
 				<label class="group-name" for="xPathItemTitle"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item_title') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItemTitle" id="xPathItemTitle" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemTitle'] ?? '' ?>"><?= $xpath['itemTitle'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItemTitle" id="xPathItemTitle" rows="2" cols="64" spellcheck="false"><?= $xpath['itemTitle'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_title.help') ?></p>
 				</div>
 			</div>
@@ -512,8 +500,7 @@
 				<label class="group-name" for="xPathItemContent"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item_content') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItemContent" id="xPathItemContent" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemContent'] ?? '' ?>"><?= $xpath['itemContent'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItemContent" id="xPathItemContent" rows="2" cols="64" spellcheck="false"><?= $xpath['itemContent'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_content.help') ?></p>
 				</div>
 			</div>
@@ -521,8 +508,7 @@
 				<label class="group-name" for="xPathItemUri"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item_uri') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItemUri" id="xPathItemUri" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemUri'] ?? '' ?>"><?= $xpath['itemUri'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItemUri" id="xPathItemUri" rows="2" cols="64" spellcheck="false"><?= $xpath['itemUri'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_uri.help') ?></p>
 				</div>
 			</div>
@@ -530,8 +516,7 @@
 				<label class="group-name" for="xPathItemThumbnail"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item_thumbnail') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItemThumbnail" id="xPathItemThumbnail" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemThumbnail'] ?? '' ?>"><?= $xpath['itemThumbnail'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItemThumbnail" id="xPathItemThumbnail" rows="2" cols="64" spellcheck="false"><?= $xpath['itemThumbnail'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_thumbnail.help') ?></p>
 				</div>
 			</div>
@@ -539,8 +524,7 @@
 				<label class="group-name" for="xPathItemAuthor"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item_author') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItemAuthor" id="xPathItemAuthor" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemAuthor'] ?? '' ?>"><?= $xpath['itemAuthor'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItemAuthor" id="xPathItemAuthor" rows="2" cols="64" spellcheck="false"><?= $xpath['itemAuthor'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_author.help') ?></p>
 				</div>
 			</div>
@@ -548,8 +532,7 @@
 				<label class="group-name" for="xPathItemTimestamp"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item_timestamp') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItemTimestamp" id="xPathItemTimestamp" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemTimestamp'] ?? '' ?>"><?= $xpath['itemTimestamp'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItemTimestamp" id="xPathItemTimestamp" rows="2" cols="64" spellcheck="false"><?= $xpath['itemTimestamp'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_timestamp.help') ?></p>
 				</div>
 			</div>
@@ -557,8 +540,7 @@
 				<label class="group-name" for="xPathItemTimeFormat">
 					<?= _t('sub.feed.kind.html_xpath.item_timeFormat') ?></label>
 				<div class="group-controls">
-					<textarea class="w100" name="xPathItemTimeFormat" id="xPathItemTimeFormat" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemTimeFormat'] ?? '' ?>"><?= $xpath['itemTimeFormat'] ?? '' ?></textarea>
+					<textarea class="w100" name="xPathItemTimeFormat" id="xPathItemTimeFormat" rows="2" cols="64" spellcheck="false"><?= $xpath['itemTimeFormat'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_timeFormat.help') ?></p>
 				</div>
 			</div>
@@ -566,16 +548,14 @@
 				<label class="group-name" for="xPathItemCategories"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item_categories') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItemCategories" id="xPathItemCategories" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemCategories'] ?? '' ?>"><?= $xpath['itemCategories'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItemCategories" id="xPathItemCategories" rows="2" cols="64" spellcheck="false"><?= $xpath['itemCategories'] ?? '' ?></textarea>
 				</div>
 			</div>
 			<div class="form-group">
 				<label class="group-name" for="xPathItemUid"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
 					<?= _t('sub.feed.kind.html_xpath.item_uid') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathItemUid" id="xPathItemUid" rows="2" cols="64" spellcheck="false"
-						data-leave-validation="<?= $xpath['itemUid'] ?? '' ?>"><?= $xpath['itemUid'] ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathItemUid" id="xPathItemUid" rows="2" cols="64" spellcheck="false"><?= $xpath['itemUid'] ?? '' ?></textarea>
 				</div>
 			</div>
 		</fieldset>
@@ -589,7 +569,7 @@
 			<div class="form-group" id="xPathToJsonGroup">
 				<label class="group-name" for="xPathToJson"><?= _t('sub.feed.kind.html_json.xpath') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-xpath w100" name="xPathToJson" id="xPathToJson" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $xPathToJson ?>"><?= $xPathToJson ?? '' ?></textarea>
+					<textarea class="valid-xpath w100" name="xPathToJson" id="xPathToJson" rows="2" cols="64" spellcheck="false"><?= $xPathToJson ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_json.xpath.help') ?></p>
 				</div>
 			</div>
@@ -599,7 +579,7 @@
 				<label class="group-name" for="jsonItem"><small><?= _t('sub.feed.kind.json_dotnotation.json') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItem" id="jsonItem" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['item'] ?? '' ?>"><?= $jsonSettings['item'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItem" id="jsonItem" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['item'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item.help') ?></p>
 				</div>
 			</div>
@@ -607,14 +587,14 @@
 				<label class="group-name" for="jsonItemTitle"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item_title') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItemTitle" id="jsonItemTitle" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemTitle'] ?? '' ?>"><?= $jsonSettings['itemTitle'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItemTitle" id="jsonItemTitle" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemTitle'] ?? '' ?></textarea>
 				</div>
 			</div>
 			<div class="form-group">
 				<label class="group-name" for="jsonItemContent"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item_content') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItemContent" id="jsonItemContent" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemContent'] ?? '' ?>"><?= $jsonSettings['itemContent'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItemContent" id="jsonItemContent" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemContent'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_content.help') ?></p>
 				</div>
 			</div>
@@ -622,7 +602,7 @@
 				<label class="group-name" for="jsonItemUri"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item_uri') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItemUri" id="jsonItemUri" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemUri'] ?? '' ?>"><?= $jsonSettings['itemUri'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItemUri" id="jsonItemUri" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemUri'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_uri.help') ?></p>
 				</div>
 			</div>
@@ -630,7 +610,7 @@
 				<label class="group-name" for="jsonItemThumbnail"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item_thumbnail') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItemThumbnail" id="jsonItemThumbnail" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemThumbnail'] ?? '' ?>"><?= $jsonSettings['itemThumbnail'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItemThumbnail" id="jsonItemThumbnail" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemThumbnail'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_thumbnail.help') ?></p>
 				</div>
 			</div>
@@ -638,14 +618,14 @@
 				<label class="group-name" for="jsonItemAuthor"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item_author') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItemAuthor" id="jsonItemAuthor" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemAuthor'] ?? '' ?>"><?= $jsonSettings['itemAuthor'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItemAuthor" id="jsonItemAuthor" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemAuthor'] ?? '' ?></textarea>
 				</div>
 			</div>
 			<div class="form-group">
 				<label class="group-name" for="jsonItemTimestamp"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item_timestamp') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItemTimestamp" id="jsonItemTimestamp" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemTimestamp'] ?? '' ?>"><?= $jsonSettings['itemTimestamp'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItemTimestamp" id="jsonItemTimestamp" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemTimestamp'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_timestamp.help') ?></p>
 				</div>
 			</div>
@@ -653,7 +633,7 @@
 				<label class="group-name" for="jsonItemTimeFormat">
 					<?= _t('sub.feed.kind.json_dotnotation.item_timeFormat') ?></label>
 				<div class="group-controls">
-					<textarea class="w100" name="jsonItemTimeFormat" id="jsonItemTimeFormat" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemTimeFormat'] ?? '' ?>"><?= $jsonSettings['itemTimeFormat'] ?? '' ?></textarea>
+					<textarea class="w100" name="jsonItemTimeFormat" id="jsonItemTimeFormat" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemTimeFormat'] ?? '' ?></textarea>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_timeFormat.help') ?></p>
 				</div>
 			</div>
@@ -661,14 +641,14 @@
 				<label class="group-name" for="jsonItemCategories"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item_categories') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItemCategories" id="jsonItemCategories" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemCategories'] ?? '' ?>"><?= $jsonSettings['itemCategories'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItemCategories" id="jsonItemCategories" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemCategories'] ?? '' ?></textarea>
 				</div>
 			</div>
 			<div class="form-group">
 				<label class="group-name" for="jsonItemUid"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
 					<?= _t('sub.feed.kind.json_dotnotation.item_uid') ?></label>
 				<div class="group-controls">
-					<textarea class="valid-json w100" name="jsonItemUid" id="jsonItemUid" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemUid'] ?? '' ?>"><?= $jsonSettings['itemUid'] ?? '' ?></textarea>
+					<textarea class="valid-json w100" name="jsonItemUid" id="jsonItemUid" rows="2" cols="64" spellcheck="false"><?= $jsonSettings['itemUid'] ?? '' ?></textarea>
 				</div>
 			</div>
 
@@ -686,8 +666,7 @@
 				<label class="group-name" for="path_entries"><?= _t('sub.feed.css_path') ?></label>
 				<div class="group-controls">
 					<div class="stick w100">
-						<input type="text" name="path_entries" id="path_entries" class="w100" value="<?= $this->feed->pathEntries() ?>"
-							data-leave-validation="<?= $this->feed->pathEntries() ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
+						<input type="text" name="path_entries" id="path_entries" class="w100" value="<?= $this->feed->pathEntries() ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
 						<a id="popup-preview-selector" class="btn" href="<?=
 							_url('feed', 'contentSelectorPreview', 'id', $this->feed->id(), 'selector', 'selector-token', 'selector_filter', 'selector-filter-token', '#', 'slider') ?>"><?= _i('look') ?></a>
 					</div>
@@ -720,8 +699,7 @@
 				<label class="group-name" for="path_entries_filter"><?= _t('sub.feed.css_path_filter') ?></label>
 				<div class="group-controls">
 					<div class="w100">
-						<input type="text" name="path_entries_filter" id="path_entries_filter" class="w100" value="<?= $path_entries_filter ?>"
-							data-leave-validation="<?= $path_entries_filter ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
+						<input type="text" name="path_entries_filter" id="path_entries_filter" class="w100" value="<?= $path_entries_filter ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
 					</div>
 					<p class="help"><?= _i('help') ?> <?= _t('sub.feed.css_path_filter.help') ?></p>
 				</div>

+ 1 - 0
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'),

+ 2 - 2
app/views/importExport/index.phtml

@@ -16,7 +16,7 @@
 	</div>
 
 	<h2><?= _t('sub.import_export.import') ?></h2>
-	<form method="post" action="<?= _url('importExport', 'import') ?>" enctype="multipart/form-data">
+	<form method="post" action="<?= _url('importExport', 'import') ?>" enctype="multipart/form-data" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 		<div class="form-group">
 			<label class="group-name" for="file">
@@ -36,7 +36,7 @@
 
 	<h2><?= _t('sub.import_export.export') ?></h2>
 	<?php if (count($this->feeds) > 0) { ?>
-	<form method="post" action="<?= _url('importExport', 'export') ?>">
+	<form method="post" action="<?= _url('importExport', 'export') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 		<div class="form-group">
 			<div class="group-controls">

+ 1 - 1
app/views/subscription/add.phtml

@@ -3,7 +3,7 @@
 	/** @var FreshRSS_View $this */
 	$this->partial('aside_subscription');
 ?>
-<main class="post drop-section">
+<main class="post drop-section" data-auto-leave-validation="1">
 	<h1><?= _t('sub.menu.add') ?></h1>
 	<h2><?= _t('sub.title.add_category') ?></h2>
 	<form action="<?= _url('category', 'create') ?>" method="post">

+ 1 - 1
app/views/tag/index.phtml

@@ -7,7 +7,7 @@
 	<h1><?= _t('sub.menu.label_management') ?></h1>
 
 	<h2><?= _t('sub.title.add_label') ?></h2>
-	<form id="add_tag" method="post" action="<?= _url('tag', 'add') ?>" autocomplete="off">
+	<form id="add_tag" method="post" action="<?= _url('tag', 'add') ?>" autocomplete="off" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 		<div class="form-group">
 			<label class="group-name" for="new_label_name"><?= _t('sub.tag.name') ?></label>

+ 1 - 1
app/views/tag/update.phtml

@@ -18,7 +18,7 @@
 		<a href="<?= _url('index', 'index', 'get', 't_' . $this->tag->id()) ?>"><?= _i('link') ?> <?= _t('gen.action.filter') ?></a>
 	</div>
 
-	<form method="post" action="<?= _url('tag', 'update', 'id', $this->tag->id(), '#', 'slider') ?>" autocomplete="off">
+	<form method="post" action="<?= _url('tag', 'update', 'id', $this->tag->id(), '#', 'slider') ?>" autocomplete="off" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 
 		<fieldset>

+ 1 - 1
app/views/user/details.phtml

@@ -10,7 +10,7 @@
 ?>
 <div class="post">
 	<h2><?= $this->username ?><?php if ($isAdmin) echo ' ― ', _t('admin.user.admin'); ?></h2>
-	<form method="post" action="<?= _url('user', 'manage', 'username', $this->username); ?>">
+	<form method="post" action="<?= _url('user', 'manage', 'username', $this->username); ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken(); ?>" />
 
 		<div class="form-group">

+ 1 - 1
app/views/user/manage.phtml

@@ -6,7 +6,7 @@
 <main class="post">
 	<h1><?= _t('gen.menu.user_management') ?></h1>
 	<h2><?= _t('admin.user.create') ?></h2>
-	<form method="post" action="<?= _url('user', 'create') ?>" autocomplete="off">
+	<form method="post" action="<?= _url('user', 'create') ?>" autocomplete="off" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 		<input type="hidden" name="originController" value="<?= Minz_Request::controllerName() ?>" />
 		<input type="hidden" name="originAction" value="<?= Minz_Request::actionName() ?>" />

+ 2 - 2
app/views/user/profile.phtml

@@ -7,7 +7,7 @@
 ?>
 
 <main class="post">
-	<form id="crypto-form" method="post" action="<?= _url('user', 'profile') ?>">
+	<form id="crypto-form" method="post" action="<?= _url('user', 'profile') ?>" data-auto-leave-validation="1">
 		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 		<h1><?= _t('conf.profile') ?></h1>
 
@@ -41,7 +41,7 @@
 			<label class="group-name" for="token"><?= _t('admin.auth.token') ?></label>
 			<?php $token = FreshRSS_Context::userConf()->token; ?>
 			<div class="group-controls">
-				<input type="text" id="token" name="token" value="<?= $token ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" data-leave-validation="<?= $token ?>"/>
+				<input type="text" id="token" name="token" value="<?= $token ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
 				<p class="help"><?= _i('help') ?> <?= _t('admin.auth.token_help') ?></p>
 				<kbd><?= Minz_Url::display(['a' => 'rss', 'params' => ['user' => Minz_User::name() ?? '',
 					'token' => $token, 'hours' => FreshRSS_Context::userConf()->since_hours_posts_per_rss]], 'html', true) ?></kbd>

+ 1 - 1
docs/i18n/flags/gen/fi.svg

@@ -2,6 +2,6 @@
 <svg xmlns="http://www.w3.org/2000/svg" width="70" height="20">
 	<g fill="white" font-size="12" font-family="Verdana" text-anchor="middle">
 		<rect rx="3" width="70" height="20" fill="green" />
-		<text x="34" y="14">🇫🇮 94%</text>
+		<text x="34" y="14">🇫🇮 93%</text>
 	</g>
 </svg>

+ 2 - 2
docs/i18n/flags/gen/sk.svg

@@ -1,7 +1,7 @@
 <!-- This file is automatically generated by `cli/check.translation.php -g` -->
 <svg xmlns="http://www.w3.org/2000/svg" width="70" height="20">
 	<g fill="white" font-size="12" font-family="Verdana" text-anchor="middle">
-		<rect rx="3" width="70" height="20" fill="green" />
-		<text x="34" y="14">🇸🇰 90%</text>
+		<rect rx="3" width="70" height="20" fill="gold" />
+		<text x="34" y="14">🇸🇰 89%</text>
 	</g>
 </svg>

+ 1 - 1
lib/core-extensions/UserCSS/configure.phtml

@@ -2,7 +2,7 @@
 	declare(strict_types=1);
 	/** @var UserCSSExtension $this */
 ?>
-<form action="<?= _url('extension', 'configure', 'e', urlencode($this->getName())); ?>" method="post">
+<form action="<?= _url('extension', 'configure', 'e', urlencode($this->getName())); ?>" method="post" data-auto-leave-validation="1">
 	<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 	<div class="form-group">
 		<label class="group-name" for="css-rules"><?= _t('ext.user_css.write_css') ?></label>

+ 1 - 1
lib/core-extensions/UserJS/configure.phtml

@@ -2,7 +2,7 @@
 	declare(strict_types=1);
 	/** @var UserJSExtension $this */
 ?>
-<form action="<?= _url('extension', 'configure', 'e', urlencode($this->getName())) ?>" method="post">
+<form action="<?= _url('extension', 'configure', 'e', urlencode($this->getName())) ?>" method="post" data-auto-leave-validation="1">
 	<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
 	<div class="form-group">
 		<label class="group-name" for="js-rules"><?= _t('ext.user_js.write_js') ?></label>

+ 24 - 1
p/scripts/extra.js

@@ -337,6 +337,7 @@ function open_slider_listener(ev) {
 				slider.classList.add('active');
 				slider.scrollTop = 0;
 				slider_content.innerHTML = this.response.body.innerHTML;
+				data_auto_leave_validation(slider);
 				init_update_feed();
 				slider_content.querySelectorAll('form').forEach(function (f) {
 					f.insertAdjacentHTML('afterbegin', '<input type="hidden" name="slider" value="1" />');
@@ -363,7 +364,7 @@ function init_slider(slider) {
 
 function close_slider_listener(ev) {
 	const slider = document.getElementById('slider');
-	if (data_leave_validation(slider) || confirm(context.i18n.confirmation_default)) {
+	if (data_leave_validation(slider) || confirm(context.i18n.confirm_exit_slider)) {
 		slider.querySelectorAll('form').forEach(function (f) { f.reset(); });
 		document.documentElement.classList.remove('slider-active');
 		return;
@@ -437,6 +438,26 @@ function data_leave_validation(parent, excludeForm = null) {
 	return true;
 }
 
+/**
+ * Automatically sets the `data-leave-validation` attribute for input, textarea, select elements for a given parent, if it's not set already.
+ * Ignores elements with the `data-no-leave-validation` attribute set.
+ */
+function data_auto_leave_validation(parent) {
+	parent.querySelectorAll(`[data-auto-leave-validation] input,
+													[data-auto-leave-validation] textarea,
+													[data-auto-leave-validation] select`).forEach(el => {
+		if (el.dataset.leaveValidation || el.dataset.noLeaveValidation) {
+			return;
+		}
+
+		if (el.type === 'checkbox' || el.type === 'radio') {
+			el.dataset.leaveValidation = +el.checked;
+		} else if (el.type !== 'hidden') {
+			el.dataset.leaveValidation = el.value;
+		}
+	});
+}
+
 function init_2stateButton() {
 	const btns = document.getElementsByClassName('btn-state1');
 	Array.prototype.forEach.call(btns, function (el) {
@@ -478,6 +499,8 @@ function init_extra_afterDOM() {
 		init_2stateButton();
 		init_update_feed();
 
+		data_auto_leave_validation(document.body);
+
 		const slider = document.getElementById('slider');
 		if (slider) {
 			slider.addEventListener('freshrss:slider-load', function (e) {