Ticket #41545: 41545.3.diff
| File 41545.3.diff, 2.6 KB (added by , 7 years ago) |
|---|
-
src/js/_enqueues/admin/edit-comments.js
592 592 } 593 593 }); 594 594 595 // Allow users to use Ctrl/Cmd+Enter to submit comment 596 $('#replycontent', row).keydown(function (e) { 597 if (( e.metaKey || e.ctrlKey ) && e.keyCode === 13) { 598 commentReply.send(); 599 e.preventDefault(); 600 return false; 601 } 602 }); 603 595 604 // add events 596 605 $('#the-comment-list .column-comment > p').dblclick(function(){ 597 606 commentReply.toggle($(this).parent()); -
src/js/_enqueues/lib/comment-reply.js
85 85 } 86 86 87 87 /** 88 * Submits the comment form. 89 * 90 * @param e The triggered event. 91 * @param textareaId The comment form textarea id. 92 * 93 * @return {boolean} 94 */ 95 function submitForm( e, textareaId ) { 96 if ( ( e.metaKey || e.ctrlKey ) && e.keyCode === 13 ) { 97 var textarea = document.getElementById( textareaId ), 98 commentForm = document.getElementById( textarea.form.id ); 99 100 document.createElement( 'form' ).submit.call( commentForm ); 101 e.preventDefault(); 102 return false; 103 } 104 } 105 106 /** 88 107 * Return all links classed .comment-reply-link. 89 108 * 90 109 * @since 5.0.0 … … 317 336 } 318 337 319 338 return { 339 submitForm: submitForm, 320 340 init: init, 321 341 moveForm: moveForm 322 342 }; -
src/wp-includes/comment-template.php
2297 2297 $fields = apply_filters( 'comment_form_default_fields', $fields ); 2298 2298 $defaults = array( 2299 2299 'fields' => $fields, 2300 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required" ></textarea></p>',2300 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required" onkeydown="return addComment.submitForm( event, \'comment\' )"></textarea></p>', 2301 2301 /** This filter is documented in wp-includes/link-template.php */ 2302 2302 'must_log_in' => '<p class="must-log-in">' . sprintf( 2303 2303 /* translators: %s: login URL */