Preserve tag escaping. Props koopersmith, Nils Jueneman. For trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@17398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
687c69d009
commit
322898f150
|
@ -36,7 +36,10 @@ tagBox = {
|
||||||
},
|
},
|
||||||
|
|
||||||
quickClicks : function(el) {
|
quickClicks : function(el) {
|
||||||
var thetags = $('.the-tags', el), tagchecklist = $('.tagchecklist', el), current_tags, disabled;
|
var thetags = $('.the-tags', el),
|
||||||
|
tagchecklist = $('.tagchecklist', el),
|
||||||
|
id = $(el).attr('id'),
|
||||||
|
current_tags, disabled;
|
||||||
|
|
||||||
if ( !thetags.length )
|
if ( !thetags.length )
|
||||||
return;
|
return;
|
||||||
|
@ -47,19 +50,25 @@ tagBox = {
|
||||||
tagchecklist.empty();
|
tagchecklist.empty();
|
||||||
|
|
||||||
$.each( current_tags, function( key, val ) {
|
$.each( current_tags, function( key, val ) {
|
||||||
var txt, button_id, id = $(el).attr('id');
|
var span, xbutton;
|
||||||
|
|
||||||
val = $.trim( val );
|
val = $.trim( val );
|
||||||
if ( !val.match(/^\s+$/) && '' != val ) {
|
|
||||||
button_id = id + '-check-num-' + key;
|
if ( ! val )
|
||||||
if ( disabled )
|
return;
|
||||||
txt = '<span>' + val + '</span> ';
|
|
||||||
else
|
// Create a new span, and ensure the text is properly escaped.
|
||||||
txt = '<span><a id="' + button_id + '" class="ntdelbutton">X</a> ' + val + '</span> ';
|
span = $('<span />').text( val );
|
||||||
tagchecklist.append(txt);
|
|
||||||
if ( ! disabled )
|
// If tags editing isn't disabled, create the X button.
|
||||||
$( '#' + button_id ).click( function(){ tagBox.parseTags(this); });
|
if ( ! disabled ) {
|
||||||
|
xbutton = $( '<a id="' + id + '-check-num-' + key + '" class="ntdelbutton">X</a>' );
|
||||||
|
xbutton.click( function(){ tagBox.parseTags(this); });
|
||||||
|
span.prepend(' ').prepend( xbutton );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Append the span to the tag list.
|
||||||
|
tagchecklist.append( span );
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -312,7 +312,7 @@ function wp_default_scripts( &$scripts ) {
|
||||||
$scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20091012' );
|
$scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20091012' );
|
||||||
$scripts->add_data( 'postbox', 'group', 1 );
|
$scripts->add_data( 'postbox', 'group', 1 );
|
||||||
|
|
||||||
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20101222' );
|
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20110203' );
|
||||||
$scripts->add_data( 'post', 'group', 1 );
|
$scripts->add_data( 'post', 'group', 1 );
|
||||||
$scripts->localize( 'post', 'postL10n', array(
|
$scripts->localize( 'post', 'postL10n', array(
|
||||||
'tagsUsed' => __('Tags used on this post:'),
|
'tagsUsed' => __('Tags used on this post:'),
|
||||||
|
|
Loading…
Reference in New Issue