From 2dd698fd79abc35f4f56fbf929d3fb0320c27bfe Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Wed, 8 Mar 2017 18:59:54 +0100 Subject: Submit editlink textarea using CTRL+Enter shortcut --- tpl/default/editlink.html | 2 +- tpl/default/js/shaarli.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'tpl') diff --git a/tpl/default/editlink.html b/tpl/default/editlink.html index d6f81f96..2180c080 100644 --- a/tpl/default/editlink.html +++ b/tpl/default/editlink.html @@ -59,7 +59,7 @@
- + {if="!$link_is_new"} diff --git a/tpl/default/js/shaarli.js b/tpl/default/js/shaarli.js index d47c257f..f7de0a49 100644 --- a/tpl/default/js/shaarli.js +++ b/tpl/default/js/shaarli.js @@ -256,7 +256,14 @@ window.onload = function () { resize(); } + if (description != null) { init(); + // Submit editlink form with CTRL + Enter in the text area. + description.addEventListener('keydown', function (event) { + if (event.ctrlKey && event.keyCode === 13) { + document.getElementById('button-save-edit').click(); + } + }); } }; -- cgit v1.2.3