From 1d0caa58fedde154e2008440ebdda8f8e3436030 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 24 Apr 2023 02:05:05 +0200 Subject: [PATCH] send more warning to user --- js/backend.js | 7 ++++++- locales/fr/main.lang.php | 1 + locales/fr/main.po | 26 +++++++++++++++----------- src/Manage.php | 3 ++- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/js/backend.js b/js/backend.js index 744a0cc..48983ca 100644 --- a/js/backend.js +++ b/js/backend.js @@ -1,8 +1,13 @@ /*global $, dotclear */ 'use strict'; -$(function () { +Object.assign(dotclear.msg, dotclear.getData('dcAdvancedCleaner')); + +$(() => { $('#parts_menu input[type=submit]').hide(); $('#parts_menu #select_part').on('change', function () {this.form.submit();}); dotclear.condSubmit('#form-funcs td input[type=checkbox]', '#form-funcs #do-action'); + $('#form-funcs').on('submit', function () { + return window.confirm(dotclear.msg.confirm_delete); + }); }); \ No newline at end of file diff --git a/locales/fr/main.lang.php b/locales/fr/main.lang.php index 8259570..e9e04a1 100644 --- a/locales/fr/main.lang.php +++ b/locales/fr/main.lang.php @@ -17,6 +17,7 @@ L10n::$locales['There are %s entries'] L10n::$locales['Objects'] = 'Objets'; L10n::$locales['Values from official distribution'] = 'Valeurs de la distribution officielle'; L10n::$locales['Action on selected rows:'] = 'Action sur les lignes sélectionnées :'; +L10n::$locales['I understand and I am want to delete this'] = 'J\'ai compris et je veux effacer ceci'; L10n::$locales['Beware: All actions done here are irreversible and are directly applied'] = 'Attention : toutes les actions menées ici sont irréversibles et sont directement appliquées'; L10n::$locales['Show Dotclear default properties'] = 'Afficher les propriétés de Dotclear'; L10n::$locales['Hide Dotclear default properties'] = 'Cacher les propriétés de Dotclear'; diff --git a/locales/fr/main.po b/locales/fr/main.po index faa584e..1d46a89 100644 --- a/locales/fr/main.po +++ b/locales/fr/main.po @@ -1,15 +1,15 @@ # Language: Français # Module: dcAdvancedCleaner - 0.2 -# Date: 2023-04-20 14:01:57 +# Date: 2023-04-24 00:01:59 # Author: , contact@jcdenis.fr -# Translated with translater 2023.03.19 +# Translated with translater 2023.04.23 msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: dcAdvancedCleaner 0.2\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-04-20T14:01:57+00:00\n" +"PO-Revision-Date: 2023-04-24T00:01:59+00:00\n" "Last-Translator: Jean-Christian Denis\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -20,35 +20,39 @@ msgstr "" msgid "Action successfuly excecuted" msgstr "Action exécutée avec succès" -#: src/Manage.php:120 +#: src/Manage.php:121 msgid "There is nothing to display" msgstr "Il n'y a rien à afficher" -#: src/Manage.php:155 +#: src/Manage.php:156 msgid "There are %s entries" msgstr "Il y a %s entrées" -#: src/Manage.php:156 +#: src/Manage.php:157 msgid "Objects" msgstr "Objets" -#: src/Manage.php:176 +#: src/Manage.php:177 msgid "Values from official distribution" msgstr "Valeurs de la distribution officielle" -#: src/Manage.php:185 +#: src/Manage.php:186 msgid "Action on selected rows:" msgstr "Action sur les lignes sélectionnées :" -#: src/Manage.php:193 +#: src/Manage.php:188 +msgid "I understand and I am want to delete this" +msgstr "J'ai compris et je veux effacer ceci" + +#: src/Manage.php:194 msgid "Beware: All actions done here are irreversible and are directly applied" msgstr "Attention : toutes les actions menées ici sont irréversibles et sont directement appliquées" -#: src/Manage.php:201 +#: src/Manage.php:202 msgid "Show Dotclear default properties" msgstr "Afficher les propriétés de Dotclear" -#: src/Manage.php:201 +#: src/Manage.php:202 msgid "Hide Dotclear default properties" msgstr "Cacher les propriétés de Dotclear" diff --git a/src/Manage.php b/src/Manage.php index 293fcd7..14eae84 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -102,6 +102,7 @@ class Manage extends dcNsProcess dcPage::openModule( My::name(), + dcPage::jsJson('dcAdvancedCleaner', ['confirm_delete' => __('Are you sure you perform these ations?')]) . dcPage::cssModuleLoad(My::id() . '/css/backend.css') . dcPage::jsModuleLoad(My::id() . '/js/backend.js') ); @@ -184,7 +185,7 @@ class Manage extends dcNsProcess (new Para())->items([ (new Label(__('Action on selected rows:'), Label::OUTSIDE_LABEL_BEFORE))->for('select_action'), (new Select(['action', 'select_action']))->items($combo_actions), - (new Submit('do-action'))->value(__('ok')), + (new Submit('do-action'))->class('delete')->value(__('I understand and I am want to delete this')), (new Hidden(['p'], My::id())), (new Hidden(['part'], $vars->cleaner->id)), dcCore::app()->formNonce(false),