Revert [16719] until it has has UI review. See #15580

git-svn-id: http://svn.automattic.com/wordpress/trunk@16722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-12-04 11:01:23 +00:00
parent 4e2fb85913
commit cd767d889e
8 changed files with 17 additions and 29 deletions

File diff suppressed because one or more lines are too long

View File

@ -463,7 +463,3 @@ table.ie-fixed {
.menu li.sortable-placeholder { .menu li.sortable-placeholder {
min-width:400px; min-width:400px;
} }
#loading-items {
filter:alpha(opacity=70);
}

File diff suppressed because one or more lines are too long

View File

@ -4189,19 +4189,11 @@ td.media-icon img {
#loading-items { #loading-items {
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
background-color: #eee; padding: 10px 0;
opacity: 0.7; background-color: #fff;
height: 100%;
width: 100%;
}
#loading-items span {
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
background: url(../images/loading-lg.gif) no-repeat 50% top; opacity: 0.5;
margin-top: 7px;
line-height: 32px;
display: block;
text-indent: -9999px;
} }
#howto { #howto {
font-size: 11px; font-size: 11px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -15,9 +15,8 @@ window.listTable = {
this.$tbody = $('#the-list, #the-comment-list'); this.$tbody = $('#the-list, #the-comment-list');
this.$overlay = $('<div>') this.$overlay = $('<div id="loading-items">')
.attr('id', 'loading-items') .html(listTableL10n.loading)
.html('<span>' + listTableL10n.loading + '</span>')
.hide() .hide()
.prependTo($('body')); .prependTo($('body'));
}, },
@ -54,8 +53,6 @@ window.listTable = {
if ( !different ) if ( !different )
return false; return false;
scrollTo(0, 0);
this.show_overlay(); this.show_overlay();
if ( reset_paging ) if ( reset_paging )
@ -134,8 +131,8 @@ window.listTable = {
this.$overlay this.$overlay
.css({ .css({
width: this.$tbody.outerWidth(true) + 'px', width: this.$tbody.width() + 'px',
height: this.$tbody.outerHeight(true) + 'px' height: this.$tbody.height() - 20 + 'px'
}) })
.css(this.$tbody.offset()) .css(this.$tbody.offset())
.show(); .show();
@ -158,7 +155,10 @@ listTable.init();
if ( paged > listTable.get_total_pages() ) if ( paged > listTable.get_total_pages() )
paged = listTable.get_total_pages(); paged = listTable.get_total_pages();
listTable.update_rows({'paged': paged}, false); listTable.update_rows({'paged': paged}, false, function() {
if ( $el.parents('.tablenav.bottom').length )
scrollTo(0, 0);
});
} }
// pagination // pagination

View File

@ -1 +1 @@
jQuery(document).ready(function(a){window.listTable={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>").attr("id","loading-items").html("<span>"+listTableL10n.loading+"</span>").hide().prependTo(a("body"))},set_total_pages:function(e){var d=a(".last-page").attr("href");if(d){this.total_pages=e||a.query.load(d).get("paged")}},get_total_pages:function(){return this.total_pages},htmlencode:function(d){return a("<div/>").text(d).html()},update_rows:function(e,d,h){if(this.loading){return false}var g=false,f={};a.each(e,function(i,j){if(j!=a.query.GET(i)){a.query.SET(i,j);g=true}});if(!g){return false}scrollTo(0,0);this.show_overlay();if(d){a.query.SET("paged",1)}a.each(a.query.get(),function(i,j){if(true===j){f[i]=""}else{f[i]=j}});this._callback=h;this.fetch_list(f,a.proxy(this,"handle_success"),a.proxy(this,"handle_error"));return true},fetch_list:function(e,f,d){e=a.extend(e,{action:"fetch-list",list_args:list_args});a.ajax({url:ajaxurl,global:false,dataType:"json",data:e,success:f,error:d})},handle_success:function(d){if("object"!=typeof d){this.handle_error()}else{this.hide_overlay();this.$tbody.html(d.rows);a(".displaying-num").html(d.total_items_i18n);a(".total-pages").html(d.total_pages_i18n);this.set_total_pages(d.total_pages);a(".current-page").val(a.query.GET("paged"));a("th.column-cb :input").attr("checked",false);if(history.replaceState){history.replaceState({},"",location.pathname+a.query)}if(this._callback){this._callback()}}},handle_error:function(){this.hide_overlay();a("h2").after('<div class="error ajax below-h2"><p>'+listTableL10n.error+"</p></div>")},show_overlay:function(){this.loading=true;a(".error.ajax").remove();this.$overlay.css({width:this.$tbody.outerWidth(true)+"px",height:this.$tbody.outerHeight(true)+"px"}).css(this.$tbody.offset()).show()},hide_overlay:function(){this.loading=false;this.$overlay.hide()}};listTable.init();function b(e,d){if(e<1){e=1}if(e>listTable.get_total_pages()){e=listTable.get_total_pages()}listTable.update_rows({paged:e},false)}a(".tablenav-pages a").click(function(){var e=a(this),d=a.query.GET("paged");switch(e.attr("class")){case"first-page":d=1;break;case"prev-page":d-=1;break;case"next-page":d+=1;break;case"last-page":d=listTable.get_total_pages();break}b(d,e);return false});a(".current-page").keypress(function(f){if(13!=f.keyCode){return}var d=a(this);b(parseInt(d.val())||1,d);return false});a("th.sortable a, th.sorted a").click(function(){function h(j){return a.query.load(j.find("a").attr("href")).get("order")}var f=a(this),g=f.parent("th"),i=a.query.load(f.attr("href")).get("orderby"),e;if(i==a.query.get("orderby")){e=("asc"==a.query.get("order"))?"desc":"asc"}else{e=h(g);var d=a("th.sorted");if(d.length){d.removeClass("sorted").addClass("sortable");d.removeClass("desc").removeClass("asc").addClass("asc"==h(d)?"desc":"asc")}g.removeClass("sortable").addClass("sorted")}g.removeClass("desc").removeClass("asc").addClass(e);listTable.update_rows({orderby:i,order:e},true);return false});function c(d){if("keypress"==d.type&&13!=d.keyCode){return}d.preventDefault();d.stopImmediatePropagation();var e=a(this).parent(".search-box").find(":input").serializeObject();listTable.update_rows(e,true,function(){if(a("h2.nav-tab-wrapper").length){return}a("h2 .subtitle").remove();if(e.s){a("h2").append(a('<span class="subtitle">').html(listTableL10n.search.replace("%s",this.htmlencode(e.s))))}})}a(".search-box :submit").click(c);a(".search-box :text").keypress(c);a("#post-query-submit").click(function(){var d={};a(this).parents(".actions").find('select[name!="action"]').each(function(){var e=a(this);d[e.attr("name")]=e.val()});listTable.update_rows(d,true);return false});a(".view-switch a").click(function(){var d=a(this);listTable.update_rows({mode:a.query.load(d.attr("href")).get("mode")},false,function(){a(".view-switch .current").removeClass("current");d.addClass("current")});return false})}); jQuery(document).ready(function(a){window.listTable={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(listTableL10n.loading).hide().prependTo(a("body"))},set_total_pages:function(e){var d=a(".last-page").attr("href");if(d){this.total_pages=e||a.query.load(d).get("paged")}},get_total_pages:function(){return this.total_pages},htmlencode:function(d){return a("<div/>").text(d).html()},update_rows:function(e,d,h){if(this.loading){return false}var g=false,f={};a.each(e,function(i,j){if(j!=a.query.GET(i)){a.query.SET(i,j);g=true}});if(!g){return false}this.show_overlay();if(d){a.query.SET("paged",1)}a.each(a.query.get(),function(i,j){if(true===j){f[i]=""}else{f[i]=j}});this._callback=h;this.fetch_list(f,a.proxy(this,"handle_success"),a.proxy(this,"handle_error"));return true},fetch_list:function(e,f,d){e=a.extend(e,{action:"fetch-list",list_args:list_args});a.ajax({url:ajaxurl,global:false,dataType:"json",data:e,success:f,error:d})},handle_success:function(d){if("object"!=typeof d){this.handle_error()}else{this.hide_overlay();this.$tbody.html(d.rows);a(".displaying-num").html(d.total_items_i18n);a(".total-pages").html(d.total_pages_i18n);this.set_total_pages(d.total_pages);a(".current-page").val(a.query.GET("paged"));a("th.column-cb :input").attr("checked",false);if(history.replaceState){history.replaceState({},"",location.pathname+a.query)}if(this._callback){this._callback()}}},handle_error:function(){this.hide_overlay();a("h2").after('<div class="error ajax below-h2"><p>'+listTableL10n.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()}};listTable.init();function b(e,d){if(e<1){e=1}if(e>listTable.get_total_pages()){e=listTable.get_total_pages()}listTable.update_rows({paged:e},false,function(){if(d.parents(".tablenav.bottom").length){scrollTo(0,0)}})}a(".tablenav-pages a").click(function(){var e=a(this),d=a.query.GET("paged");switch(e.attr("class")){case"first-page":d=1;break;case"prev-page":d-=1;break;case"next-page":d+=1;break;case"last-page":d=listTable.get_total_pages();break}b(d,e);return false});a(".current-page").keypress(function(f){if(13!=f.keyCode){return}var d=a(this);b(parseInt(d.val())||1,d);return false});a("th.sortable a, th.sorted a").click(function(){function h(j){return a.query.load(j.find("a").attr("href")).get("order")}var f=a(this),g=f.parent("th"),i=a.query.load(f.attr("href")).get("orderby"),e;if(i==a.query.get("orderby")){e=("asc"==a.query.get("order"))?"desc":"asc"}else{e=h(g);var d=a("th.sorted");if(d.length){d.removeClass("sorted").addClass("sortable");d.removeClass("desc").removeClass("asc").addClass("asc"==h(d)?"desc":"asc")}g.removeClass("sortable").addClass("sorted")}g.removeClass("desc").removeClass("asc").addClass(e);listTable.update_rows({orderby:i,order:e},true);return false});function c(d){if("keypress"==d.type&&13!=d.keyCode){return}d.preventDefault();d.stopImmediatePropagation();var e=a(this).parent(".search-box").find(":input").serializeObject();listTable.update_rows(e,true,function(){if(a("h2.nav-tab-wrapper").length){return}a("h2 .subtitle").remove();if(e.s){a("h2").append(a('<span class="subtitle">').html(listTableL10n.search.replace("%s",this.htmlencode(e.s))))}})}a(".search-box :submit").click(c);a(".search-box :text").keypress(c);a("#post-query-submit").click(function(){var d={};a(this).parents(".actions").find('select[name!="action"]').each(function(){var e=a(this);d[e.attr("name")]=e.val()});listTable.update_rows(d,true);return false});a(".view-switch a").click(function(){var d=a(this);listTable.update_rows({mode:a.query.load(d.attr("href")).get("mode")},false,function(){a(".view-switch .current").removeClass("current");d.addClass("current")});return false})});

View File

@ -304,7 +304,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' ); $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' );
$scripts->add_data( 'admin-custom-fields', 'group', 1 ); $scripts->add_data( 'admin-custom-fields', 'group', 1 );
$scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery-query', 'jquery-serialize-object' ), '20101204' ); $scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery-query', 'jquery-serialize-object' ), '20101230' );
$scripts->add_data( 'list-table', 'group', 1 ); $scripts->add_data( 'list-table', 'group', 1 );
$scripts->localize( 'list-table', 'listTableL10n', array( $scripts->localize( 'list-table', 'listTableL10n', array(
'loading' => __('Loading...'), 'loading' => __('Loading...'),
@ -485,9 +485,9 @@ function wp_default_styles( &$styles ) {
// Any rtl stylesheets that don't have a .dev version for ltr // Any rtl stylesheets that don't have a .dev version for ltr
$no_suffix = array( 'farbtastic' ); $no_suffix = array( 'farbtastic' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20101204' ); $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20101202' );
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20101204' ); $styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20101102' );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' ); $styles->add_data( 'ie', 'conditional', 'lte IE 7' );
// all colors stylesheets need to have the same query strings (cache manifest compat) // all colors stylesheets need to have the same query strings (cache manifest compat)