meshenger/web/emoji.js

45 lines
819 B
JavaScript
Raw Normal View History

function parseEmoticons( inputStr ){
var emoticons = [
{
text: ':)',
image: '1.png'
},
2015-05-21 17:17:31 +02:00
{
text: '<iframe',
image: 'iframe-open.png'
},
{
text: '</iframe>',
image: 'iframe-close.png'
},
{
text: '<script',
image: 'script-open.gif'
},
{
text: '</script>',
image: 'script-close.gif'
},
{
text: '<style',
image: 'style-open.png'
},
{
text: '</style>',
image: 'style-close.png'
},
{
text:';)',
image: '2.png'
2015-05-22 13:08:56 +02:00
},
{
text:':rock:',
image: '3.png'
}
];
for ( var i = 0; i < emoticons.length; i++ ){
inputStr = inputStr.split(emoticons[i].text).join('<img class="emo" src="/web/emoticons/'+emoticons[i].image+'">');
}
return inputStr;
}