diff --git a/dist/js/emoji.js b/dist/js/emoji.js index e69de29..37cf341 100644 --- a/dist/js/emoji.js +++ b/dist/js/emoji.js @@ -0,0 +1,105 @@ +// Get emojis from file +function get_emojo_json(callback) +{ + let xhr = new XMLHttpRequest(); + xhr.open("GET", "/emoji.json"); + xhr.onreadystatechange = function() { + if (this.readyState === XMLHttpRequest.DONE) + callback(this.response); + }; + xhr.send(); +} + +function construct_emojo_picker() +{ + let emoji_picker = document.createElement("div"); + emoji_picker.className = "emoji-picker"; + emoji_picker.innerHTML = ` + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ +
+ {{%s:emojis_smileys}} +
+ +
+ {{%s:emojis_animals}} +
+ +
+ {{%s:emojis_food}} +
+ +
+ {{%s:emojis_travel}} +
+ +
+ {{%s:emojis_activities}} +
+ +
+ {{%s:emojis_objects}} +
+ +
+ {{%s:emojis_symbols}} +
+ +
+ {{%s:emojis_flags}} +
+
+ +`; + + return emoji_picker; +} + +get_emojo_json((emojo_json_str) => { + const emojo_json = JSON.parse(emojo_json_str); + console.log(emojo_json); +}); diff --git a/static/index.tmpl b/static/index.tmpl index 647c93e..f638293 100644 --- a/static/index.tmpl +++ b/static/index.tmpl @@ -66,5 +66,6 @@ +