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

featurerequest: button for copy unicode char to clipboard #182

Closed
s-light opened this issue Dec 21, 2023 · 5 comments · Fixed by #185
Closed

featurerequest: button for copy unicode char to clipboard #182

s-light opened this issue Dec 21, 2023 · 5 comments · Fixed by #185

Comments

@s-light
Copy link
Contributor

s-light commented Dec 21, 2023

currently there is no way - at least i found - to easily copy the shown unicode character to the clipboard to use it in another tool...

so my featurerequest is to change the current link to the same detailed page to a js-click action to copy the code to clipboard.
this would need some sort of user feedback - so they now what happened..

this is currently handleld in src/components/library/EmojiDetail/EmojiDetail.astro Line 95

{generalUtil.getEmojiCombinationLink(openmoji.hexcode)}

that resolves to
src/util/generalUtil.js

const getEmojiCombinationLink = (hexcodeString) => {
  return hexcodeString.split("-").map(function(hex) {
      if (hex === "200D") return '<a href="https://emojipedia.org/zero-width-joiner/" target="_blank" rel="noreferrer noopener" class="redlink">ZWJ</a>';
      if (hex === "FE0F") return '<a href="https://emojipedia.org/variation-selector-16/" target="_blank" rel="noreferrer noopener" class="redlink">VS16</a>';
      return '<a href="/library/emoji-'+ hex +'" target="_blank" rel="noreferrer noopener" class="redlink">'+ String.fromCodePoint(parseInt(hex, 16)) +'</a>';
  }).join(" • ");
}

maybe just a copy button is easier?

open to ideas!
and willing to create a pr if we know how to integrate it.

@s-light
Copy link
Contributor Author

s-light commented Dec 21, 2023

related last change was in #114

@b-g
Copy link
Member

b-g commented Dec 21, 2023

Hi @s-light, many thanks for the interest! Good call, this would be a nice feature. Happy to get a PR on this. Maybe a small button with something like https://openmoji.org/library/emoji-E25B/ ? Basically similar like copy to clipboard button in github? But where to put in the layout? Marked a few potential spots in the screenshot ... what do you think?

2023-12-21 at 12 29

@s-light
Copy link
Contributor Author

s-light commented Dec 22, 2023

thanks for your suggestions!

that brings some other ideas to my mind..
it could be helpfull to also just copy the svg and png OpenMojis picture to the clipboard..
of course that opens up a bunch of other UI how to do it questions..

i think for the unicode char would be a logical position the symbol itself -
or a as you mentioned a dedicated graphical button.
for the button i think it makes sens in the same row as the symbol -
if the button is at the end of the hex representation i would intuitively think that copies this hex code...
the button in the last row would mean for me copy the OpenMojis image

for a first call i will create a button and then just pack it at end of the symbol line..
with this done we can have a look / think on if that is logical fine and good enough for now ;-)

so i will do a pr..

@s-light
Copy link
Contributor Author

s-light commented Dec 23, 2023

i just added buttons at different points..
the image copy buttons are not working yet..
(was just an experiment)

@s-light
Copy link
Contributor Author

s-light commented Dec 23, 2023

image

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

Successfully merging a pull request may close this issue.

2 participants