Make posting by Ctrl+Enter possible
It is nice to be able to post a reply by pressing Ctrl/Cmd+Enter, this also works on in other microbloging clients like Twitter. This patch adds this possibility.
This commit is contained in:
parent
bf540b5b49
commit
0c19e27520
1 changed files with 8 additions and 0 deletions
|
@ -78,6 +78,14 @@ $(function(){
|
|||
$("#older-link").off('click').click(clickOlderLink);
|
||||
$(".micropub-form button[type='submit']").off('click').click(submitMicropubForm);
|
||||
|
||||
// Post by ctrl/cmd + enter in the text area
|
||||
$(".micropub-form textarea.content").keyup(function(e) {
|
||||
if ((e.ctrlKey || e.metaKey) && (e.keyCode == 13 || e.keyCode == 10)) {
|
||||
var button = $(e.target).closest('form').find('button[value=reply]');
|
||||
button[0].click();
|
||||
}
|
||||
});
|
||||
|
||||
$(".micropub-form .content").focus(function () {
|
||||
$(this).animate({ height: "4em" }, 200);
|
||||
var $target = $(evt.target);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue