treebird/dist/js/emoji.js
nekobit ff2aa768c9 Use insertAdjacentHTML for the emojo picker:
FossilOrigin-Name: b42f9e4982e0e02f62c1d5de7e41c4fb9d35326149ebab55a853d0bd672cc45e
2022-06-26 05:04:41 +00:00

15 lines
408 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.insertAdjacentHTML('beforeend', emojo_picker_str);
});