<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15509] trunk: Use adminTable to refill #the-extra-comment-list.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15509">15509</a></dd>
<dt>Author</dt> <dd>scribu</dd>
<dt>Date</dt> <dd>2010-08-19 00:06:51 +0000 (Thu, 19 Aug 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use adminTable to refill #the-extra-comment-list. See <a href="http://trac.wordpress.org/ticket/14637">#14637</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmineditcommentsphp">trunk/wp-admin/edit-comments.php</a></li>
<li><a href="#trunkwpadminincludesdefaultlisttablesphp">trunk/wp-admin/includes/default-list-tables.php</a></li>
<li><a href="#trunkwpadminjsadmintabledevjs">trunk/wp-admin/js/admin-table.dev.js</a></li>
<li><a href="#trunkwpadminjsadmintablejs">trunk/wp-admin/js/admin-table.js</a></li>
<li><a href="#trunkwpadminjseditcommentsdevjs">trunk/wp-admin/js/edit-comments.dev.js</a></li>
<li><a href="#trunkwpadminjseditcommentsjs">trunk/wp-admin/js/edit-comments.js</a></li>
<li><a href="#trunkwpincludesjswplistsdevjs">trunk/wp-includes/js/wp-lists.dev.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmineditcommentsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-comments.php (15508 => 15509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-comments.php        2010-08-18 22:26:22 UTC (rev 15508)
+++ trunk/wp-admin/edit-comments.php        2010-08-19 00:06:51 UTC (rev 15509)
</span><span class="lines">@@ -274,17 +274,6 @@
</span><span class="cx">
</span><span class="cx"> </form>
</span><span class="cx">
</span><del>-<form id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;">
-        <input type="hidden" name="s" value="<?php echo esc_attr($search); ?>" />
-        <input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
-        <input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
-        <input type="hidden" name="page" value="<?php echo esc_attr( $table->get_pagination_arg('page') ); ?>" />
-        <input type="hidden" name="per_page" value="1" />
-        <input type="hidden" name="p" value="<?php echo esc_attr( $post_id ); ?>" />
-        <input type="hidden" name="comment_type" value="<?php echo esc_attr( $comment_type ); ?>" />
-        <?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
-</form>
-
</del><span class="cx"> <div id="ajax-response"></div>
</span><span class="cx">
</span><span class="cx"> <?php } elseif ( 'moderated' == $comment_status ) { ?>
</span></span></pre></div>
<a id="trunkwpadminincludesdefaultlisttablesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/default-list-tables.php (15508 => 15509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/default-list-tables.php        2010-08-18 22:26:22 UTC (rev 15508)
+++ trunk/wp-admin/includes/default-list-tables.php        2010-08-19 00:06:51 UTC (rev 15509)
</span><span class="lines">@@ -1964,6 +1964,11 @@
</span><span class="cx">                         $comments_per_page = 20;
</span><span class="cx">                 $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
</span><span class="cx">
</span><ins>+                if ( isset( $_POST['number'] ) )
+                        $number = (int) $_POST['number'];
+                else
+                        $number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra
+
</ins><span class="cx">                 $page = $this->get_pagenum();
</span><span class="cx">
</span><span class="cx">                 $start = $offset = ( $page - 1 ) * $comments_per_page;
</span><span class="lines">@@ -1972,7 +1977,7 @@
</span><span class="cx">                         'status' => ( 'moderated' == $comment_status ) ? 'hold' : $comment_status, // TODO: replace all instances of 'moderated' with 'hold'
</span><span class="cx">                         'search' => $search,
</span><span class="cx">                         'offset' => $start,
</span><del>-                        'number' => $comments_per_page + 8, // Grab a few extra
</del><ins>+                        'number' => $number,
</ins><span class="cx">                         'post_id' => $post_id,
</span><span class="cx">                         'plural' => $comment_type,
</span><span class="cx">                         'orderby' => @$_REQUEST['orderby'],
</span><span class="lines">@@ -1983,11 +1988,11 @@
</span><span class="cx">
</span><span class="cx">                 update_comment_cache( $_comments );
</span><span class="cx">
</span><del>-                $args['count'] = true;
-                $args['offset'] = 0;
-                $args['number'] = 0;
-                $total_comments = get_comments( $args );
</del><ins>+                $this->items = array_slice( $_comments, 0, $comments_per_page );
+                $this->extra_items = array_slice( $_comments, $comments_per_page );
</ins><span class="cx">
</span><ins>+                $total_comments = get_comments( array_merge( $args, array('count' => true, 'offset' => 0, 'number' => 0) ) );
+
</ins><span class="cx">                 $_comment_post_ids = array();
</span><span class="cx">                 foreach ( $_comments as $_c ) {
</span><span class="cx">                         $_comment_post_ids[] = $_c->comment_post_ID;
</span><span class="lines">@@ -1995,9 +2000,6 @@
</span><span class="cx">
</span><span class="cx">                 $_comment_pending_count = get_pending_comments_num( $_comment_post_ids );
</span><span class="cx">
</span><del>-                $this->items = array_slice( $_comments, 0, $comments_per_page );
-                $this->extra_items = array_slice( $_comments, $comments_per_page );
-
</del><span class="cx">                 $this->set_pagination_args( array(
</span><span class="cx">                         'total_items' => $total_comments,
</span><span class="cx">                         'per_page' => $comments_per_page,
</span><span class="lines">@@ -2114,10 +2116,10 @@
</span><span class="cx">                 $this->display_tablenav( 'bottom' );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function display_rows( $items = array() ) {
</del><ins>+        function display_rows( $items = false ) {
</ins><span class="cx">                 global $mode, $comment_status;
</span><span class="cx">
</span><del>-                if ( empty( $items ) )
</del><ins>+                if ( false === $items )
</ins><span class="cx">                         $items = $this->items;
</span><span class="cx">
</span><span class="cx">                 foreach ( $items as $comment )
</span></span></pre></div>
<a id="trunkwpadminjsadmintabledevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/admin-table.dev.js (15508 => 15509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/admin-table.dev.js        2010-08-18 22:26:22 UTC (rev 15508)
+++ trunk/wp-admin/js/admin-table.dev.js        2010-08-19 00:06:51 UTC (rev 15509)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> jQuery(document).ready(function($) {
</span><span class="cx">
</span><del>-var adminTable = {
</del><ins>+window.adminTable = {
</ins><span class="cx">
</span><span class="cx">         init: function() {
</span><span class="cx">                 this.loading = false;
</span><span class="lines">@@ -74,21 +74,31 @@
</span><span class="cx">
</span><span class="cx">                 var data = $.query.get();
</span><span class="cx">
</span><del>-                data['action'] = 'fetch-list';
-                data['list_args'] = list_args;
-
</del><span class="cx">                 this._callback = callback;
</span><span class="cx">
</span><ins>+                this.fetch_list(
+                        data,
+                        $.proxy(this, 'handle_success'),
+                        $.proxy(this, 'handle_error')
+                );
+
+                return true;
+        },
+
+        fetch_list: function(data, success_callback, error_callback) {
+                data = $.extend(data, {
+                        'action': 'fetch-list',
+                        'list_args': list_args,
+                });
+
</ins><span class="cx">                 $.ajax({
</span><span class="cx">                         url: ajaxurl,
</span><span class="cx">                         global: false,
</span><span class="cx">                         dataType: 'json',
</span><span class="cx">                         data: data,
</span><del>-                        success: $.proxy(this, 'handle_success'),
-                        error: $.proxy(this, 'handle_error')
</del><ins>+                        success: success_callback,
+                        error: error_callback,
</ins><span class="cx">                 });
</span><del>-
-                return true;
</del><span class="cx">         },
</span><span class="cx">
</span><span class="cx">         handle_success: function(response) {
</span></span></pre></div>
<a id="trunkwpadminjsadmintablejs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/admin-table.js (15508 => 15509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/admin-table.js        2010-08-18 22:26:22 UTC (rev 15508)
+++ trunk/wp-admin/js/admin-table.js        2010-08-19 00:06:51 UTC (rev 15509)
</span><span class="lines">@@ -1 +1 @@
</span><del>-jQuery(document).ready(function(b){var a={init:function(){this.loading=false;b("form").each(function(){this.reset()});if(""==b.query.GET("paged")){b.query.SET("paged",1)}this.set_total_pages();this.$tbody=b("#the-list, #the-comment-list");this.$overlay=b('<div id="loading-items>').html(adminTableL10n.loading).hide().prependTo(b("body"))},set_total_pages:function(){this.total_pages=parseInt(b(".total-pages").eq(0).text())},get_total_pages:function(){return this.total_pages},change_page:function(c){if(c<1||c>this.total_pages){return false}this.update_rows({paged:c})},change_search:function(c){this.update_rows({s:c},true,function(){b("h2 .subtitle").remove();if(c){b("h2").eq(0).append(b('<span class="subtitle">').html(adminTableL10n.search.replace("%s",this.htmlencode(c))))}})},htmlencode:function(c){return b("<div/>").text(c).html()},update_rows:function(d,c,g){if(this.loading){return false}var f=false;b.each(d,function(h,i){if(i!=b.query.GET(h)){b.query.SET(h,i);f=true}});if(!f){return false}this.show_overlay();if(c){b.query.SET("paged",1)}var e=b.query.get();e.action="fetch-list";e.list_args=list_args;this._callback=g;b.ajax({url:ajaxurl,global:false,dataType:"json",data:e,success:b.proxy(this,"handle_success"),error:b.proxy(this,"handle_error")});return true},handle_success:function(c){if("object"!=typeof c){this.handle_error()}else{this.hide_overlay();this.$tbody.html(c.rows);b(".displaying-num").html(c.total_items);b(".total-pages").html(c.total_pages);this.set_total_pages();b(".current-page").val(b.query.GET("paged"));if(this._callback){this._callback()}}},handle_error:function(){this.hide_overlay();b("h2").after('<div class="error ajax below-h2"><p>'+adminTableL10n.error+"</p></div>")},show_overlay:function(){this.loading=true;b(".error.ajax").remove();this.$overlay.css({width:this.$tbody.width()+"px",height:this.$tbody.height()-20+"px"}).css(this.$tbody.offset()).show()},hide_overlay:function(){this.loading=false;this.$overlay.hide()}};a.init();b(".tablenav-pages a").click(function(){var c=b.query.GET("paged");switch(b(this).attr("class")){case"first-page":c=1;break;case"prev-page":c-=1;break;case"next-page":c+=1;break;case"last-page":c=a.get_total_pages();break}a.change_page(c);return false});b(".current-page").keypress(function(c){if(13!=c.keyCode){return}a.change_page(parseInt(b(this).val()));return false});b("th a").click(function(){var e=b.query.GET("orderby"),c=b.query.GET("order"),d=b(this).parent("th");if(d.hasClass("sortable")){e=b.query.load(b(this).attr("href")).get("orderby");c="asc";b("th.sorted-desc, th.sorted-asc").removeClass("sorted-asc").removeClass("sorted-desc").addClass("sortable");d.removeClass("sortable").addClass("sorted-asc")}else{if(d.hasClass("sorted-asc")){c="desc";d.removeClass("sorted-asc").addClass("sorted-desc")}else{if(d.hasClass("sorted-desc")){c="asc";d.removeClass("sorted-desc").addClass("sorted-asc")}}}a.update_rows({orderby:e,order:c},true);return false});b(".search-box :submit").click(function(){a.change_search(b(this).parent(".search-box").find(":text").val());return false});b(".search-box :text").keypress(function(c){if(13!=c.keyCode){return}a.change_search(b(this).val());return false});b("#post-query-submit").click(function(){var d,e,c={};b(this).parents(".actions").find('select[name!="action"]').each(function(){var f=b(this);c[f.attr("name")]=f.val()});a.update_rows(c,true);return false});b(".view-switch a").click(function(){var c=b(this);a.update_rows({mode:b.query.load(c.attr("href")).get("mode")},false,function(){b(".view-switch .current").removeClass("current");c.addClass("current")});return false})});
</del><span class="cx">\ No newline at end of file
</span><ins>+var adminTable;jQuery(document).ready(function(a){adminTable={init:function(){this.loading=false;a("form").each(function(){this.reset()});if(""==a.query.GET("paged")){a.query.SET("paged",1)}this.set_total_pages();this.$tbody=a("#the-list, #the-comment-list");this.$overlay=a('<div id="loading-items>').html(adminTableL10n.loading).hide().prependTo(a("body"))},set_total_pages:function(){this.total_pages=parseInt(a(".total-pages").eq(0).text())},get_total_pages:function(){return this.total_pages},change_page:function(b){if(b<1||b>this.total_pages){return false}this.update_rows({paged:b})},change_search:function(b){this.update_rows({s:b},true,function(){a("h2 .subtitle").remove();if(b){a("h2").eq(0).append(a('<span class="subtitle">').html(adminTableL10n.search.replace("%s",this.htmlencode(b))))}})},htmlencode:function(b){return a("<div/>").text(b).html()},update_rows:function(c,b,f){if(this.loading){return false}var e=false;a.each(c,function(g,h){if(h!=a.query.GET(g)){a.query.SET(g,h);e=true}});if(!e){return false}this.show_overlay();if(b){a.query.SET("paged",1)}var d=a.query.get();this._callback=f;this.fetch_list(d,a.proxy(this,"handle_success"),a.proxy(this,"handle_error"));return true},fetch_list:function(c,d,b){c=a.extend(c,{action:"fetch-list",list_args:list_args,});a.ajax({url:ajaxurl,global:false,dataType:"json",data:c,success:d,error:b,})},handle_success:function(b){if("object"!=typeof b){this.handle_error()}else{this.hide_overlay();this.$tbody.html(b.rows);a(".displaying-num").html(b.total_items);a(".total-pages").html(b.total_pages);this.set_total_pages();a(".current-page").val(a.query.GET("paged"));if(this._callback){this._callback()}}},handle_error:function(){this.hide_overlay();a("h2").after('<div class="error ajax below-h2"><p>'+adminTableL10n.error+"</p></div>")},show_overlay:function(){this.loading=true;a(".error.ajax").remove();this.$overlay.css({width:this.$tbody.width()+"px",height:this.$tbody.height()-20+"px"}).css(this.$tbody.offset()).show()},hide_overlay:function(){this.loading=false;this.$overlay.hide()}};adminTable.init();a(".tablenav-pages a").click(function(){var b=a.query.GET("paged");switch(a(this).attr("class")){case"first-page":b=1;break;case"prev-page":b-=1;break;case"next-page":b+=1;break;case"last-page":b=adminTable.get_total_pages();break}adminTable.change_page(b);return false});a(".current-page").keypress(function(b){if(13!=b.keyCode){return}adminTable.change_page(parseInt(a(this).val()));return false});a("th a").click(function(){var d=a.query.GET("orderby"),b=a.query.GET("order"),c=a(this).parent("th");if(c.hasClass("sortable")){d=a.query.load(a(this).attr("href")).get("orderby");b="asc";a("th.sorted-desc, th.sorted-asc").removeClass("sorted-asc").removeClass("sorted-desc").addClass("sortable");c.removeClass("sortable").addClass("sorted-asc")}else{if(c.hasClass("sorted-asc")){b="desc";c.removeClass("sorted-asc").addClass("sorted-desc")}else{if(c.hasClass("sorted-desc")){b="asc";c.removeClass("sorted-desc").addClass("sorted-asc")}}}adminTable.update_rows({orderby:d,order:b},true);return false});a(".search-box :submit").click(function(){adminTable.change_search(a(this).parent(".search-box").find(":text").val());return false});a(".search-box :text").keypress(function(b){if(13!=b.keyCode){return}adminTable.change_search(a(this).val());return false});a("#post-query-submit").click(function(){var c,d,b={};a(this).parents(".actions").find('select[name!="action"]').each(function(){var e=a(this);b[e.attr("name")]=e.val()});adminTable.update_rows(b,true);return false});a(".view-switch a").click(function(){var b=a(this);adminTable.update_rows({mode:a.query.load(b.attr("href")).get("mode")},false,function(){a(".view-switch .current").removeClass("current");b.addClass("current")});return false})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjseditcommentsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/edit-comments.dev.js (15508 => 15509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/edit-comments.dev.js        2010-08-18 22:26:22 UTC (rev 15508)
+++ trunk/wp-admin/js/edit-comments.dev.js        2010-08-19 00:06:51 UTC (rev 15509)
</span><span class="lines">@@ -209,7 +209,14 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
</span><del>-                $('#get-extra-comments').submit();
</del><ins>+
+                // Refill the extra list
+                var args = $.query.get();
+                args.number = 1;
+                args.paged++;
+                adminTable.fetch_list(args, function(response) {
+                        theExtraList.get(0).wpList.add( response.rows );
+                });
</ins><span class="cx">         };
</span><span class="cx">
</span><span class="cx">         theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
</span></span></pre></div>
<a id="trunkwpadminjseditcommentsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/edit-comments.js (15508 => 15509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/edit-comments.js        2010-08-18 22:26:22 UTC (rev 15508)
+++ trunk/wp-admin/js/edit-comments.js        2010-08-19 00:06:51 UTC (rev 15509)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var c,e,h,l=0,g,i,d,k;c=a('.tablenav input[name="_total"]',"#comments-form");e=a('.tablenav input[name="_per_page"]',"#comments-form");h=a('.tablenav input[name="_page"]',"#comments-form");g=function(n,m){var o=a("#"+m.element);if(o.is(".unapproved")){o.find("div.comment_status").html("0")}else{o.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var p=a(this),r,q;r=p.html().replace(/[^0-9]+/g,"");r=parseInt(r,10);if(isNaN(r)){return}q=a("#"+m.element).is("."+m.dimClass)?1:-1;r=r+q;if(r<0){r=0}p.closest("#awaiting-mod")[0==r?"addClass":"removeClass"]("count-0");f(p,r);j()})};i=function(q,u){var w=a(q.target).attr("className"),m,o,p,t,v,s,r=false;q.data._total=c.val()||0;q.data._per_page=e.val()||0;q.data._page=h.val()||0;q.data._url=document.location.href;if(w.indexOf(":trash=1")!=-1){r="trash"}else{if(w.indexOf(":spam=1")!=-1){r="spam"}}if(r){m=w.replace(/.*?comment-([0-9]+).*/,"$1");o=a("#comment-"+m);note=a("#"+r+"-undo-holder").html();o.find(".check-column :checkbox").attr("checked","");if(o.siblings("#replyrow").length&&commentReply.cid==m){commentReply.close()}if(o.is("tr")){p=o.children(":visible").length;s=a(".author strong",o).text();t=a('<tr id="undo-'+m+'" class="undo un'+r+'" style="display:none;"><td colspan="'+p+'">'+note+"</td></tr>")}else{s=a(".comment-author",o).text();t=a('<div id="undo-'+m+'" style="display:none;" class="undo un'+r+'">'+note+"</div>")}o.before(t);a("strong","#undo-"+m).text(s+" ");v=a(".undo a","#undo-"+m);v.attr("href","comment.php?action=un"+r+"comment&c="+m+"&_wpnonce="+q.data._ajax_nonce);v.attr("className","delete:the-comment-list:comment-"+m+"::un"+r+"=1 vim-z vim-destructive");a(".avatar",o).clone().prependTo("#undo-"+m+" ."+r+"-undo-inside");v.click(function(){u.wpList.del(this);a("#undo-"+m).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove();a("#comment-"+m).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return q};d=function(m,n,o){if(n<l){return}if(o){l=n}c.val(m.toString());a("span.total-type-count").each(function(){f(a(this),m)})};function j(s){var r=a("#dashboard_right_now"),o,q,p,m;s=s||0;if(isNaN(s)||!r.length){return}o=a("span.total-count",r);q=a("span.approved-count",r);p=b(o);p=p+s;m=p-b(a("span.pending-count",r))-b(a("span.spam-count",r));f(o,p);f(q,m)}function b(m){var o=parseInt(m.html().replace(/[^0-9]+/g,""),10);if(isNaN(o)){return 0}return o}function f(o,p){var m="";if(isNaN(p)){return}p=p<1?"0":p.toString();if(p.length>3){while(p.length>3){m=thousandsSeparator+p.substr(p.length-3)+m;p=p.substr(0,p.length-3)}p=p+m}o.html(p)}k=function(m,o){var t,p,q,v=a(o.target).parent().is("span.untrash"),n=a(o.target).parent().is("span.unspam"),u,s;function w(r){if(a(o.target).parent().is("span."+r)){return 1}else{if(a("#"+o.element).is("."+r)){return -1}}return 0}u=w("spam");s=w("trash");if(v){s=-1}if(n){u=-1}a("span.pending-count").each(function(){var r=a(this),y=b(r),x=a("#"+o.element).is(".unapproved");if(a(o.target).parent().is("span.unapprove")||((v||n)&&x)){y=y+1}else{if(x){y=y-1}}if(y<0){y=0}r.closest("#awaiting-mod")[0==y?"addClass":"removeClass"]("count-0");f(r,y);j()});a("span.spam-count").each(function(){var r=a(this),x=b(r)+u;f(r,x)});a("span.trash-count").each(function(){var r=a(this),x=b(r)+s;f(r,x)});if(a("#dashboard_right_now").length){q=s?-1*s:0;j(q)}else{t=c.val()?parseInt(c.val(),10):0;t=t-u-s;if(t<0){t=0}if(("object"==typeof m)&&l<o.parsed.responses[0].supplemental.time){p=o.parsed.responses[0].supplemental.pageLinks||"";if(a.trim(p)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(p))}else{a(".tablenav-pages").find(".page-numbers").remove()}d(t,o.parsed.responses[0].supplemental.time,true)}else{d(t,m,false)}}if(theExtraList.size()==0||theExtraList.children().size()==0||v){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());a("#get-extra-comments").submit()};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:i,dimAfter:g,delAfter:k,addColor:"none"}).bind("wpListDelEnd",function(n,m){var o=m.element.replace(/[^0-9]+/g,"");if(m.target.className.indexOf(":trash=1")!=-1||m.target.className.indexOf(":spam=1")!=-1){a("#undo-"+o).fadeIn(300,function(){a(this).show()})}})};commentReply={cid:"",act:"",init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){var b;if(this.cid){b=a("#comment-"+this.cid);if(this.act=="edit-comment"){b.fadeIn(300,function(){b.show()}).css("backgroundColor","")}a("#replyrow").hide();a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("input","#edithead").val("");a(".error","#replysubmit").html("").hide();a(".waiting","#replysubmit").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var l=this,e,f,i,g,j=a("#comment-"+b);l.close();l.cid=b;a("td","#replyrow").attr("colspan",a("table.widefat thead th:visible").length);e=a("#replyrow");f=a("#inline-"+b);i=l.act=(k=="edit")?"edit-comment":"replyto-comment";a("#action",e).val(i);a("#comment_post_ID",e).val(d);a("#comment_ID",e).val(b);if(k=="edit"){a("#author",e).val(a("div.author",f).text());a("#author-email",e).val(a("div.author-email",f).text());a("#author-url",e).val(a("div.author-url",f).text());a("#status",e).val(a("div.comment_status",f).text());a("#replycontent",e).val(a("textarea.comment",f).val());a("#edithead, #savebtn",e).show();a("#replyhead, #replybtn",e).hide();g=j.height();if(g>220){if(a.browser.msie){a("#replycontainer, #replycontent",e).height(g-105)}else{a("#replycontainer",e).height(g-105)}}j.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})}else{a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);a("#replyrow").fadeIn(300,function(){a(this).show()})}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var n,h,o,c,m;n=a("#replyrow").offset().top;h=n+a("#replyrow").height();o=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;m=o+c;if(m-20<h){window.scroll(0,h-c+35)}else{if(n-20<o){window.scroll(0,n-35)}}a("#replycontent").focus().keyup(function(p){if(p.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}e=e.responses[0];g=e.data;f="#comment-"+e.id;if("edit-comment"==this.act){a(f).remove()}a(g).hide();a("#replyrow").after(g);this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("input:checkbox","#cb").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a("option[value="+f+"]",g).attr("selected","selected");a("#comments-form").submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",b],["shift+x",c],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+t",d("trash")],["shift+z",d("untrash")],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var c,e,h,l=0,g,i,d,k;c=a('.tablenav input[name="_total"]',"#comments-form");e=a('.tablenav input[name="_per_page"]',"#comments-form");h=a('.tablenav input[name="_page"]',"#comments-form");g=function(n,m){var o=a("#"+m.element);if(o.is(".unapproved")){o.find("div.comment_status").html("0")}else{o.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var p=a(this),r,q;r=p.html().replace(/[^0-9]+/g,"");r=parseInt(r,10);if(isNaN(r)){return}q=a("#"+m.element).is("."+m.dimClass)?1:-1;r=r+q;if(r<0){r=0}p.closest("#awaiting-mod")[0==r?"addClass":"removeClass"]("count-0");f(p,r);j()})};i=function(q,u){var w=a(q.target).attr("className"),m,o,p,t,v,s,r=false;q.data._total=c.val()||0;q.data._per_page=e.val()||0;q.data._page=h.val()||0;q.data._url=document.location.href;if(w.indexOf(":trash=1")!=-1){r="trash"}else{if(w.indexOf(":spam=1")!=-1){r="spam"}}if(r){m=w.replace(/.*?comment-([0-9]+).*/,"$1");o=a("#comment-"+m);note=a("#"+r+"-undo-holder").html();o.find(".check-column :checkbox").attr("checked","");if(o.siblings("#replyrow").length&&commentReply.cid==m){commentReply.close()}if(o.is("tr")){p=o.children(":visible").length;s=a(".author strong",o).text();t=a('<tr id="undo-'+m+'" class="undo un'+r+'" style="display:none;"><td colspan="'+p+'">'+note+"</td></tr>")}else{s=a(".comment-author",o).text();t=a('<div id="undo-'+m+'" style="display:none;" class="undo un'+r+'">'+note+"</div>")}o.before(t);a("strong","#undo-"+m).text(s+" ");v=a(".undo a","#undo-"+m);v.attr("href","comment.php?action=un"+r+"comment&c="+m+"&_wpnonce="+q.data._ajax_nonce);v.attr("className","delete:the-comment-list:comment-"+m+"::un"+r+"=1 vim-z vim-destructive");a(".avatar",o).clone().prependTo("#undo-"+m+" ."+r+"-undo-inside");v.click(function(){u.wpList.del(this);a("#undo-"+m).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove();a("#comment-"+m).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return q};d=function(m,n,o){if(n<l){return}if(o){l=n}c.val(m.toString());a("span.total-type-count").each(function(){f(a(this),m)})};function j(s){var r=a("#dashboard_right_now"),o,q,p,m;s=s||0;if(isNaN(s)||!r.length){return}o=a("span.total-count",r);q=a("span.approved-count",r);p=b(o);p=p+s;m=p-b(a("span.pending-count",r))-b(a("span.spam-count",r));f(o,p);f(q,m)}function b(m){var o=parseInt(m.html().replace(/[^0-9]+/g,""),10);if(isNaN(o)){return 0}return o}function f(o,p){var m="";if(isNaN(p)){return}p=p<1?"0":p.toString();if(p.length>3){while(p.length>3){m=thousandsSeparator+p.substr(p.length-3)+m;p=p.substr(0,p.length-3)}p=p+m}o.html(p)}k=function(m,o){var u,p,q,w=a(o.target).parent().is("span.untrash"),n=a(o.target).parent().is("span.unspam"),v,t;function x(r){if(a(o.target).parent().is("span."+r)){return 1}else{if(a("#"+o.element).is("."+r)){return -1}}return 0}v=x("spam");t=x("trash");if(w){t=-1}if(n){v=-1}a("span.pending-count").each(function(){var r=a(this),z=b(r),y=a("#"+o.element).is(".unapproved");if(a(o.target).parent().is("span.unapprove")||((w||n)&&y)){z=z+1}else{if(y){z=z-1}}if(z<0){z=0}r.closest("#awaiting-mod")[0==z?"addClass":"removeClass"]("count-0");f(r,z);j()});a("span.spam-count").each(function(){var r=a(this),y=b(r)+v;f(r,y)});a("span.trash-count").each(function(){var r=a(this),y=b(r)+t;f(r,y)});if(a("#dashboard_right_now").length){q=t?-1*t:0;j(q)}else{u=c.val()?parseInt(c.val(),10):0;u=u-v-t;if(u<0){u=0}if(("object"==typeof m)&&l<o.parsed.responses[0].supplemental.time){p=o.parsed.responses[0].supplemental.pageLinks||"";if(a.trim(p)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(p))}else{a(".tablenav-pages").find(".page-numbers").remove()}d(u,o.parsed.responses[0].supplemental.time,true)}else{d(u,m,false)}}if(theExtraList.size()==0||theExtraList.children().size()==0||w){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());var s=a.query.get();s.number=1;s.paged++;adminTable.fetch_list(s,function(r){theExtraList.get(0).wpList.add(r.rows)})};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:i,dimAfter:g,delAfter:k,addColor:"none"}).bind("wpListDelEnd",function(n,m){var o=m.element.replace(/[^0-9]+/g,"");if(m.target.className.indexOf(":trash=1")!=-1||m.target.className.indexOf(":spam=1")!=-1){a("#undo-"+o).fadeIn(300,function(){a(this).show()})}})};commentReply={cid:"",act:"",init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){var b;if(this.cid){b=a("#comment-"+this.cid);if(this.act=="edit-comment"){b.fadeIn(300,function(){b.show()}).css("backgroundColor","")}a("#replyrow").hide();a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("input","#edithead").val("");a(".error","#replysubmit").html("").hide();a(".waiting","#replysubmit").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var l=this,e,f,i,g,j=a("#comment-"+b);l.close();l.cid=b;a("td","#replyrow").attr("colspan",a("table.widefat thead th:visible").length);e=a("#replyrow");f=a("#inline-"+b);i=l.act=(k=="edit")?"edit-comment":"replyto-comment";a("#action",e).val(i);a("#comment_post_ID",e).val(d);a("#comment_ID",e).val(b);if(k=="edit"){a("#author",e).val(a("div.author",f).text());a("#author-email",e).val(a("div.author-email",f).text());a("#author-url",e).val(a("div.author-url",f).text());a("#status",e).val(a("div.comment_status",f).text());a("#replycontent",e).val(a("textarea.comment",f).val());a("#edithead, #savebtn",e).show();a("#replyhead, #replybtn",e).hide();g=j.height();if(g>220){if(a.browser.msie){a("#replycontainer, #replycontent",e).height(g-105)}else{a("#replycontainer",e).height(g-105)}}j.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})}else{a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);a("#replyrow").fadeIn(300,function(){a(this).show()})}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var n,h,o,c,m;n=a("#replyrow").offset().top;h=n+a("#replyrow").height();o=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;m=o+c;if(m-20<h){window.scroll(0,h-c+35)}else{if(n-20<o){window.scroll(0,n-35)}}a("#replycontent").focus().keyup(function(p){if(p.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}e=e.responses[0];g=e.data;f="#comment-"+e.id;if("edit-comment"==this.act){a(f).remove()}a(g).hide();a("#replyrow").after(g);this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("input:checkbox","#cb").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a("option[value="+f+"]",g).attr("selected","selected");a("#comments-form").submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",b],["shift+x",c],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+t",d("trash")],["shift+z",d("untrash")],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjswplistsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/wp-lists.dev.js (15508 => 15509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/wp-lists.dev.js        2010-08-18 22:26:22 UTC (rev 15508)
+++ trunk/wp-includes/js/wp-lists.dev.js        2010-08-19 00:06:51 UTC (rev 15509)
</span><span class="lines">@@ -259,12 +259,21 @@
</span><span class="cx">                 e = $(e);
</span><span class="cx">
</span><span class="cx">                 var list = $(this), old = false, _s = { pos: 0, id: 0, oldId: null }, ba, ref, color;
</span><del>-                if ( 'string' == typeof s ) { s = { what: s }; }
</del><ins>+
+                if ( 'string' == typeof s )
+                        s = { what: s };
+
</ins><span class="cx">                 s = $.extend(_s, this.wpList.settings, s);
</span><del>-                if ( !e.size() || !s.what ) { return false; }
-                if ( s.oldId ) { old = $('#' + s.what + '-' + s.oldId); }
-                if ( s.id && ( s.id != s.oldId || !old || !old.size() ) ) { $('#' + s.what + '-' + s.id).remove(); }
</del><span class="cx">
</span><ins>+                if ( !e.size() || !s.what )
+                        return false;
+
+                if ( s.oldId )
+                        old = $('#' + s.what + '-' + s.oldId);
+
+                if ( s.id && ( s.id != s.oldId || !old || !old.size() ) )
+                        $('#' + s.what + '-' + s.id).remove();
+
</ins><span class="cx">                 if ( old && old.size() ) {
</span><span class="cx">                         old.before(e);
</span><span class="cx">                         old.remove();
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (15508 => 15509)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-08-18 22:26:22 UTC (rev 15508)
+++ trunk/wp-includes/script-loader.php        2010-08-19 00:06:51 UTC (rev 15509)
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx">                 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array('jquery'), '20100301' );
</span><span class="cx">                 $scripts->add_data( 'user-profile', 'group', 1 );
</span><span class="cx">
</span><del>-                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20100418' );
</del><ins>+                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'admin-table', 'jquery-ui-resizable', 'quicktags'), '20100818' );
</ins><span class="cx">                 $scripts->add_data( 'admin-comments', 'group', 1 );
</span><span class="cx">                 $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
</span><span class="cx">                         'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
</span></span></pre>
</div>
</div>
</body>
</html>