Accessible Tags autocomplete:

- Replace suggest.js with UI Autocomplete.
- Use the same settings like in the editor link toolbar.
- Abstract it and add in a new file, tags-suggest.js. Then make it a dependency for the Tags postbox(es) and Quick and Bulk Edit.
- Add `data-wp-taxonomy` on all input elements to improve handling in the UI for custom taxonomies.

Props afercia, azaozz.
See #33902.
Built from https://develop.svn.wordpress.org/trunk@38797


git-svn-id: http://core.svn.wordpress.org/trunk@38740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2016-10-14 22:40:28 +00:00
parent e2e22580db
commit d91da52588
10 changed files with 224 additions and 47 deletions

View File

@ -1550,10 +1550,13 @@ class WP_Posts_List_Table extends WP_List_Table {
<?php if ( count( $flat_taxonomies ) && !$bulk ) : ?>
<?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
<?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) : ?>
<?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) :
$taxonomy_name = esc_attr( $taxonomy->name );
?>
<label class="inline-edit-tags">
<span class="title"><?php echo esc_html( $taxonomy->labels->name ) ?></span>
<textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr( $taxonomy->name )?>]" class="tax_input_<?php echo esc_attr( $taxonomy->name )?>"></textarea>
<textarea data-wp-taxonomy="<?php echo $taxonomy_name; ?>" cols="22" rows="1" name="tax_input[<?php echo $taxonomy_name; ?>]" class="tax_input_<?php echo $taxonomy_name; ?>"></textarea>
</label>
<?php endif; ?>

View File

@ -431,7 +431,7 @@ function post_tags_meta_box( $post, $box ) {
<?php if ( $user_can_assign_terms ) : ?>
<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
<p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" />
<p><input data-wp-taxonomy="<?php echo $tax_name; ?>" type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" />
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p>
</div>
<p class="howto" id="new-tag-<?php echo $tax_name; ?>-desc"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>

View File

@ -83,7 +83,7 @@ inlineEditPost = {
},
setBulk : function(){
var te = '', type = this.type, tax, c = true;
var te = '', type = this.type, c = true;
this.revert();
$( '#bulk-edit td' ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length );
@ -114,9 +114,9 @@ inlineEditPost = {
// enable autocomplete for tags
if ( 'post' === type ) {
// support multi taxonomies?
tax = 'post_tag';
$('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 } );
$( 'tr.inline-editor textarea[data-wp-taxonomy]' ).each( function ( i, element ) {
$( element ).wpTagsSuggest();
} );
}
$('html, body').animate( { scrollTop: 0 }, 'fast' );
},
@ -196,7 +196,7 @@ inlineEditPost = {
textarea.val(terms);
}
textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma } );
textarea.wpTagsSuggest();
});
// handle the post status

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,8 @@
var tagBox, array_unique_noempty;
( function( $ ) {
var tagDelimiter = ( window.tagsSuggestL10n && window.tagsSuggestL10n.tagDelimiter ) || ',';
// Return an array with any duplicate, whitespace or empty values removed
array_unique_noempty = function( array ) {
var out = [];
@ -20,13 +22,17 @@ var tagBox, array_unique_noempty;
};
tagBox = {
clean : function(tags) {
var comma = window.tagsBoxL10n.tagDelimiter;
if ( ',' !== comma )
tags = tags.replace(new RegExp(comma, 'g'), ',');
clean : function( tags ) {
if ( ',' !== tagDelimiter ) {
tags = tags.replace( new RegExp( tagDelimiter, 'g' ), ',' );
}
tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
if ( ',' !== comma )
tags = tags.replace(/,/g, comma);
if ( ',' !== tagDelimiter ) {
tags = tags.replace( /,/g, tagDelimiter );
}
return tags;
},
@ -35,8 +41,7 @@ var tagBox, array_unique_noempty;
num = id.split('-check-num-')[1],
taxbox = $(el).closest('.tagsdiv'),
thetags = taxbox.find('.the-tags'),
comma = window.tagsBoxL10n.tagDelimiter,
current_tags = thetags.val().split( comma ),
current_tags = thetags.val().split( tagDelimiter ),
new_tags = [];
delete current_tags[num];
@ -48,7 +53,7 @@ var tagBox, array_unique_noempty;
}
});
thetags.val( this.clean( new_tags.join( comma ) ) );
thetags.val( this.clean( new_tags.join( tagDelimiter ) ) );
this.quickClicks( taxbox );
return false;
@ -65,7 +70,7 @@ var tagBox, array_unique_noempty;
disabled = thetags.prop('disabled');
current_tags = thetags.val().split( window.tagsBoxL10n.tagDelimiter );
current_tags = thetags.val().split( tagDelimiter );
tagchecklist.empty();
$.each( current_tags, function( key, val ) {
@ -106,8 +111,7 @@ var tagBox, array_unique_noempty;
flushTags : function( el, a, f ) {
var tagsval, newtags, text,
tags = $( '.the-tags', el ),
newtag = $( 'input.newtag', el ),
comma = window.tagsBoxL10n.tagDelimiter;
newtag = $( 'input.newtag', el );
a = a || false;
@ -118,10 +122,10 @@ var tagBox, array_unique_noempty;
}
tagsval = tags.val();
newtags = tagsval ? tagsval + comma + text : text;
newtags = tagsval ? tagsval + tagDelimiter + text : text;
newtags = this.clean( newtags );
newtags = array_unique_noempty( newtags.split( comma ) ).join( comma );
newtags = array_unique_noempty( newtags.split( tagDelimiter ) ).join( tagDelimiter );
tags.val( newtags );
this.quickClicks( el );
@ -153,32 +157,29 @@ var tagBox, array_unique_noempty;
},
init : function() {
var t = this, ajaxtag = $('div.ajaxtag');
var ajaxtag = $('div.ajaxtag');
$('.tagsdiv').each( function() {
tagBox.quickClicks(this);
tagBox.quickClicks( this );
});
$('.tagadd', ajaxtag).click(function(){
t.flushTags( $(this).closest('.tagsdiv') );
$( '.tagadd', ajaxtag ).click( function() {
tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
});
$('input.newtag', ajaxtag).keyup(function(e){
if ( 13 == e.which ) {
tagBox.flushTags( $(this).closest('.tagsdiv') );
return false;
$( 'input.newtag', ajaxtag ).keyup( function( event ) {
if ( 13 == event.which ) {
tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
event.preventDefault();
event.stopPropagation();
}
}).keypress(function(e){
if ( 13 == e.which ) {
e.preventDefault();
return false;
}).keypress( function( event ) {
if ( 13 == event.which ) {
event.preventDefault();
event.stopPropagation();
}
}).each( function() {
var tax = $(this).closest('div.tagsdiv').attr('id');
$(this).suggest(
ajaxurl + '?action=ajax-tag-search&tax=' + tax,
{ delay: 500, minchars: 2, multiple: true, multipleSep: window.tagsBoxL10n.tagDelimiter }
);
}).each( function( i, element ) {
$( element ).wpTagsSuggest();
});
// save tags on post save/publish

View File

@ -1 +1 @@
var tagBox,array_unique_noempty;!function(a){array_unique_noempty=function(b){var c=[];return a.each(b,function(b,d){d=a.trim(d),d&&-1===a.inArray(d,c)&&c.push(d)}),c},tagBox={clean:function(a){var b=window.tagsBoxL10n.tagDelimiter;return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(b){var c=b.id,d=c.split("-check-num-")[1],e=a(b).closest(".tagsdiv"),f=e.find(".the-tags"),g=window.tagsBoxL10n.tagDelimiter,h=f.val().split(g),i=[];return delete h[d],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),f.val(this.clean(i.join(g))),this.quickClicks(e),!1},quickClicks:function(b){var c,d,e=a(".the-tags",b),f=a(".tagchecklist",b),g=a(b).attr("id");e.length&&(d=e.prop("disabled"),c=e.val().split(window.tagsBoxL10n.tagDelimiter),f.empty(),a.each(c,function(b,c){var e,h;c=a.trim(c),c&&(e=a("<span />").text(c),d||(h=a('<a id="'+g+"-check-num-"+b+'" class="ntdelbutton" tabindex="0">X</a>'),h.on("click keypress",function(b){"click"!==b.type&&13!==b.keyCode||(13===b.keyCode&&a(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.parseTags(this))}),e.prepend("&nbsp;").prepend(h)),f.append(e))}))},flushTags:function(b,c,d){var e,f,g,h=a(".the-tags",b),i=a("input.newtag",b),j=window.tagsBoxL10n.tagDelimiter;return c=c||!1,g=c?a(c).text():i.val(),"undefined"==typeof g?!1:(e=h.val(),f=e?e+j+g:g,f=this.clean(f),f=array_unique_noempty(f.split(j)).join(j),h.val(f),this.quickClicks(b),c||i.val(""),"undefined"==typeof d&&i.focus(),!1)},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){0!==d&&"success"==e&&(d=a('<p id="tagcloud-'+c+'" class="the-tagcloud">'+d+"</p>"),a("a",d).click(function(){return tagBox.flushTags(a("#"+c),this),!1}),a("#"+b).after(d))})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a(".tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))}),a("input.newtag",c).keyup(function(b){return 13==b.which?(tagBox.flushTags(a(this).closest(".tagsdiv")),!1):void 0}).keypress(function(a){return 13==a.which?(a.preventDefault(),!1):void 0}).each(function(){var b=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:!0,multipleSep:window.tagsBoxL10n.tagDelimiter})}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a(".tagcloud-link").click(function(){return tagBox.get(a(this).attr("id")),a(this).unbind().click(function(){return a(this).siblings(".the-tagcloud").toggle(),!1}),!1})}}}(jQuery);
var tagBox,array_unique_noempty;!function(a){var b=window.tagsSuggestL10n&&window.tagsSuggestL10n.tagDelimiter||",";array_unique_noempty=function(b){var c=[];return a.each(b,function(b,d){d=a.trim(d),d&&-1===a.inArray(d,c)&&c.push(d)}),c},tagBox={clean:function(a){return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(c){var d=c.id,e=d.split("-check-num-")[1],f=a(c).closest(".tagsdiv"),g=f.find(".the-tags"),h=g.val().split(b),i=[];return delete h[e],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),g.val(this.clean(i.join(b))),this.quickClicks(f),!1},quickClicks:function(c){var d,e,f=a(".the-tags",c),g=a(".tagchecklist",c),h=a(c).attr("id");f.length&&(e=f.prop("disabled"),d=f.val().split(b),g.empty(),a.each(d,function(b,c){var d,f;c=a.trim(c),c&&(d=a("<span />").text(c),e||(f=a('<a id="'+h+"-check-num-"+b+'" class="ntdelbutton" tabindex="0">X</a>'),f.on("click keypress",function(b){"click"!==b.type&&13!==b.keyCode||(13===b.keyCode&&a(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.parseTags(this))}),d.prepend("&nbsp;").prepend(f)),g.append(d))}))},flushTags:function(c,d,e){var f,g,h,i=a(".the-tags",c),j=a("input.newtag",c);return d=d||!1,h=d?a(d).text():j.val(),"undefined"==typeof h?!1:(f=i.val(),g=f?f+b+h:h,g=this.clean(g),g=array_unique_noempty(g.split(b)).join(b),i.val(g),this.quickClicks(c),d||j.val(""),"undefined"==typeof e&&j.focus(),!1)},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){0!==d&&"success"==e&&(d=a('<p id="tagcloud-'+c+'" class="the-tagcloud">'+d+"</p>"),a("a",d).click(function(){return tagBox.flushTags(a("#"+c),this),!1}),a("#"+b).after(d))})},init:function(){var b=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a(".tagadd",b).click(function(){tagBox.flushTags(a(this).closest(".tagsdiv"))}),a("input.newtag",b).keyup(function(b){13==b.which&&(tagBox.flushTags(a(this).closest(".tagsdiv")),b.preventDefault(),b.stopPropagation())}).keypress(function(a){13==a.which&&(a.preventDefault(),a.stopPropagation())}).each(function(b,c){a(c).wpTagsSuggest()}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a(".tagcloud-link").click(function(){return tagBox.get(a(this).attr("id")),a(this).unbind().click(function(){return a(this).siblings(".the-tagcloud").toggle(),!1}),!1})}}}(jQuery);

167
wp-admin/js/tags-suggest.js Normal file
View File

@ -0,0 +1,167 @@
( function( $ ) {
var tempID = 0;
var separator = ( window.tagsSuggestL10n && window.tagsSuggestL10n.tagDelimiter ) || ',';
function split( val ) {
return val.split( new RegExp( separator + '\\s*' ) );
}
function getLast( term ) {
return split( term ).pop();
}
$.fn.wpTagsSuggest = function( options ) {
var cache;
var last;
var $element = $( this );
options = options || {};
var taxonomy = options.taxonomy || $element.attr( 'data-wp-taxonomy' ) || 'post_tag';
delete( options.taxonomy );
options = $.extend( {
source: function( request, response ) {
var term;
if ( last === request.term ) {
response( cache );
return;
}
term = getLast( request.term );
$.get( window.ajaxurl, {
action: 'ajax-tag-search',
tax: taxonomy,
q: term
} ).always( function() {
$element.removeClass( 'ui-autocomplete-loading' ); // UI fails to remove this sometimes?
} ).done( function( data ) {
var value;
var terms = [];
if ( data ) {
data = data.split( '\n' );
for ( value in data ) {
var id = ++tempID;
terms.push({
id: id,
name: data[value]
});
}
cache = terms;
response( terms );
} else {
response( terms );
}
} );
last = request.term;
},
focus: function( event, ui ) {
$element.attr( 'aria-activedescendant', 'wp-tags-autocomplete-' + ui.item.id );
// Don't empty the input field when using the arrow keys to
// highlight items. See api.jqueryui.com/autocomplete/#event-focus
event.preventDefault();
},
select: function( event, ui ) {
var tags = split( $element.val() );
// Remove the last user input.
tags.pop();
// Append the new tag and an empty element to get one more separator at the end.
tags.push( ui.item.name, '' );
$element.val( tags.join( separator + ' ' ) );
if ( $.ui.keyCode.TAB === event.keyCode ) {
if ( typeof window.uiAutocompleteL10n !== 'undefined' ) {
// Audible confirmation message when a tag has been selected.
window.wp.a11y.speak( window.uiAutocompleteL10n.itemSelected );
}
event.preventDefault();
} else if ( $.ui.keyCode.ENTER === event.keyCode ) {
// Do not close Quick Edit / Bulk Edit
event.preventDefault();
event.stopPropagation();
}
return false;
},
open: function() {
$element.attr( 'aria-expanded', 'true' );
},
close: function() {
$element.attr( 'aria-expanded', 'false' );
},
minLength: 2,
position: {
my: 'left top+2'
},
messages: {
noResults: ( typeof window.uiAutocompleteL10n !== 'undefined' ) ? window.uiAutocompleteL10n.noResults : '',
results: function( number ) {
if ( typeof window.uiAutocompleteL10n !== 'undefined' ) {
if ( number > 1 ) {
return window.uiAutocompleteL10n.manyResults.replace( '%d', number );
}
return window.uiAutocompleteL10n.oneResult;
}
}
}
}, options );
$element.on( 'keydown', function() {
$element.removeAttr( 'aria-activedescendant' );
} )
.autocomplete( options )
.autocomplete( 'instance' )._renderItem = function( ul, item ) {
return $( '<li role="option" id="wp-tags-autocomplete-' + item.id + '">' )
.text( item.name )
.appendTo( ul );
};
$element.attr( {
'role': 'combobox',
'aria-autocomplete': 'list',
'aria-expanded': 'false',
'aria-owns': $element.autocomplete( 'widget' ).attr( 'id' )
} )
.on( 'focus', function() {
var inputValue = split( $element.val() ).pop();
// Don't trigger a search if the field is empty.
// Also, avoids screen readers announce `No search results`.
if ( inputValue ) {
$element.autocomplete( 'search' );
}
} )
// Returns a jQuery object containing the menu element.
.autocomplete( 'widget' )
.addClass( 'wp-tags-autocomplete' )
.attr( 'role', 'listbox' )
.removeAttr( 'tabindex' ) // Remove the `tabindex=0` attribute added by jQuery UI.
// Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301.
// The `menufocus` and `menublur` events are the same events used to add and remove
// the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget.
.on( 'menufocus', function( event, ui ) {
ui.item.attr( 'aria-selected', 'true' );
})
.on( 'menublur', function() {
// The `menublur` event returns an object where the item is `null`
// so we need to find the active item with other means.
$( this ).find( '[aria-selected="true"]' ).removeAttr( 'aria-selected' );
});
return this;
};
}( jQuery ) );

1
wp-admin/js/tags-suggest.min.js vendored Normal file
View File

@ -0,0 +1 @@
!function(a){function b(a){return a.split(new RegExp(e+"\\s*"))}function c(a){return b(a).pop()}var d=0,e=window.tagsSuggestL10n&&window.tagsSuggestL10n.tagDelimiter||",";a.fn.wpTagsSuggest=function(f){var g,h,i=a(this);f=f||{};var j=f.taxonomy||i.attr("data-wp-taxonomy")||"post_tag";return delete f.taxonomy,f=a.extend({source:function(b,e){var f;return h===b.term?void e(g):(f=c(b.term),a.get(window.ajaxurl,{action:"ajax-tag-search",tax:j,q:f}).always(function(){i.removeClass("ui-autocomplete-loading")}).done(function(a){var b,c=[];if(a){a=a.split("\n");for(b in a){var f=++d;c.push({id:f,name:a[b]})}g=c,e(c)}else e(c)}),void(h=b.term))},focus:function(a,b){i.attr("aria-activedescendant","wp-tags-autocomplete-"+b.item.id),a.preventDefault()},select:function(c,d){var f=b(i.val());return f.pop(),f.push(d.item.name,""),i.val(f.join(e+" ")),a.ui.keyCode.TAB===c.keyCode?("undefined"!=typeof window.uiAutocompleteL10n&&window.wp.a11y.speak(window.uiAutocompleteL10n.itemSelected),c.preventDefault()):a.ui.keyCode.ENTER===c.keyCode&&(c.preventDefault(),c.stopPropagation()),!1},open:function(){i.attr("aria-expanded","true")},close:function(){i.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2"},messages:{noResults:"undefined"!=typeof window.uiAutocompleteL10n?window.uiAutocompleteL10n.noResults:"",results:function(a){return"undefined"!=typeof window.uiAutocompleteL10n?a>1?window.uiAutocompleteL10n.manyResults.replace("%d",a):window.uiAutocompleteL10n.oneResult:void 0}}},f),i.on("keydown",function(){i.removeAttr("aria-activedescendant")}).autocomplete(f).autocomplete("instance")._renderItem=function(b,c){return a('<li role="option" id="wp-tags-autocomplete-'+c.id+'">').text(c.name).appendTo(b)},i.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":i.autocomplete("widget").attr("id")}).on("focus",function(){var a=b(i.val()).pop();a&&i.autocomplete("search")}).autocomplete("widget").addClass("wp-tags-autocomplete").attr("role","listbox").removeAttr("tabindex").on("menufocus",function(a,b){b.item.attr("aria-selected","true")}).on("menublur",function(){a(this).find('[aria-selected="true"]').removeAttr("aria-selected")}),this}}(jQuery);

View File

@ -234,6 +234,7 @@ function wp_default_scripts( &$scripts ) {
'oneResult' => __( '1 result found. Use up and down arrow keys to navigate.' ),
/* translators: %d: Number of results found when using jQuery UI Autocomplete */
'manyResults' => __( '%d results found. Use up and down arrow keys to navigate.' ),
'itemSelected' => __( 'Item selected.' ),
) );
// deprecated, not used in core, most functionality is included in jQuery 1.3
@ -241,7 +242,6 @@ function wp_default_scripts( &$scripts ) {
// jQuery plugins
$scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color.min.js", array('jquery'), '2.1.1', 1 );
$scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20110113', 1 );
$scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20m', 1 );
$scripts->add( 'jquery-query', "/wp-includes/js/jquery/jquery.query.js", array('jquery'), '2.1.7', 1 );
$scripts->add( 'jquery-serialize-object', "/wp-includes/js/jquery/jquery.serialize-object.js", array('jquery'), '0.2', 1 );
@ -249,6 +249,9 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), false, 1 );
$scripts->add( 'jquery-touch-punch', "/wp-includes/js/jquery/jquery.ui.touch-punch.js", array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1 );
// Not used any more, registered for backwards compatibility.
$scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20110113', 1 );
// Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv.
// It sets jQuery as a dependency, as the theme may have been implicitly loading it this way.
$scripts->add( 'imagesloaded', "/wp-includes/js/imagesloaded.min.js", array(), '3.2.0', 1 );
@ -523,8 +526,10 @@ function wp_default_scripts( &$scripts ) {
'postBoxEmptyString' => __( 'Drag boxes here' ),
) );
$scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'suggest' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'tags-box', 'tagsBoxL10n', array(
$scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'tags-suggest' ), false, 1 );
$scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'tags-suggest', 'tagsSuggestL10n', array(
'tagDelimiter' => _x( ',', 'tag delimiter' ),
) );
@ -584,7 +589,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'wp-backbone', 'wp-a11y' ), false, 1 );
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest', 'wp-a11y' ), false, 1 );
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'tags-suggest', 'wp-a11y' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
'error' => __( 'Error while saving the changes.' ),
'ntdeltitle' => __( 'Remove From Bulk Edit' ),

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38796';
$wp_version = '4.7-alpha-38797';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.