Changeset 37303
- Timestamp:
- 04/22/2016 09:42:38 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/edit-comments.js
r37302 r37303 567 567 cid : '', 568 568 act : '', 569 originalContent : '', 569 570 570 571 init : function() { … … 650 651 651 652 this.cid = ''; 653 this.originalContent = ''; 652 654 }, 653 655 … … 659 661 colspanVal = 0; 660 662 663 if ( ! this.discardCommentChanges() ) { 664 return false; 665 } 666 661 667 t.close(); 662 668 t.cid = comment_id; … … 667 673 act = 'edit' == action ? 'edit' : 'replyto'; 668 674 act = t.act = act + '-comment'; 675 t.originalContent = $('textarea.comment', rowData).val(); 669 676 colspanVal = $( '> th:visible, > td:visible', c ).length; 670 677 … … 854 861 $('#no-comments').remove(); 855 862 }); 863 }, 864 865 /** 866 * Alert the user if they have unsaved changes on a comment that will be 867 * lost if they proceed. 868 * 869 * @returns {boolean} 870 */ 871 discardCommentChanges: function() { 872 var editRow = $( '#replyrow' ); 873 874 if ( this.originalContent === $( '#replycontent', editRow ).val() ) { 875 return true; 876 } 877 878 return window.confirm( adminCommentsL10n.warnCommentChanges ); 856 879 } 857 880 }; -
trunk/src/wp-admin/js/post.js
r36972 r37303 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. -
trunk/src/wp-includes/script-loader.php
r37201 r37303 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 */
Note: See TracChangeset
for help on using the changeset viewer.