add emoji support - but disabled.. for now
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css" href="style/checkbox.css" media="screen">
|
<link rel="stylesheet" type="text/css" href="style/checkbox.css" media="screen">
|
||||||
<link rel="stylesheet" type="text/css" href="style/main.css" media="screen">
|
<link rel="stylesheet" type="text/css" href="style/main.css" media="screen">
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="chat" class="ui_element">
|
<div id="chat" class="ui_element">
|
||||||
<ul id="chat_messages"></ul>
|
<ul id="chat_messages"></ul>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
|
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
|
||||||
<script src="js/main.js"></script>
|
<script src="js/newMain.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
var neatoEmojiConverter = require('neato-emoji-converter')
|
||||||
|
|
||||||
let chat =
|
let chat =
|
||||||
{
|
{
|
||||||
size: 0,
|
size: 0,
|
||||||
@@ -38,9 +40,14 @@ var chatAPI =
|
|||||||
push: (text) => {
|
push: (text) => {
|
||||||
let colorPositions = [];
|
let colorPositions = [];
|
||||||
let colors = [];
|
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++) {
|
for (let i = 0; i < text.length; i++) {
|
||||||
let colorCheck = `${text[i]}${text[i + 1]}${text[i + 2]}`;
|
let colorCheck = `${text[i]}${text[i + 1]}${text[i + 2]}`;
|
||||||
@@ -66,7 +73,6 @@ var chatAPI =
|
|||||||
|
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
|
|
||||||
|
|
||||||
if (chatElement === "<li></li>") {
|
if (chatElement === "<li></li>") {
|
||||||
if (chat.input == null || elmnt.scrollTop == elmnt.scrollHeight - elmnt.clientHeight) {
|
if (chat.input == null || elmnt.scrollTop == elmnt.scrollHeight - elmnt.clientHeight) {
|
||||||
chat.container.append("<li>" + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "</li>");
|
chat.container.append("<li>" + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "</li>");
|
||||||
|
|||||||
1273
ReallifeGamemode.Client/assets/chat/js/newMain.js
Normal file
1273
ReallifeGamemode.Client/assets/chat/js/newMain.js
Normal file
File diff suppressed because one or more lines are too long
21
ReallifeGamemode.Client/package-lock.json
generated
21
ReallifeGamemode.Client/package-lock.json
generated
@@ -2471,6 +2471,27 @@
|
|||||||
"to-regex": "^3.0.1"
|
"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": {
|
"neo-async": {
|
||||||
"version": "2.6.1",
|
"version": "2.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"neato-emoji-converter": "^1.1.2",
|
||||||
"ragemp-better-bindings": "^1.0.4"
|
"ragemp-better-bindings": "^1.0.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user