From 8058967e7fe5fdca4e0d5f14c1743a3f7207372f Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Wed, 20 Jan 2016 12:38:21 +0000 Subject: [PATCH 1/2] [ticket/14422] Support cmd+enter for submitting message PHPBB3-14422 --- phpBB/assets/javascript/editor.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js index 298526ab1f..8b2d5741b7 100644 --- a/phpBB/assets/javascript/editor.js +++ b/phpBB/assets/javascript/editor.js @@ -358,6 +358,12 @@ function getCaretPosition(txtarea) { if ($('#attach-panel').length) { phpbb.showDragNDrop(textarea); } + + $('textarea').on('keydown', function (e) { + if (e.which === 13 && e.metaKey) { + $(this).closest('form').submit(); + } + }); }); })(jQuery); From 1f25f710eacae402c5f38f9b063a72bbb5258fe4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 10 Mar 2016 15:08:12 +0100 Subject: [PATCH 2/2] [ticket/14422] Submit when pressing ctrl or cmd + enter PHPBB3-14422 --- phpBB/assets/javascript/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js index 8b2d5741b7..3abf5c84f4 100644 --- a/phpBB/assets/javascript/editor.js +++ b/phpBB/assets/javascript/editor.js @@ -360,7 +360,7 @@ function getCaretPosition(txtarea) { } $('textarea').on('keydown', function (e) { - if (e.which === 13 && e.metaKey) { + if (e.which === 13 && (e.metaKey || e.ctrlKey)) { $(this).closest('form').submit(); } });