Ticket #32818: 32818.patch
File 32818.patch, 2.8 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/edit-comments.js
563 563 commentReply = { 564 564 cid : '', 565 565 act : '', 566 originalContent : '', 566 567 567 568 init : function() { 568 569 var row = $('#replyrow'); … … 646 647 $( '.spinner', replyrow ).removeClass( 'is-active' ); 647 648 648 649 this.cid = ''; 650 this.originalContent = ''; 649 651 }, 650 652 651 653 open : function(comment_id, post_id, action) { … … 655 657 h = c.height(), 656 658 colspanVal = 0; 657 659 660 if ( ! this.discardCommentChanges() ) { 661 return false; 662 } 663 658 664 t.close(); 659 665 t.cid = comment_id; 660 666 … … 663 669 action = action || 'replyto'; 664 670 act = 'edit' == action ? 'edit' : 'replyto'; 665 671 act = t.act = act + '-comment'; 672 t.originalContent = $('textarea.comment', rowData).val(); 666 673 colspanVal = $( '> th:visible, > td:visible', c ).length; 667 674 668 675 // Make sure it's actually a table and there's a `colspan` value to apply. … … 850 857 $('table.comments-box').css('display', ''); 851 858 $('#no-comments').remove(); 852 859 }); 860 }, 861 862 /** 863 * Alert the user if they have unsaved changes on a comment that will be 864 * lost if they proceed. 865 * 866 * @returns {boolean} 867 */ 868 discardCommentChanges: function() { 869 var editRow = $( '#replyrow' ); 870 871 if ( this.originalContent === $( '#replycontent', editRow ).val() ) { 872 return true; 873 } 874 875 return window.confirm( adminCommentsL10n.warnCommentChanges ); 853 876 } 854 877 }; 855 878 -
src/wp-admin/js/post.js
272 272 273 273 if ( typeof commentReply !== 'undefined' ) { 274 274 /* 275 * Warn the user they have an unsaved comment before submitting 276 * the post data for update. 277 */ 278 if ( ! commentReply.discardCommentChanges() ) { 279 return false; 280 } 281 282 /* 275 283 * Close the comment edit/reply form if open to stop the form 276 284 * action from interfering with the post's form action. 277 285 */ -
src/wp-includes/script-loader.php
495 495 'replyApprove' => __( 'Approve and Reply' ), 496 496 'reply' => __( 'Reply' ), 497 497 'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ), 498 'warnCommentChanges' => __( "Are you sure you want to do this?\nThe comment changes you made will be lost." ), 498 499 'docTitleComments' => __( 'Comments' ), 499 500 /* translators: %s: comments count */ 500 501 'docTitleCommentsCount' => __( 'Comments (%s)' ),