From 018a5682647a47712c6512cc5fbe495aa9211a2a Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 26 Nov 2021 11:39:10 +0100 Subject: [PATCH] Enhance the "contact by email" section (again) --- src/cljs/codegouvfr/core.cljs | 14 +------------- src/cljs/codegouvfr/i18n.cljs | 6 ++---- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/cljs/codegouvfr/core.cljs b/src/cljs/codegouvfr/core.cljs index 93a9a39..c2a7a8d 100644 --- a/src/cljs/codegouvfr/core.cljs +++ b/src/cljs/codegouvfr/core.cljs @@ -167,15 +167,6 @@ :href (str "#/repos?" param "=" k)} k] v}))) top)))) -;; https://gist.github.com/rotaliator/73daca2dc93c586122a0da57189ece13 -(defn copy-to-clipboard [val] - (let [el (js/document.createElement "textarea")] - (set! (.-value el) val) - (.appendChild js/document.body el) - (.select el) - (js/document.execCommand "copy") - (.removeChild js/document.body el))) - ;; Filters (defn apply-repos-filters [m] @@ -1195,10 +1186,7 @@ [:div.fr-follow__special [:div [:h1.fr-h5.fr-follow__title (i/i lang [:contact])] - [:p.fr-text--sm.fr-follow__desc (to-hiccup (i/i lang [:contact-title]))] - [:a {:on-click #(do (.stopPropagation %) - (copy-to-clipboard "logiciels-libres@data.gouv.fr"))} - [:button.fr-btn {:type "button"} "logiciels-libres@data.gouv.fr"]]]]] + [:p.fr-text--sm.fr-follow__desc (to-hiccup (i/i lang [:contact-title]))]]]] ;; Subscribe to he newsletter [:div.fr-col-12.fr-col-md-5 [:div.fr-follow__newsletter diff --git a/src/cljs/codegouvfr/i18n.cljs b/src/cljs/codegouvfr/i18n.cljs index 10ac86b..f6a3fab 100644 --- a/src/cljs/codegouvfr/i18n.cljs +++ b/src/cljs/codegouvfr/i18n.cljs @@ -29,8 +29,7 @@ :browse-repos-orga "Voir la liste des dépôts de cette organisation ou de ce groupe" :close "Fermer" :contact "Contact" - :contact-title "[Écrivez-nous en suivant ce lien](mailto:logiciel-libres@data.gouv.fr) ou copiez notre adresse dans le presse-papier en cliquant sur le bouton ci-dessous." - :copy-to-clipboard "Copier notre adresse de courriel dans le presse-papier" + :contact-title "Vous pouvez nous contacter en utilisant l'adresse électronique :
[logiciel-libres@data.gouv.fr](mailto:logiciel-libres@data.gouv.fr \"Suivez ce lien pour nous envoyer un courriel\")" :created-at "Création" :dep " dépendance" :deps " dépendances" @@ -151,8 +150,7 @@ :browse-repos-orga "See the list of repositories from this organization or group" :close "Close" :contact "Contact" - :contact-title "[Send us an email by following this link](mailto:logiciel-libres@data.gouv.fr) or copy our email to your clipboard by clicking on the button below." - :copy-to-clipboard "Copy our email address to the clipboard" + :contact-title "You can reach us by email:
[logiciel-libres@data.gouv.fr](mailto:logiciel-libres@data.gouv.fr \"Follow this link to send us an email\")" :created-at "Created" :dep " dependency" :deps " dependencies" -- 2.34.2