Add optional {{char}} display name visible in formatted messages

This commit is contained in:
SillyLossy
2023-05-05 17:52:19 +03:00
parent a8c47037ac
commit f9d3120338
4 changed files with 46 additions and 13 deletions

View File

@ -100,6 +100,7 @@ let power_user = {
auto_fix_generated_markdown: true,
send_on_enter: send_on_enter_options.AUTO,
render_formulas: false,
allow_name2_display: false,
};
let themes = [];
@ -372,6 +373,7 @@ function loadPowerUserSettings(settings, data) {
$("#play_message_sound").prop("checked", power_user.play_message_sound);
$("#play_sound_unfocused").prop("checked", power_user.play_sound_unfocused);
$("#auto_save_msg_edits").prop("checked", power_user.auto_save_msg_edits);
$("#allow_name2_display").prop("checked", power_user.allow_name2_display);
$(`input[name="avatar_style"][value="${power_user.avatar_style}"]`).prop("checked", true);
$(`input[name="chat_display"][value="${power_user.chat_display}"]`).prop("checked", true);
$(`input[name="sheld_width"][value="${power_user.sheld_width}"]`).prop("checked", true);
@ -747,6 +749,12 @@ $(document).ready(() => {
saveSettingsDebounced();
})
$("#allow_name2_display").on("input", function () {
power_user.allow_name2_display = !!$(this).prop('checked');
reloadCurrentChat();
saveSettingsDebounced();
});
$(window).on('focus', function () {
browser_has_focus = true;
});