diff --git a/index.php b/index.php index e484f1e..91d125a 100644 --- a/index.php +++ b/index.php @@ -60,19 +60,19 @@ require_once(SITE_LOCATION . '/php/notificationconditiontree.php');
🔒
diff --git a/js/ui.js b/js/ui.js index 9b3312d..a6a5aa8 100644 --- a/js/ui.js +++ b/js/ui.js @@ -248,6 +248,18 @@ function CloseUpdateConflictArea(displayId) { EnableForm(); } +function SubmitWordOnCtrlEnter(keypress) { + var keyCode = (event.which ? event.which : event.keyCode); + + if (keyCode === 10 || (keyCode == 13 && event.ctrlKey)) { //Windows and Linux Chrome accept ctrl+enter as keyCode 10. + AddWord(); + + if (document.getElementById("newWordButtonArea").style.display == "none" && document.getElementById("editWordButtonArea").style.display == "none") { + document.getElementById("updateConfirmButton").focus(); + } + } +} + function DisableForm() { document.getElementById("word").disabled = true; document.getElementById("pronunciation").disabled = true;