Merge branch 'staging' into st-object-vars

This commit is contained in:
Cohee 2023-12-07 16:46:02 +02:00
commit 785be22e51
3 changed files with 12 additions and 3 deletions

View File

@ -378,7 +378,7 @@ jQuery(function () {
});
$(document).on('click', '.editor_maximize', function () {
const broId = $(this).data('for');
const broId = $(this).attr('data-for');
const bro = $(`#${broId}`);
if (!bro.length) {

View File

@ -40,5 +40,10 @@
<span><i class="fa-solid fa-fw fa-message"></i> Execute on opening chat</span>
</label>
</div>
<h3><strong>UI Options</strong></h3>
<div class="flex-container flexFlowColumn">
<label for="quickReply_ui_title">Title (tooltip, leave empty to show the message or /command)</label>
<input type="text" class="text_pole" id="quickReply_ui_title">
</div>
</div>
</div>

View File

@ -189,6 +189,8 @@ async function onQuickReplyCtxButtonClick(id) {
saveSettingsDebounced();
});
$('#quickReply_ui_title').val(qr.title ?? '');
if (await popupResult) {
qr.contextMenu = Array.from(document.querySelectorAll('#quickReply_contextMenuEditor_content > .quickReplyContextMenuEditor_item'))
.map(item => ({
@ -197,6 +199,8 @@ async function onQuickReplyCtxButtonClick(id) {
}))
.filter(item => item.preset);
$(`#quickReplyContainer[data-order="${id}"]`).attr('data-contextMenu', JSON.stringify(qr.contextMenu));
qr.title = $('#quickReply_ui_title').val();
saveSettingsDebounced();
updateQuickReplyPreset();
onQuickReplyLabelInput(id);
}
@ -436,7 +440,7 @@ function addQuickReplyBar() {
if (extension_settings.quickReply.quickReplySlots[i]?.contextMenu?.length) {
expander = '<span class="ctx-expander" title="Open context menu">⋮</span>';
}
quickReplyButtonHtml += `<div title="${escapeHtml(quickReplyMes)}" class="quickReplyButton ${hidden ? 'displayNone' : ''}" data-index="${i}" id="quickReply${i + 1}">${DOMPurify.sanitize(quickReplyLabel)}${expander}</div>`;
quickReplyButtonHtml += `<div title="${escapeHtml(qr.title || quickReplyMes)}" class="quickReplyButton ${hidden ? 'displayNone' : ''}" data-index="${i}" id="quickReply${i + 1}">${DOMPurify.sanitize(quickReplyLabel)}${expander}</div>`;
}
const quickReplyBarFullHtml = `
@ -691,7 +695,7 @@ function saveQROrder() {
$(this).find('input').attr('id', `quickReply${i}Label`);
$(this).find('textarea').attr('id', `quickReply${i}Mes`);
$(this).find(`#quickReply${oldOrder}CtxButton`).attr('id', `quickReply${i}CtxButton`);
$(this).find(`#quickReply${oldOrder}ExpandButton`).attr('id', `quickReply${i}ExpandButton`);
$(this).find(`#quickReply${oldOrder}ExpandButton`).attr({ 'data-for': `quickReply${i}Mes`, 'id': `quickReply${i}ExpandButton` });
i++;
});