Add Save shortcut
This commit is contained in:
@@ -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('# '); },
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user