From 32fca7c4e11a57d23df08f17363b28f8b552d34c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 12 Jul 2014 09:00:26 -0400 Subject: Add a confirmation when using shortcuts Before, it was possible to mark everything as read with no confirmation using shortcut even if the configuration introduced in a previous commit asked for a confirmation. Now, depending of the configuration, a confirm dialog box is displayed when requested in the configuration. --- p/scripts/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index 243159ca5..9fdc67047 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -499,7 +499,13 @@ function init_shortcuts() { shortcut.add("shift+" + shortcuts.mark_read, function () { // on marque tout comme lu var url = $(".nav_menu a.read_all").attr("href"); - redirect(url, false); + if ($(".nav_menu a.read_all").hasClass('confirm')) { + if (confirm(str_confirmation)) { + redirect(url, false); + } + } else { + redirect(url, false); + } }, { 'disable_in_input': true }); -- cgit v1.2.3