QE: fix notices and check if the returned string contains the row HTML, props DD32, fixes #8115

git-svn-id: https://develop.svn.wordpress.org/trunk@9712 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2008-11-15 12:04:38 +00:00
parent abd0d8d127
commit 70914a2ca0
5 changed files with 23 additions and 18 deletions
+14 -10
View File
@@ -123,7 +123,7 @@ inlineEditPost = {
if ( typeof(id) == 'object' )
id = t.getId(id);
var fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'post_password'];
var fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password'];
if ( t.type == 'page' ) fields.push('post_parent', 'menu_order', 'page_template');
if ( t.type == 'post' ) fields.push('tags_input');
@@ -207,15 +207,19 @@ inlineEditPost = {
var row = $(inlineEditPost.what+id);
if (r) {
r = r.replace(/hide-if-no-js/, '');
$('#edit-'+id).remove();
row.html($(r).html());
if ( 'draft' == $('input[name="post_status"]').val() )
row.find('td.column-comments').hide();
inlineEditPost.addEvents(row);
row.fadeIn();
if ( -1 != r.indexOf('<tr') ) {
r = r.replace(/hide-if-no-js/, '');
$('#edit-'+id).remove();
row.html($(r).html());
if ( 'draft' == $('input[name="post_status"]').val() )
row.find('td.column-comments').hide();
inlineEditPost.addEvents(row);
row.fadeIn();
} else {
r = r.replace( /<.[^<>]*?>/g, '' );
$('#edit-'+id+' .inline-edit-save').append('<span class="error">'+r+'</span>');
}
} else {
$('#edit-'+id+' .inline-edit-save').append('<span class="error">'+inlineEditL10n.error+'</span>');
}
+1 -5
View File
@@ -12,7 +12,6 @@ inlineEditTax = {
t.rows = $('tr.iedit');
// prepare the edit row
// .dblclick(function() { inlineEditTax.toggle(this); })
row.keyup(function(e) { if(e.which == 27) return inlineEditTax.revert(); });
$('a.cancel', row).click(function() { return inlineEditTax.revert(); });
@@ -20,7 +19,6 @@ inlineEditTax = {
$('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditTax.save(this); });
// add events
// t.rows.dblclick(function() { inlineEditTax.toggle(this); });
t.addEvents(t.rows);
$('#posts-filter input[type="submit"]').click(function(e){
@@ -112,9 +110,7 @@ inlineEditTax = {
if ( -1 != r.indexOf('<tr') ) {
$('#edit-'+id).remove();
r = r.replace(/hide-if-no-js/, '');
row.html($(r).html()).show()
.animate( { backgroundColor: '#CCEEBB' }, 500)
.animate( { backgroundColor: '#eefee7' }, 500);
row.html($(r).html()).fadeIn();
inlineEditTax.addEvents(row);
} else
$('#edit-'+id+' .inline-edit-save .error').html(r).show();