From d1cb0fdcb5226643f60a796b783ca0dfbad7f735 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 9 Jul 2024 20:10:04 +0100 Subject: [PATCH] Modal Changes to export and link shortener --- src/app/components/ModalPermalink.jsx | 20 ++++++- src/app/components/ModalShoppingList.jsx | 55 +++++++++-------- src/app/i18n/en.json | 7 ++- src/app/stores/Persist.js | 4 +- src/less/modal.less | 76 +++++++++++++++++------- 5 files changed, 108 insertions(+), 54 deletions(-) diff --git a/src/app/components/ModalPermalink.jsx b/src/app/components/ModalPermalink.jsx index 96d611e6..975e97bc 100644 --- a/src/app/components/ModalPermalink.jsx +++ b/src/app/components/ModalPermalink.jsx @@ -34,6 +34,18 @@ export default class ModalPermalink extends TranslatedComponent { ); } + /** + * Copy the shortened URL to the clipboard + * @param {Event} e Click event + * @return {void} + */ + copyShortLink() { + let copyText = document.getElementById("shortenedUrl"); + // Copy the text inside the shortendUrl input to the clipboard + copyText.select(); + document.execCommand("copy"); + } + /** * Render the modal * @return {React.Component} Modal Content @@ -42,15 +54,17 @@ export default class ModalPermalink extends TranslatedComponent { let translate = this.context.language.translate; return
e.stopPropagation() }> -

{translate('permalink')}

+

{translate('permalink')}


{translate('URL')}

e.target.select() }/>

{translate('shortened')}

- e.target.select() }/> + e.target.select() }/>

-

s.orbis.zone is the new URL shortener domain, old eddp.co urls are considered end of life and could go down at any moment. Sorry for any inconvenience.

+
+

s.orbis.zone is the URL shortener domain. These links should persist indefinitely going forward. If for some reason there is a problem with the link shortening process, please report it in the EDCD Discord Server.

+
; } diff --git a/src/app/components/ModalShoppingList.jsx b/src/app/components/ModalShoppingList.jsx index b1f21e15..5b96b29b 100644 --- a/src/app/components/ModalShoppingList.jsx +++ b/src/app/components/ModalShoppingList.jsx @@ -355,41 +355,46 @@ export default class ModalShoppingList extends TranslatedComponent { this.sendToEDEng = this.sendToEDEng.bind(this); this.sendToEDOMH = this.sendToEDOMH.bind(this); return
e.stopPropagation() }> -

{translate('PHRASE_SHOPPING_MATS')}

-

{translate('PHRASE_DIFFERENT_ROLLS')}

- {/* - -
- - -
- - -
- - -
- - */} +

{translate('PHRASE_SHOPPING_MATS')}

-