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

8 years ago
  1. var Stickers = {
  2. addSmiley: function(element) {
  3. Chat.insertAtCursor(element.dataset.emoji);
  4. Drawer.clear();
  5. },
  6. zoom: function(element, jid, pack, value) {
  7. var zoomed = document.querySelectorAll('.zoomed');
  8. if (element.classList.contains('zoomed')) {
  9. Drawer.clear();
  10. var textarea = document.querySelector('#chat_textarea');
  11. Stickers_ajaxSend(jid, pack, value, Boolean(textarea.dataset.muc));
  12. }
  13. var i = 0;
  14. while(i < zoomed.length) {
  15. zoomed[i].classList.remove('zoomed');
  16. i++;
  17. }
  18. element.classList.add('zoomed');
  19. },
  20. setEmojisEvent(mid) {
  21. const emojis = document.querySelectorAll('#emojisearchbar + .emojis img');
  22. let i = 0;
  23. while (i < emojis.length) {
  24. emojis[i].onclick = function() {
  25. if (mid) {
  26. Chat_ajaxHttpDaemonSendReaction(mid, this.dataset.emoji);
  27. Dialog_ajaxClear();
  28. } else {
  29. Stickers.addSmiley(this);
  30. }
  31. }
  32. i++;
  33. }
  34. }
  35. }