Fix adding similar tags

git-svn-id: http://svn.automattic.com/wordpress/trunk@9542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-11-06 02:54:35 +00:00
parent 3b043a8308
commit 63bc2ead19
2 changed files with 5 additions and 3 deletions

View File

@ -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, '' );

View File

@ -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')),