diff --git a/src/mami.js/main.js b/src/mami.js/main.js index bdedb21..7dc3a5e 100644 --- a/src/mami.js/main.js +++ b/src/mami.js/main.js @@ -135,6 +135,7 @@ window.Umi = { UI: {} }; settings.define('marqueeAllNames').default(false).create(); settings.define('tmpDisableOldThemeSys').default(false).critical().create(); settings.define('dbgAnimDurationMulti').default(1).min(0).max(10).create(); + settings.define('newLineOnEnter').default(false).create(); const noNotifSupport = !('Notification' in window); 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('autoEmbedV1').title('Auto-embed 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 => { category.header('Notifications'); diff --git a/src/mami.js/ui/hooks.js b/src/mami.js/ui/hooks.js index 6894eff..d4ea9a4 100644 --- a/src/mami.js/ui/hooks.js +++ b/src/mami.js/ui/hooks.js @@ -92,7 +92,7 @@ Umi.UI.Hooks = (function() { 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(); $i('umi-msg-form').requestSubmit(); return;