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

Is there an option to display shortnames in the emojioneArea? #137

Closed
blkc opened this issue May 30, 2017 · 15 comments
Closed

Is there an option to display shortnames in the emojioneArea? #137

blkc opened this issue May 30, 2017 · 15 comments

Comments

@blkc
Copy link

blkc commented May 30, 2017

As starter, thanks for the library! As above in the title, how can I display 😄 as :smile: inside the emojioneArea instead of it being an image?

@mervick
Copy link
Owner

mervick commented May 30, 2017

use option
shortnames: true

@blkc
Copy link
Author

blkc commented May 30, 2017

Sorry, just a bit of clarification, but isn't that option just change it from unicode to shortname but both options still show the 😄 inside the contenteditable div such as your fiddle https://jsfiddle.net/1v03Lqnu/71/ ? I want it to actually write :smile: inside the contenteditable div after selecting the emoji because I want to get the caret position for something else.

@mervick
Copy link
Owner

mervick commented May 30, 2017

when you write in https://jsfiddle.net/1v03Lqnu/71/ it will open dropdown menu with emojis in where you can select whatever you want

@mervick
Copy link
Owner

mervick commented May 30, 2017

Sorry, i don't get you.

As starter, thanks for the library! As above in the title, how can I display 😄 as 😄 inside the emojioneArea instead of it being an image?

You can't do it now

@mervick
Copy link
Owner

mervick commented May 30, 2017

But for what you need it?

@blkc
Copy link
Author

blkc commented May 30, 2017

screenshot from 2017-05-30 16-13-23 so after selecting the emoji from the dropdown, I can't let the text leave as is?

@mervick
Copy link
Owner

mervick commented May 30, 2017

not, you can't do it without changing the code of plugin

@blkc
Copy link
Author

blkc commented May 30, 2017

Can you point me to around where I need to change it?

@mervick
Copy link
Owner

mervick commented May 30, 2017

if you need it just for saving, you can use option saveEmojisAs: 'shortname', so it will be replaced to shortname in source

@blkc
Copy link
Author

blkc commented May 30, 2017

I need to pop another dropdown containing some username for mentioning with @ and replace at the right location. Calculating caret position in contentEditable div with image tags is not as easy as I thought.

@mervick
Copy link
Owner

mervick commented May 30, 2017

I am understanding you, but if you replace smileys with text it still be not some simple.
Emojionearea already use dropdown plugin, you can add some code to add your functionality

@blkc
Copy link
Author

blkc commented May 30, 2017

ok I see thanks for your suggestion.

@blkc blkc closed this as completed May 30, 2017
@mervick
Copy link
Owner

mervick commented May 30, 2017

there is a working example: https://jsfiddle.net/1v03Lqnu/426/
with changed lines (1046-1070), also remove code after line 1347

@blkc
Copy link
Author

blkc commented May 30, 2017

Oh perfect! Thanks a lot!

@mervick
Copy link
Owner

mervick commented Feb 3, 2018

Better solution here #233 (comment)

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

2 participants