From bcb1e3750a9eee51070d602cc77def06f7f071c9 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 13:56:40 +0200 Subject: More explicit message when deleting feeds or cats Introduce "data-str-confirm" to override default message for confirm actions. Fix https://github.com/marienfressinaud/FreshRSS/issues/625 --- app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/views/configure/categorize.phtml | 5 ++++- app/views/configure/feed.phtml | 7 +++++-- app/views/helpers/javascript_vars.phtml | 2 +- p/scripts/main.js | 5 +++++ 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/i18n/en.php b/app/i18n/en.php index e5def46be..1ceb7b1fa 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -368,6 +368,7 @@ return array ( 'login_required' => 'Login required:', '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 may lost related favorites and user queries. It cannot be cancelled!', 'notif_title_new_articles' => 'FreshRSS: new articles!', 'notif_body_new_articles' => 'There are \d new articles to read on FreshRSS.', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 4d39f7eb4..b0fbf15ae 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -368,6 +368,7 @@ return array ( 'login_required' => 'Accès protégé par mot de passe :', '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 pourriez perdre les favoris et les filtres associés. Cette action ne peut être annulée !', 'notif_title_new_articles' => 'FreshRSS : nouveaux articles !', 'notif_body_new_articles' => 'Il y a \d nouveaux articles à lire sur FreshRSS.', diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml index 2f0e554ca..23d1c9fa1 100644 --- a/app/views/configure/categorize.phtml +++ b/app/views/configure/categorize.phtml @@ -21,7 +21,10 @@ - + (nbFeed ()); ?>) diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index 0959652c2..e96a28739 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -79,8 +79,11 @@
- - + +
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index bf0ffdb76..1139eb446 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -51,7 +51,7 @@ echo 'authType="', $authType, '",', 'url_login="', _url ('index', 'login'), '",', 'url_logout="', _url ('index', 'logout'), '",'; -echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; +echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n"; echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n"; echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n"; echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n"; diff --git a/p/scripts/main.js b/p/scripts/main.js index 2503116ee..f6d5d2907 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1109,6 +1109,11 @@ function init_persona() { function init_confirm_action() { $('body').on('click', '.confirm', function () { + var str_confirmation = $(this).attr('data-str-confirm'); + if (!str_confirmation) { + str_confirmation = str_confirmation_default; + } + return confirm(str_confirmation); }); } -- cgit v1.2.3