Typecho was used six years ago (a long history). The default comment does not support ctrl+enter to submit comments. At that time, the processing method was to directly modify the html and add code:
onkeydown="if(event.ctrlKey&&event.keyCode==13){document.getElementById('misubmit').click();return false};"
See the history article for details《 How to add Ctrl+Enter quick reply to Typecho comments 》
Then I didn't know when to start, but I made an upgraded version. At that time, I forgot to refer to whose code, and changed it to:
function key_submit(){
if(window.event.ctrlKey && event.keyCode==13){
document.comment_form.submit();
}
}document.onkeydown=key_submit;
Then until today, another upgrade was carried out.
$('form[id=comment_form]').keypress(function(e){
if(e.ctrlKey && e.which == 13 || e.which == 10) {
$('#misubmit').click();
}
});
The replacement of the corresponding ID is as simple as that.
see jquery Typecho Related articles for
Please specify that the original article of this website is reproduced from To be kicked , Link: https://103.126.210.91/articles/2304.html