Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/main/inc/lib/javascript/emojione/js/emojione.js

443 lines
92 KiB

(function(ns){
ns.emojioneList = {':hash:':["0023-fe0f-20e3","0023-20e3"],':zero:':["0030-fe0f-20e3","0030-20e3"],':one:':["0031-fe0f-20e3","0031-20e3"],':two:':["0032-fe0f-20e3","0032-20e3"],':three:':["0033-fe0f-20e3","0033-20e3"],':four:':["0034-fe0f-20e3","0034-20e3"],':five:':["0035-fe0f-20e3","0035-20e3"],':six:':["0036-fe0f-20e3","0036-20e3"],':seven:':["0037-fe0f-20e3","0037-20e3"],':eight:':["0038-fe0f-20e3","0038-20e3"],':nine:':["0039-fe0f-20e3","0039-20e3"],':copyright:':["00a9"],':registered:':["00ae"],':bangbang:':["203c-fe0f","203c"],':interrobang:':["2049-fe0f","2049"],':tm:':["2122"],':information_source:':["2139-fe0f","2139"],':left_right_arrow:':["2194-fe0f","2194"],':arrow_up_down:':["2195-fe0f","2195"],':arrow_upper_left:':["2196-fe0f","2196"],':arrow_upper_right:':["2197-fe0f","2197"],':arrow_lower_right:':["2198-fe0f","2198"],':arrow_lower_left:':["2199-fe0f","2199"],':leftwards_arrow_with_hook:':["21a9-fe0f","21a9"],':arrow_right_hook:':["21aa-fe0f","21aa"],':watch:':["231a-fe0f","231a"],':hourglass:':["231b-fe0f","231b"],':fast_forward:':["23e9"],':rewind:':["23ea"],':arrow_double_up:':["23eb"],':arrow_double_down:':["23ec"],':alarm_clock:':["23f0"],':hourglass_flowing_sand:':["23f3"],':m:':["24c2-fe0f","24c2"],':black_small_square:':["25aa-fe0f","25aa"],':white_small_square:':["25ab-fe0f","25ab"],':arrow_forward:':["25b6-fe0f","25b6"],':arrow_backward:':["25c0-fe0f","25c0"],':white_medium_square:':["25fb-fe0f","25fb"],':black_medium_square:':["25fc-fe0f","25fc"],':white_medium_small_square:':["25fd-fe0f","25fd"],':black_medium_small_square:':["25fe-fe0f","25fe"],':sunny:':["2600-fe0f","2600"],':cloud:':["2601-fe0f","2601"],':telephone:':["260e-fe0f","260e"],':ballot_box_with_check:':["2611-fe0f","2611"],':umbrella:':["2614-fe0f","2614"],':coffee:':["2615-fe0f","2615"],':point_up:':["261d-fe0f","261d"],':relaxed:':["263a-fe0f","263a"],':aries:':["2648-fe0f","2648"],':taurus:':["2649-fe0f","2649"],':gemini:':["264a-fe0f","264a"],':cancer:':["264b-fe0f","264b"],':leo:':["264c-fe0f","264c"],':virgo:':["264d-fe0f","264d"],':libra:':["264e-fe0f","264e"],':scorpius:':["264f-fe0f","264f"],':sagittarius:':["2650-fe0f","2650"],':capricorn:':["2651-fe0f","2651"],':aquarius:':["2652-fe0f","2652"],':pisces:':["2653-fe0f","2653"],':spades:':["2660-fe0f","2660"],':clubs:':["2663-fe0f","2663"],':hearts:':["2665-fe0f","2665"],':diamonds:':["2666-fe0f","2666"],':hotsprings:':["2668-fe0f","2668"],':recycle:':["267b-fe0f","267b"],':wheelchair:':["267f-fe0f","267f"],':anchor:':["2693-fe0f","2693"],':warning:':["26a0-fe0f","26a0"],':zap:':["26a1-fe0f","26a1"],':white_circle:':["26aa-fe0f","26aa"],':black_circle:':["26ab-fe0f","26ab"],':soccer:':["26bd-fe0f","26bd"],':baseball:':["26be-fe0f","26be"],':snowman:':["26c4-fe0f","26c4"],':partly_sunny:':["26c5-fe0f","26c5"],':ophiuchus:':["26ce"],':no_entry:':["26d4-fe0f","26d4"],':church:':["26ea-fe0f","26ea"],':fountain:':["26f2-fe0f","26f2"],':golf:':["26f3-fe0f","26f3"],':sailboat:':["26f5-fe0f","26f5"],':tent:':["26fa-fe0f","26fa"],':fuelpump:':["26fd-fe0f","26fd"],':scissors:':["2702-fe0f","2702"],':white_check_mark:':["2705"],':airplane:':["2708-fe0f","2708"],':envelope:':["2709-fe0f","2709"],':fist:':["270a"],':raised_hand:':["270b"],':v:':["270c-fe0f","270c"],':pencil2:':["270f-fe0f","270f"],':black_nib:':["2712-fe0f","2712"],':heavy_check_mark:':["2714-fe0f","2714"],':heavy_multiplication_x:':["2716-fe0f","2716"],':sparkles:':["2728"],':eight_spoked_asterisk:':["2733-fe0f","2733"],':eight_pointed_black_star:':["2734-fe0f","2734"],':snowflake:':["2744-fe0f","2744"],':sparkle:':["2747-fe0f","2747"],':x:':["274c"],':negative_squared_cross_mark:':["274e"],':question:':["2753"],':grey_question:':["2754"],':grey_exclamation:':["2755"],':exclamation:':["2757-fe0f","2757"],':heart:':["2764-fe0f","2764"],':heavy_plus_sign:':["2795"],':heavy_minus_sign:':["2796"],':heavy_division_sign:':["2797"],':arrow_right:':["27a1-fe0f","27a1"],':curly_loop:':["27b0"],':arrow_heading_up:':["2934-fe0f","2934"],':arrow_heading_down:':["2935-fe0f","2935"],':arrow_left:':["2b05-fe0f","2b05"],':arrow
ns.asciiList = {
'<3':'2764',
'</3':'1f494',
':\')':'1f602',
':\'-)':'1f602',
':D':'1f603',
':-D':'1f603',
'=D':'1f603',
':)':'1f604',
':-)':'1f604',
'=]':'1f604',
'=)':'1f604',
':]':'1f604',
'\':)':'1f605',
'\':-)':'1f605',
'\'=)':'1f605',
'\':D':'1f605',
'\':-D':'1f605',
'\'=D':'1f605',
'>:)':'1f606',
'>;)':'1f606',
'>:-)':'1f606',
'>=)':'1f606',
';)':'1f609',
';-)':'1f609',
'*-)':'1f609',
'*)':'1f609',
';-]':'1f609',
';]':'1f609',
';D':'1f609',
';^)':'1f609',
'\':(':'1f613',
'\':-(':'1f613',
'\'=(':'1f613',
':*':'1f618',
':-*':'1f618',
'=*':'1f618',
':^*':'1f618',
'>:P':'1f61c',
'X-P':'1f61c',
'x-p':'1f61c',
'>:[':'1f61e',
':-(':'1f61e',
':(':'1f61e',
':-[':'1f61e',
':[':'1f61e',
'=(':'1f61e',
'>:(':'1f620',
'>:-(':'1f620',
':@':'1f620',
':\'(':'1f622',
':\'-(':'1f622',
';(':'1f622',
';-(':'1f622',
'>.<':'1f623',
':$':'1f633',
'=$':'1f633',
'#-)':'1f635',
'#)':'1f635',
'%-)':'1f635',
'%)':'1f635',
'X)':'1f635',
'X-)':'1f635',
'*\\0/*':'1f646',
'\\0/':'1f646',
'*\\O/*':'1f646',
'\\O/':'1f646',
'O:-)':'1f607',
'0:-3':'1f607',
'0:3':'1f607',
'0:-)':'1f607',
'0:)':'1f607',
'0;^)':'1f607',
'O:-)':'1f607',
'O:)':'1f607',
'O;-)':'1f607',
'O=)':'1f607',
'0;-)':'1f607',
'O:-3':'1f607',
'O:3':'1f607',
'B-)':'1f60e',
'B)':'1f60e',
'8)':'1f60e',
'8-)':'1f60e',
'B-D':'1f60e',
'8-D':'1f60e',
'-_-':'1f611',
'-__-':'1f611',
'-___-':'1f611',
'>:\\':'1f615',
'>:/':'1f615',
':-/':'1f615',
':-.':'1f615',
':/':'1f615',
':\\':'1f615',
'=/':'1f615',
'=\\':'1f615',
':L':'1f615',
'=L':'1f615',
':P':'1f61b',
':-P':'1f61b',
'=P':'1f61b',
':-p':'1f61b',
':p':'1f61b',
'=p':'1f61b',
':-Þ':'1f61b',
':Þ':'1f61b',
':þ':'1f61b',
':-þ':'1f61b',
':-b':'1f61b',
':b':'1f61b',
'd:':'1f61b',
':-O':'1f62e',
':O':'1f62e',
':-o':'1f62e',
':o':'1f62e',
'O_O':'1f62e',
'>:O':'1f62e',
':-X':'1f636',
':X':'1f636',
':-#':'1f636',
':#':'1f636',
'=X':'1f636',
'=x':'1f636',
':x':'1f636',
':-x':'1f636',
'=#':'1f636'
};
ns.asciiRegexp = '(\\<3|&lt;3|\\<\\/3|&lt;\\/3|\\:\'\\)|\\:\'\\-\\)|\\:D|\\:\\-D|\\=D|\\:\\)|\\:\\-\\)|\\=\\]|\\=\\)|\\:\\]|\'\\:\\)|\'\\:\\-\\)|\'\\=\\)|\'\\:D|\'\\:\\-D|\'\\=D|\\>\\:\\)|&gt;\\:\\)|\\>;\\)|&gt;;\\)|\\>\\:\\-\\)|&gt;\\:\\-\\)|\\>\\=\\)|&gt;\\=\\)|;\\)|;\\-\\)|\\*\\-\\)|\\*\\)|;\\-\\]|;\\]|;D|;\\^\\)|\'\\:\\(|\'\\:\\-\\(|\'\\=\\(|\\:\\*|\\:\\-\\*|\\=\\*|\\:\\^\\*|\\>\\:P|&gt;\\:P|X\\-P|x\\-p|\\>\\:\\[|&gt;\\:\\[|\\:\\-\\(|\\:\\(|\\:\\-\\[|\\:\\[|\\=\\(|\\>\\:\\(|&gt;\\:\\(|\\>\\:\\-\\(|&gt;\\:\\-\\(|\\:@|\\:\'\\(|\\:\'\\-\\(|;\\(|;\\-\\(|\\>\\.\\<|&gt;\\.&lt;|\\:\\$|\\=\\$|#\\-\\)|#\\)|%\\-\\)|%\\)|X\\)|X\\-\\)|\\*\\\\0\\/\\*|\\\\0\\/|\\*\\\\O\\/\\*|\\\\O\\/|O\\:\\-\\)|0\\:\\-3|0\\:3|0\\:\\-\\)|0\\:\\)|0;\\^\\)|O\\:\\-\\)|O\\:\\)|O;\\-\\)|O\\=\\)|0;\\-\\)|O\\:\\-3|O\\:3|B\\-\\)|B\\)|8\\)|8\\-\\)|B\\-D|8\\-D|\\-_\\-|\\-__\\-|\\-___\\-|\\>\\:\\\\|&gt;\\:\\\\|\\>\\:\\/|&gt;\\:\\/|\\:\\-\\/|\\:\\-\\.|\\:\\/|\\:\\\\|\\=\\/|\\=\\\\|\\:L|\\=L|\\:P|\\:\\-P|\\=P|\\:\\-p|\\:p|\\=p|\\:\\-Þ|\\:\\-&THORN;|\\:Þ|\\:&THORN;|\\:þ|\\:&thorn;|\\:\\-þ|\\:\\-&thorn;|\\:\\-b|\\:b|d\\:|\\:\\-O|\\:O|\\:\\-o|\\:o|O_O|\\>\\:O|&gt;\\:O|\\:\\-X|\\:X|\\:\\-#|\\:#|\\=X|\\=x|\\:x|\\:\\-x|\\=#)';
ns.unicodeRegexp = '(#\\uFE0F\\u20E3|#\\u20E3|0\\uFE0F\\u20E3|0\\u20E3|1\\uFE0F\\u20E3|1\\u20E3|2\\uFE0F\\u20E3|2\\u20E3|3\\uFE0F\\u20E3|3\\u20E3|4\\uFE0F\\u20E3|4\\u20E3|5\\uFE0F\\u20E3|5\\u20E3|6\\uFE0F\\u20E3|6\\u20E3|7\\uFE0F\\u20E3|7\\u20E3|8\\uFE0F\\u20E3|8\\u20E3|9\\uFE0F\\u20E3|9\\u20E3|\\u00A9|\\u00AE|\\u203C\\uFE0F|\\u203C|\\u2049\\uFE0F|\\u2049|\\u2122|\\u2139\\uFE0F|\\u2139|\\u2194\\uFE0F|\\u2194|\\u2195\\uFE0F|\\u2195|\\u2196\\uFE0F|\\u2196|\\u2197\\uFE0F|\\u2197|\\u2198\\uFE0F|\\u2198|\\u2199\\uFE0F|\\u2199|\\u21A9\\uFE0F|\\u21A9|\\u21AA\\uFE0F|\\u21AA|\\u231A\\uFE0F|\\u231A|\\u231B\\uFE0F|\\u231B|\\u23E9|\\u23EA|\\u23EB|\\u23EC|\\u23F0|\\u23F3|\\u24C2\\uFE0F|\\u24C2|\\u25AA\\uFE0F|\\u25AA|\\u25AB\\uFE0F|\\u25AB|\\u25B6\\uFE0F|\\u25B6|\\u25C0\\uFE0F|\\u25C0|\\u25FB\\uFE0F|\\u25FB|\\u25FC\\uFE0F|\\u25FC|\\u25FD\\uFE0F|\\u25FD|\\u25FE\\uFE0F|\\u25FE|\\u2600\\uFE0F|\\u2600|\\u2601\\uFE0F|\\u2601|\\u260E\\uFE0F|\\u260E|\\u2611\\uFE0F|\\u2611|\\u2614\\uFE0F|\\u2614|\\u2615\\uFE0F|\\u2615|\\u261D\\uFE0F|\\u261D|\\u263A\\uFE0F|\\u263A|\\u2648\\uFE0F|\\u2648|\\u2649\\uFE0F|\\u2649|\\u264A\\uFE0F|\\u264A|\\u264B\\uFE0F|\\u264B|\\u264C\\uFE0F|\\u264C|\\u264D\\uFE0F|\\u264D|\\u264E\\uFE0F|\\u264E|\\u264F\\uFE0F|\\u264F|\\u2650\\uFE0F|\\u2650|\\u2651\\uFE0F|\\u2651|\\u2652\\uFE0F|\\u2652|\\u2653\\uFE0F|\\u2653|\\u2660\\uFE0F|\\u2660|\\u2663\\uFE0F|\\u2663|\\u2665\\uFE0F|\\u2665|\\u2666\\uFE0F|\\u2666|\\u2668\\uFE0F|\\u2668|\\u267B\\uFE0F|\\u267B|\\u267F\\uFE0F|\\u267F|\\u2693\\uFE0F|\\u2693|\\u26A0\\uFE0F|\\u26A0|\\u26A1\\uFE0F|\\u26A1|\\u26AA\\uFE0F|\\u26AA|\\u26AB\\uFE0F|\\u26AB|\\u26BD\\uFE0F|\\u26BD|\\u26BE\\uFE0F|\\u26BE|\\u26C4\\uFE0F|\\u26C4|\\u26C5\\uFE0F|\\u26C5|\\u26CE|\\u26D4\\uFE0F|\\u26D4|\\u26EA\\uFE0F|\\u26EA|\\u26F2\\uFE0F|\\u26F2|\\u26F3\\uFE0F|\\u26F3|\\u26F5\\uFE0F|\\u26F5|\\u26FA\\uFE0F|\\u26FA|\\u26FD\\uFE0F|\\u26FD|\\u2702\\uFE0F|\\u2702|\\u2705|\\u2708\\uFE0F|\\u2708|\\u2709\\uFE0F|\\u2709|\\u270A|\\u270B|\\u270C\\uFE0F|\\u270C|\\u270F\\uFE0F|\\u270F|\\u2712\\uFE0F|\\u2712|\\u2714\\uFE0F|\\u2714|\\u2716\\uFE0F|\\u2716|\\u2728|\\u2733\\uFE0F|\\u2733|\\u2734\\uFE0F|\\u2734|\\u2744\\uFE0F|\\u2744|\\u2747\\uFE0F|\\u2747|\\u274C|\\u274E|\\u2753|\\u2754|\\u2755|\\u2757\\uFE0F|\\u2757|\\u2764\\uFE0F|\\u2764|\\u2795|\\u2796|\\u2797|\\u27A1\\uFE0F|\\u27A1|\\u27B0|\\u2934\\uFE0F|\\u2934|\\u2935\\uFE0F|\\u2935|\\u2B05\\uFE0F|\\u2B05|\\u2B06\\uFE0F|\\u2B06|\\u2B07\\uFE0F|\\u2B07|\\u2B1B\\uFE0F|\\u2B1B|\\u2B1C\\uFE0F|\\u2B1C|\\u2B50\\uFE0F|\\u2B50|\\u2B55\\uFE0F|\\u2B55|\\u3030|\\u303D\\uFE0F|\\u303D|\\u3297\\uFE0F|\\u3297|\\u3299\\uFE0F|\\u3299|\\uD83C\\uDC04\\uFE0F|\\uD83C\\uDC04|\\uD83C\\uDCCF|\\uD83C\\uDD70|\\uD83C\\uDD71|\\uD83C\\uDD7E|\\uD83C\\uDD7F\\uFE0F|\\uD83C\\uDD7F|\\uD83C\\uDD8E|\\uD83C\\uDD91|\\uD83C\\uDD92|\\uD83C\\uDD93|\\uD83C\\uDD94|\\uD83C\\uDD95|\\uD83C\\uDD96|\\uD83C\\uDD97|\\uD83C\\uDD98|\\uD83C\\uDD99|\\uD83C\\uDD9A|\\uD83C\\uDDE8\\uD83C\\uDDF3|\\uD83C\\uDDE9\\uD83C\\uDDEA|\\uD83C\\uDDEA\\uD83C\\uDDF8|\\uD83C\\uDDEB\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDE7|\\uD83C\\uDDEE\\uD83C\\uDDF9|\\uD83C\\uDDEF\\uD83C\\uDDF5|\\uD83C\\uDDF0\\uD83C\\uDDF7|\\uD83C\\uDDFA\\uD83C\\uDDF8|\\uD83C\\uDDF7\\uD83C\\uDDFA|\\uD83C\\uDE01|\\uD83C\\uDE02|\\uD83C\\uDE1A\\uFE0F|\\uD83C\\uDE1A|\\uD83C\\uDE2F\\uFE0F|\\uD83C\\uDE2F|\\uD83C\\uDE32|\\uD83C\\uDE33|\\uD83C\\uDE34|\\uD83C\\uDE35|\\uD83C\\uDE36|\\uD83C\\uDE37|\\uD83C\\uDE38|\\uD83C\\uDE39|\\uD83C\\uDE3A|\\uD83C\\uDE50|\\uD83C\\uDE51|\\uD83C\\uDF00|\\uD83C\\uDF01|\\uD83C\\uDF02|\\uD83C\\uDF03|\\uD83C\\uDF04|\\uD83C\\uDF05|\\uD83C\\uDF06|\\uD83C\\uDF07|\\uD83C\\uDF08|\\uD83C\\uDF09|\\uD83C\\uDF0A|\\uD83C\\uDF0B|\\uD83C\\uDF0C|\\uD83C\\uDF0F|\\uD83C\\uDF11|\\uD83C\\uDF13|\\uD83C\\uDF14|\\uD83C\\uDF15|\\uD83C\\uDF19|\\uD83C\\uDF1B|\\uD83C\\uDF1F|\\uD83C\\uDF20|\\uD83C\\uDF30|\\uD83C\\uDF31|\\uD83C\\uDF34|\\uD83C\\uDF35|\\uD83C\\uDF37|\\uD83C\\uDF38|\\uD83C\\uDF39|\\uD83C\\uDF3A|\\uD83C\\uDF3B|\\uD83C\\uDF3C|\\uD83C\\uDF3D|\\uD83C\\uDF3E|\\uD83C\\uDF3F|\\uD83C\\uDF40|\\uD83C\\uDF41|\\uD83C\\uDF42|\\uD83C\\uDF43|\\uD83C\\uDF44|\\uD83C\\uDF45|\\uD83C\\uDF46
ns.jsecapeMap = {"#\uFE0F\u20E3":"0023-20E3","#\u20E3":"0023-20E3","0\uFE0F\u20E3":"0030-20E3","0\u20E3":"0030-20E3","1\uFE0F\u20E3":"0031-20E3","1\u20E3":"0031-20E3","2\uFE0F\u20E3":"0032-20E3","2\u20E3":"0032-20E3","3\uFE0F\u20E3":"0033-20E3","3\u20E3":"0033-20E3","4\uFE0F\u20E3":"0034-20E3","4\u20E3":"0034-20E3","5\uFE0F\u20E3":"0035-20E3","5\u20E3":"0035-20E3","6\uFE0F\u20E3":"0036-20E3","6\u20E3":"0036-20E3","7\uFE0F\u20E3":"0037-20E3","7\u20E3":"0037-20E3","8\uFE0F\u20E3":"0038-20E3","8\u20E3":"0038-20E3","9\uFE0F\u20E3":"0039-20E3","9\u20E3":"0039-20E3","\u00A9":"00A9","\u00AE":"00AE","\u203C\uFE0F":"203C","\u203C":"203C","\u2049\uFE0F":"2049","\u2049":"2049","\u2122":"2122","\u2139\uFE0F":"2139","\u2139":"2139","\u2194\uFE0F":"2194","\u2194":"2194","\u2195\uFE0F":"2195","\u2195":"2195","\u2196\uFE0F":"2196","\u2196":"2196","\u2197\uFE0F":"2197","\u2197":"2197","\u2198\uFE0F":"2198","\u2198":"2198","\u2199\uFE0F":"2199","\u2199":"2199","\u21A9\uFE0F":"21A9","\u21A9":"21A9","\u21AA\uFE0F":"21AA","\u21AA":"21AA","\u231A\uFE0F":"231A","\u231A":"231A","\u231B\uFE0F":"231B","\u231B":"231B","\u23E9":"23E9","\u23EA":"23EA","\u23EB":"23EB","\u23EC":"23EC","\u23F0":"23F0","\u23F3":"23F3","\u24C2\uFE0F":"24C2","\u24C2":"24C2","\u25AA\uFE0F":"25AA","\u25AA":"25AA","\u25AB\uFE0F":"25AB","\u25AB":"25AB","\u25B6\uFE0F":"25B6","\u25B6":"25B6","\u25C0\uFE0F":"25C0","\u25C0":"25C0","\u25FB\uFE0F":"25FB","\u25FB":"25FB","\u25FC\uFE0F":"25FC","\u25FC":"25FC","\u25FD\uFE0F":"25FD","\u25FD":"25FD","\u25FE\uFE0F":"25FE","\u25FE":"25FE","\u2600\uFE0F":"2600","\u2600":"2600","\u2601\uFE0F":"2601","\u2601":"2601","\u260E\uFE0F":"260E","\u260E":"260E","\u2611\uFE0F":"2611","\u2611":"2611","\u2614\uFE0F":"2614","\u2614":"2614","\u2615\uFE0F":"2615","\u2615":"2615","\u261D\uFE0F":"261D","\u261D":"261D","\u263A\uFE0F":"263A","\u263A":"263A","\u2648\uFE0F":"2648","\u2648":"2648","\u2649\uFE0F":"2649","\u2649":"2649","\u264A\uFE0F":"264A","\u264A":"264A","\u264B\uFE0F":"264B","\u264B":"264B","\u264C\uFE0F":"264C","\u264C":"264C","\u264D\uFE0F":"264D","\u264D":"264D","\u264E\uFE0F":"264E","\u264E":"264E","\u264F\uFE0F":"264F","\u264F":"264F","\u2650\uFE0F":"2650","\u2650":"2650","\u2651\uFE0F":"2651","\u2651":"2651","\u2652\uFE0F":"2652","\u2652":"2652","\u2653\uFE0F":"2653","\u2653":"2653","\u2660\uFE0F":"2660","\u2660":"2660","\u2663\uFE0F":"2663","\u2663":"2663","\u2665\uFE0F":"2665","\u2665":"2665","\u2666\uFE0F":"2666","\u2666":"2666","\u2668\uFE0F":"2668","\u2668":"2668","\u267B\uFE0F":"267B","\u267B":"267B","\u267F\uFE0F":"267F","\u267F":"267F","\u2693\uFE0F":"2693","\u2693":"2693","\u26A0\uFE0F":"26A0","\u26A0":"26A0","\u26A1\uFE0F":"26A1","\u26A1":"26A1","\u26AA\uFE0F":"26AA","\u26AA":"26AA","\u26AB\uFE0F":"26AB","\u26AB":"26AB","\u26BD\uFE0F":"26BD","\u26BD":"26BD","\u26BE\uFE0F":"26BE","\u26BE":"26BE","\u26C4\uFE0F":"26C4","\u26C4":"26C4","\u26C5\uFE0F":"26C5","\u26C5":"26C5","\u26CE":"26CE","\u26D4\uFE0F":"26D4","\u26D4":"26D4","\u26EA\uFE0F":"26EA","\u26EA":"26EA","\u26F2\uFE0F":"26F2","\u26F2":"26F2","\u26F3\uFE0F":"26F3","\u26F3":"26F3","\u26F5\uFE0F":"26F5","\u26F5":"26F5","\u26FA\uFE0F":"26FA","\u26FA":"26FA","\u26FD\uFE0F":"26FD","\u26FD":"26FD","\u2702\uFE0F":"2702","\u2702":"2702","\u2705":"2705","\u2708\uFE0F":"2708","\u2708":"2708","\u2709\uFE0F":"2709","\u2709":"2709","\u270A":"270A","\u270B":"270B","\u270C\uFE0F":"270C","\u270C":"270C","\u270F\uFE0F":"270F","\u270F":"270F","\u2712\uFE0F":"2712","\u2712":"2712","\u2714\uFE0F":"2714","\u2714":"2714","\u2716\uFE0F":"2716","\u2716":"2716","\u2728":"2728","\u2733\uFE0F":"2733","\u2733":"2733","\u2734\uFE0F":"2734","\u2734":"2734","\u2744\uFE0F":"2744","\u2744":"2744","\u2747\uFE0F":"2747","\u2747":"2747","\u274C":"274C","\u274E":"274E","\u2753":"2753","\u2754":"2754","\u2755":"2755","\u2757\uFE0F":"2757","\u2757":"2757","\u2764\uFE0F":"2764","\u2764":"2764","\u2795":"2795","\u2796":"2796","\u2797":"2797","\u27A1\uFE0F":"27A1","\u27A1":"27A1","\u27B0":"27B0","\u2934\uFE0F":"2934","\u2934":"2934","\u2935\uFE0F":"2935","\u2935":"2935","\u2B05\uFE0F":"2B05","\u2B05":"2B05","\
ns.shortnameRegexp = ':([-+\\w]+):';
ns.imagePathPNG = '//cdn.jsdelivr.net/emojione/assets/png/';
ns.imagePathSVG = '//cdn.jsdelivr.net/emojione/assets/svg/';
ns.imagePathSVGSprites = './../assets/sprites/emojione.sprites.svg';
ns.imageType = 'png'; // or svg
ns.sprites = false; // if this is true then sprite markup will be used (if SVG image type is set then you must include the SVG sprite file locally)
ns.unicodeAlt = true; // use the unicode char as the alt attribute (makes copy and pasting the resulting text better)
ns.ascii = false; // change to true to convert ascii smileys
ns.cacheBustParam = '?v=1.2.4'; // you can [optionally] modify this to force browsers to refresh their cache. it will be appended to the send of the filenames
ns.toImage = function(str) {
str = ns.unicodeToImage(str);
str = ns.shortnameToImage(str);
return str;
}
// Uses toShort to transform all unicode into a standard shortname
// then transforms the shortname into unicode
// This is done for standardization when converting several unicode types
ns.unifyUnicode = function(str) {
str = ns.toShort(str);
str = ns.shortnameToUnicode(str);
return str;
}
// Replace shortnames (:wink:) with Ascii equivalents ( ;^) )
// Useful for systems that dont support unicode nor images
ns.shortnameToAscii = function(str) {
var unicode,
// something to keep in mind here is that array flip will destroy
// half of the ascii text "emojis" because the unicode numbers are duplicated
// this is ok for what it's being used for
unicodeToAscii = ns.objectFlip(ns.asciiList);
str = str.replace(new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+ns.shortnameRegexp+")", "gi"),function(shortname) {
if( (shortname == undefined) || (shortname == '') || (!(shortname in ns.emojioneList)) ) {
// if the shortname doesnt exist just return the entire match
return shortname;
}
else {
unicode = ns.emojioneList[shortname][ns.emojioneList[shortname].length-1].toLowerCase();
if(typeof unicodeToAscii[unicode] !== "undefined") {
return unicodeToAscii[unicode];
} else {
return shortname;
}
}
});
return str;
}
// will output unicode from shortname
// useful for sending emojis back to mobile devices
ns.shortnameToUnicode = function(str) {
// replace regular shortnames first
var unicode;
str = str.replace(new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+ns.shortnameRegexp+")", "gi"),function(shortname) {
if( (shortname == undefined) || (shortname == '') || (!(shortname in ns.emojioneList)) ) {
// if the shortname doesnt exist just return the entire match
return shortname;
}
else {
unicode = ns.emojioneList[shortname][ns.emojioneList[shortname].length-1].toUpperCase();
return ns.convert(unicode);
}
});
// if ascii smileys are turned on, then we'll replace them!
if (ns.ascii) {
str = str.replace(new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)"+ns.asciiRegexp+"(?=\\s|$|[!,\.]))","g"),function(entire, m1, m2, m3, m4) {
if( (m3 == undefined) || (m3 == '') || (!(ns.unescapeHTML(m3) in ns.asciiList)) ) {
// if the shortname doesnt exist just return the entire match
return entire;
}
else {
m3 = ns.unescapeHTML(m3);
unicode = ns.asciiList[m3].toUpperCase();
return ns.convert(unicode);
}
});
}
return str;
}
ns.shortnameToImage = function(str) {
// replace regular shortnames first
var replaceWith,unicode,alt;
str = str.replace(new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+ns.shortnameRegexp+")", "gi"),function(shortname) {
if( (shortname == undefined) || (shortname == '') || (!(shortname in ns.emojioneList)) ) {
// if the shortname doesnt exist just return the entire match
return shortname;
}
else {
unicode = ns.emojioneList[shortname][ns.emojioneList[shortname].length-1].toUpperCase();
// depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname
alt = (ns.unicodeAlt) ? ns.convert(unicode) : shortname;
if(ns.imageType == 'png') {
if(ns.sprites) {
replaceWith = '<span class="emojione-'+unicode+'" title="'+shortname+'">'+alt+'</span>';
}
else {
replaceWith = '<img class="emojione" alt="'+alt+'" src="'+ns.imagePathPNG+unicode+'.png'+ns.cacheBustParam+'"/>';
}
}
else {
// svg
if(ns.sprites) {
replaceWith = '<svg class="emojione"><description>'+alt+'</description><use xlink:href="'+ns.imagePathSVGSprites+'#emoji-'+unicode+'"></use></svg>';
}
else {
replaceWith = '<object class="emojione" data="'+ns.imagePathSVG+unicode+'.svg'+ns.cacheBustParam+'" type="image/svg+xml" standby="'+alt+'">'+alt+'</object>';
}
}
return replaceWith;
}
});
// if ascii smileys are turned on, then we'll replace them!
if (ns.ascii) {
str = str.replace(new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)"+ns.asciiRegexp+"(?=\\s|$|[!,\.]))","g"),function(entire, m1, m2, m3, m4) {
if( (m3 == undefined) || (m3 == '') || (!(ns.unescapeHTML(m3) in ns.asciiList)) ) {
// if the shortname doesnt exist just return the entire match
return entire;
}
else {
m3 = ns.unescapeHTML(m3);
unicode = ns.asciiList[m3].toUpperCase();
// depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname
alt = (ns.unicodeAlt) ? ns.convert(unicode) : ns.escapeHTML(m3);
if(ns.imageType == 'png') {
if(ns.sprites) {
replaceWith = m2+'<span class="emojione-'+unicode.toUpperCase()+'" title="'+ns.escapeHTML(m3)+'">'+alt+'</span>';
}
else {
replaceWith = m2+'<img class="emojione" alt="'+alt+'" src="'+ns.imagePathPNG+unicode+'.png'+ns.cacheBustParam+'"/>';
}
}
else {
// svg
if(ns.sprites) {
replaceWith = '<svg class="emojione"><description>'+alt+'</description><use xlink:href="'+ns.imagePathSVGSprites+'#emoji-'+unicode.toUpperCase()+'"></use></svg>';
}
else {
replaceWith = m2+'<object class="emojione" data="'+ns.imagePathSVG+unicode+'.svg'+ns.cacheBustParam+'" type="image/svg+xml" standby="'+alt+'">'+alt+'</object>';
}
}
return replaceWith;
}
});
}
return str;
}
ns.unicodeToImage = function(str) {
var replaceWith,unicode,alt;
if((!ns.unicodeAlt) || (ns.sprites)) {
// if we are using the shortname as the alt tag then we need a reversed array to map unicode code point to shortnames
var mappedUnicode = ns.mapShortToUnicode();
}
str = str.replace(new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+ns.unicodeRegexp+")", "gi"),function(unicodeChar) {
if( (unicodeChar == undefined) || (unicodeChar == '') || (!(unicodeChar in ns.jsecapeMap)) ) {
// if the unicodeChar doesnt exist just return the entire match
return unicodeChar;
}
else {
// get the unicode codepoint from the actual char
unicode = ns.jsecapeMap[unicodeChar];
// depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname
alt = (ns.unicodeAlt) ? ns.convert(unicode) : mappedUnicode[unicode];
if(ns.imageType == 'png') {
if(ns.sprites) {
replaceWith = '<span class="emojione-'+unicode.toUpperCase()+'" title="'+mappedUnicode[unicode]+'">'+alt+'</span>';
}
else {
replaceWith = '<img class="emojione" alt="'+alt+'" src="'+ns.imagePathPNG+unicode+'.png'+ns.cacheBustParam+'"/>';
}
}
else {
// svg
if(ns.sprites) {
replaceWith = '<svg class="emojione"><description>'+alt+'</description><use xlink:href="'+ns.imagePathSVGSprites+'#emoji-'+unicode.toUpperCase()+'"></use></svg>';
}
else {
replaceWith = '<object class="emojione" data="'+ns.imagePathSVG+unicode+'.svg'+ns.cacheBustParam+'" type="image/svg+xml" standby="'+alt+'">'+alt+'</object>';
}
}
return replaceWith;
}
});
return str;
}
// super simple loop to replace all unicode emoji to shortnames
// needs to be improved into one big replacement instead, for performance reasons
ns.toShort = function(str) { // this is really just unicodeToShortname() but I opted for the shorthand name to match toImage()
for (var shortcode in ns.emojioneList) {
for (var ukey in ns.emojioneList[shortcode]) {
var unicode = ns.emojioneList[shortcode][ukey].toUpperCase();
str = ns.replaceAll(str,ns.convert(unicode),shortcode);
}
}
return str;
}
// for converting unicode code points and code pairs to their respective characters
ns.convert = function(unicode) {
if(unicode.indexOf("-") > -1) {
var parts = [];
var s = unicode.split('-');
for(var i = 0; i < s.length; i++) {
var part = parseInt(s[i], 16);
if (part >= 0x10000 && part <= 0x10FFFF) {
var hi = Math.floor((part - 0x10000) / 0x400) + 0xD800;
var lo = ((part - 0x10000) % 0x400) + 0xDC00;
part = (String.fromCharCode(hi) + String.fromCharCode(lo));
}
else {
part = String.fromCharCode(part);
}
parts.push(part);
}
return parts.join('');
}
else {
var s = parseInt(unicode, 16);
if (s >= 0x10000 && s <= 0x10FFFF) {
var hi = Math.floor((s - 0x10000) / 0x400) + 0xD800;
var lo = ((s - 0x10000) % 0x400) + 0xDC00;
return (String.fromCharCode(hi) + String.fromCharCode(lo));
}
else {
return String.fromCharCode(s);
}
}
}
ns.escapeHTML = function (string) {
return string
.replace("&","&amp;","g")
.replace("<","&lt;","g")
.replace( ">","&gt;","g")
.replace("\"","&quot;","g")
.replace("'","&#039;","g");
}
ns.unescapeHTML = function (string) {
return string
.replace("&amp;","&","g")
.replace("&lt;","<","g")
.replace( "&gt;",">","g")
.replace("&quot;","\"","g")
.replace("&#039;","'","g");
}
ns.mapShortToUnicode = function() {
var new_obj = {};
for (var shortname in ns.emojioneList) {
for (var ukey in ns.emojioneList[shortname]) {
new_obj[ns.emojioneList[shortname][ukey].toUpperCase()] = shortname;
}
}
return new_obj;
};
//reverse an object
ns.objectFlip = function (obj) {
var key, tmp_obj = {};
for (key in obj) {
if (obj.hasOwnProperty(key)) {
tmp_obj[obj[key]] = key;
}
}
return tmp_obj;
}
ns.escapeRegExp = function(string) {
return string.replace(/[-[\]{}()*+?.,;:&\\^$|#\s]/g, "\\$&")
}
ns.replaceAll = function(string, find, replaceWith) {
var search = new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+find+")", "gi");
// callback prevents replacing anything inside of these common html tags as well as between an <object></object> tag
var replace = function(entire, m1) {
return ((m1 == undefined) || (m1 == '')) ? entire : replaceWith;
}
return string.replace(search,replace);
}
}(this.emojione = this.emojione || {}));
if(typeof module === "object") module.exports = this.emojione;