Make WordPress Core

Ticket #28471: 28471-2.diff

File 28471-2.diff, 2.9 KB (added by camdensegal, 11 years ago)

Updated to trim tag delimiter to solve any localization that may add whitespace around the delimiter, removed whitespace option, and cleaned js code style.

  • wp-admin/js/inline-edit-post.js

     
    110110                if ( 'post' === type ) {
    111111                        // support multi taxonomies?
    112112                        tax = 'post_tag';
    113                         $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );
     113                        $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma } );
    114114                }
    115115                $('html, body').animate( { scrollTop: 0 }, 'fast' );
    116116        },
     
    195195                                textarea.val(terms);
    196196                        }
    197197
    198                         textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );
     198                        textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma } );
    199199                });
    200200
    201201                // handle the post status
  • wp-includes/js/jquery/suggest.js

     
    240240                        if ($currentResult) {
    241241                                if ( options.multiple ) {
    242242                                        if ( $input.val().indexOf(options.multipleSep) != -1 ) {
    243                                                 $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) );
     243                                                $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ) + ' ';
    244244                                        } else {
    245245                                                $currentVal = "";
    246246                                        }
    247                                         $input.val( $currentVal + $currentResult.text() + options.multipleSep);
     247                                        $input.val( $currentVal + $currentResult.text() + options.multipleSep + ' ' );
    248248                                        $input.focus();
    249249                                } else {
    250250                                        $input.val($currentResult.text());
     
    294294
    295295                options = options || {};
    296296                options.multiple = options.multiple || false;
    297                 options.multipleSep = options.multipleSep || ", ";
     297                options.multipleSep = options.multipleSep || ",";
    298298                options.source = source;
    299299                options.delay = options.delay || 100;
    300300                options.resultsClass = options.resultsClass || 'ac_results';
  • wp-includes/script-loader.php

     
    476476                        'error' => __('Error while saving the changes.'),
    477477                        'ntdeltitle' => __('Remove From Bulk Edit'),
    478478                        'notitle' => __('(no title)'),
    479                         'comma' => _x( ',', 'tag delimiter' ),
     479                        'comma' => trim( _x( ',', 'tag delimiter' ) ),
    480480                ) );
    481481
    482482                $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), false, 1 );