add: chat message reactions
This commit is contained in:
parent
a4298f95f6
commit
a37312fecf
20 changed files with 557 additions and 25 deletions
|
@ -109,6 +109,23 @@
|
|||
("title" "Send")
|
||||
(text "{{ icon \"send-horizontal\" }}"))))
|
||||
(text "{%- endif %}")
|
||||
|
||||
; emoji picker
|
||||
(text "{{ components::emoji_picker(element_id=\"\", render_dialog=true, render_button=false) }}")
|
||||
(input ("id" "react_emoji_picker_field") ("class" "hidden") ("type" "hidden"))
|
||||
|
||||
(script
|
||||
(text "window.EMOJI_PICKER_MODE = \"replace\";
|
||||
document.getElementById(\"react_emoji_picker_field\").addEventListener(\"change\", (e) => {
|
||||
if (!EMOJI_PICKER_REACTION_MESSAGE_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
const emoji = e.target.value === \"::\" ? \":heart:\" : e.target.value;
|
||||
trigger(\"me::message_react\", [document.getElementById(`message-${EMOJI_PICKER_REACTION_MESSAGE_ID}`), EMOJI_PICKER_REACTION_MESSAGE_ID, emoji]);
|
||||
});"))
|
||||
|
||||
; ...
|
||||
(script
|
||||
(text "window.CURRENT_PAGE = Number.parseInt(\"{{ page }}\");
|
||||
window.VIEWING_SINGLE = \"{{ message }}\".length > 0;
|
||||
|
@ -434,6 +451,7 @@
|
|||
const clean_text = () => {
|
||||
trigger(\"atto::clean_date_codes\");
|
||||
trigger(\"atto::hooks::online_indicator\");
|
||||
trigger(\"atto::hooks::check_message_reactions\");
|
||||
};
|
||||
|
||||
document.addEventListener(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue