<!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>[15495] trunk: Fix ajaxification in network area by using ajaxurl.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15495">15495</a></dd>
<dt>Author</dt> <dd>scribu</dd>
<dt>Date</dt> <dd>2010-08-12 00:45:40 +0000 (Thu, 12 Aug 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix ajaxification in network area by using ajaxurl. See <a href="http://trac.wordpress.org/ticket/14579">#14579</a></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 (15494 => 15495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/admin-table.dev.js        2010-08-12 00:38:46 UTC (rev 15494)
+++ trunk/wp-admin/js/admin-table.dev.js        2010-08-12 00:45:40 UTC (rev 15495)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">                 data['list_args'] = list_args;
</span><span class="cx">
</span><span class="cx">                 $.ajax({
</span><del>-                        url: 'admin-ajax.php',
</del><ins>+                        url: ajaxurl,
</ins><span class="cx">                         global: false,
</span><span class="cx">                         dataType: 'json',
</span><span class="cx">                         data: data,
</span></span></pre></div>
<a id="trunkwpadminjsadmintablejs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/admin-table.js (15494 => 15495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/admin-table.js        2010-08-12 00:38:46 UTC (rev 15494)
+++ trunk/wp-admin/js/admin-table.js        2010-08-12 00:45:40 UTC (rev 15495)
</span><span class="lines">@@ -1 +1 @@
</span><del>-jQuery(document).ready(function($){$("form").each(function(){this.reset()});if(""==$.query.GET("paged")){$.query.SET("paged",1)}var total_pages;var set_total_pages=function(){total_pages=parseInt($(".total-pages").eq(0).text())};set_total_pages();var loading=false,$tbody=$("#the-list, #the-comment-list"),$overlay=$('<div id="loading-items>').html(adminTableL10n.loading).hide().prependTo($("body"));var show_overlay=function(){loading=true;$(".error.ajax").remove();$overlay.css({width:$tbody.width()+"px",height:$tbody.height()-20+"px"}).css($tbody.offset()).show()};var hide_overlay=function(){loading=false;$overlay.hide()};var handle_error=function(){hide_overlay();$("h2").after('<div class="error ajax below-h2"><p>'+adminTableL10n.error+"</p></div>")};var update_rows=function(args,reset_paging,callback){if(loading){return false}var different=false;$.each(args,function(key,val){if(val!=$.query.GET(key)){$.query.SET(key,val);different=true}});if(!different){return false}show_overlay();if(reset_paging){$.query.SET("paged",1)}var data=$.query.get();data.action="fetch-list";data.list_args=list_args;$.ajax({url:"admin-ajax.php",global:false,dataType:"json",data:data,success:function(response){if("object"!=typeof response){handle_error()}else{hide_overlay();$tbody.html(response.rows);$(".displaying-num").html(response.total_items);$(".total-pages").html(response.total_pages);set_total_pages();$(".current-page").val($.query.GET("paged"));if(callback){callback()}}},error:handle_error});return true};var change_page=function(paged){if(paged<1||paged>total_pages){return false}update_rows({paged:paged})};$(".tablenav-pages a").click(function(){var paged=$.query.GET("paged");switch($(this).attr("class")){case"first-page":paged=1;break;case"prev-page":paged-=1;break;case"next-page":paged+=1;break;case"last-page":paged=total_pages;break}change_page(paged);return false});$(".current-page").keypress(function(e){if(13!=e.keyCode){return}change_page(parseInt($(this).val()));return false});$("th a").click(function(){var orderby=$.query.GET("orderby"),order=$.query.GET("order"),$th=$(this).parent("th");if($th.hasClass("sortable")){orderby=$.query.load($(this).attr("href")).get("orderby");order="asc";$("th.sorted-desc, th.sorted-asc").removeClass("sorted-asc").removeClass("sorted-desc").addClass("sortable");$th.removeClass("sortable").addClass("sorted-asc")}else{if($th.hasClass("sorted-asc")){order="desc";$th.removeClass("sorted-asc").addClass("sorted-desc")}else{if($th.hasClass("sorted-desc")){order="asc";$th.removeClass("sorted-desc").addClass("sorted-asc")}}}update_rows({orderby:orderby,order:order},true);return false});var htmlencode=function(value){return $("<div/>").text(value).html()};var change_search=function(s){update_rows({s:s},true,function(){$("h2 .subtitle").remove();if(s){$("h2").eq(0).append($('<span class="subtitle">').html(adminTableL10n.search.replace("%s",htmlencode(s))))}})};$(".search-box :submit").click(function(){change_search($(this).parent(".search-box").find(":text").val());return false});$(".search-box :text").keypress(function(e){if(13!=e.keyCode){return}change_search($(this).val());return false});$("#post-query-submit").click(function(){var $this=$(this),key,val,args={};$this.parents(".actions").find('select[name!="action"]').each(function(){args[$this.attr("name")]=$this.val()});update_rows(args,true);return false});$(".view-switch a").click(function(){var $this=$(this);update_rows({mode:$.query.load($this.attr("href")).get("mode")},false,function(){$(".view-switch .current").removeClass("current");$this.addClass("current")});return false})});
</del><span class="cx">\ No newline at end of file
</span><ins>+jQuery(document).ready(function(g){g("form").each(function(){this.reset()});if(""==g.query.GET("paged")){g.query.SET("paged",1)}var l;var b=function(){l=parseInt(g(".total-pages").eq(0).text())};b();var c=false,f=g("#the-list, #the-comment-list"),m=g('<div id="loading-items>').html(adminTableL10n.loading).hide().prependTo(g("body"));var a=function(){c=true;g(".error.ajax").remove();m.css({width:f.width()+"px",height:f.height()-20+"px"}).css(f.offset()).show()};var i=function(){c=false;m.hide()};var e=function(){i();g("h2").after('<div class="error ajax below-h2"><p>'+adminTableL10n.error+"</p></div>")};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("paged",1)}var p=g.query.get();p.action="fetch-list";p.list_args=list_args;g.ajax({url:ajaxurl,global:false,dataType:"json",data:p,success:function(s){if("object"!=typeof s){e()}else{i();f.html(s.rows);g(".displaying-num").html(s.total_items);g(".total-pages").html(s.total_pages);b();g(".current-page").val(g.query.GET("paged"));if(r){r()}}},error:e});return true};var d=function(n){if(n<1||n>l){return false}k({paged:n})};g(".tablenav-pages a").click(function(){var n=g.query.GET("paged");switch(g(this).attr("class")){case"first-page":n=1;break;case"prev-page":n-=1;break;case"next-page":n+=1;break;case"last-page":n=l;break}d(n);return false});g(".current-page").keypress(function(n){if(13!=n.keyCode){return}d(parseInt(g(this).val()));return false});g("th a").click(function(){var p=g.query.GET("orderby"),n=g.query.GET("order"),o=g(this).parent("th");if(o.hasClass("sortable")){p=g.query.load(g(this).attr("href")).get("orderby");n="asc";g("th.sorted-desc, th.sorted-asc").removeClass("sorted-asc").removeClass("sorted-desc").addClass("sortable");o.removeClass("sortable").addClass("sorted-asc")}else{if(o.hasClass("sorted-asc")){n="desc";o.removeClass("sorted-asc").addClass("sorted-desc")}else{if(o.hasClass("sorted-desc")){n="asc";o.removeClass("sorted-desc").addClass("sorted-asc")}}}k({orderby:p,order:n},true);return false});var h=function(n){return g("<div/>").text(n).html()};var j=function(n){k({s:n},true,function(){g("h2 .subtitle").remove();if(n){g("h2").eq(0).append(g('<span class="subtitle">').html(adminTableL10n.search.replace("%s",h(n))))}})};g(".search-box :submit").click(function(){j(g(this).parent(".search-box").find(":text").val());return false});g(".search-box :text").keypress(function(n){if(13!=n.keyCode){return}j(g(this).val());return false});g("#post-query-submit").click(function(){var p=g(this),o,q,n={};p.parents(".actions").find('select[name!="action"]').each(function(){n[p.attr("name")]=p.val()});k(n,true);return false});g(".view-switch a").click(function(){var n=g(this);k({mode:g.query.load(n.attr("href")).get("mode")},false,function(){g(".view-switch .current").removeClass("current");n.addClass("current")});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 (15494 => 15495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-08-12 00:38:46 UTC (rev 15494)
+++ trunk/wp-includes/script-loader.php        2010-08-12 00:45:40 UTC (rev 15495)
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx">                 $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20100407' );
</span><span class="cx">                 $scripts->add_data( 'theme-preview', 'group', 1 );
</span><span class="cx">
</span><del>-                $scripts->add( 'admin-table', "/wp-admin/js/admin-table$suffix.js", array( 'jquery', 'jquery-query' ), '20100626' );
</del><ins>+                $scripts->add( 'admin-table', "/wp-admin/js/admin-table$suffix.js", array( 'jquery', 'jquery-query' ), '20100812' );
</ins><span class="cx">                 $scripts->add_data( 'admin-table', 'group', 1 );
</span><span class="cx">                 $scripts->localize( 'admin-table', 'adminTableL10n', array(
</span><span class="cx">                         'loading' => __('Loading...'),
</span></span></pre>
</div>
</div>
</body>
</html>