mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 01:48:50 +00:00
Perform colons conversion
This commit is contained in:
parent
25525dcd94
commit
b05a26d734
@ -14,6 +14,11 @@ ComunicWeb.components.emoji.parser = {
|
||||
*/
|
||||
__twemojiBase: ComunicWeb.__config.assetsURL + "3rdparty/twemoji/2/",
|
||||
|
||||
/**
|
||||
* EmojiConvertor instance
|
||||
*/
|
||||
__emojiConvertor: null,
|
||||
|
||||
/**
|
||||
* Parse emojies
|
||||
*
|
||||
@ -26,6 +31,9 @@ ComunicWeb.components.emoji.parser = {
|
||||
//Peform string parsing
|
||||
infos.element.innerHTML = this.shorcutToHTMLcode(infos.element.innerHTML);
|
||||
|
||||
//Perform colon conversion
|
||||
infos.element.innerHTML = this.colonConversion(infos.element.innerHTML);
|
||||
|
||||
//Perform Twitter parsing
|
||||
this.twitterEmojiesParsing(infos.element);
|
||||
|
||||
@ -33,6 +41,25 @@ ComunicWeb.components.emoji.parser = {
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Perform the conversion from colon code to Emoji code
|
||||
*
|
||||
* @param {string} string The string to convert
|
||||
* @return {string} Converted string
|
||||
*/
|
||||
colonConversion: function(string){
|
||||
|
||||
//Check if the emoji convertor has to be created
|
||||
if(this.__emojiConvertor == null){
|
||||
this.__emojiConvertor = new EmojiConvertor();
|
||||
this.__emojiConvertor.init_env(); // else auto-detection will trigger when we first convert
|
||||
this.__emojiConvertor.replace_mode = 'unified';
|
||||
this.__emojiConvertor.allow_native = true;
|
||||
}
|
||||
|
||||
return this.__emojiConvertor.replace_colons(string);
|
||||
},
|
||||
|
||||
/**
|
||||
* Perform Twitter emojies parsing
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user