Ticket #33414: 33414.3.diff
File 33414.3.diff, 4.1 KB (added by , 9 years ago) |
---|
-
src/wp-admin/admin-header.php
75 75 pagenow = '<?php echo $current_screen->id; ?>', 76 76 typenow = '<?php echo $current_screen->post_type; ?>', 77 77 adminpage = '<?php echo $admin_body_class; ?>', 78 adminTitle = '<?php echo esc_js( html_entity_decode( $admin_title ) ) ?>', 78 79 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', 79 80 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>', 80 81 isRtl = <?php echo (int) is_rtl(); ?>; -
src/wp-admin/edit-comments.php
104 104 wp_enqueue_script('admin-comments'); 105 105 enqueue_comment_hotkeys_js(); 106 106 107 if ( $post_id ) 108 $title = sprintf( __( 'Comments on “%s”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) ); 109 else 110 $title = __('Comments'); 107 if ( $post_id ) { 108 $comments_count = get_comment_count( $post_id ); 109 $draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ); 110 if ( $comments_count['awaiting_moderation'] > 0 ) { 111 $title = sprintf( 112 __( 'Comments (%s) on “%s”' ), 113 number_format_i18n( $comments_count['awaiting_moderation'] ), 114 $draft_or_post_title 115 ); 116 } else { 117 $title = sprintf( __( 'Comments on “%s”' ), $draft_or_post_title ); 118 } 119 } else { 120 $comments_count = get_comment_count(); 121 if ( $comments_count['awaiting_moderation'] > 0 ) { 122 $title = sprintf( 123 __( 'Comments (%s)' ), 124 number_format_i18n( $comments_count['awaiting_moderation'] ) 125 ); 126 } else { 127 $title = __( 'Comments' ); 128 } 129 } 111 130 112 131 add_screen_option( 'per_page' ); 113 132 -
src/wp-admin/js/edit-comments.js
1 /* global admin CommentsL10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */1 /* global adminTitle, adminCommentsL10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */ 2 2 var setCommentsList, theList, theExtraList, commentReply; 3 3 4 4 (function($) { 5 var getCount, updateCount, updateCountText, updatePending, updateApproved ;5 var getCount, updateCount, updateCountText, updatePending, updateApproved, updateHtmlTitle; 6 6 7 7 setCommentsList = function() { 8 8 var totalInput, perPageInput, pageInput, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList, diff, 9 lastConfidentTime = 0 ;9 lastConfidentTime = 0, titleDiv, titleRegEx; 10 10 11 11 totalInput = $('input[name="_total"]', '#comments-form'); 12 12 perPageInput = $('input[name="_per_page"]', '#comments-form'); … … 135 135 el.html(n); 136 136 }; 137 137 138 updateHtmlTitle = function ( diff ) { 139 var newTitle, regexMatch, titleCount; 140 141 titleRegEx = titleRegEx || new RegExp( 'Comments (\\([0-9' + thousandsSeparator + ']+\\))?' ); 142 // count funcs operate on a $'d element 143 titleDiv = titleDiv || $( '<div />' ); 144 newTitle = adminTitle; 145 146 titleDiv.html( document.title ); 147 titleCount = getCount( titleDiv ) + diff; 148 if ( titleCount >= 1 ) { 149 updateCount( titleDiv, titleCount ); 150 regexMatch = titleRegEx.exec( document.title ); 151 if ( regexMatch ) { 152 newTitle = document.title.replace( regexMatch[0], 'Comments (' + titleDiv.text() + ') ' ); 153 } 154 } else { 155 regexMatch = titleRegEx.exec( newTitle ); 156 if ( regexMatch ) { 157 newTitle = newTitle.replace( regexMatch[0], 'Comments' ); 158 } 159 } 160 document.title = newTitle; 161 }; 162 138 163 updatePending = function( diff, commentPostId ) { 139 164 var postSelector = '.post-com-count-' + commentPostId, 140 165 noClass = 'comment-count-no-pending', … … 143 168 pending, 144 169 noPending; 145 170 171 updateHtmlTitle( diff ); 172 146 173 $( 'span.pending-count' ).each(function() { 147 174 var a = $(this), n = getCount(a) + diff; 148 175 if ( n < 1 )