Add Save shortcut

This commit is contained in:
2026-04-10 11:03:17 +02:00
parent a7e22d1aa7
commit 2724e05e90
2 changed files with 4 additions and 1 deletions

View File

@@ -26,7 +26,10 @@
textarea.focus();
}
var form = textarea.closest('form');
var actions = {
save: function () { form.submit(); },
bold: function () { wrap('**', '**', 'bold text'); },
italic: function () { wrap('*', '*', 'italic text'); },
h1: function () { linePrefix('# '); },

View File

@@ -39,7 +39,7 @@
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
<div class="form-actions">
<a class="btn-cancel" href="{{.PostURL}}">CANCEL</a>
<button class="btn-save" type="submit">SAVE</button>
<button class="btn-save" type="submit" data-action="save" data-key="S" title="Save (S)">SAVE</button>
</div>
</form>
<script src="/_/editor.js"></script>