...
Code Block | ||
---|---|---|
| ||
jQuery("#mytextarea").on("change keyup", function() { var text = jQuery("#mytextarea").val(); text = text.replace( new RegExp("(\\:\/:(\w+\\):)$", "gi")/gi, function(matchall, code) { // Emoji Match if (typeof LIVECHATSDK.LIVECHAT.emojiShortNames[ match.replace(/\:/g, "") ] !== "undefined") { return LIVECHATSDK.LIVECHAT.emojiShortNames[ match.replace(/\:/g, "") ]; } else { return match; }code] || code; } ); jQuery("#mytextarea").val( text ); } ); |
...