switch from twitter's emoji lib to emojione
This commit is contained in:
parent
fe3360df15
commit
f042f729e1
|
@ -539,12 +539,19 @@ li.buffer.indent.private a {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scales emoji to font size */
|
.emojione {
|
||||||
img.emoji {
|
font-size: inherit;
|
||||||
height: 1em;
|
height: 3ex;
|
||||||
width: 1em;
|
width: 3.1ex;
|
||||||
margin: 0 .05em 0 .1em;
|
min-height: 20px;
|
||||||
vertical-align: -0.1em;
|
min-width: 20px;
|
||||||
|
display: inline-block;
|
||||||
|
margin: -.2ex .15em .2ex;
|
||||||
|
line-height: normal;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
img.emojione {
|
||||||
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1400px) {
|
@media (min-width: 1400px) {
|
||||||
|
|
|
@ -141,11 +141,11 @@ weechat.filter('getBufferQuickKeys', function () {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// Emojifis the string using https://github.com/twitter/twemoji
|
// Emojifis the string using https://github.com/Ranks/emojione
|
||||||
weechat.filter('emojify', function() {
|
weechat.filter('emojify', function() {
|
||||||
return function(text, enable_JS_Emoji) {
|
return function(text, enable_JS_Emoji) {
|
||||||
if (enable_JS_Emoji === true) {
|
if (enable_JS_Emoji === true) {
|
||||||
return twemoji.parse(text);
|
return emojione.unicodeToImage(text);
|
||||||
} else {
|
} else {
|
||||||
return(text);
|
return(text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,17 +385,17 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// To reduce loading times for users who don't want twemoji,
|
// To reduce loading times for users who don't want emojione,
|
||||||
// load it only if the setting is enabled.
|
// load it only if the setting is enabled.
|
||||||
// This also fires when the page is loaded.
|
// This also fires when the page is loaded.
|
||||||
settings.addCallback('enableJSEmoji', function(enabled) {
|
settings.addCallback('enableJSEmoji', function(enabled) {
|
||||||
if (enabled && !$rootScope.twemoji_init) {
|
if (enabled && !$rootScope.twemoji_init) {
|
||||||
// Load twemoji only once
|
// Load script only once
|
||||||
$rootScope.twemoji_init = true;
|
$rootScope.twemoji_init = true;
|
||||||
(function() {
|
(function() {
|
||||||
var script = document.createElement("script");
|
var script = document.createElement("script");
|
||||||
script.type = "text/javascript";
|
script.type = "text/javascript";
|
||||||
script.src = "//twemoji.maxcdn.com/twemoji.min.js";
|
script.src = "//cdn.jsdelivr.net/emojione/1.3.0/lib/js/emojione.min.js";
|
||||||
document.getElementsByTagName("head")[0].appendChild(script);
|
document.getElementsByTagName("head")[0].appendChild(script);
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue