Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ryan778
GitHub Repository: Ryan778/Ryan778.github.io
Path: blob/master/emojionearea/src/function/getTemplate.js
575 views
1
define([
2
'var/emojione',
3
'var/emojioneSupportMode'
4
],
5
function(emojione, emojioneSupportMode) {
6
return function(template, unicode, shortname) {
7
var imageType = emojione.imageType, imagePath;
8
if (imageType=='svg'){
9
imagePath = emojione.imagePathSVG;
10
} else {
11
imagePath = emojione.imagePathPNG;
12
}
13
return template
14
.replace('{name}', shortname || '')
15
.replace('{img}', imagePath + (emojioneSupportMode < 2 ? unicode.toUpperCase() : unicode) + '.' + imageType)
16
.replace('{uni}', unicode)
17
.replace('{alt}', emojione.convert(unicode));
18
};
19
});
20