Added toggle to swap Enter and Shift+Enter behaviour.

This commit is contained in:
flash 2024-06-24 22:10:00 +00:00
parent a080776723
commit c1d70471b3
2 changed files with 3 additions and 1 deletions

View file

@ -135,6 +135,7 @@ window.Umi = { UI: {} };
settings.define('marqueeAllNames').default(false).create(); settings.define('marqueeAllNames').default(false).create();
settings.define('tmpDisableOldThemeSys').default(false).critical().create(); settings.define('tmpDisableOldThemeSys').default(false).critical().create();
settings.define('dbgAnimDurationMulti').default(1).min(0).max(10).create(); settings.define('dbgAnimDurationMulti').default(1).min(0).max(10).create();
settings.define('newLineOnEnter').default(false).create();
const noNotifSupport = !('Notification' in window); const noNotifSupport = !('Notification' in window);
settings.define('enableNotifications').default(false).immutable(noNotifSupport).critical().create(); settings.define('enableNotifications').default(false).immutable(noNotifSupport).critical().create();
@ -432,6 +433,7 @@ window.Umi = { UI: {} };
category.setting('eepromAutoInsert').title('Auto-insert uploads').done(); category.setting('eepromAutoInsert').title('Auto-insert uploads').done();
category.setting('autoEmbedV1').title('Auto-embed media').done(); category.setting('autoEmbedV1').title('Auto-embed media').done();
category.setting('autoEmbedPlay').title('Auto-play embedded media').done(); category.setting('autoEmbedPlay').title('Auto-play embedded media').done();
category.setting('newLineOnEnter').title('Swap Enter and Shift+Enter behaviour').done();
}); });
sbSettings.category(category => { sbSettings.category(category => {
category.header('Notifications'); category.header('Notifications');

View file

@ -92,7 +92,7 @@ Umi.UI.Hooks = (function() {
return; return;
} }
if((ev.key === 'Enter' || ev.key === 'NumpadEnter') && !ev.shiftKey) { if((ev.key === 'Enter' || ev.key === 'NumpadEnter') && ev.shiftKey === mami.settings.get('newLineOnEnter')) {
ev.preventDefault(); ev.preventDefault();
$i('umi-msg-form').requestSubmit(); $i('umi-msg-form').requestSubmit();
return; return;