19 lines
702 B
JavaScript
Executable file
19 lines
702 B
JavaScript
Executable file
// Adds a row of quick emoji buttons that insert into the message box.
|
|
(function () {
|
|
var input = document.querySelector('#chat [name="chat_text"]');
|
|
if (!input) return;
|
|
var row = document.createElement('div');
|
|
row.className = 'mt-2';
|
|
['😀', '😂', '👍', '❤️', '🎉', '🙏'].forEach(function (emoji) {
|
|
var b = document.createElement('button');
|
|
b.type = 'button';
|
|
b.className = 'btn btn-sm btn-outline-secondary me-1';
|
|
b.textContent = emoji;
|
|
b.addEventListener('click', function () {
|
|
input.setRangeText(emoji, input.selectionStart, input.selectionEnd, 'end');
|
|
input.focus();
|
|
});
|
|
row.appendChild(b);
|
|
});
|
|
input.form.appendChild(row);
|
|
})();
|