From 8e59fa3f27d39d643511ef228e440bfd9be5469b Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Tue, 17 Jul 2018 09:16:59 +0200 Subject: [PATCH] Add shortcut to save wiki page This allows saving the wiki page with Ctrl-Enter. --- public/js/index.js | 3 ++- templates/repo/wiki/new.tmpl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index 696b63e7787de..5f4a7bc774aad 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -790,7 +790,7 @@ function initTeamSettings() { function initWikiForm() { var $editArea = $('.repository.wiki textarea#edit_area'); if ($editArea.length > 0) { - new SimpleMDE({ + var simplemde = new SimpleMDE({ autoDownloadFontAwesome: false, element: $editArea[0], forceSync: true, @@ -825,6 +825,7 @@ function initWikiForm() { "link", "image", "table", "horizontal-rule", "|", "clean-block", "preview", "fullscreen"] }) + $(simplemde.codemirror.getInputField()).addClass("js-quick-submit"); } } diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl index 34c6b2d0cacb4..7dc066ffb86b5 100644 --- a/templates/repo/wiki/new.tmpl +++ b/templates/repo/wiki/new.tmpl @@ -17,7 +17,7 @@
- +