add emoji support - but disabled.. for now

This commit is contained in:
2021-04-11 18:20:05 +02:00
parent 3ee706e809
commit 734f8fa304
5 changed files with 1317 additions and 16 deletions

View File

@@ -1,14 +1,14 @@
<html>
<head>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/checkbox.css" media="screen">
<link rel="stylesheet" type="text/css" href="style/main.css" media="screen">
<meta charset="utf-8" />
</head>
<body>
</head>
<body>
<div id="chat" class="ui_element">
<ul id="chat_messages"></ul>
</div>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script src="js/main.js"></script>
</body>
<script src="js/newMain.js"></script>
</body>
</html>

View File

@@ -1,3 +1,5 @@
var neatoEmojiConverter = require('neato-emoji-converter')
let chat =
{
size: 0,
@@ -38,9 +40,14 @@ var chatAPI =
push: (text) => {
let colorPositions = [];
let colors = [];
let chatElement = "<li>";
let chatElement = "<li>"
var converter = new neatoEmojiConverter([replacements]);
text = converter.replaceShortcodesWith(text, function (unicodeChar, shortcode, name, object) {
if (unicodeChar) { return unicodeChar }
else if (object.url) { return `<img src="${object.url}" alt="${name}" title="${name}" style="max-height:35px; max-width:35px; width:auto; height:auto;" />` }
else { return shortcode }
});
for (let i = 0; i < text.length; i++) {
let colorCheck = `${text[i]}${text[i + 1]}${text[i + 2]}`;
@@ -66,7 +73,6 @@ var chatAPI =
var today = new Date();
if (chatElement === "<li></li>") {
if (chat.input == null || elmnt.scrollTop == elmnt.scrollHeight - elmnt.clientHeight) {
chat.container.append("<li>" + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "</li>");

File diff suppressed because one or more lines are too long

View File

@@ -2471,6 +2471,27 @@
"to-regex": "^3.0.1"
}
},
"neato-emoji-converter": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/neato-emoji-converter/-/neato-emoji-converter-1.1.2.tgz",
"integrity": "sha512-w3cTUXmawqnD8hRFP2sptCrPoymsFO0epmVQzy3mrhvKZToAIZji3/Wa6H3WoVxL5jdimGFzvnq+LEFoEjybpg==",
"requires": {
"emoji-toolkit": "^5.0.5",
"lodash.toarray": "^4.4.0"
},
"dependencies": {
"emoji-toolkit": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/emoji-toolkit/-/emoji-toolkit-5.0.5.tgz",
"integrity": "sha512-I57/yzEll8mIczqUCv2DaBhF61eBKtOwUN/7bxFPjwtwoVB9FnkRoabQRLZS6+KeSZNscw0av8o/N7tfy59PUg=="
},
"lodash.toarray": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz",
"integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE="
}
}
},
"neo-async": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",

View File

@@ -24,6 +24,7 @@
]
},
"dependencies": {
"neato-emoji-converter": "^1.1.2",
"ragemp-better-bindings": "^1.0.4"
}
}