question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Emoji smilies really sucks

See original GitHub issue

I use the emoji plugins like mentioned in the plugin with Thumbowyg: https://github.com/Ranks/emojify.js

function opensmiley()
{
('#write_blog').trumbowyg({
		  btns: [['bold', 'italic','h2'], ['link'],['emoji'] ],
		autogrow: true,
		semantic: false,
		removeformatPasted: true,
		plugins: {
 		emoji: {
            emojiList: [
   [':+1:',HTML_ROOT+'images/smiley/small/+1.png'],
   [':-1:',HTML_ROOT+'images/smiley/small/-1.png'],
   [':airplane:',HTML_ROOT+'images/smiley/small/airplane.png'],
   [':angry:',HTML_ROOT+'images/smiley/small/angry.png']
            ]
        }
		}
					
		
	});
}

opensmiley();

Well it works, but not loaded every time. I need to reload all the time.

so this emoji button:

<button type="button" class="trumbowyg-emoji-button trumbowyg-open-dropdown trumbowyg-active" title="Add an emoji" tabindex="-1"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#trumbowyg-emoji"></use></svg></button>

Is not always present.

I have made an interval to check if the icon exists:

` var replai = setInterval(function() { if ($(‘.trumbowyg-button-pane div:nth-child(3)’).children().hasClass(‘trumbowyg-emoji-button’)) {

					  // content.next().children().prepend('<a href="'+delink+'" class="tag reply-to" type="button" data-role="none" target="_blank" title="Go to profile">@'+naamm+' </a>');
					  clearInterval(replai);
				   } else {
					var button = '<button type="button" class="trumbowyg-emoji-button  trumbowyg-open-dropdown trumbowyg-active" title="Add an emoji" tabindex="-1"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#trumbowyg-emoji"></use></svg></button>';

// creates the smiley button $(‘.trumbowyg-button-pane div:nth-child(3)’).html(button);

					console.log('not good');
					opensmiley(); doesnt reload
					clearInterval(replai);
				   }
				}, 100); // check every 100ms

`

the console log gives “no good” when the class is not present. it created the smiley button, but no click event works anymore.

Very annoying, does anyone knows how to fix it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
ghostcommented, May 19, 2017

if i test it with only the needed libs , it works as expected…

Good to know that is not really sucks 👍

0reactions
mysufcommented, Aug 8, 2017

Hi, emoji img tags are copied to textarea and it probably should not. It should be distributed like img tags -> $ed for preview while raw emoji keys -> $ta. Can you describe some approach how to do that? I am trying to implement https://github.com/twitter/twemoji. I can insert only text and parse whole content everytime, but it contrasts with current solution. Thank you

P.S. I think, simplest solution would be emoji key within img tag attrs and method that replaces all img tags of class “emoji” with this key while syncing to textarea

Read more comments on GitHub >

github_iconTop Results From Across the Web

Your Emoji Style Is Making You Look Bad to Your Younger ...
Using thumbs-ups and smiley faces, we can now better celebrate each other, be clearer in our tone and intention, and even add some...
Read more >
45 Emojis You Should Know and Their (Hidden) Meanings
People who use this often will rarely be sad, and you can always find a smile on their face when you see them...
Read more >
Sucks Emoticon
Sucks emoticon Some days really do suck and there's no getting around it. Sometimes there's a bad referee call that blows the game...
Read more >
The Slightly Smiling Emoji Conveys the Complex Tragedy ...
The Slightly Smiling Emoji Conveys the Complex Tragedy and Joy of Human Existence ... and it's really not too bad when you think...
Read more >
58 Bad emojis ideas
May 27, 2018 - Explore Gladys James's board "Bad emojis" on Pinterest. See more ideas about emoji symbols, smiley emoji, emoticons emojis.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found