mirror of https://github.com/movim/movim
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
var Stickers = {
|
|
addSmiley: function(element) {
|
|
Chat.insertAtCursor(element.dataset.emoji);
|
|
Drawer.clear();
|
|
},
|
|
zoom: function(element, jid, pack, value) {
|
|
var zoomed = document.querySelectorAll('.zoomed');
|
|
|
|
if (element.classList.contains('zoomed')) {
|
|
Drawer.clear();
|
|
|
|
var textarea = document.querySelector('#chat_textarea');
|
|
Stickers_ajaxSend(jid, pack, value, Boolean(textarea.dataset.muc));
|
|
}
|
|
|
|
var i = 0;
|
|
while(i < zoomed.length) {
|
|
zoomed[i].classList.remove('zoomed');
|
|
i++;
|
|
}
|
|
|
|
element.classList.add('zoomed');
|
|
},
|
|
setEmojisEvent(mid) {
|
|
const emojis = document.querySelectorAll('#emojisearchbar + .emojis img');
|
|
let i = 0;
|
|
|
|
while (i < emojis.length) {
|
|
emojis[i].onclick = function() {
|
|
if (mid) {
|
|
Chat_ajaxHttpDaemonSendReaction(mid, this.dataset.emoji);
|
|
Dialog_ajaxClear();
|
|
} else {
|
|
Stickers.addSmiley(this);
|
|
}
|
|
}
|
|
|
|
i++;
|
|
}
|
|
}
|
|
}
|