<!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>[15507] trunk: refactor admin-table.js code</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15507">15507</a></dd>
<dt>Author</dt> <dd>scribu</dd>
<dt>Date</dt> <dd>2010-08-18 21:02:24 +0000 (Wed, 18 Aug 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>refactor admin-table.js code</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjsadmintabledevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/admin-table.dev.js (15506 => 15507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/admin-table.dev.js        2010-08-18 16:58:55 UTC (rev 15506)
+++ trunk/wp-admin/js/admin-table.dev.js        2010-08-18 21:02:24 UTC (rev 15507)
</span><span class="lines">@@ -1,52 +1,58 @@
</span><span class="cx"> jQuery(document).ready(function($) {
</span><del>-        $('form').each(function() {
-                this.reset();
-        });
</del><span class="cx"> 
</span><del>-        if ( '' == $.query.GET('paged') )
-                $.query.SET('paged', 1);
</del><ins>+var adminTable = {
</ins><span class="cx"> 
</span><del>-        var total_pages;
-        var set_total_pages = function() {
-                total_pages = parseInt($('.total-pages').eq(0).text());
-        }
</del><ins>+        init: function() {
+                this.loading = false;
</ins><span class="cx"> 
</span><del>-        set_total_pages();
</del><ins>+                $('form').each(function() {
+                        this.reset();
+                });
</ins><span class="cx"> 
</span><del>-        var loading = false,
-                $tbody = $('#the-list, #the-comment-list'),
-                $overlay = $('&lt;div id=&quot;loading-items&gt;')
</del><ins>+                if ( '' == $.query.GET('paged') )
+                        $.query.SET('paged', 1);
+                this.set_total_pages();
+
+                this.$tbody = $('#the-list, #the-comment-list');
+
+                this.$overlay = $('&lt;div id=&quot;loading-items&gt;')
</ins><span class="cx">                         .html(adminTableL10n.loading)
</span><span class="cx">                         .hide()
</span><span class="cx">                         .prependTo($('body'));
</span><ins>+        },
</ins><span class="cx"> 
</span><del>-        var show_overlay = function() {
-                loading = true;
</del><ins>+        // paging
+        set_total_pages: function() {
+                this.total_pages = parseInt($('.total-pages').eq(0).text());
+        },
</ins><span class="cx"> 
</span><del>-                $('.error.ajax').remove();
</del><ins>+        get_total_pages: function() {
+                return this.total_pages;
+        },
</ins><span class="cx"> 
</span><del>-                $overlay
-                        .css({
-                                width: $tbody.width() + 'px',
-                                height: $tbody.height() - 20 + 'px'
-                        })
-                        .css($tbody.offset())
-                        .show();
-        }
</del><ins>+        change_page: function(paged) {
+                if ( paged &lt; 1 || paged &gt;this.total_pages )
+                        return false;
</ins><span class="cx"> 
</span><del>-        var hide_overlay = function() {
-                loading = false;
-                $overlay.hide();
-        }
</del><ins>+                this.update_rows({'paged': paged});
+        },
</ins><span class="cx"> 
</span><del>-        var handle_error = function() {
-                hide_overlay();
</del><ins>+        // searching
+        change_search: function(s) {
+                this.update_rows({'s': s}, true, function() {
+                        $('h2 .subtitle').remove();
</ins><span class="cx"> 
</span><del>-                $('h2').after('&lt;div class=&quot;error ajax below-h2&quot;&gt;&lt;p&gt;' + adminTableL10n.error + '&lt;/p&gt;&lt;/div&gt;');
-        }
</del><ins>+                        if ( s )
+                                $('h2').eq(0).append($('&lt;span class=&quot;subtitle&quot;&gt;').html(adminTableL10n.search.replace('%s', this.htmlencode(s))));
+                });
+        },
</ins><span class="cx"> 
</span><del>-        var update_rows = function(args, reset_paging, callback) {
-                if ( loading )
</del><ins>+        htmlencode: function(value) {
+                return $('&lt;div/&gt;').text(value).html();
+        },
+
+        update_rows: function(args, reset_paging, callback) {
+                if ( this.loading )
</ins><span class="cx">                         return false;
</span><span class="cx"> 
</span><span class="cx">                 var different = false;
</span><span class="lines">@@ -57,11 +63,11 @@
</span><span class="cx">                                 different = true;
</span><span class="cx">                         }
</span><span class="cx">                 });
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( !different )
</span><span class="cx">                         return false;
</span><span class="cx"> 
</span><del>-                show_overlay();
</del><ins>+                this.show_overlay();
</ins><span class="cx"> 
</span><span class="cx">                 if ( reset_paging )
</span><span class="cx">                         $.query.SET('paged', 1);
</span><span class="lines">@@ -71,44 +77,71 @@
</span><span class="cx">                 data['action'] = 'fetch-list';
</span><span class="cx">                 data['list_args'] = list_args;
</span><span class="cx"> 
</span><ins>+                this._callback = callback;
+
</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: function(response) {
-                                if ( 'object' != typeof response ) {
-                                        handle_error();
-                                } else {
-                                        hide_overlay();
</del><ins>+                        success: $.proxy(this, 'handle_success'),
+                        error: $.proxy(this, 'handle_error')
+                });
</ins><span class="cx"> 
</span><del>-                                        $tbody.html(response.rows);
</del><ins>+                return true;
+        },
</ins><span class="cx"> 
</span><del>-                                        $('.displaying-num').html(response.total_items);
</del><ins>+        handle_success: function(response) {
+                if ( 'object' != typeof response ) {
+                        this.handle_error();
+                } else {
+                        this.hide_overlay();
</ins><span class="cx"> 
</span><del>-                                        $('.total-pages').html(response.total_pages);
-                                        set_total_pages();
</del><ins>+                        this.$tbody.html(response.rows);
</ins><span class="cx"> 
</span><del>-                                        $('.current-page').val($.query.GET('paged'));
</del><ins>+                        $('.displaying-num').html(response.total_items);
</ins><span class="cx"> 
</span><del>-                                        if ( callback )
-                                                callback();
-                                }
-                        },
-                        error: handle_error
-                });
</del><ins>+                        $('.total-pages').html(response.total_pages);
+                        this.set_total_pages();
</ins><span class="cx"> 
</span><del>-                return true;
-        }
</del><ins>+                        $('.current-page').val($.query.GET('paged'));
</ins><span class="cx"> 
</span><del>-        // paging
-        var change_page = function(paged) {
-                if ( paged &lt; 1 || paged &gt; total_pages )
-                        return false;
</del><ins>+                        if ( this._callback )
+                                this._callback();
+                }
+        },
</ins><span class="cx"> 
</span><del>-                update_rows({'paged': paged});
</del><ins>+        handle_error: function() {
+                this.hide_overlay();
+
+                $('h2').after('&lt;div class=&quot;error ajax below-h2&quot;&gt;&lt;p&gt;' + adminTableL10n.error + '&lt;/p&gt;&lt;/div&gt;');
+        },
+
+        show_overlay: function() {
+                this.loading = true;
+
+                $('.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();
</ins><span class="cx">         }
</span><ins>+}
</ins><span class="cx"> 
</span><ins>+adminTable.init();
+
+// Ajaxify various UI elements
+
+        // pagination
</ins><span class="cx">         $('.tablenav-pages a').click(function() {
</span><span class="cx">                 var paged = $.query.GET('paged');
</span><span class="cx"> 
</span><span class="lines">@@ -123,11 +156,11 @@
</span><span class="cx">                                 paged += 1;
</span><span class="cx">                                 break;
</span><span class="cx">                         case 'last-page':
</span><del>-                                paged = total_pages;
</del><ins>+                                paged = adminTable.get_total_pages();
</ins><span class="cx">                                 break;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                change_page(paged);
</del><ins>+                adminTable.change_page(paged);
</ins><span class="cx"> 
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="lines">@@ -136,12 +169,12 @@
</span><span class="cx">                 if ( 13 != e.keyCode )
</span><span class="cx">                         return;
</span><span class="cx"> 
</span><del>-                change_page(parseInt($(this).val()));
</del><ins>+                adminTable.change_page(parseInt($(this).val()));
</ins><span class="cx"> 
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="cx"> 
</span><del>-        // sorting
</del><ins>+        // sortable columns
</ins><span class="cx">         $('th a').click(function() {
</span><span class="cx">                 var orderby = $.query.GET('orderby'),
</span><span class="cx">                         order = $.query.GET('order'),
</span><span class="lines">@@ -167,27 +200,14 @@
</span><span class="cx">                         $th.removeClass('sorted-desc').addClass('sorted-asc');
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                update_rows({'orderby': orderby, 'order': order}, true);
</del><ins>+                adminTable.update_rows({'orderby': orderby, 'order': order}, true);
</ins><span class="cx"> 
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="cx"> 
</span><del>-        // searching
-        var htmlencode = function(value) {
-                return $('&lt;div/&gt;').text(value).html();
-        }
-
-        var change_search = function(s) {
-                update_rows({'s': s}, true, function() {
-                        $('h2 .subtitle').remove();
-
-                        if ( s )
-                                $('h2').eq(0).append($('&lt;span class=&quot;subtitle&quot;&gt;').html(adminTableL10n.search.replace('%s', htmlencode(s))));
-                });
-        }
-
</del><ins>+        // searchbox
</ins><span class="cx">         $('.search-box :submit').click(function() {
</span><del>-                change_search($(this).parent('.search-box').find(':text').val());
</del><ins>+                adminTable.change_search($(this).parent('.search-box').find(':text').val());
</ins><span class="cx"> 
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="lines">@@ -196,20 +216,22 @@
</span><span class="cx">                 if ( 13 != e.keyCode )
</span><span class="cx">                         return;
</span><span class="cx"> 
</span><del>-                change_search($(this).val());
</del><ins>+                adminTable.change_search($(this).val());
</ins><span class="cx"> 
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         // tablenav dropdowns
</span><span class="cx">         $('#post-query-submit').click(function() {
</span><del>-                var $this = $(this), key, val, args = {};
</del><ins>+                var key, val, args = {};
</ins><span class="cx"> 
</span><del>-                $this.parents('.actions').find('select[name!=&quot;action&quot;]').each(function() {
-                        args[$this.attr('name')] = $this.val();
</del><ins>+                $(this).parents('.actions').find('select[name!=&quot;action&quot;]').each(function() {
+                        var $el = $(this);
+
+                        args[$el.attr('name')] = $el.val();
</ins><span class="cx">                 });
</span><span class="cx"> 
</span><del>-                update_rows(args, true);
</del><ins>+                adminTable.update_rows(args, true);
</ins><span class="cx"> 
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="lines">@@ -218,26 +240,12 @@
</span><span class="cx">         $('.view-switch a').click(function() {
</span><span class="cx">                 var $this = $(this);
</span><span class="cx"> 
</span><del>-                update_rows({'mode': $.query.load($this.attr('href')).get('mode')}, false, function() {
</del><ins>+                adminTable.update_rows({'mode': $.query.load($this.attr('href')).get('mode')}, false, function() {
</ins><span class="cx">                         $('.view-switch .current').removeClass('current');
</span><span class="cx">                         $this.addClass('current');
</span><span class="cx">                 });
</span><span class="cx"> 
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><del>-
-/*
-        // problem: when switching from one to the other, columns are not always the same
-        $('.subsubsub a').click(function() {
-                var $this = $(this);
-
-                update_rows($.query.load($this.attr('href')).get(), true, function() {
-                        $('.subsubsub .current').removeClass('current');
-                        $this.addClass('current');
-                });
-
-                return false;
-        });
-/**/
</del><span class="cx"> });
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminjsadmintablejs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/admin-table.js (15506 => 15507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/admin-table.js        2010-08-18 16:58:55 UTC (rev 15506)
+++ trunk/wp-admin/js/admin-table.js        2010-08-18 21:02:24 UTC (rev 15507)
</span><span class="lines">@@ -1 +1 @@
</span><del>-jQuery(document).ready(function(g){g(&quot;form&quot;).each(function(){this.reset()});if(&quot;&quot;==g.query.GET(&quot;paged&quot;)){g.query.SET(&quot;paged&quot;,1)}var l;var b=function(){l=parseInt(g(&quot;.total-pages&quot;).eq(0).text())};b();var c=false,f=g(&quot;#the-list, #the-comment-list&quot;),m=g('&lt;div id=&quot;loading-items&gt;').html(adminTableL10n.loading).hide().prependTo(g(&quot;body&quot;));var a=function(){c=true;g(&quot;.error.ajax&quot;).remove();m.css({width:f.width()+&quot;px&quot;,height:f.height()-20+&quot;px&quot;}).css(f.offset()).show()};var i=function(){c=false;m.hide()};var e=function(){i();g(&quot;h2&quot;).after('&lt;div class=&quot;error ajax below-h2&quot;&gt;&lt;p&gt;'+adminTableL10n.error+&quot;&lt;/p&gt;&lt;/div&gt;&quot;)};var k=function(o,n,r){if(c){return false}var q=false;g.each(o,function(s,t){if(t!=g.query.GET(s)){g.query.SET(s,t);q=true}});if(!q){return false}a();if(n){g.query.SET(&quot;paged&quot;,1)}var p=g.query.get();p.action=&quot;fetch-list&quot;;p.list_args=list_args;g.ajax({url:ajaxurl,global:false,dataType:&quot;json&quot;,data:p,success:function(s){if(&quot;object&quot;!=typeof s){e()}else{i();f.html(s.rows);g(&quot;.displaying-num&quot;).html(s.total_items);g(&quot;.total-pages&quot;).html(s.total_pages);b();g(&quot;.current-page&quot;).val(g.query.GET(&quot;paged&quot;));if(r){r()}}},error:e});return true};var d=function(n){if(n&lt;1||n&gt;l){return false}k({paged:n})};g(&quot;.tablenav-pages a&quot;).click(function(){var n=g.query.GET(&quot;paged&quot;);switch(g(this).attr(&quot;class&quot;)){case&quot;first-page&quot;:n=1;break;case&quot;prev-page&quot;:n-=1;break;case&quot;next-page&quot;:n+=1;break;case&quot;last-page&quot;:n=l;break}d(n);return false});g(&quot;.current-page&quot;).keypress(function(n){if(13!=n.keyCode){return}d(parseInt(g(this).val()));return false});g(&quot;th a&quot;).click(function(){var p=g.query.GET(&quot;orderby&quot;),n=g.query.GET(&quot;order&quot;),o=g(this).parent(&quot;th&quot;);if(o.hasClass(&quot;sortable&quot;)){p=g.query.load(g(this).attr(&quot;href&quot;)).get(&quot;orderby&quot;);n=&quot;asc&quot;;g(&quot;th.sorted-desc, th.sorted-asc&quot;).removeClass(&quot;sorted-asc&quot;).removeClass(&quot;sorted-desc&quot;).addClass(&quot;sortable&quot;);o.removeClass(&quot;sortable&quot;).addClass(&quot;sorted-asc&quot;)}else{if(o.hasClass(&quot;sorted-asc&quot;)){n=&quot;desc&quot;;o.removeClass(&quot;sorted-asc&quot;).addClass(&quot;sorted-desc&quot;)}else{if(o.hasClass(&quot;sorted-desc&quot;)){n=&quot;asc&quot;;o.removeClass(&quot;sorted-desc&quot;).addClass(&quot;sorted-asc&quot;)}}}k({orderby:p,order:n},true);return false});var h=function(n){return g(&quot;&lt;div/&gt;&quot;).text(n).html()};var j=function(n){k({s:n},true,function(){g(&quot;h2 .subtitle&quot;).remove();if(n){g(&quot;h2&quot;).eq(0).append(g('&lt;span class=&quot;subtitle&quot;&gt;').html(adminTableL10n.search.replace(&quot;%s&quot;,h(n))))}})};g(&quot;.search-box :submit&quot;).click(function(){j(g(this).parent(&quot;.search-box&quot;).find(&quot;:text&quot;).val());return false});g(&quot;.search-box :text&quot;).keypress(function(n){if(13!=n.keyCode){return}j(g(this).val());return false});g(&quot;#post-query-submit&quot;).click(function(){var p=g(this),o,q,n={};p.parents(&quot;.actions&quot;).find('select[name!=&quot;action&quot;]').each(function(){n[p.attr(&quot;name&quot;)]=p.val()});k(n,true);return false});g(&quot;.view-switch a&quot;).click(function(){var n=g(this);k({mode:g.query.load(n.attr(&quot;href&quot;)).get(&quot;mode&quot;)},false,function(){g(&quot;.view-switch .current&quot;).removeClass(&quot;current&quot;);n.addClass(&quot;current&quot;)});return false})});
</del><span class="cx">\ No newline at end of file
</span><ins>+jQuery(document).ready(function(b){var a={init:function(){this.loading=false;b(&quot;form&quot;).each(function(){this.reset()});if(&quot;&quot;==b.query.GET(&quot;paged&quot;)){b.query.SET(&quot;paged&quot;,1)}this.set_total_pages();this.$tbody=b(&quot;#the-list, #the-comment-list&quot;);this.$overlay=b('&lt;div id=&quot;loading-items&gt;').html(adminTableL10n.loading).hide().prependTo(b(&quot;body&quot;))},set_total_pages:function(){this.total_pages=parseInt(b(&quot;.total-pages&quot;).eq(0).text())},get_total_pages:function(){return this.total_pages},change_page:function(c){if(c&lt;1||c&gt;this.total_pages){return false}this.update_rows({paged:c})},change_search:function(c){this.update_rows({s:c},true,function(){b(&quot;h2 .subtitle&quot;).remove();if(c){b(&quot;h2&quot;).eq(0).append(b('&lt;span class=&quot;subtitle&quot;&gt;').html(adminTableL10n.search.replace(&quot;%s&quot;,this.htmlencode(c))))}})},htmlencode:function(c){return b(&quot;&lt;div/&gt;&quot;).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(&quot;paged&quot;,1)}var e=b.query.get();e.action=&quot;fetch-list&quot;;e.list_args=list_args;this._callback=g;b.ajax({url:ajaxurl,global:false,dataType:&quot;json&quot;,data:e,success:b.proxy(this,&quot;handle_success&quot;),error:b.proxy(this,&quot;handle_error&quot;)});return true},handle_success:function(c){if(&quot;object&quot;!=typeof c){this.handle_error()}else{this.hide_overlay();this.$tbody.html(c.rows);b(&quot;.displaying-num&quot;).html(c.total_items);b(&quot;.total-pages&quot;).html(c.total_pages);this.set_total_pages();b(&quot;.current-page&quot;).val(b.query.GET(&quot;paged&quot;));if(this._callback){this._callback()}}},handle_error:function(){this.hide_overlay();b(&quot;h2&quot;).after('&lt;div class=&quot;error ajax below-h2&quot;&gt;&lt;p&gt;'+adminTableL10n.error+&quot;&lt;/p&gt;&lt;/div&gt;&quot;)},show_overlay:function(){this.loading=true;b(&quot;.error.ajax&quot;).remove();this.$overlay.css({width:this.$tbody.width()+&quot;px&quot;,height:this.$tbody.height()-20+&quot;px&quot;}).css(this.$tbody.offset()).show()},hide_overlay:function(){this.loading=false;this.$overlay.hide()}};a.init();b(&quot;.tablenav-pages a&quot;).click(function(){var c=b.query.GET(&quot;paged&quot;);switch(b(this).attr(&quot;class&quot;)){case&quot;first-page&quot;:c=1;break;case&quot;prev-page&quot;:c-=1;break;case&quot;next-page&quot;:c+=1;break;case&quot;last-page&quot;:c=a.get_total_pages();break}a.change_page(c);return false});b(&quot;.current-page&quot;).keypress(function(c){if(13!=c.keyCode){return}a.change_page(parseInt(b(this).val()));return false});b(&quot;th a&quot;).click(function(){var e=b.query.GET(&quot;orderby&quot;),c=b.query.GET(&quot;order&quot;),d=b(this).parent(&quot;th&quot;);if(d.hasClass(&quot;sortable&quot;)){e=b.query.load(b(this).attr(&quot;href&quot;)).get(&quot;orderby&quot;);c=&quot;asc&quot;;b(&quot;th.sorted-desc, th.sorted-asc&quot;).removeClass(&quot;sorted-asc&quot;).removeClass(&quot;sorted-desc&quot;).addClass(&quot;sortable&quot;);d.removeClass(&quot;sortable&quot;).addClass(&quot;sorted-asc&quot;)}else{if(d.hasClass(&quot;sorted-asc&quot;)){c=&quot;desc&quot;;d.removeClass(&quot;sorted-asc&quot;).addClass(&quot;sorted-desc&quot;)}else{if(d.hasClass(&quot;sorted-desc&quot;)){c=&quot;asc&quot;;d.removeClass(&quot;sorted-desc&quot;).addClass(&quot;sorted-asc&quot;)}}}a.update_rows({orderby:e,order:c},true);return false});b(&quot;.search-box :submit&quot;).click(function(){a.change_search(b(this).parent(&quot;.search-box&quot;).find(&quot;:text&quot;).val());return false});b(&quot;.search-box :text&quot;).keypress(function(c){if(13!=c.keyCode){return}a.change_search(b(this).val());return false});b(&quot;#post-query-submit&quot;).click(function(){var d,e,c={};b(this).parents(&quot;.actions&quot;).find('select[name!=&quot;action&quot;]').each(function(){var f=b(this);c[f.attr(&quot;name&quot;)]=f.val()});a.update_rows(c,true);return false});b(&quot;.view-switch a&quot;).click(function(){var c=b(this);a.update_rows({mode:b.query.load(c.attr(&quot;href&quot;)).get(&quot;mode&quot;)},false,function(){b(&quot;.view-switch .current&quot;).removeClass(&quot;current&quot;);c.addClass(&quot;current&quot;)});return false})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (15506 => 15507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-08-18 16:58:55 UTC (rev 15506)
+++ trunk/wp-includes/script-loader.php        2010-08-18 21:02:24 UTC (rev 15507)
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx">                 $scripts-&gt;add( 'theme-preview', &quot;/wp-admin/js/theme-preview$suffix.js&quot;, array( 'thickbox', 'jquery' ), '20100407' );
</span><span class="cx">                 $scripts-&gt;add_data( 'theme-preview', 'group', 1 );
</span><span class="cx"> 
</span><del>-                $scripts-&gt;add( 'admin-table', &quot;/wp-admin/js/admin-table$suffix.js&quot;, array( 'jquery', 'jquery-query' ), '20100812' );
</del><ins>+                $scripts-&gt;add( 'admin-table', &quot;/wp-admin/js/admin-table$suffix.js&quot;, array( 'jquery', 'jquery-query' ), '20100818' );
</ins><span class="cx">                 $scripts-&gt;add_data( 'admin-table', 'group', 1 );
</span><span class="cx">                 $scripts-&gt;localize( 'admin-table', 'adminTableL10n', array(
</span><span class="cx">                         'loading' =&gt; __('Loading...'),
</span></span></pre>
</div>
</div>

</body>
</html>