mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
Trim leading whitespace from AJAX responses.
This fixes the warning "$(html) HTML strings must start with '<' character" by jQuery Migrate when adding nav menu items, post custom fields or comment replies. fixes #23681. Built from https://develop.svn.wordpress.org/trunk@25546 git-svn-id: http://core.svn.wordpress.org/trunk@25466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1998919ade
commit
c2739d12cc
@ -495,7 +495,6 @@ commentReply = {
|
|||||||
t.revert();
|
t.revert();
|
||||||
|
|
||||||
r = r.responses[0];
|
r = r.responses[0];
|
||||||
c = r.data;
|
|
||||||
id = '#comment-' + r.id;
|
id = '#comment-' + r.id;
|
||||||
|
|
||||||
if ( 'edit-comment' == t.act )
|
if ( 'edit-comment' == t.act )
|
||||||
@ -513,8 +512,10 @@ commentReply = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c = $.trim(r.data); // Trim leading whitespaces
|
||||||
$(c).hide()
|
$(c).hide()
|
||||||
$('#replyrow').after(c);
|
$('#replyrow').after(c);
|
||||||
|
|
||||||
id = $(id);
|
id = $(id);
|
||||||
t.addEvents(id);
|
t.addEvents(id);
|
||||||
bg = id.hasClass('unapproved') ? '#FFFFE0' : id.closest('.widefat, .postbox').css('backgroundColor');
|
bg = id.hasClass('unapproved') ? '#FFFFE0' : id.closest('.widefat, .postbox').css('backgroundColor');
|
||||||
|
2
wp-admin/js/edit-comments.min.js
vendored
2
wp-admin/js/edit-comments.min.js
vendored
File diff suppressed because one or more lines are too long
@ -902,12 +902,16 @@ var wpNavMenu;
|
|||||||
|
|
||||||
$.post( ajaxurl, params, function(menuMarkup) {
|
$.post( ajaxurl, params, function(menuMarkup) {
|
||||||
var ins = $('#menu-instructions');
|
var ins = $('#menu-instructions');
|
||||||
|
|
||||||
|
menuMarkup = $.trim( menuMarkup ); // Trim leading whitespaces
|
||||||
processMethod(menuMarkup, params);
|
processMethod(menuMarkup, params);
|
||||||
|
|
||||||
// Make it stand out a bit more visually, by adding a fadeIn
|
// Make it stand out a bit more visually, by adding a fadeIn
|
||||||
$( 'li.pending' ).hide().fadeIn('slow');
|
$( 'li.pending' ).hide().fadeIn('slow');
|
||||||
$( '.drag-instructions' ).show();
|
$( '.drag-instructions' ).show();
|
||||||
if( ! ins.hasClass( 'menu-instructions-inactive' ) && ins.siblings().length )
|
if( ! ins.hasClass( 'menu-instructions-inactive' ) && ins.siblings().length )
|
||||||
ins.addClass( 'menu-instructions-inactive' );
|
ins.addClass( 'menu-instructions-inactive' );
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
2
wp-admin/js/nav-menu.min.js
vendored
2
wp-admin/js/nav-menu.min.js
vendored
File diff suppressed because one or more lines are too long
@ -208,7 +208,7 @@ wpList = {
|
|||||||
s.delAfter( rres, _s );
|
s.delAfter( rres, _s );
|
||||||
}).dequeue();
|
}).dequeue();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
$.ajax( s );
|
$.ajax( s );
|
||||||
return false;
|
return false;
|
||||||
@ -308,7 +308,7 @@ wpList = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
add: function( e, s ) {
|
add: function( e, s ) {
|
||||||
e = $(e);
|
e = $( $.trim(e) ); // Trim leading whitespaces
|
||||||
|
|
||||||
var list = $(this), old = false, _s = { pos: 0, id: 0, oldId: null }, ba, ref, color;
|
var list = $(this), old = false, _s = { pos: 0, id: 0, oldId: null }, ba, ref, color;
|
||||||
|
|
||||||
|
2
wp-includes/js/wp-lists.min.js
vendored
2
wp-includes/js/wp-lists.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user