Add Save shortcut
This commit is contained in:
@@ -26,7 +26,10 @@
|
|||||||
textarea.focus();
|
textarea.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var form = textarea.closest('form');
|
||||||
|
|
||||||
var actions = {
|
var actions = {
|
||||||
|
save: function () { form.submit(); },
|
||||||
bold: function () { wrap('**', '**', 'bold text'); },
|
bold: function () { wrap('**', '**', 'bold text'); },
|
||||||
italic: function () { wrap('*', '*', 'italic text'); },
|
italic: function () { wrap('*', '*', 'italic text'); },
|
||||||
h1: function () { linePrefix('# '); },
|
h1: function () { linePrefix('# '); },
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
|
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<a class="btn-cancel" href="{{.PostURL}}">CANCEL</a>
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<script src="/_/editor.js"></script>
|
<script src="/_/editor.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user