Changeset 9241
- Timestamp:
- 10/18/2008 05:00:20 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r9233 r9241 341 341 </p> 342 342 <?php 343 344 if ( !$post_ID || $post_ID < 0 || 0 == $post->comment_count ) 343 $total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID)); 344 345 if ( !$post_ID || $post_ID < 0 || 1 > $total ) 345 346 return; 346 347 … … 359 360 </tbody> 360 361 </table> 361 <p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get();return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /></p> 362 <?php 362 <p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /></p> 363 <?php 364 $hidden = (array) get_user_option( "meta-box-hidden_post" ); 365 if ( ! in_array('commentstatusdiv', $hidden) ) { ?> 366 <script type="text/javascript">commentsBox.get(<?php echo $total; ?>, 10);</script> 367 <?php 368 } 363 369 } 364 370 add_meta_box('commentstatusdiv', __('Comments on this Post'), 'post_comment_status_meta_box', 'post', 'normal', 'core'); -
trunk/wp-admin/js/post.js
r9225 r9241 235 235 st : 0, 236 236 237 get : function( id, nonce) {237 get : function(total, num) { 238 238 var st = this.st; 239 this.st += 20; 240 239 if ( ! num ) 240 num = 20; 241 242 this.st += num; 243 this.total = total; 241 244 $('.waiting').show(); 242 245 … … 247 250 'post_ID' : $('#post_ID').val(), 248 251 'start' : st, 249 'num' : '20'252 'num' : num 250 253 }; 251 254 … … 263 266 $("a[className*=':']").unbind(); 264 267 setCommentsList(); 265 $('#show-comments').html(postL10n.showcomm); 268 269 if ( commentsBox.st > commentsBox.total ) 270 $('#show-comments').hide(); 271 else 272 $('#show-comments').html(postL10n.showcomm); 266 273 return; 267 274 } else if ( 1 == r ) { -
trunk/wp-includes/script-loader.php
r9240 r9241 176 176 'cancel' => __('Cancel'), 177 177 ) ); 178 $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug', 'settings-box'), '2008 0925' );178 $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug', 'settings-box'), '20081018' ); 179 179 $scripts->localize( 'post', 'postL10n', array( 180 180 'tagsUsed' => __('Tags used on this post:'),
Note: See TracChangeset
for help on using the changeset viewer.