]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fix confirm popup before bookmark deletion 1625/head
authorArthurHoaro <arthur@hoa.ro>
Thu, 5 Nov 2020 15:32:15 +0000 (16:32 +0100)
committerArthurHoaro <arthur@hoa.ro>
Thu, 5 Nov 2020 15:49:00 +0000 (16:49 +0100)
Regression introduced by #1596

Fixes #1623

assets/default/js/base.js
inc/languages/fr/LC_MESSAGES/shaarli.po
tpl/default/changetag.html
tpl/default/page.footer.html

index 4163577d0da527d3d1d7b91c3c1eb830bfda4cea..66badfb265eeacbe3acfcadf292b63701506a407 100644 (file)
@@ -294,7 +294,8 @@ function init(description) {
   const deleteLinks = document.querySelectorAll('.confirm-delete');
   [...deleteLinks].forEach((deleteLink) => {
     deleteLink.addEventListener('click', (event) => {
   const deleteLinks = document.querySelectorAll('.confirm-delete');
   [...deleteLinks].forEach((deleteLink) => {
     deleteLink.addEventListener('click', (event) => {
-      if (!confirm(document.getElementById('translation-delete-tag').innerHTML)) {
+      const type = event.currentTarget.getAttribute('data-type') || 'link';
+      if (!confirm(document.getElementById(`translation-delete-${type}`).innerHTML)) {
         event.preventDefault();
       }
     });
         event.preventDefault();
       }
     });
index d5b012275ec65b61a907dc50ccc24cf46cc42329..4c363fa8669a5f46f6317de81de6a41cb2170d12 100644 (file)
@@ -1,8 +1,8 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: Shaarli\n"
 msgid ""
 msgstr ""
 "Project-Id-Version: Shaarli\n"
-"POT-Creation-Date: 2020-11-03 11:51+0100\n"
-"PO-Revision-Date: 2020-11-03 11:55+0100\n"
+"POT-Creation-Date: 2020-11-05 16:47+0100\n"
+"PO-Revision-Date: 2020-11-05 16:48+0100\n"
 "Last-Translator: \n"
 "Language-Team: Shaarli\n"
 "Language: fr_FR\n"
 "Last-Translator: \n"
 "Language-Team: Shaarli\n"
 "Language: fr_FR\n"
@@ -189,9 +189,9 @@ msgstr ""
 #: application/bookmark/BookmarkInitializer.php:91
 #: application/legacy/LegacyLinkDB.php:246
 #: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
 #: application/bookmark/BookmarkInitializer.php:91
 #: application/legacy/LegacyLinkDB.php:246
 #: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:49
+#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:50
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:15
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:15
-#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:49
+#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:50
 msgid ""
 "The personal, minimalist, super-fast, database free, bookmarking service"
 msgstr ""
 msgid ""
 "The personal, minimalist, super-fast, database free, bookmarking service"
 msgstr ""
@@ -1017,11 +1017,11 @@ msgstr "Renommer le tag"
 msgid "Delete tag"
 msgstr "Supprimer le tag"
 
 msgid "Delete tag"
 msgstr "Supprimer le tag"
 
-#: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:39
+#: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:40
 msgid "You can also edit tags in the"
 msgstr "Vous pouvez aussi modifier les tags dans la"
 
 msgid "You can also edit tags in the"
 msgstr "Vous pouvez aussi modifier les tags dans la"
 
-#: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:39
+#: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:40
 msgid "tag list"
 msgstr "liste des tags"
 
 msgid "tag list"
 msgstr "liste des tags"
 
@@ -1502,9 +1502,9 @@ msgid "Remember me"
 msgstr "Rester connecté"
 
 #: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
 msgstr "Rester connecté"
 
 #: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:49
+#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:50
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:15
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:15
-#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:49
+#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:50
 msgid "by the Shaarli community"
 msgstr "par la communauté Shaarli"
 
 msgid "by the Shaarli community"
 msgstr "par la communauté Shaarli"
 
@@ -1525,6 +1525,11 @@ msgstr "Déplier tout"
 
 #: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:47
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:47
 
 #: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:47
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:47
+msgid "Are you sure you want to delete this link?"
+msgstr "Êtes-vous sûr de vouloir supprimer ce lien ?"
+
+#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
+#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:48
 msgid "Are you sure you want to delete this tag?"
 msgstr "Êtes-vous sûr de vouloir supprimer ce tag ?"
 
 msgid "Are you sure you want to delete this tag?"
 msgstr "Êtes-vous sûr de vouloir supprimer ce tag ?"
 
index 89d08e2cab7e16c9a2658a17b6093e72476d896c..a5fbd31e4952ff723900b837dd81d0c2978c8020 100644 (file)
@@ -28,7 +28,8 @@
       <input type="hidden" name="token" value="{$token}">
       <div>
         <input type="submit" value="{'Rename tag'|t}" name="renametag">
       <input type="hidden" name="token" value="{$token}">
       <div>
         <input type="submit" value="{'Rename tag'|t}" name="renametag">
-        <input type="submit" value="{'Delete tag'|t}" name="deletetag" class="button button-red confirm-delete">
+        <input type="submit" value="{'Delete tag'|t}" name="deletetag"
+               class="button button-red confirm-delete" data-type="tag">
       </div>
     </form>
 
       </div>
     </form>
 
index c153def0450419477dccc8c56cf19c3f146f35e8..964ffff110b210f12a77fe588ddddd05b4bf5588 100644 (file)
        <script src="{$root_path}/{$value}#"></script>
 {/loop}
 
        <script src="{$root_path}/{$value}#"></script>
 {/loop}
 
-<div id="js-translations" class="hidden">
+<div id="js-translations" class="hidden" aria-hidden="true">
   <span id="translation-fold">{'Fold'|t}</span>
   <span id="translation-fold-all">{'Fold all'|t}</span>
   <span id="translation-expand">{'Expand'|t}</span>
   <span id="translation-expand-all">{'Expand all'|t}</span>
   <span id="translation-fold">{'Fold'|t}</span>
   <span id="translation-fold-all">{'Fold all'|t}</span>
   <span id="translation-expand">{'Expand'|t}</span>
   <span id="translation-expand-all">{'Expand all'|t}</span>
-  <span id="translation-delete-link">{'Are you sure you want to delete this tag?'|t}</span>
+  <span id="translation-delete-link">{'Are you sure you want to delete this link?'|t}</span>
+  <span id="translation-delete-tag">{'Are you sure you want to delete this tag?'|t}</span>
   <span id="translation-shaarli-desc">
     {'The personal, minimalist, super-fast, database free, bookmarking service'|t} {'by the Shaarli community'|t}
   </span>
   <span id="translation-shaarli-desc">
     {'The personal, minimalist, super-fast, database free, bookmarking service'|t} {'by the Shaarli community'|t}
   </span>