diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-09 19:14:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 19:14:10 +0100 |
commit | 1e38df6606a1faf86f5f6b2e94b61dec250db622 (patch) | |
tree | f1c78f7d75d9be5591c96f8103ac8b6a13691b16 | |
parent | 2008098574b2c5e308058414b426977068ade08d (diff) | |
parent | 2dd698fd79abc35f4f56fbf929d3fb0320c27bfe (diff) | |
download | Shaarli-1e38df6606a1faf86f5f6b2e94b61dec250db622.tar.gz Shaarli-1e38df6606a1faf86f5f6b2e94b61dec250db622.tar.zst Shaarli-1e38df6606a1faf86f5f6b2e94b61dec250db622.zip |
Merge pull request #791 from ArthurHoaro/feature/ctrl-enter-submit
Submit editlink textarea using CTRL+Enter shortcut
-rw-r--r-- | tpl/default/editlink.html | 2 | ||||
-rw-r--r-- | tpl/default/js/shaarli.js | 7 |
2 files changed, 8 insertions, 1 deletions
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 @@ | |||
59 | 59 | ||
60 | 60 | ||
61 | <div class="submit-buttons center"> | 61 | <div class="submit-buttons center"> |
62 | <input type="submit" value="{'Save'|t}" name="save_edit" class=""> | 62 | <input type="submit" value="{'Save'|t}" name="save_edit" class="" id="button-save-edit"> |
63 | {if="!$link_is_new"} | 63 | {if="!$link_is_new"} |
64 | <a href="?delete_link&lf_linkdate={$link.id}&token={$token}" | 64 | <a href="?delete_link&lf_linkdate={$link.id}&token={$token}" |
65 | title="" name="delete_link" class="button button-red confirm-delete"> | 65 | title="" name="delete_link" class="button button-red confirm-delete"> |
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 () { | |||
256 | 256 | ||
257 | resize(); | 257 | resize(); |
258 | } | 258 | } |
259 | |||
259 | if (description != null) { | 260 | if (description != null) { |
260 | init(); | 261 | init(); |
262 | // Submit editlink form with CTRL + Enter in the text area. | ||
263 | description.addEventListener('keydown', function (event) { | ||
264 | if (event.ctrlKey && event.keyCode === 13) { | ||
265 | document.getElementById('button-save-edit').click(); | ||
266 | } | ||
267 | }); | ||
261 | } | 268 | } |
262 | }; | 269 | }; |