Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick copy button for preview links #541

Open
ElizabethPace opened this issue Apr 25, 2024 · 6 comments
Open

Quick copy button for preview links #541

ElizabethPace opened this issue Apr 25, 2024 · 6 comments

Comments

@ElizabethPace
Copy link

ElizabethPace commented Apr 25, 2024

Hi.

Is it possible to have a quick copy button for preview links? Would save having to click and highlight the link and Ctrl C.

Something similar to YouTube or the 2 squares copy icon?

Thanks.

PreviewCopy

@andybroomfield
Copy link

Could be worth looking at Clipboard js module and seeing if that template is modifiable.

Right clicking the link should get you the option to copy the link for now.

@markconroy
Copy link
Member

Hi @ElizabethPace.

Thanks for posting this issue, I think it's a great idea.

I'm going to create a patch for this for the main Drupal module rather than just LocalGov Drupal, so all users of the Preview Link module can benefit from it.

If it's accepted there, great. If not, I'll do a local version of it just for LGD.

Here's 2 screenshots of what I have worked out so far:

Screenshot 2024-05-22 at 14 54 30

Screenshot 2024-05-22 at 14 54 38

===
Thanks to Big Blue Door for sponsoring my time to work on this.

@ElizabethPace
Copy link
Author

Hi Mark

This looks great. Thank you.

On the 'Preview link copied to clipboard' message, is it possible that the message is just shown for 5 seconds and then disappears (like on YouTube) so the user doesn't have to click 'OK'?

@markconroy
Copy link
Member

Here's the PR for this on Drupal.org - https://www.drupal.org/project/preview_link/issues/3449121

I've changed the working of it a little now, so when you click on "Copy link to clipboard", the text changes to "Copied!" for 2 seconds, then back to the default text.

Screenshot 2024-05-22 at 17 01 21

===
Thanks to Big Blue Door for sponsoring my time to work on this.

@willguv
Copy link
Member

willguv commented May 22, 2024

Love this idea, thanks both!

@ElizabethPace
Copy link
Author

Brilliant! Thanks a lot @markconroy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants