treebird/dist/js/emoji.js
nekobit f1abdd3b50 Fetch emoji picker document instead for JS - Before we were generating our own but this was pretty slow for JS
FossilOrigin-Name: 97ab71ad7f73882b8f980ce0daaad90636e9d2214e4fab4169f975b64f5eb309
2022-06-24 23:56:54 +00:00

15 lines
388 B
JavaScript

// Get emojis from file
function get_emojo_picker(callback)
{
let xhr = new XMLHttpRequest();
xhr.open("GET", "/emoji_picker");
xhr.onreadystatechange = function() {
if (this.readyState === XMLHttpRequest.DONE)
callback(this.response);
};
xhr.send();
}
get_emojo_picker((emojo_picker_str) => {
document.body.innerHTML += emojo_picker_str;
});