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

Add "Copy URL" button #41

Closed
ToogleLiu opened this issue Jan 12, 2023 · 14 comments · Fixed by #44
Closed

Add "Copy URL" button #41

ToogleLiu opened this issue Jan 12, 2023 · 14 comments · Fixed by #44
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers new button Issues that request or PRs that add new social buttons

Comments

@ToogleLiu
Copy link

No description provided.

@ToogleLiu
Copy link
Author

Thank you for developing this project, it helped me a lot.
Have you considered adding the function of copying link?

@ToogleLiu ToogleLiu changed the title he function of copying the link The function of copying the link Jan 12, 2023
@ToogleLiu ToogleLiu changed the title The function of copying the link The function of copying link Jan 12, 2023
@kytta
Copy link
Owner

kytta commented Jan 12, 2023

Thank you for developing this project, it helped me a lot.

Thank you for your kind words!

Have you considered adding the function of copying link?

I actually didn't! I considered something similar, that being the Share API that would open the share sheet on mobile devices. This sheet offers the "Copy link" functionality, but it isn't very present on the desktop yet. "Copy URL" would be an excellent addition!

@kytta kytta added new button Issues that request or PRs that add new social buttons enhancement New feature or request good first issue Good for newcomers labels Jan 12, 2023
@kytta kytta changed the title The function of copying link Add "Copy URL" button Jan 12, 2023
@c00kie123
Copy link

Can you share more info about the Copy URL button? Where do you want it?

@kytta
Copy link
Owner

kytta commented Jan 12, 2023

Can you share more info about the Copy URL button? Where do you want it?

Well, I'd want to have a button, similar to how there already are buttons for social networks. It should have a neutral background (dark grey, I guess), a generic "link" icon (for example: Bootstrap Icons "link-45deg" icon), and by clicking it, the page url (location.href) should be copied to the clipboard

@ToogleLiu
Copy link
Author

Can you share more info about the Copy URL button? Where do you want it?

Well, I'd want to have a button, similar to how there already are buttons for social networks. It should have a neutral background (dark grey, I guess), a generic "link" icon (for example: Bootstrap Icons "link-45deg" icon), and by clicking it, the page url (location.href) should be copied to the clipboard

Yes, what you describe is exactly what I want.

@c00kie123
Copy link

c00kie123 commented Jan 17, 2023

So you want to add new button, next to the social networks button? This button will copies the current page url location.href to the clipboard?

@ToogleLiu
Copy link
Author

So you want to add new button, next to the social networks button? This button will copies the current page url location.href to the clipboard?

Yes. Like this:

image

Just like the one on the https://medium.com/ website.

@c00kie123
Copy link

Thanks for sharing! I have been looking through the code and it has been quite confusing for me. Can you share the files where I have to edit to add in this copy link button? Is it in index.html?

@ToogleLiu
Copy link
Author

Thanks for sharing! I have been looking through the code and it has been quite confusing for me. Can you share the files where I have to edit to add in this copy link button? Is it in index.html?

Are you planning to add the Copy URL button in this open source project? Your question may require the author of this open source project to answer.

@kytta
Copy link
Owner

kytta commented Jan 17, 2023

I think that explaining the code will take me more time than actually implementing the feature. I'll take a look at it today :)

@kytta kytta self-assigned this Jan 17, 2023
@kytta
Copy link
Owner

kytta commented Jan 17, 2023

To-do list for this issue:

  • edit shareon.js — adding to the URL map won't work since it's not a URL
  • edit shareon.css — add new style and icon. Colour should be something like #222222, see above for the icon
  • edit index.html — it's a testing page that doesn't get published anywhere, but I need it to test my buttons manually
  • check that everything works
    • on mobile
    • on desktop
  • release as minor

kytta added a commit that referenced this issue Jan 23, 2023
kytta added a commit that referenced this issue Mar 20, 2023
kytta added a commit that referenced this issue Mar 20, 2023
kytta added a commit that referenced this issue Mar 20, 2023
@kytta kytta closed this as completed in #44 Mar 20, 2023
@kytta
Copy link
Owner

kytta commented Mar 20, 2023

Will release this shortly!

@kytta
Copy link
Owner

kytta commented Mar 20, 2023

🚀 Released in v2.1.0! See it in action: https://shareon.js.org/

@ToogleLiu
Copy link
Author

Great! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers new button Issues that request or PRs that add new social buttons
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants