mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Fix adding similar tags
git-svn-id: http://svn.automattic.com/wordpress/trunk@9542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3b043a8308
commit
63bc2ead19
@ -41,12 +41,14 @@ function tag_flush_to_text(e,a) {
|
||||
a = a || false;
|
||||
var text = a ? jQuery(a).text() : jQuery('#newtag').val();
|
||||
var newtags = jQuery('#tags-input').val();
|
||||
var t = text.replace( /\s*([^,]+)[\s,]*/, '$1' );
|
||||
|
||||
var t = text.replace( /\s*([^,]+).*/, '$1,' );
|
||||
newtags += ','
|
||||
|
||||
if ( newtags.indexOf(t) != -1 )
|
||||
return false;
|
||||
|
||||
newtags += ',' + text;
|
||||
newtags += text;
|
||||
|
||||
// massage
|
||||
newtags = newtags.replace( /\s+,+\s*/g, ',' ).replace( /,+/g, ',' ).replace( /,+\s+,+/g, ',' ).replace( /,+\s*$/g, '' ).replace( /^\s*,+/g, '' );
|
||||
|
@ -176,7 +176,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'save' => __('Save'),
|
||||
'cancel' => __('Cancel'),
|
||||
) );
|
||||
$scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug', 'settings-box'), '20081103' );
|
||||
$scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug', 'settings-box'), '20081105' );
|
||||
$scripts->localize( 'post', 'postL10n', array(
|
||||
'tagsUsed' => __('Tags used on this post:'),
|
||||
'add' => attribute_escape(__('Add')),
|
||||
|
Loading…
Reference in New Issue
Block a user