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 an option for inserting smiley markup #323

Closed
AttitudeMonger opened this issue Jul 10, 2016 · 20 comments
Closed

Add an option for inserting smiley markup #323

AttitudeMonger opened this issue Jul 10, 2016 · 20 comments
Labels
need contributor plugin Non-core related things

Comments

@AttitudeMonger
Copy link

I want to give an additional button for inserting smileys. When user clicks the button, a popup is shown nearby displaying some 30 smiley icons, clicking any of which inserts that into the caret position.

How do I add this button and the functionality here?

@Alex-D
Copy link
Owner

Alex-D commented Jul 11, 2016

Idk. Maybe on the color plugin base, changing colors squares by smileys and by calling insertImage with the smiley URL.

@Alex-D Alex-D added plugin Non-core related things need contributor labels Jul 11, 2016
@Alex-D Alex-D removed the question label Jul 19, 2016
@graphek
Copy link

graphek commented Aug 2, 2016

any progress on this? i'm interested as well!

@AttitudeMonger
Copy link
Author

Not sure right now. I am planning to do it like Facebook, let the users use markup like :) or :( in the text, then at the time of getting the HTML and pasting ti back, parse through such markups, convert them to respective inline images and render alongwith the rest of the content.

@graphek
Copy link

graphek commented Aug 2, 2016

Sounds good! I'm currently looking in a implemenation with at.js

@ghost
Copy link

ghost commented Aug 3, 2016

Hi,
I do this (based on colors plugin + emojify.js), but i dont know if i can do a pull-request because it depends on emojifyjs :

screenflow

@graphek
Copy link

graphek commented Aug 3, 2016

@NicolasPion
wow, thats an awesome implementation! It would be really great, if you could share the code somehow :) I think that would be a great enhancement for the trumbowyg editor, emojis is the only thing i missed on the editor.

this is how it works wit my At.js implementation right now, but i like yours better:

jcx0q1lnca

best regards

@ghost
Copy link

ghost commented Aug 3, 2016

@graphek, thanks !
PR & files : #354
;-)

@Alex-D
Copy link
Owner

Alex-D commented Aug 3, 2016

You can PR them in two plugins :)

@muyiwaoyeniyi
Copy link

@NicolasPion There is an issue with the scroll bar in the emoji dropdown.

Testing in:
Chrome 54.0.2840 and Latest Firefox
Ubuntu 16.04

Using version 2.3.0 but I replicated this issue in 2.4.2

You can't click on the emoji scroll bar. When you do so, the emoji dropdown goes away. I believe this is happening because the dropdown as a whole has a close on click event attached to it. But that affects the scroll bar. The emojis themselves probably need a container separate from the dropdown container.

I tried to track down where this is done in you code but I couldn't. If you point me in the right direction, maybe I can fix it. Thanks.

Thanks.

@ghost
Copy link

ghost commented Dec 16, 2016

Hi @muyiwaoyeniyi , i think it's not emoji plugin related (you can reproduce this issue with the "color" plugins for exemple, if you dont click on a color icon but you click inside the dropdown.. in a "white" area)

but this PR can resolve that 😈 : #459

@muyiwaoyeniyi
Copy link

@NicolasPion Thanks for the response and PR.. Yea I didnt try out the color plugin. But good to know.

All the best.

@Alex-D
Copy link
Owner

Alex-D commented Dec 17, 2016

Merged :)

@Alex-D Alex-D closed this as completed Dec 17, 2016
@danman1234
Copy link

Helo, i have done the emojifyjs : plugin, i get smileys, with text, but how to get the images inside the div??

@ghost
Copy link

ghost commented May 17, 2017

@danman1234, you can add something like :

function handleEmoji()
{
	emojify.setConfig({
		img_dir : '/vendor/emojify.js/dist/images/basic',
	});
	emojify.run();  
}

$('.trumbowyg-editor').bind('input propertychange', function() {
	handleEmoji();
});

@danman1234
Copy link

danman1234 commented May 18, 2017

This works, but as before too sometimes it shows the smiley ico and othertimes not.
It looks a bit hacky.

If i refeesh 4 times, then the smiley ico will show up.
Also i want to remove tons of smileys, i just need 10 for faster laoding, but in trumpowyg.emoji.js i have removed a lot from the:

var defaultOptions = {
    emojiList: 

but then it never shows up anymore.
If i use the full list then it shows up but also after an average of 4 times loading.

@ghost
Copy link

ghost commented May 18, 2017

@danman1234 try this PR (not yet merged) : #548
With this PR, you can specify an array of icons (ex here: #547), and you dont need anymore emojify.js

@Ydalb
Copy link

Ydalb commented Jul 4, 2017

hey @graphek : possible to share your at.js implementation please ? :)

@graphek
Copy link

graphek commented Jul 4, 2017

@Ydalb Sorry, i dont have the code for the smilies anymore because i liked the toolbar-version more. But i still use At.js for @mentions like this:

` // @MENTIONS

    $(selector).atwho({
      at: "@",
      data: this.api+'users/getForMentions',
      displayTpl: '<li class="mentionLi"><img src="'+this.cdn+'/avatare/${avatar}" alt="${name}" /> ${name} </li>',
      insertTpl: '<span class="mention" value="${slug}">${name}</span>',
    });`

Insert after initialization of trumbowyg

best regards

@Ydalb
Copy link

Ydalb commented Jul 4, 2017

Nevermind @graphek , I also implemented the toolbar-version :D

But I also use at.js for mentions, love it ❤️

@mavinalim
Copy link

mavinalim commented Apr 10, 2018

@Ydalb @graphek Sorry to open up this post. How did you guys integrate @mention? I was able to use At.js to integreat into regular textarea but I am unable to make it with with Trumbowyg editor. It only works if i switch the editor into source code mode where you can see the html tags. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need contributor plugin Non-core related things
Projects
None yet
Development

No branches or pull requests

7 participants