mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-23 21:47:04 +01:00
Twemoji parsing
This commit is contained in:
parent
315173924c
commit
7badfea64f
@ -9,6 +9,7 @@
|
||||
/* global cheet */
|
||||
/* global location */
|
||||
/* global io */
|
||||
/* global twemoji */
|
||||
|
||||
(function () {
|
||||
const theme_options = ["DiscordDark", "BetterTitan"]; // All the avaliable theming names
|
||||
@ -672,6 +673,18 @@
|
||||
}
|
||||
var rendered = Mustache.render(template, {"id": "$2", "name": "$1"}).trim();
|
||||
message.content = message.content.replace(/<:(.*?):(.*?)>/g, rendered);
|
||||
message.content = twemoji.parse(message.content, {
|
||||
className: "message_emoji",
|
||||
callback: function(icon, options, variant) { // exclude special characters
|
||||
switch (icon) {
|
||||
case 'a9': // © copyright
|
||||
case 'ae': // ® registered trademark
|
||||
case '2122': // ™ trademark
|
||||
return false;
|
||||
}
|
||||
return ''.concat(options.base, options.size, '/', icon, options.ext);
|
||||
}
|
||||
});
|
||||
return message;
|
||||
}
|
||||
|
||||
|
@ -189,6 +189,7 @@
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jQuery-linkify/2.1.4/linkify-jquery.min.js" integrity="sha256-BlSfVPlZijMLojgte2AtSget879chk1+8Z8bEH/L4Cs=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/cheet.js/0.3.3/cheet.min.js" integrity="sha256-FxQrnIC3BX45JRzOyFUlKiM6dY3A/ZakV6w4WpYyfyA=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js" integrity="sha256-sdmLD9jD1PIzq3KOQPNSGZYxjv76rds79Mnyk5JNp1M=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twemoji/2.5.0/2/twemoji.min.js" integrity="sha256-t5bxASdQ5tDbKQZy330h/YufCiZg82xG8PqIYzFpwhU=" crossorigin="anonymous"></script>
|
||||
|
||||
{% raw %}
|
||||
<script id="mustache_channellistings" type="text/template">
|
||||
|
Loading…
Reference in New Issue
Block a user