External Libraries: Further fix jQuery deprecations in WordPress core.

Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429].

Props Clorith.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50547


git-svn-id: http://core.svn.wordpress.org/trunk@50160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-03-18 19:01:03 +00:00
parent cd3e85fe23
commit 87db5b833d
81 changed files with 161 additions and 151 deletions

View File

@ -31,7 +31,7 @@
( function( $ ){ ( function( $ ){
$( document ).ready( function () { $( function () {
// Expand/Collapse accordion sections on click. // Expand/Collapse accordion sections on click.
$( '.accordion-container' ).on( 'click keydown', '.accordion-section-title', function( e ) { $( '.accordion-container' ).on( 'click keydown', '.accordion-section-title', function( e ) {

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
!function(s){s(document).ready(function(){s(".accordion-container").on("click keydown",".accordion-section-title",function(e){var n,o,a,i,t;"keydown"===e.type&&13!==e.which||(e.preventDefault(),n=s(this),o=n.closest(".accordion-section"),a=o.find("[aria-expanded]").first(),i=o.closest(".accordion-container"),t=i.find(".open"),e=t.find("[aria-expanded]").first(),n=o.find(".accordion-section-content"),o.hasClass("cannot-expand")||(i.addClass("opening"),o.hasClass("open")?(o.toggleClass("open"),n.toggle(!0).slideToggle(150)):(e.attr("aria-expanded","false"),t.removeClass("open"),t.find(".accordion-section-content").show().slideUp(150),n.toggle(!1).slideToggle(150),o.toggleClass("open")),setTimeout(function(){i.removeClass("opening")},150),a&&a.attr("aria-expanded",String("false"===a.attr("aria-expanded")))))})})}(jQuery); !function(s){s(function(){s(".accordion-container").on("click keydown",".accordion-section-title",function(e){var n,o,a,i,t;"keydown"===e.type&&13!==e.which||(e.preventDefault(),n=s(this),o=n.closest(".accordion-section"),a=o.find("[aria-expanded]").first(),i=o.closest(".accordion-container"),t=i.find(".open"),e=t.find("[aria-expanded]").first(),n=o.find(".accordion-section-content"),o.hasClass("cannot-expand")||(i.addClass("opening"),o.hasClass("open")?(o.toggleClass("open"),n.toggle(!0).slideToggle(150)):(e.attr("aria-expanded","false"),t.removeClass("open"),t.find(".accordion-section-content").show().slideUp(150),n.toggle(!1).slideToggle(150),o.toggleClass("open")),setTimeout(function(){i.removeClass("opening")},150),a&&a.attr("aria-expanded",String("false"===a.attr("aria-expanded")))))})})}(jQuery);

View File

@ -101,7 +101,7 @@
} }
// Bind the close event. // Bind the close event.
self.close = $.proxy( self.close, self ); self.close = self.close.bind( self );
self.initialValue = el.val(); self.initialValue = el.val();
@ -277,7 +277,7 @@
if ( me.hasClass( 'wp-picker-clear' ) ) { if ( me.hasClass( 'wp-picker-clear' ) ) {
self.element.val( '' ); self.element.val( '' );
self.toggler.css( 'backgroundColor', '' ); self.toggler.css( 'backgroundColor', '' );
if ( $.isFunction( self.options.clear ) ) { if ( typeof self.options.clear === 'function' ) {
self.options.clear.call( this, event ); self.options.clear.call( this, event );
} }
} else if ( me.hasClass( 'wp-picker-default' ) ) { } else if ( me.hasClass( 'wp-picker-default' ) ) {

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
!function(i,t){var a=wp.i18n.__,e={options:{defaultColor:!1,change:!1,clear:!1,hide:!0,palettes:!0,width:255,mode:"hsv",type:"full",slider:"horizontal"},_createHueOnly:function(){var e,o=this,t=o.element;t.hide(),e="hsl("+t.val()+", 100, 50)",t.iris({mode:"hsl",type:"hue",hide:!1,color:e,change:function(e,t){"function"==typeof o.options.change&&o.options.change.call(this,e,t)},width:o.options.width,slider:o.options.slider})},_create:function(){if(i.support.iris){var o=this,e=o.element;if(i.extend(o.options,e.data()),"hue"===o.options.type)return o._createHueOnly();o.close=i.proxy(o.close,o),o.initialValue=e.val(),e.addClass("wp-color-picker"),e.parent("label").length||(e.wrap("<label></label>"),o.wrappingLabelText=i('<span class="screen-reader-text"></span>').insertBefore(e).text(a("Color value"))),o.wrappingLabel=e.parent(),o.wrappingLabel.wrap('<div class="wp-picker-container" />'),o.wrap=o.wrappingLabel.parent(),o.toggler=i('<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>').insertBefore(o.wrappingLabel).css({backgroundColor:o.initialValue}),o.toggler.find(".wp-color-result-text").text(a("Select Color")),o.pickerContainer=i('<div class="wp-picker-holder" />').insertAfter(o.wrappingLabel),o.button=i('<input type="button" class="button button-small" />'),o.options.defaultColor?o.button.addClass("wp-picker-default").val(a("Default")).attr("aria-label",a("Select default color")):o.button.addClass("wp-picker-clear").val(a("Clear")).attr("aria-label",a("Clear color")),o.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(o.button),o.inputWrapper=e.closest(".wp-picker-input-wrap"),e.iris({target:o.pickerContainer,hide:o.options.hide,width:o.options.width,mode:o.options.mode,palettes:o.options.palettes,change:function(e,t){o.toggler.css({backgroundColor:t.color.toString()}),"function"==typeof o.options.change&&o.options.change.call(this,e,t)}}),e.val(o.initialValue),o._addListeners(),o.options.hide||o.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(e){e.stopPropagation()}),o.toggler.on("click",function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(e){var t=i(this).val();""!==t&&"#"!==t||(o.toggler.css("backgroundColor",""),"function"==typeof o.options.clear&&o.options.clear.call(this,e))}),o.button.on("click",function(e){var t=i(this);t.hasClass("wp-picker-clear")?(o.element.val(""),o.toggler.css("backgroundColor",""),i.isFunction(o.options.clear)&&o.options.clear.call(this,e)):t.hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})},open:function(){this.element.iris("toggle"),this.inputWrapper.removeClass("hidden"),this.wrap.addClass("wp-picker-active"),this.toggler.addClass("wp-picker-open").attr("aria-expanded","true"),i("body").trigger("click.wpcolorpicker").on("click.wpcolorpicker",this.close)},close:function(){this.element.iris("toggle"),this.inputWrapper.addClass("hidden"),this.wrap.removeClass("wp-picker-active"),this.toggler.removeClass("wp-picker-open").attr("aria-expanded","false"),i("body").off("click.wpcolorpicker",this.close)},color:function(e){if(e===t)return this.element.iris("option","color");this.element.iris("option","color",e)},defaultColor:function(e){if(e===t)return this.options.defaultColor;this.options.defaultColor=e}};i.widget("wp.wpColorPicker",e)}(jQuery); !function(i,t){var a=wp.i18n.__,e={options:{defaultColor:!1,change:!1,clear:!1,hide:!0,palettes:!0,width:255,mode:"hsv",type:"full",slider:"horizontal"},_createHueOnly:function(){var e,o=this,t=o.element;t.hide(),e="hsl("+t.val()+", 100, 50)",t.iris({mode:"hsl",type:"hue",hide:!1,color:e,change:function(e,t){"function"==typeof o.options.change&&o.options.change.call(this,e,t)},width:o.options.width,slider:o.options.slider})},_create:function(){if(i.support.iris){var o=this,e=o.element;if(i.extend(o.options,e.data()),"hue"===o.options.type)return o._createHueOnly();o.close=o.close.bind(o),o.initialValue=e.val(),e.addClass("wp-color-picker"),e.parent("label").length||(e.wrap("<label></label>"),o.wrappingLabelText=i('<span class="screen-reader-text"></span>').insertBefore(e).text(a("Color value"))),o.wrappingLabel=e.parent(),o.wrappingLabel.wrap('<div class="wp-picker-container" />'),o.wrap=o.wrappingLabel.parent(),o.toggler=i('<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>').insertBefore(o.wrappingLabel).css({backgroundColor:o.initialValue}),o.toggler.find(".wp-color-result-text").text(a("Select Color")),o.pickerContainer=i('<div class="wp-picker-holder" />').insertAfter(o.wrappingLabel),o.button=i('<input type="button" class="button button-small" />'),o.options.defaultColor?o.button.addClass("wp-picker-default").val(a("Default")).attr("aria-label",a("Select default color")):o.button.addClass("wp-picker-clear").val(a("Clear")).attr("aria-label",a("Clear color")),o.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(o.button),o.inputWrapper=e.closest(".wp-picker-input-wrap"),e.iris({target:o.pickerContainer,hide:o.options.hide,width:o.options.width,mode:o.options.mode,palettes:o.options.palettes,change:function(e,t){o.toggler.css({backgroundColor:t.color.toString()}),"function"==typeof o.options.change&&o.options.change.call(this,e,t)}}),e.val(o.initialValue),o._addListeners(),o.options.hide||o.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(e){e.stopPropagation()}),o.toggler.on("click",function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(e){var t=i(this).val();""!==t&&"#"!==t||(o.toggler.css("backgroundColor",""),"function"==typeof o.options.clear&&o.options.clear.call(this,e))}),o.button.on("click",function(e){var t=i(this);t.hasClass("wp-picker-clear")?(o.element.val(""),o.toggler.css("backgroundColor",""),"function"==typeof o.options.clear&&o.options.clear.call(this,e)):t.hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})},open:function(){this.element.iris("toggle"),this.inputWrapper.removeClass("hidden"),this.wrap.addClass("wp-picker-active"),this.toggler.addClass("wp-picker-open").attr("aria-expanded","true"),i("body").trigger("click.wpcolorpicker").on("click.wpcolorpicker",this.close)},close:function(){this.element.iris("toggle"),this.inputWrapper.addClass("hidden"),this.wrap.removeClass("wp-picker-active"),this.toggler.removeClass("wp-picker-open").attr("aria-expanded","false"),i("body").off("click.wpcolorpicker",this.close)},color:function(e){if(e===t)return this.element.iris("option","color");this.element.iris("option","color",e)},defaultColor:function(e){if(e===t)return this.options.defaultColor;this.options.defaultColor=e}};i.widget("wp.wpColorPicker",e)}(jQuery);

View File

@ -11,7 +11,7 @@
* *
* @param {jQuery} $ The jQuery object. * @param {jQuery} $ The jQuery object.
*/ */
jQuery(document).ready( function($) { jQuery( function($) {
postboxes.add_postbox_toggles('comment'); postboxes.add_postbox_toggles('comment');

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(m){postboxes.add_postbox_toggles("comment");var d=m("#timestampdiv"),o=m("#timestamp"),a=o.html(),c=d.find(".timestamp-wrap"),r=d.siblings("a.edit-timestamp");r.on("click",function(e){d.is(":hidden")&&(d.slideDown("fast",function(){m("input, select",c).first().trigger("focus")}),m(this).hide()),e.preventDefault()}),d.find(".cancel-timestamp").on("click",function(e){r.show().trigger("focus"),d.slideUp("fast"),m("#mm").val(m("#hidden_mm").val()),m("#jj").val(m("#hidden_jj").val()),m("#aa").val(m("#hidden_aa").val()),m("#hh").val(m("#hidden_hh").val()),m("#mn").val(m("#hidden_mn").val()),o.html(a),e.preventDefault()}),d.find(".save-timestamp").on("click",function(e){var a=m("#aa").val(),t=m("#mm").val(),i=m("#jj").val(),s=m("#hh").val(),l=m("#mn").val(),n=new Date(a,t-1,i,s,l);e.preventDefault(),n.getFullYear()==a&&1+n.getMonth()==t&&n.getDate()==i&&n.getMinutes()==l?(c.removeClass("form-invalid"),o.html(wp.i18n.__("Submitted on:")+" <b>"+wp.i18n.__("%1$s %2$s, %3$s at %4$s:%5$s").replace("%1$s",m('option[value="'+t+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(i,10)).replace("%3$s",a).replace("%4$s",("00"+s).slice(-2)).replace("%5$s",("00"+l).slice(-2))+"</b> "),r.show().trigger("focus"),d.slideUp("fast")):c.addClass("form-invalid")})}); jQuery(function(m){postboxes.add_postbox_toggles("comment");var d=m("#timestampdiv"),o=m("#timestamp"),a=o.html(),v=d.find(".timestamp-wrap"),c=d.siblings("a.edit-timestamp");c.on("click",function(e){d.is(":hidden")&&(d.slideDown("fast",function(){m("input, select",v).first().trigger("focus")}),m(this).hide()),e.preventDefault()}),d.find(".cancel-timestamp").on("click",function(e){c.show().trigger("focus"),d.slideUp("fast"),m("#mm").val(m("#hidden_mm").val()),m("#jj").val(m("#hidden_jj").val()),m("#aa").val(m("#hidden_aa").val()),m("#hh").val(m("#hidden_hh").val()),m("#mn").val(m("#hidden_mn").val()),o.html(a),e.preventDefault()}),d.find(".save-timestamp").on("click",function(e){var a=m("#aa").val(),t=m("#mm").val(),i=m("#jj").val(),s=m("#hh").val(),l=m("#mn").val(),n=new Date(a,t-1,i,s,l);e.preventDefault(),n.getFullYear()==a&&1+n.getMonth()==t&&n.getDate()==i&&n.getMinutes()==l?(v.removeClass("form-invalid"),o.html(wp.i18n.__("Submitted on:")+" <b>"+wp.i18n.__("%1$s %2$s, %3$s at %4$s:%5$s").replace("%1$s",m('option[value="'+t+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(i,10)).replace("%3$s",a).replace("%4$s",("00"+s).slice(-2)).replace("%5$s",("00"+l).slice(-2))+"</b> "),c.show().trigger("focus"),d.slideUp("fast")):v.addClass("form-invalid")})});

View File

@ -483,7 +483,7 @@ window.columns = {
} }
}; };
$document.ready(function(){columns.init();}); $( function() { columns.init(); } );
/** /**
* Validates that the required form fields are not empty. * Validates that the required form fields are not empty.
@ -802,7 +802,7 @@ $availableStructureTags.on( 'click', function() {
} }
} ); } );
$document.ready( function() { $( function() {
var checks, first, last, checked, sliced, mobileEvent, transitionTimeout, focusedRowActions, var checks, first, last, checked, sliced, mobileEvent, transitionTimeout, focusedRowActions,
lastClicked = false, lastClicked = false,
pageInput = $('input.current-page'), pageInput = $('input.current-page'),
@ -1706,7 +1706,7 @@ $document.ready( function() {
}); });
self.trigger(); self.trigger();
$document.on( 'wp-window-resized.wp-responsive', $.proxy( this.trigger, this ) ); $document.on( 'wp-window-resized.wp-responsive', this.trigger.bind( this ) );
// This needs to run later as UI Sortable may be initialized later on $(document).ready(). // This needs to run later as UI Sortable may be initialized later on $(document).ready().
$window.on( 'load.wp-responsive', this.maybeDisableSortables ); $window.on( 'load.wp-responsive', this.maybeDisableSortables );
@ -1889,7 +1889,7 @@ $document.ready( function() {
$( '.aria-button-if-js' ).attr( 'role', 'button' ); $( '.aria-button-if-js' ).attr( 'role', 'button' );
} }
$( document ).ajaxComplete( function() { $( document ).on( 'ajaxComplete', function() {
aria_button_if_js(); aria_button_if_js();
}); });
@ -2008,7 +2008,7 @@ $document.ready( function() {
* *
* @since 5.5.0 * @since 5.5.0
*/ */
$document.ready( function( $ ) { $( function( $ ) {
var $overwrite, $warning; var $overwrite, $warning;
if ( ! $body.hasClass( 'update-php' ) ) { if ( ! $body.hasClass( 'update-php' ) ) {

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
* @requires jQuery * @requires jQuery
*/ */
(function($) { (function($) {
$(document).ready(function() { $( function() {
var frame, var frame,
bgImage = $( '#custom-background-image' ); bgImage = $( '#custom-background-image' );

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
!function(e){e(document).ready(function(){var c,a=e("#custom-background-image");e("#background-color").wpColorPicker({change:function(n,o){a.css("background-color",o.color.toString())},clear:function(){a.css("background-color","")}}),e('select[name="background-size"]').on("change",function(){a.css("background-size",e(this).val())}),e('input[name="background-position"]').on("change",function(){a.css("background-position",e(this).val())}),e('input[name="background-repeat"]').on("change",function(){a.css("background-repeat",e(this).is(":checked")?"repeat":"no-repeat")}),e('input[name="background-attachment"]').on("change",function(){a.css("background-attachment",e(this).is(":checked")?"scroll":"fixed")}),e("#choose-from-library-link").on("click",function(n){var o=e(this);n.preventDefault(),c||(c=wp.media.frames.customBackground=wp.media({title:o.data("choose"),library:{type:"image"},button:{text:o.data("update"),close:!1}})).on("select",function(){var n=c.state().get("selection").first(),o=e("#_wpnonce").val()||"";e.post(ajaxurl,{action:"set-background-image",attachment_id:n.id,_ajax_nonce:o,size:"full"}).done(function(){window.location.reload()})}),c.open()})})}(jQuery); !function(e){e(function(){var c,a=e("#custom-background-image");e("#background-color").wpColorPicker({change:function(n,o){a.css("background-color",o.color.toString())},clear:function(){a.css("background-color","")}}),e('select[name="background-size"]').on("change",function(){a.css("background-size",e(this).val())}),e('input[name="background-position"]').on("change",function(){a.css("background-position",e(this).val())}),e('input[name="background-repeat"]').on("change",function(){a.css("background-repeat",e(this).is(":checked")?"repeat":"no-repeat")}),e('input[name="background-attachment"]').on("change",function(){a.css("background-attachment",e(this).is(":checked")?"scroll":"fixed")}),e("#choose-from-library-link").on("click",function(n){var o=e(this);n.preventDefault(),c||(c=wp.media.frames.customBackground=wp.media({title:o.data("choose"),library:{type:"image"},button:{text:o.data("update"),close:!1}})).on("select",function(){var n=c.state().get("selection").first(),o=e("#_wpnonce").val()||"";e.post(ajaxurl,{action:"set-background-image",attachment_id:n.id,_ajax_nonce:o,size:"full"}).done(function(){window.location.reload()})}),c.open()})})}(jQuery);

View File

@ -289,7 +289,7 @@
collection.focusContainer.focus(); collection.focusContainer.focus();
} }
} else if ( collection.previousActiveElement ) { } else if ( collection.previousActiveElement ) {
$( collection.previousActiveElement ).focus(); $( collection.previousActiveElement ).trigger( 'focus' );
collection.previousActiveElement = null; collection.previousActiveElement = null;
} }
@ -1592,7 +1592,7 @@
if ( args.unchanged ) { if ( args.unchanged ) {
expand = args.completeCallback; expand = args.completeCallback;
} else { } else {
expand = $.proxy( function() { expand = function() {
section._animateChangeExpanded( function() { section._animateChangeExpanded( function() {
sectionTitle.attr( 'tabindex', '-1' ); sectionTitle.attr( 'tabindex', '-1' );
backBtn.attr( 'tabindex', '0' ); backBtn.attr( 'tabindex', '0' );
@ -1609,7 +1609,7 @@
content.addClass( 'open' ); content.addClass( 'open' );
overlay.addClass( 'section-open' ); overlay.addClass( 'section-open' );
api.state( 'expandedSection' ).set( section ); api.state( 'expandedSection' ).set( section );
}, this ); }.bind( this );
} }
if ( ! args.allowMultiple ) { if ( ! args.allowMultiple ) {
@ -2696,12 +2696,12 @@
if ( args.unchanged ) { if ( args.unchanged ) {
expand = args.completeCallback; expand = args.completeCallback;
} else { } else {
expand = $.proxy( function() { expand = function() {
section._animateChangeExpanded( function() { section._animateChangeExpanded( function() {
sectionTitle.attr( 'tabindex', '-1' ); sectionTitle.attr( 'tabindex', '-1' );
backBtn.attr( 'tabindex', '0' ); backBtn.attr( 'tabindex', '0' );
backBtn.focus(); backBtn.trigger( 'focus' );
content.css( 'top', '' ); content.css( 'top', '' );
container.scrollTop( 0 ); container.scrollTop( 0 );
@ -2711,7 +2711,7 @@
} ); } );
content.addClass( 'open' ); content.addClass( 'open' );
}, this ); }.bind( this );
} }
if ( section.panel() ) { if ( section.panel() ) {
@ -2956,7 +2956,7 @@
topPanel.attr( 'tabindex', '-1' ); topPanel.attr( 'tabindex', '-1' );
backBtn.attr( 'tabindex', '0' ); backBtn.attr( 'tabindex', '0' );
backBtn.focus(); backBtn.trigger( 'focus' );
accordionSection.css( 'top', '' ); accordionSection.css( 'top', '' );
container.scrollTop( 0 ); container.scrollTop( 0 );
@ -3874,9 +3874,9 @@
control.container.toggleClass( 'has-notifications', 0 !== notifications.length ); control.container.toggleClass( 'has-notifications', 0 !== notifications.length );
control.container.toggleClass( 'has-error', hasError ); control.container.toggleClass( 'has-error', hasError );
container.empty().append( $.trim( container.empty().append(
control.notificationsTemplate( { notifications: notifications, altNotice: Boolean( control.altNotice ) } ) control.notificationsTemplate( { notifications: notifications, altNotice: Boolean( control.altNotice ) } ).trim()
) ); );
}, },
/** /**

File diff suppressed because one or more lines are too long

View File

@ -218,7 +218,7 @@
// Clear the search results and trigger an `input` event to fire a new search. // Clear the search results and trigger an `input` event to fire a new search.
this.$clearResults.on( 'click', function() { this.$clearResults.on( 'click', function() {
self.$search.val( '' ).focus().trigger( 'input' ); self.$search.val( '' ).trigger( 'focus' ).trigger( 'input' );
} ); } );
this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() { this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() {
@ -446,7 +446,7 @@
self.pages[ name ] = -1; self.pages[ name ] = -1;
return; return;
} else if ( ( 'post_type:page' === name ) && ( ! availableMenuItemContainers[ name ].hasClass( 'open' ) ) ) { } else if ( ( 'post_type:page' === name ) && ( ! availableMenuItemContainers[ name ].hasClass( 'open' ) ) ) {
availableMenuItemContainers[ name ].find( '.accordion-section-title > button' ).click(); availableMenuItemContainers[ name ].find( '.accordion-section-title > button' ).trigger( 'click' );
} }
typeItems = new api.Menus.AvailableItemCollection( typeItems ); // @todo Why is this collection created and then thrown away? typeItems = new api.Menus.AvailableItemCollection( typeItems ); // @todo Why is this collection created and then thrown away?
self.collection.add( typeItems.models ); self.collection.add( typeItems.models );
@ -644,7 +644,7 @@
return; return;
} }
if ( '' === $.trim( itemName.val() ) ) { if ( '' === itemName.val().trim() ) {
itemName.addClass( 'invalid' ); itemName.addClass( 'invalid' );
itemName.focus(); itemName.focus();
return; return;
@ -716,7 +716,7 @@
this.$el.find( '.selected' ).removeClass( 'selected' ); this.$el.find( '.selected' ).removeClass( 'selected' );
this.$search.focus(); this.$search.trigger( 'focus' );
}, },
// Closes the panel. // Closes the panel.
@ -1879,7 +1879,7 @@
// Ensure that whitespace is trimmed on blur so placeholder can be shown. // Ensure that whitespace is trimmed on blur so placeholder can be shown.
control.container.find( '.edit-menu-item-title' ).on( 'blur', function() { control.container.find( '.edit-menu-item-title' ).on( 'blur', function() {
$( this ).val( $.trim( $( this ).val() ) ); $( this ).val( $( this ).val().trim() );
} ); } );
titleEl = control.container.find( '.menu-item-title' ); titleEl = control.container.find( '.menu-item-title' );
@ -1888,7 +1888,8 @@
if ( ! item ) { if ( ! item ) {
return; return;
} }
trimmedTitle = $.trim( item.title ); item.title = item.title || '';
trimmedTitle = item.title.trim();
titleText = trimmedTitle || item.original_title || api.Menus.data.l10n.untitled; titleText = trimmedTitle || item.original_title || api.Menus.data.l10n.untitled;

File diff suppressed because one or more lines are too long

View File

@ -195,7 +195,7 @@
// Clear the search results and trigger an `input` event to fire a new search. // Clear the search results and trigger an `input` event to fire a new search.
this.$clearResults.on( 'click', function() { this.$clearResults.on( 'click', function() {
self.$search.val( '' ).focus().trigger( 'input' ); self.$search.val( '' ).trigger( 'focus' ).trigger( 'input' );
} ); } );
// Close the panel if the URL in the preview changes. // Close the panel if the URL in the preview changes.
@ -365,7 +365,7 @@
this.collection.doSearch( '' ); this.collection.doSearch( '' );
if ( ! api.settings.browser.mobile ) { if ( ! api.settings.browser.mobile ) {
this.$search.focus(); this.$search.trigger( 'focus' );
} }
}, },
@ -421,9 +421,9 @@
this.select( selected ); this.select( selected );
if ( selected ) { if ( selected ) {
selected.focus(); selected.trigger( 'focus' );
} else { } else {
this.$search.focus(); this.$search.trigger( 'focus' );
} }
return; return;
@ -818,7 +818,7 @@
if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) { if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) {
return; return;
} }
$( this ).focus(); $( this ).trigger( 'focus' );
if ( $( this ).is( '.move-widget' ) ) { if ( $( this ).is( '.move-widget' ) ) {
self.toggleWidgetMoveArea(); self.toggleWidgetMoveArea();
@ -839,7 +839,7 @@
wp.a11y.speak( l10n.widgetMovedDown ); wp.a11y.speak( l10n.widgetMovedDown );
} }
$( this ).focus(); // Re-focus after the container was moved. $( this ).trigger( 'focus' ); // Re-focus after the container was moved.
} }
} ); } );
@ -1103,7 +1103,7 @@
if ( input.is( ':radio, :checkbox' ) ) { if ( input.is( ':radio, :checkbox' ) ) {
input.prop( 'checked', state ); input.prop( 'checked', state );
} else if ( input.is( 'select[multiple]' ) ) { } else if ( input.is( 'select[multiple]' ) ) {
if ( ! $.isArray( state ) ) { if ( ! Array.isArray( state ) ) {
state = []; state = [];
} else { } else {
// Make sure all state items are strings since the DOM value is a string. // Make sure all state items are strings since the DOM value is a string.
@ -2089,7 +2089,7 @@
widgetNumber = widget.get( 'multi_number' ); widgetNumber = widget.get( 'multi_number' );
} }
controlHtml = $.trim( $( '#widget-tpl-' + widget.get( 'id' ) ).html() ); controlHtml = $( '#widget-tpl-' + widget.get( 'id' ) ).html().trim();
if ( widget.get( 'is_multi' ) ) { if ( widget.get( 'is_multi' ) ) {
controlHtml = controlHtml.replace( /<[^<>]+>/g, function( m ) { controlHtml = controlHtml.replace( /<[^<>]+>/g, function( m ) {
return m.replace( /__i__|%i%/g, widgetNumber ); return m.replace( /__i__|%i%/g, widgetNumber );

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@ window.communityEventsData = window.communityEventsData || {};
* *
* @since 2.7.0 * @since 2.7.0
*/ */
jQuery(document).ready( function($) { jQuery( function($) {
var welcomePanel = $( '#welcome-panel' ), var welcomePanel = $( '#welcome-panel' ),
welcomePanelHide = $('#wp_welcome_panel-hide'), welcomePanelHide = $('#wp_welcome_panel-hide'),
updateWelcomePanel; updateWelcomePanel;
@ -328,7 +328,7 @@ jQuery( function( $ ) {
* @return {void} * @return {void}
*/ */
$container.on( 'submit', '.community-events-form', function( event ) { $container.on( 'submit', '.community-events-form', function( event ) {
var location = $.trim( $( '#community-events-location' ).val() ); var location = $( '#community-events-location' ).val().trim();
event.preventDefault(); event.preventDefault();

File diff suppressed because one or more lines are too long

View File

@ -1225,7 +1225,7 @@ window.commentReply = {
} }
}; };
$(document).ready(function(){ $( function(){
var make_hotkeys_redirect, edit_comment, toggle_all, make_bulk; var make_hotkeys_redirect, edit_comment, toggle_all, make_bulk;
setCommentsList(); setCommentsList();

File diff suppressed because one or more lines are too long

View File

@ -1178,7 +1178,7 @@ window.wp = window.wp || {};
} }
if ( $ ) { if ( $ ) {
$( document ).ready( init ); $( init );
} else if ( document.addEventListener ) { } else if ( document.addEventListener ) {
document.addEventListener( 'DOMContentLoaded', init, false ); document.addEventListener( 'DOMContentLoaded', init, false );
window.addEventListener( 'load', init, false ); window.addEventListener( 'load', init, false );

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
/* global unescape, getUserSetting, setUserSetting, wpgallery, tinymce */ /* global unescape, getUserSetting, setUserSetting, wpgallery, tinymce */
jQuery(document).ready(function($) { jQuery( function($) {
var gallerySortable, gallerySortableInit, sortIt, clearAll, w, desc = false; var gallerySortable, gallerySortableInit, sortIt, clearAll, w, desc = false;
gallerySortableInit = function() { gallerySortableInit = function() {

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(n){var o=!1,e=function(){n("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(){var e=n("#media-items").sortable("toArray"),i=e.length;n.each(e,function(e,t){e=o?i-e:1+e;n("#"+t+" .menu_order input").val(e)})}})},t=function(){var e=n(".menu_order_input"),t=e.length;e.each(function(e){e=o?t-e:1+e;n(this).val(e)})},i=function(e){e=e||0,n(".menu_order_input").each(function(){"0"!==this.value&&!e||(this.value="")})};n("#asc").on("click",function(e){e.preventDefault(),o=!1,t()}),n("#desc").on("click",function(e){e.preventDefault(),o=!0,t()}),n("#clear").on("click",function(e){e.preventDefault(),i(1)}),n("#showall").on("click",function(e){e.preventDefault(),n("#sort-buttons span a").toggle(),n("a.describe-toggle-on").hide(),n("a.describe-toggle-off, table.slidetoggle").show(),n("img.pinkynail").toggle(!1)}),n("#hideall").on("click",function(e){e.preventDefault(),n("#sort-buttons span a").toggle(),n("a.describe-toggle-on").show(),n("a.describe-toggle-off, table.slidetoggle").hide(),n("img.pinkynail").toggle(!0)}),e(),i(),1<n("#media-items>*").length&&(e=wpgallery.getWin(),n("#save-all, #gallery-settings").show(),void 0!==e.tinyMCE&&e.tinyMCE.activeEditor&&!e.tinyMCE.activeEditor.isHidden()?(wpgallery.mcemode=!0,wpgallery.init()):n("#insert-gallery").show())}),jQuery(window).on("unload",function(){window.tinymce=window.tinyMCE=window.wpgallery=null}),window.tinymce=null,window.wpgallery={mcemode:!1,editor:{},dom:{},is_update:!1,el:{},I:function(e){return document.getElementById(e)},init:function(){var e,t,i,n,o=this,l=o.getWin();if(o.mcemode){for(e=(""+document.location.search).replace(/^\?/,"").split("&"),t={},i=0;i<e.length;i++)n=e[i].split("="),t[unescape(n[0])]=unescape(n[1]);t.mce_rdomain&&(document.domain=t.mce_rdomain),window.tinymce=l.tinymce,window.tinyMCE=l.tinyMCE,o.editor=tinymce.EditorManager.activeEditor,o.setup()}},getWin:function(){return window.dialogArguments||opener||parent||top},setup:function(){var e,t,i,n=this,o=n.editor;if(n.mcemode){if(n.el=o.selection.getNode(),"IMG"!==n.el.nodeName||!o.dom.hasClass(n.el,"wpGallery")){if(!(t=o.dom.select("img.wpGallery"))||!t[0])return"1"===getUserSetting("galfile")&&(n.I("linkto-file").checked="checked"),"1"===getUserSetting("galdesc")&&(n.I("order-desc").checked="checked"),getUserSetting("galcols")&&(n.I("columns").value=getUserSetting("galcols")),getUserSetting("galord")&&(n.I("orderby").value=getUserSetting("galord")),void jQuery("#insert-gallery").show();n.el=t[0]}i=o.dom.getAttrib(n.el,"title"),(i=o.dom.decode(i))?(jQuery("#update-gallery").show(),n.is_update=!0,e=i.match(/columns=['"]([0-9]+)['"]/),t=i.match(/link=['"]([^'"]+)['"]/i),o=i.match(/order=['"]([^'"]+)['"]/i),i=i.match(/orderby=['"]([^'"]+)['"]/i),t&&t[1]&&(n.I("linkto-file").checked="checked"),o&&o[1]&&(n.I("order-desc").checked="checked"),e&&e[1]&&(n.I("columns").value=""+e[1]),i&&i[1]&&(n.I("orderby").value=i[1])):jQuery("#insert-gallery").show()}},update:function(){var e,t=this,i=t.editor,n="";if(!t.mcemode||!t.is_update)return e="[gallery"+t.getSettings()+"]",void t.getWin().send_to_editor(e);"IMG"===t.el.nodeName&&(n=(n=i.dom.decode(i.dom.getAttrib(t.el,"title"))).replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,""),n+=t.getSettings(),i.dom.setAttrib(t.el,"title",n),t.getWin().tb_remove())},getSettings:function(){var e=this.I,t="";return e("linkto-file").checked&&(t+=' link="file"',setUserSetting("galfile","1")),e("order-desc").checked&&(t+=' order="DESC"',setUserSetting("galdesc","1")),3!==e("columns").value&&(t+=' columns="'+e("columns").value+'"',setUserSetting("galcols",e("columns").value)),"menu_order"!==e("orderby").value&&(t+=' orderby="'+e("orderby").value+'"',setUserSetting("galord",e("orderby").value)),t}}; jQuery(function(n){var o=!1,e=function(){n("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(){var e=n("#media-items").sortable("toArray"),i=e.length;n.each(e,function(e,t){e=o?i-e:1+e;n("#"+t+" .menu_order input").val(e)})}})},t=function(){var e=n(".menu_order_input"),t=e.length;e.each(function(e){e=o?t-e:1+e;n(this).val(e)})},i=function(e){e=e||0,n(".menu_order_input").each(function(){"0"!==this.value&&!e||(this.value="")})};n("#asc").on("click",function(e){e.preventDefault(),o=!1,t()}),n("#desc").on("click",function(e){e.preventDefault(),o=!0,t()}),n("#clear").on("click",function(e){e.preventDefault(),i(1)}),n("#showall").on("click",function(e){e.preventDefault(),n("#sort-buttons span a").toggle(),n("a.describe-toggle-on").hide(),n("a.describe-toggle-off, table.slidetoggle").show(),n("img.pinkynail").toggle(!1)}),n("#hideall").on("click",function(e){e.preventDefault(),n("#sort-buttons span a").toggle(),n("a.describe-toggle-on").show(),n("a.describe-toggle-off, table.slidetoggle").hide(),n("img.pinkynail").toggle(!0)}),e(),i(),1<n("#media-items>*").length&&(e=wpgallery.getWin(),n("#save-all, #gallery-settings").show(),void 0!==e.tinyMCE&&e.tinyMCE.activeEditor&&!e.tinyMCE.activeEditor.isHidden()?(wpgallery.mcemode=!0,wpgallery.init()):n("#insert-gallery").show())}),jQuery(window).on("unload",function(){window.tinymce=window.tinyMCE=window.wpgallery=null}),window.tinymce=null,window.wpgallery={mcemode:!1,editor:{},dom:{},is_update:!1,el:{},I:function(e){return document.getElementById(e)},init:function(){var e,t,i,n,o=this,l=o.getWin();if(o.mcemode){for(e=(""+document.location.search).replace(/^\?/,"").split("&"),t={},i=0;i<e.length;i++)n=e[i].split("="),t[unescape(n[0])]=unescape(n[1]);t.mce_rdomain&&(document.domain=t.mce_rdomain),window.tinymce=l.tinymce,window.tinyMCE=l.tinyMCE,o.editor=tinymce.EditorManager.activeEditor,o.setup()}},getWin:function(){return window.dialogArguments||opener||parent||top},setup:function(){var e,t,i,n=this,o=n.editor;if(n.mcemode){if(n.el=o.selection.getNode(),"IMG"!==n.el.nodeName||!o.dom.hasClass(n.el,"wpGallery")){if(!(t=o.dom.select("img.wpGallery"))||!t[0])return"1"===getUserSetting("galfile")&&(n.I("linkto-file").checked="checked"),"1"===getUserSetting("galdesc")&&(n.I("order-desc").checked="checked"),getUserSetting("galcols")&&(n.I("columns").value=getUserSetting("galcols")),getUserSetting("galord")&&(n.I("orderby").value=getUserSetting("galord")),void jQuery("#insert-gallery").show();n.el=t[0]}i=o.dom.getAttrib(n.el,"title"),(i=o.dom.decode(i))?(jQuery("#update-gallery").show(),n.is_update=!0,e=i.match(/columns=['"]([0-9]+)['"]/),t=i.match(/link=['"]([^'"]+)['"]/i),o=i.match(/order=['"]([^'"]+)['"]/i),i=i.match(/orderby=['"]([^'"]+)['"]/i),t&&t[1]&&(n.I("linkto-file").checked="checked"),o&&o[1]&&(n.I("order-desc").checked="checked"),e&&e[1]&&(n.I("columns").value=""+e[1]),i&&i[1]&&(n.I("orderby").value=i[1])):jQuery("#insert-gallery").show()}},update:function(){var e,t=this,i=t.editor,n="";if(!t.mcemode||!t.is_update)return e="[gallery"+t.getSettings()+"]",void t.getWin().send_to_editor(e);"IMG"===t.el.nodeName&&(n=(n=i.dom.decode(i.dom.getAttrib(t.el,"title"))).replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,""),n+=t.getSettings(),i.dom.setAttrib(t.el,"title",n),t.getWin().tb_remove())},getSettings:function(){var e=this.I,t="";return e("linkto-file").checked&&(t+=' link="file"',setUserSetting("galfile","1")),e("order-desc").checked&&(t+=' order="DESC"',setUserSetting("galdesc","1")),3!==e("columns").value&&(t+=' columns="'+e("columns").value+'"',setUserSetting("galcols",e("columns").value)),"menu_order"!==e("orderby").value&&(t+=' orderby="'+e("orderby").value+'"',setUserSetting("galord",e("orderby").value)),t}};

View File

@ -516,10 +516,16 @@ window.wp = window.wp || {};
} }
}; };
$( document ).ready( function(){ inlineEditPost.init(); } ); $( function() { inlineEditPost.init(); } );
// Show/hide locks on posts. // Show/hide locks on posts.
$( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) { $( function() {
// Set the heartbeat interval to 15 seconds.
if ( typeof wp !== 'undefined' && wp.heartbeat ) {
wp.heartbeat.interval( 15 );
}
}).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
var locked = data['wp-check-locked-posts'] || {}; var locked = data['wp-check-locked-posts'] || {};
$('#the-list tr').each( function(i, el) { $('#the-list tr').each( function(i, el) {
@ -560,12 +566,6 @@ $( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
if ( check.length ) { if ( check.length ) {
data['wp-check-locked-posts'] = check; data['wp-check-locked-posts'] = check;
} }
}).ready( function() {
// Set the heartbeat interval to 15 seconds.
if ( typeof wp !== 'undefined' && wp.heartbeat ) {
wp.heartbeat.interval( 15 );
}
}); });
})( jQuery, window.wp ); })( jQuery, window.wp );

File diff suppressed because one or more lines are too long

View File

@ -289,6 +289,6 @@ window.inlineEditTax = {
} }
}; };
$(document).ready(function(){inlineEditTax.init();}); $( function() { inlineEditTax.init(); } );
})( jQuery, window.wp ); })( jQuery, window.wp );

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
window.wp=window.wp||{},function(s,l){window.inlineEditTax={init:function(){var t=this,e=s("#inline-edit");t.type=s("#the-list").attr("data-wp-lists").substr(5),t.what="#"+t.type+"-",s("#the-list").on("click",".editinline",function(){s(this).attr("aria-expanded","true"),inlineEditTax.edit(this)}),e.on("keyup",function(t){if(27===t.which)return inlineEditTax.revert()}),s(".cancel",e).on("click",function(){return inlineEditTax.revert()}),s(".save",e).on("click",function(){return inlineEditTax.save(this)}),s("input, select",e).on("keydown",function(t){if(13===t.which)return inlineEditTax.save(this)}),s('#posts-filter input[type="submit"]').on("mousedown",function(){t.revert()})},toggle:function(t){var e=this;"none"===s(e.what+e.getId(t)).css("display")?e.revert():e.edit(t)},edit:function(t){var e,i,n=this;return n.revert(),"object"==typeof t&&(t=n.getId(t)),e=s("#inline-edit").clone(!0),i=s("#inline_"+t),s("td",e).attr("colspan",s("th:visible, td:visible",".wp-list-table.widefat:first thead").length),s(n.what+t).hide().after(e).after('<tr class="hidden"></tr>'),(n=s(".name",i)).find("img").replaceWith(function(){return this.alt}),n=n.text(),s(':input[name="name"]',e).val(n),(n=s(".slug",i)).find("img").replaceWith(function(){return this.alt}),n=n.text(),s(':input[name="slug"]',e).val(n),s(e).attr("id","edit-"+t).addClass("inline-editor").show(),s(".ptitle",e).eq(0).trigger("focus"),!1},save:function(d){var t=s('input[name="taxonomy"]').val()||"";return"object"==typeof d&&(d=this.getId(d)),s("table.widefat .spinner").addClass("is-active"),t={action:"inline-save-tax",tax_type:this.type,tax_ID:d,taxonomy:t},t=s("#edit-"+d).find(":input").serialize()+"&"+s.param(t),s.post(ajaxurl,t,function(t){var e,i,n,a=s("#edit-"+d+" .inline-edit-save .notice-error"),r=a.find(".error");s("table.widefat .spinner").removeClass("is-active"),t?-1!==t.indexOf("<tr")?(s(inlineEditTax.what+d).siblings("tr.hidden").addBack().remove(),i=s(t).attr("id"),s("#edit-"+d).before(t).remove(),e=i?(n=i.replace(inlineEditTax.type+"-",""),s("#"+i)):(n=d,s(inlineEditTax.what+d)),s("#parent").find("option[value="+n+"]").text(e.find(".row-title").text()),e.hide().fadeIn(400,function(){e.find(".editinline").attr("aria-expanded","false").trigger("focus"),l.a11y.speak(l.i18n.__("Changes saved."))})):(a.removeClass("hidden"),r.html(t),l.a11y.speak(r.text())):(a.removeClass("hidden"),r.text(l.i18n.__("Error while saving the changes.")),l.a11y.speak(l.i18n.__("Error while saving the changes.")))}),!1},revert:function(){var t=s("table.widefat tr.inline-editor").attr("id");t&&(s("table.widefat .spinner").removeClass("is-active"),s("#"+t).siblings("tr.hidden").addBack().remove(),t=t.substr(t.lastIndexOf("-")+1),s(this.what+t).show().find(".editinline").attr("aria-expanded","false").trigger("focus"))},getId:function(t){t=("TR"===t.tagName?t.id:s(t).parents("tr").attr("id")).split("-");return t[t.length-1]}},s(document).ready(function(){inlineEditTax.init()})}(jQuery,window.wp); window.wp=window.wp||{},function(s,l){window.inlineEditTax={init:function(){var t=this,i=s("#inline-edit");t.type=s("#the-list").attr("data-wp-lists").substr(5),t.what="#"+t.type+"-",s("#the-list").on("click",".editinline",function(){s(this).attr("aria-expanded","true"),inlineEditTax.edit(this)}),i.on("keyup",function(t){if(27===t.which)return inlineEditTax.revert()}),s(".cancel",i).on("click",function(){return inlineEditTax.revert()}),s(".save",i).on("click",function(){return inlineEditTax.save(this)}),s("input, select",i).on("keydown",function(t){if(13===t.which)return inlineEditTax.save(this)}),s('#posts-filter input[type="submit"]').on("mousedown",function(){t.revert()})},toggle:function(t){var i=this;"none"===s(i.what+i.getId(t)).css("display")?i.revert():i.edit(t)},edit:function(t){var i,e,n=this;return n.revert(),"object"==typeof t&&(t=n.getId(t)),i=s("#inline-edit").clone(!0),e=s("#inline_"+t),s("td",i).attr("colspan",s("th:visible, td:visible",".wp-list-table.widefat:first thead").length),s(n.what+t).hide().after(i).after('<tr class="hidden"></tr>'),(n=s(".name",e)).find("img").replaceWith(function(){return this.alt}),n=n.text(),s(':input[name="name"]',i).val(n),(n=s(".slug",e)).find("img").replaceWith(function(){return this.alt}),n=n.text(),s(':input[name="slug"]',i).val(n),s(i).attr("id","edit-"+t).addClass("inline-editor").show(),s(".ptitle",i).eq(0).trigger("focus"),!1},save:function(d){var t=s('input[name="taxonomy"]').val()||"";return"object"==typeof d&&(d=this.getId(d)),s("table.widefat .spinner").addClass("is-active"),t={action:"inline-save-tax",tax_type:this.type,tax_ID:d,taxonomy:t},t=s("#edit-"+d).find(":input").serialize()+"&"+s.param(t),s.post(ajaxurl,t,function(t){var i,e,n,a=s("#edit-"+d+" .inline-edit-save .notice-error"),r=a.find(".error");s("table.widefat .spinner").removeClass("is-active"),t?-1!==t.indexOf("<tr")?(s(inlineEditTax.what+d).siblings("tr.hidden").addBack().remove(),e=s(t).attr("id"),s("#edit-"+d).before(t).remove(),i=e?(n=e.replace(inlineEditTax.type+"-",""),s("#"+e)):(n=d,s(inlineEditTax.what+d)),s("#parent").find("option[value="+n+"]").text(i.find(".row-title").text()),i.hide().fadeIn(400,function(){i.find(".editinline").attr("aria-expanded","false").trigger("focus"),l.a11y.speak(l.i18n.__("Changes saved."))})):(a.removeClass("hidden"),r.html(t),l.a11y.speak(r.text())):(a.removeClass("hidden"),r.text(l.i18n.__("Error while saving the changes.")),l.a11y.speak(l.i18n.__("Error while saving the changes.")))}),!1},revert:function(){var t=s("table.widefat tr.inline-editor").attr("id");t&&(s("table.widefat .spinner").removeClass("is-active"),s("#"+t).siblings("tr.hidden").addBack().remove(),t=t.substr(t.lastIndexOf("-")+1),s(this.what+t).show().find(".editinline").attr("aria-expanded","false").trigger("focus"))},getId:function(t){t=("TR"===t.tagName?t.id:s(t).parents("tr").attr("id")).split("-");return t[t.length-1]}},s(function(){inlineEditTax.init()})}(jQuery,window.wp);

View File

@ -4,7 +4,7 @@
/* global postboxes, deleteUserSetting, setUserSetting, getUserSetting */ /* global postboxes, deleteUserSetting, setUserSetting, getUserSetting */
jQuery(document).ready( function($) { jQuery( function($) {
var newCat, noSyncChecks = false, syncChecks, catAddAfter; var newCat, noSyncChecks = false, syncChecks, catAddAfter;
@ -81,7 +81,11 @@ jQuery(document).ready( function($) {
$(s.what + ' response_data', r).each( function() { $(s.what + ' response_data', r).each( function() {
var t = $($(this).text()); var t = $($(this).text());
t.find( 'label' ).each( function() { t.find( 'label' ).each( function() {
var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name = $.trim( th.text() ), o; var th = $(this),
val = th.find('input').val(),
id = th.find('input')[0].id,
name = th.text().trim(),
o;
$('#' + id).on( 'change', syncChecks ); $('#' + id).on( 'change', syncChecks );
o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name ); o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
} ); } );

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(i){var t,c,e,a=!1;i("#link_name").trigger("focus"),postboxes.add_postbox_toggles("link"),i("#category-tabs a").on("click",function(){var t=i(this).attr("href");return i(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),i(".tabs-panel").hide(),i(t).show(),"#categories-all"==t?deleteUserSetting("cats"):setUserSetting("cats","pop"),!1}),getUserSetting("cats")&&i('#category-tabs a[href="#categories-pop"]').trigger("click"),t=i("#newcat").one("focus",function(){i(this).val("").removeClass("form-input-tip")}),i("#link-category-add-submit").on("click",function(){t.focus()}),c=function(){var t,e;a||(a=!0,t=(e=i(this)).is(":checked"),e=e.val().toString(),i("#in-link-category-"+e+", #in-popular-link_category-"+e).prop("checked",t),a=!1)},e=function(t,e){i(e.what+" response_data",t).each(function(){i(i(this).text()).find("label").each(function(){var t=i(this),e=t.find("input").val(),a=t.find("input")[0].id,t=i.trim(t.text());i("#"+a).on("change",c),i('<option value="'+parseInt(e,10)+'"></option>').text(t)})})},i("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e}),i('a[href="#categories-all"]').on("click",function(){deleteUserSetting("cats")}),i('a[href="#categories-pop"]').on("click",function(){setUserSetting("cats","pop")}),"pop"==getUserSetting("cats")&&i('a[href="#categories-pop"]').trigger("click"),i("#category-add-toggle").on("click",function(){return i(this).parents("div:first").toggleClass("wp-hidden-children"),i('#category-tabs a[href="#categories-all"]').trigger("click"),i("#newcategory").trigger("focus"),!1}),i(".categorychecklist :checkbox").on("change",c).filter(":checked").trigger("change")}); jQuery(function(a){var t,c,e,i=!1;a("#link_name").trigger("focus"),postboxes.add_postbox_toggles("link"),a("#category-tabs a").on("click",function(){var t=a(this).attr("href");return a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a(".tabs-panel").hide(),a(t).show(),"#categories-all"==t?deleteUserSetting("cats"):setUserSetting("cats","pop"),!1}),getUserSetting("cats")&&a('#category-tabs a[href="#categories-pop"]').trigger("click"),t=a("#newcat").one("focus",function(){a(this).val("").removeClass("form-input-tip")}),a("#link-category-add-submit").on("click",function(){t.focus()}),c=function(){var t,e;i||(i=!0,t=(e=a(this)).is(":checked"),e=e.val().toString(),a("#in-link-category-"+e+", #in-popular-link_category-"+e).prop("checked",t),i=!1)},e=function(t,e){a(e.what+" response_data",t).each(function(){a(a(this).text()).find("label").each(function(){var t=a(this),e=t.find("input").val(),i=t.find("input")[0].id,t=t.text().trim();a("#"+i).on("change",c),a('<option value="'+parseInt(e,10)+'"></option>').text(t)})})},a("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e}),a('a[href="#categories-all"]').on("click",function(){deleteUserSetting("cats")}),a('a[href="#categories-pop"]').on("click",function(){setUserSetting("cats","pop")}),"pop"==getUserSetting("cats")&&a('a[href="#categories-pop"]').trigger("click"),a("#category-add-toggle").on("click",function(){return a(this).parents("div:first").toggleClass("wp-hidden-children"),a('#category-tabs a[href="#categories-all"]').trigger("click"),a("#newcategory").trigger("focus"),!1}),a(".categorychecklist :checkbox").on("change",c).filter(":checked").trigger("change")});

View File

@ -140,7 +140,7 @@
* *
* @return {void} * @return {void}
*/ */
$( document ).ready( function() { $( function() {
var settings, $mediaGridWrap = $( '#wp-media-grid' ); var settings, $mediaGridWrap = $( '#wp-media-grid' );
// Opens a manage media frame into the grid. // Opens a manage media frame into the grid.

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
!function(o){window.findPosts={open:function(n,e){var i=o(".ui-find-overlay");return 0===i.length&&(o("body").append('<div class="ui-find-overlay"></div>'),findPosts.overlay()),i.show(),n&&e&&o("#affected").attr("name",n).val(e),o("#find-posts").show(),o("#find-posts-input").trigger("focus").on("keyup",function(n){27==n.which&&findPosts.close()}),findPosts.send(),!1},close:function(){o("#find-posts-response").empty(),o("#find-posts").hide(),o(".ui-find-overlay").hide()},overlay:function(){o(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var n={ps:o("#find-posts-input").val(),action:"find_posts",_ajax_nonce:o("#_ajax_nonce").val()},e=o(".find-box-search .spinner");e.addClass("is-active"),o.ajax(ajaxurl,{type:"POST",data:n,dataType:"json"}).always(function(){e.removeClass("is-active")}).done(function(n){n.success||o("#find-posts-response").text(wp.i18n.__("An error has occurred. Please reload the page and try again.")),o("#find-posts-response").html(n.data)}).fail(function(){o("#find-posts-response").text(wp.i18n.__("An error has occurred. Please reload the page and try again."))})}},o(document).ready(function(){var n,e=o("#wp-media-grid");e.length&&window.wp&&window.wp.media&&(n=_wpMediaGridSettings,n=window.wp.media({frame:"manage",container:e,library:n.queryVars}).open(),e.trigger("wp-media-grid-ready",n)),o("#find-posts-submit").on("click",function(n){o('#find-posts-response input[type="radio"]:checked').length||n.preventDefault()}),o("#find-posts .find-box-search :input").on("keypress",function(n){if(13==n.which)return findPosts.send(),!1}),o("#find-posts-search").on("click",findPosts.send),o("#find-posts-close").on("click",findPosts.close),o("#doaction").on("click",function(e){o('select[name="action"]').each(function(){var n=o(this).val();"attach"===n?(e.preventDefault(),findPosts.open()):"delete"===n&&(showNotice.warn()||e.preventDefault())})}),o(".find-box-inside").on("click","tr",function(){o(this).find(".found-radio input").prop("checked",!0)})})}(jQuery); !function(s){window.findPosts={open:function(n,e){var i=s(".ui-find-overlay");return 0===i.length&&(s("body").append('<div class="ui-find-overlay"></div>'),findPosts.overlay()),i.show(),n&&e&&s("#affected").attr("name",n).val(e),s("#find-posts").show(),s("#find-posts-input").trigger("focus").on("keyup",function(n){27==n.which&&findPosts.close()}),findPosts.send(),!1},close:function(){s("#find-posts-response").empty(),s("#find-posts").hide(),s(".ui-find-overlay").hide()},overlay:function(){s(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var n={ps:s("#find-posts-input").val(),action:"find_posts",_ajax_nonce:s("#_ajax_nonce").val()},e=s(".find-box-search .spinner");e.addClass("is-active"),s.ajax(ajaxurl,{type:"POST",data:n,dataType:"json"}).always(function(){e.removeClass("is-active")}).done(function(n){n.success||s("#find-posts-response").text(wp.i18n.__("An error has occurred. Please reload the page and try again.")),s("#find-posts-response").html(n.data)}).fail(function(){s("#find-posts-response").text(wp.i18n.__("An error has occurred. Please reload the page and try again."))})}},s(function(){var n,e=s("#wp-media-grid");e.length&&window.wp&&window.wp.media&&(n=_wpMediaGridSettings,n=window.wp.media({frame:"manage",container:e,library:n.queryVars}).open(),e.trigger("wp-media-grid-ready",n)),s("#find-posts-submit").on("click",function(n){s('#find-posts-response input[type="radio"]:checked').length||n.preventDefault()}),s("#find-posts .find-box-search :input").on("keypress",function(n){if(13==n.which)return findPosts.send(),!1}),s("#find-posts-search").on("click",findPosts.send),s("#find-posts-close").on("click",findPosts.close),s("#doaction").on("click",function(e){s('select[name="action"]').each(function(){var n=s(this).val();"attach"===n?(e.preventDefault(),findPosts.open()):"delete"===n&&(showNotice.warn()||e.preventDefault())})}),s(".find-box-inside").on("click","tr",function(){s(this).find(".found-radio input").prop("checked",!0)})})}(jQuery);

View File

@ -1331,7 +1331,7 @@
}; };
$(document).ready(function() { $( function() {
wpNavMenu.init(); wpNavMenu.init();

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
/* global tb_click, tb_remove, tb_position */ /* global tb_click, tb_remove, tb_position */
jQuery( document ).ready( function( $ ) { jQuery( function( $ ) {
var tbWindow, var tbWindow,
$iframeBody, $iframeBody,

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(e){var o,i,n,a,l,r=e(),d=e(".upload-view-toggle"),t=e(".wrap"),s=e(document.body);function c(){var t;n=e(":tabbable",i),a=o.find("#TB_closeWindowButton"),l=n.last(),(t=a.add(l)).off("keydown.wp-plugin-details"),t.on("keydown.wp-plugin-details",function(t){9===(t=t).which&&(l[0]!==t.target||t.shiftKey?a[0]===t.target&&t.shiftKey&&(t.preventDefault(),l.trigger("focus")):(t.preventDefault(),a.trigger("focus")))})}window.tb_position=function(){var t=e(window).width(),i=e(window).height()-(792<t?60:20),n=792<t?772:t-20;return(o=e("#TB_window")).length&&(o.width(n).height(i),e("#TB_iframeContent").width(n).height(i),o.css({"margin-left":"-"+parseInt(n/2,10)+"px"}),void 0!==document.body.style.maxWidth&&o.css({top:"30px","margin-top":"0"})),e("a.thickbox").each(function(){var t=e(this).attr("href");t&&(t=(t=t.replace(/&width=[0-9]+/g,"")).replace(/&height=[0-9]+/g,""),e(this).attr("href",t+"&width="+n+"&height="+i))})},e(window).on("resize",function(){tb_position()}),s.on("thickbox:iframe:loaded",o,function(){var t;o.hasClass("plugin-details-modal")&&(t=o.find("#TB_iframeContent"),i=t.contents().find("body"),c(),a.trigger("focus"),e("#plugin-information-tabs a",i).on("click",function(){c()}),i.on("keydown",function(t){27===t.which&&tb_remove()}))}).on("thickbox:removed",function(){r.trigger("focus")}),e(".wrap").on("click",".thickbox.open-plugin-details-modal",function(t){var i=e(this).data("title")?wp.i18n.sprintf(wp.i18n.__("Plugin: %s"),e(this).data("title")):wp.i18n.__("Plugin details");t.preventDefault(),t.stopPropagation(),r=e(this),tb_click.call(this),o.attr({role:"dialog","aria-label":wp.i18n.__("Plugin details")}).addClass("plugin-details-modal"),o.find("#TB_iframeContent").attr("title",i)}),e("#plugin-information-tabs a").on("click",function(t){var i=e(this).attr("name");t.preventDefault(),e("#plugin-information-tabs a.current").removeClass("current"),e(this).addClass("current"),"description"!==i&&e(window).width()<772?e("#plugin-information-content").find(".fyi").hide():e("#plugin-information-content").find(".fyi").show(),e("#section-holder div.section").hide(),e("#section-"+i).show()}),t.hasClass("plugin-install-tab-upload")||d.attr({role:"button","aria-expanded":"false"}).on("click",function(t){t.preventDefault(),s.toggleClass("show-upload-view"),d.attr("aria-expanded",s.hasClass("show-upload-view"))})}); jQuery(function(e){var o,i,n,a,l,r=e(),s=e(".upload-view-toggle"),t=e(".wrap"),d=e(document.body);function c(){var t;n=e(":tabbable",i),a=o.find("#TB_closeWindowButton"),l=n.last(),(t=a.add(l)).off("keydown.wp-plugin-details"),t.on("keydown.wp-plugin-details",function(t){9===(t=t).which&&(l[0]!==t.target||t.shiftKey?a[0]===t.target&&t.shiftKey&&(t.preventDefault(),l.trigger("focus")):(t.preventDefault(),a.trigger("focus")))})}window.tb_position=function(){var t=e(window).width(),i=e(window).height()-(792<t?60:20),n=792<t?772:t-20;return(o=e("#TB_window")).length&&(o.width(n).height(i),e("#TB_iframeContent").width(n).height(i),o.css({"margin-left":"-"+parseInt(n/2,10)+"px"}),void 0!==document.body.style.maxWidth&&o.css({top:"30px","margin-top":"0"})),e("a.thickbox").each(function(){var t=e(this).attr("href");t&&(t=(t=t.replace(/&width=[0-9]+/g,"")).replace(/&height=[0-9]+/g,""),e(this).attr("href",t+"&width="+n+"&height="+i))})},e(window).on("resize",function(){tb_position()}),d.on("thickbox:iframe:loaded",o,function(){var t;o.hasClass("plugin-details-modal")&&(t=o.find("#TB_iframeContent"),i=t.contents().find("body"),c(),a.trigger("focus"),e("#plugin-information-tabs a",i).on("click",function(){c()}),i.on("keydown",function(t){27===t.which&&tb_remove()}))}).on("thickbox:removed",function(){r.trigger("focus")}),e(".wrap").on("click",".thickbox.open-plugin-details-modal",function(t){var i=e(this).data("title")?wp.i18n.sprintf(wp.i18n.__("Plugin: %s"),e(this).data("title")):wp.i18n.__("Plugin details");t.preventDefault(),t.stopPropagation(),r=e(this),tb_click.call(this),o.attr({role:"dialog","aria-label":wp.i18n.__("Plugin details")}).addClass("plugin-details-modal"),o.find("#TB_iframeContent").attr("title",i)}),e("#plugin-information-tabs a").on("click",function(t){var i=e(this).attr("name");t.preventDefault(),e("#plugin-information-tabs a.current").removeClass("current"),e(this).addClass("current"),"description"!==i&&e(window).width()<772?e("#plugin-information-content").find(".fyi").hide():e("#plugin-information-content").find(".fyi").show(),e("#section-holder div.section").hide(),e("#section-"+i).show()}),t.hasClass("plugin-install-tab-upload")||s.attr({role:"button","aria-expanded":"false"}).on("click",function(t){t.preventDefault(),d.toggleClass("show-upload-view"),s.attr("aria-expanded",d.hasClass("show-upload-view"))})});

View File

@ -260,7 +260,9 @@ window.wp = window.wp || {};
timeout = window.setTimeout( function(){ check = true; }, 300000 ); timeout = window.setTimeout( function(){ check = true; }, 300000 );
} }
$(document).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) { $( function() {
schedule();
}).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) {
var post_id, var post_id,
$authCheck = $('#wp-auth-check-wrap'); $authCheck = $('#wp-auth-check-wrap');
@ -286,15 +288,13 @@ window.wp = window.wp || {};
if ( nonces.heartbeatNonce ) if ( nonces.heartbeatNonce )
window.heartbeatSettings.nonce = nonces.heartbeatNonce; window.heartbeatSettings.nonce = nonces.heartbeatNonce;
} }
}).ready( function() {
schedule();
}); });
}(jQuery)); }(jQuery));
/** /**
* All post and postbox controls and functionality. * All post and postbox controls and functionality.
*/ */
jQuery(document).ready( function($) { jQuery( function($) {
var stamp, visibility, $submitButtons, updateVisibility, updateText, var stamp, visibility, $submitButtons, updateVisibility, updateText,
$textarea = $('#content'), $textarea = $('#content'),
$document = $(document), $document = $(document),
@ -661,7 +661,7 @@ jQuery(document).ready( function($) {
$('#' + taxonomy + '-add-toggle').on( 'click', function( e ) { $('#' + taxonomy + '-add-toggle').on( 'click', function( e ) {
e.preventDefault(); e.preventDefault();
$('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' ); $('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
$('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click(); $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').trigger( 'click' );
$('#new'+taxonomy).trigger( 'focus' ); $('#new'+taxonomy).trigger( 'focus' );
}); });

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
*/ */
// Privacy request action handling. // Privacy request action handling.
jQuery( document ).ready( function( $ ) { jQuery( function( $ ) {
var __ = wp.i18n.__, var __ = wp.i18n.__,
copiedNoticeTimeout; copiedNoticeTimeout;

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
/* global ajaxurl, ClipboardJS, SiteHealth, wp */ /* global ajaxurl, ClipboardJS, SiteHealth, wp */
jQuery( document ).ready( function( $ ) { jQuery( function( $ ) {
var __ = wp.i18n.__, var __ = wp.i18n.__,
_n = wp.i18n._n, _n = wp.i18n._n,

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@ wp.svgPainter = ( function( $, window, document, undefined ) {
colorscheme = {}, colorscheme = {},
elements = []; elements = [];
$(document).ready( function() { $( function() {
// Detection for browser SVG capability. // Detection for browser SVG capability.
if ( document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) { if ( document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) {
$( document.body ).removeClass( 'no-svg' ).addClass( 'svg' ); $( document.body ).removeClass( 'no-svg' ).addClass( 'svg' );

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
window.wp=window.wp||{},wp.svgPainter=function(e,i,n){"use strict";var t,o,a,m,r,s,c,u,l,f={},g=[];function p(){for(;l<256;)m=String.fromCharCode(l),s+=m,u[l]=l,c[l]=r.indexOf(m),++l}function d(n,t,e,a,i,o){for(var r,s=0,c=0,u="",l=0,f=(n=String(n)).length;c<f;){for(s=(s<<i)+(m=(m=n.charCodeAt(c))<256?e[m]:-1),l+=i;o<=l;)l-=o,u+=a.charAt(r=s>>l),s^=r<<l;++c}return!t&&0<l&&(u+=a.charAt(s<<o-l)),u}return e(n).ready(function(){n.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")&&(e(n.body).removeClass("no-svg").addClass("svg"),wp.svgPainter.init())}),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="",c=[256],u=[256],l=0,o={atob:function(n){var t;for(m||p(),n=n.replace(/[^A-Za-z0-9\+\/\=]/g,""),n=String(n).split("="),t=n.length;n[--t]=d(n[t],!0,c,s,6,8),0<t;);return n=n.join("")},btoa:function(n){return m||p(),(n=d(n,!1,u,r,8,6))+"====".slice(n.length%4||4)}},{init:function(){a=this,t=e("#adminmenu .wp-menu-image, #wpadminbar .ab-item"),this.setColors(),this.findElements(),this.paint()},setColors:function(n){(n=void 0===n&&void 0!==i._wpColorScheme?i._wpColorScheme:n)&&n.icons&&n.icons.base&&n.icons.current&&n.icons.focus&&(f=n.icons)},findElements:function(){t.each(function(){var n=e(this),t=n.css("background-image");t&&-1!=t.indexOf("data:image/svg+xml;base64")&&g.push(n)})},paint:function(){e.each(g,function(n,t){var e=t.parent().parent();e.hasClass("current")||e.hasClass("wp-has-current-submenu")?a.paintElement(t,"current"):(a.paintElement(t,"base"),e.on("mouseenter",function(){a.paintElement(t,"focus")}).on("mouseleave",function(){i.setTimeout(function(){a.paintElement(t,"base")},100)}))})},paintElement:function(n,t){var e,a;if(t&&f.hasOwnProperty(t)&&(a=f[t],a.match(/^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i)&&"none"!==(e=n.data("wp-ui-svg-"+a)))){if(!e){if(!(t=n.css("background-image").match(/.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/))||!t[1])return void n.data("wp-ui-svg-"+a,"none");try{e=("atob"in i?i:o).atob(t[1])}catch(n){}if(!e)return void n.data("wp-ui-svg-"+a,"none");e=(e=(e=e.replace(/fill="(.+?)"/g,'fill="'+a+'"')).replace(/style="(.+?)"/g,'style="fill:'+a+'"')).replace(/fill:.*?;/g,"fill: "+a+";"),e=("btoa"in i?i:o).btoa(e),n.data("wp-ui-svg-"+a,e)}n.attr("style",'background-image: url("data:image/svg+xml;base64,'+e+'") !important;')}}}}(jQuery,window,document); window.wp=window.wp||{},wp.svgPainter=function(e,i,n){"use strict";var t,o,a,m,r,s,c,u,l,f={},g=[];function p(){for(;l<256;)m=String.fromCharCode(l),s+=m,u[l]=l,c[l]=r.indexOf(m),++l}function d(n,t,e,a,i,o){for(var r,s=0,c=0,u="",l=0,f=(n=String(n)).length;c<f;){for(s=(s<<i)+(m=(m=n.charCodeAt(c))<256?e[m]:-1),l+=i;o<=l;)l-=o,u+=a.charAt(r=s>>l),s^=r<<l;++c}return!t&&0<l&&(u+=a.charAt(s<<o-l)),u}return e(function(){n.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")&&(e(n.body).removeClass("no-svg").addClass("svg"),wp.svgPainter.init())}),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="",c=[256],u=[256],l=0,o={atob:function(n){var t;for(m||p(),n=n.replace(/[^A-Za-z0-9\+\/\=]/g,""),n=String(n).split("="),t=n.length;n[--t]=d(n[t],!0,c,s,6,8),0<t;);return n=n.join("")},btoa:function(n){return m||p(),(n=d(n,!1,u,r,8,6))+"====".slice(n.length%4||4)}},{init:function(){a=this,t=e("#adminmenu .wp-menu-image, #wpadminbar .ab-item"),this.setColors(),this.findElements(),this.paint()},setColors:function(n){(n=void 0===n&&void 0!==i._wpColorScheme?i._wpColorScheme:n)&&n.icons&&n.icons.base&&n.icons.current&&n.icons.focus&&(f=n.icons)},findElements:function(){t.each(function(){var n=e(this),t=n.css("background-image");t&&-1!=t.indexOf("data:image/svg+xml;base64")&&g.push(n)})},paint:function(){e.each(g,function(n,t){var e=t.parent().parent();e.hasClass("current")||e.hasClass("wp-has-current-submenu")?a.paintElement(t,"current"):(a.paintElement(t,"base"),e.on("mouseenter",function(){a.paintElement(t,"focus")}).on("mouseleave",function(){i.setTimeout(function(){a.paintElement(t,"base")},100)}))})},paintElement:function(n,t){var e,a;if(t&&f.hasOwnProperty(t)&&(a=f[t],a.match(/^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i)&&"none"!==(e=n.data("wp-ui-svg-"+a)))){if(!e){if(!(t=n.css("background-image").match(/.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/))||!t[1])return void n.data("wp-ui-svg-"+a,"none");try{e=("atob"in i?i:o).atob(t[1])}catch(n){}if(!e)return void n.data("wp-ui-svg-"+a,"none");e=(e=(e=e.replace(/fill="(.+?)"/g,'fill="'+a+'"')).replace(/style="(.+?)"/g,'style="fill:'+a+'"')).replace(/fill:.*?;/g,"fill: "+a+";"),e=("btoa"in i?i:o).btoa(e),n.data("wp-ui-svg-"+a,e)}n.attr("style",'background-image: url("data:image/svg+xml;base64,'+e+'") !important;')}}}}(jQuery,window,document);

View File

@ -27,7 +27,8 @@
// Trim the values and ensure they are unique. // Trim the values and ensure they are unique.
$.each( array, function( key, val ) { $.each( array, function( key, val ) {
val = $.trim( val ); val = val || '';
val = val.trim();
if ( val && $.inArray( val, out ) === -1 ) { if ( val && $.inArray( val, out ) === -1 ) {
out.push( val ); out.push( val );
@ -96,7 +97,8 @@
// Sanitize the current tags and push them as if they're new tags. // Sanitize the current tags and push them as if they're new tags.
$.each( current_tags, function( key, val ) { $.each( current_tags, function( key, val ) {
val = $.trim( val ); val = val || '';
val = val.trim();
if ( val ) { if ( val ) {
new_tags.push( val ); new_tags.push( val );
} }
@ -148,7 +150,8 @@
$.each( current_tags, function( key, val ) { $.each( current_tags, function( key, val ) {
var listItem, xbutton; var listItem, xbutton;
val = $.trim( val ); val = val || '';
val = val.trim();
if ( ! val ) if ( ! val )
return; return;

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
!function(o){var r=wp.i18n._x(",","tag delimiter")||",";window.array_unique_noempty=function(t){var a=[];return o.each(t,function(t,e){(e=o.trim(e))&&-1===o.inArray(e,a)&&a.push(e)}),a},window.tagBox={clean:function(t){return t=(t=","!==r?t.replace(new RegExp(r,"g"),","):t).replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),t=","!==r?t.replace(/,/g,r):t},parseTags:function(t){var e=t.id.split("-check-num-")[1],a=o(t).closest(".tagsdiv"),i=a.find(".the-tags"),t=i.val().split(r),n=[];return delete t[e],o.each(t,function(t,e){(e=o.trim(e))&&n.push(e)}),i.val(this.clean(n.join(r))),this.quickClicks(a),!1},quickClicks:function(t){var a,e=o(".the-tags",t),i=o(".tagchecklist",t),n=o(t).attr("id");e.length&&(a=e.prop("disabled"),e=e.val().split(r),i.empty(),o.each(e,function(t,e){(e=o.trim(e))&&(e=o("<li />").text(e),a||((t=o('<button type="button" id="'+n+"-check-num-"+t+'" class="ntdelbutton"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+wp.i18n.__("Remove term:")+" "+e.html()+"</span></button>")).on("click keypress",function(t){"click"!==t.type&&13!==t.keyCode&&32!==t.keyCode||(13!==t.keyCode&&32!==t.keyCode||o(this).closest(".tagsdiv").find("input.newtag").trigger("focus"),tagBox.userAction="remove",tagBox.parseTags(this))}),e.prepend("&nbsp;").prepend(t)),i.append(e))}),tagBox.screenReadersMessage())},flushTags:function(t,e,a){var i,n,s=o(".the-tags",t),c=o("input.newtag",t);return void 0===(n=(e=e||!1)?o(e).text():c.val())||""===n||(i=s.val(),n=this.clean(n=i?i+r+n:n),n=array_unique_noempty(n.split(r)).join(r),s.val(n),this.quickClicks(t),e||c.val(""),void 0===a&&c.trigger("focus")),!1},get:function(a){var i=a.substr(a.indexOf("-")+1);o.post(ajaxurl,{action:"get-tagcloud",tax:i},function(t,e){0!==t&&"success"==e&&(t=o('<div id="tagcloud-'+i+'" class="the-tagcloud">'+t+"</div>"),o("a",t).on("click",function(){return tagBox.userAction="add",tagBox.flushTags(o("#"+i),this),!1}),o("#"+a).after(t))})},userAction:"",screenReadersMessage:function(){var t;switch(this.userAction){case"remove":t=wp.i18n.__("Term removed.");break;case"add":t=wp.i18n.__("Term added.");break;default:return}window.wp.a11y.speak(t,"assertive")},init:function(){var t=o("div.ajaxtag");o(".tagsdiv").each(function(){tagBox.quickClicks(this)}),o(".tagadd",t).on("click",function(){tagBox.userAction="add",tagBox.flushTags(o(this).closest(".tagsdiv"))}),o("input.newtag",t).on("keypress",function(t){13==t.which&&(tagBox.userAction="add",tagBox.flushTags(o(this).closest(".tagsdiv")),t.preventDefault(),t.stopPropagation())}).each(function(t,e){o(e).wpTagsSuggest()}),o("#post").on("submit",function(){o("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),o(".tagcloud-link").on("click",function(){tagBox.get(o(this).attr("id")),o(this).attr("aria-expanded","true").off().on("click",function(){o(this).attr("aria-expanded","false"===o(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery); !function(o){var r=wp.i18n._x(",","tag delimiter")||",";window.array_unique_noempty=function(t){var a=[];return o.each(t,function(t,e){(e=(e=e||"").trim())&&-1===o.inArray(e,a)&&a.push(e)}),a},window.tagBox={clean:function(t){return t=(t=","!==r?t.replace(new RegExp(r,"g"),","):t).replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),t=","!==r?t.replace(/,/g,r):t},parseTags:function(t){var e=t.id.split("-check-num-")[1],a=o(t).closest(".tagsdiv"),i=a.find(".the-tags"),t=i.val().split(r),n=[];return delete t[e],o.each(t,function(t,e){(e=(e=e||"").trim())&&n.push(e)}),i.val(this.clean(n.join(r))),this.quickClicks(a),!1},quickClicks:function(t){var a,e=o(".the-tags",t),i=o(".tagchecklist",t),n=o(t).attr("id");e.length&&(a=e.prop("disabled"),e=e.val().split(r),i.empty(),o.each(e,function(t,e){(e=(e=e||"").trim())&&(e=o("<li />").text(e),a||((t=o('<button type="button" id="'+n+"-check-num-"+t+'" class="ntdelbutton"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+wp.i18n.__("Remove term:")+" "+e.html()+"</span></button>")).on("click keypress",function(t){"click"!==t.type&&13!==t.keyCode&&32!==t.keyCode||(13!==t.keyCode&&32!==t.keyCode||o(this).closest(".tagsdiv").find("input.newtag").trigger("focus"),tagBox.userAction="remove",tagBox.parseTags(this))}),e.prepend("&nbsp;").prepend(t)),i.append(e))}),tagBox.screenReadersMessage())},flushTags:function(t,e,a){var i,n,s=o(".the-tags",t),c=o("input.newtag",t);return void 0===(n=(e=e||!1)?o(e).text():c.val())||""===n||(i=s.val(),n=this.clean(n=i?i+r+n:n),n=array_unique_noempty(n.split(r)).join(r),s.val(n),this.quickClicks(t),e||c.val(""),void 0===a&&c.trigger("focus")),!1},get:function(a){var i=a.substr(a.indexOf("-")+1);o.post(ajaxurl,{action:"get-tagcloud",tax:i},function(t,e){0!==t&&"success"==e&&(t=o('<div id="tagcloud-'+i+'" class="the-tagcloud">'+t+"</div>"),o("a",t).on("click",function(){return tagBox.userAction="add",tagBox.flushTags(o("#"+i),this),!1}),o("#"+a).after(t))})},userAction:"",screenReadersMessage:function(){var t;switch(this.userAction){case"remove":t=wp.i18n.__("Term removed.");break;case"add":t=wp.i18n.__("Term added.");break;default:return}window.wp.a11y.speak(t,"assertive")},init:function(){var t=o("div.ajaxtag");o(".tagsdiv").each(function(){tagBox.quickClicks(this)}),o(".tagadd",t).on("click",function(){tagBox.userAction="add",tagBox.flushTags(o(this).closest(".tagsdiv"))}),o("input.newtag",t).on("keypress",function(t){13==t.which&&(tagBox.userAction="add",tagBox.flushTags(o(this).closest(".tagsdiv")),t.preventDefault(),t.stopPropagation())}).each(function(t,e){o(e).wpTagsSuggest()}),o("#post").on("submit",function(){o("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),o(".tagcloud-link").on("click",function(){tagBox.get(o(this).attr("id")),o(this).attr("aria-expanded","true").off().on("click",function(){o(this).attr("aria-expanded","false"===o(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery);

View File

@ -9,7 +9,7 @@
/* global ajaxurl, wpAjax, showNotice, validateForm */ /* global ajaxurl, wpAjax, showNotice, validateForm */
jQuery(document).ready(function($) { jQuery( function($) {
var addingTerm = false; var addingTerm = false;

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(r){var o=!1;r("#the-list").on("click",".delete-tag",function(){var t,e=r(this),n=e.parents("tr"),a=!0;return(a="undefined"!=showNotice?showNotice.warn():a)&&(t=e.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag"),r.post(ajaxurl,t,function(e){"1"==e?(r("#ajax-response").empty(),n.fadeOut("normal",function(){n.remove()}),r('select#parent option[value="'+t.match(/tag_ID=(\d+)/)[1]+'"]').remove(),r("a.tag-link-"+t.match(/tag_ID=(\d+)/)[1]).remove()):("-1"==e?r("#ajax-response").empty().append('<div class="error"><p>'+wp.i18n.__("Sorry, you are not allowed to do that.")+"</p></div>"):r("#ajax-response").empty().append('<div class="error"><p>'+wp.i18n.__("Something went wrong.")+"</p></div>"),n.children().css("backgroundColor",""))}),n.children().css("backgroundColor","#f33")),!1}),r("#edittag").on("click",".delete",function(e){return"undefined"==typeof showNotice||void(showNotice.warn()||e.preventDefault())}),r("#submit").on("click",function(){var s=r(this).parents("form");return validateForm(s)&&(o||(o=!0,s.find(".submit .spinner").addClass("is-active"),r.post(ajaxurl,r("#addtag").serialize(),function(e){var t,n,a;if(o=!1,s.find(".submit .spinner").removeClass("is-active"),r("#ajax-response").empty(),(t=wpAjax.parseAjaxResponse(e,"ajax-response"))&&!t.errors){if(0<(e=s.find("select#parent").val())&&0<r("#tag-"+e).length?r(".tags #tag-"+e).after(t.responses[0].supplemental.noparents):r(".tags").prepend(t.responses[0].supplemental.parents),r(".tags .no-items").remove(),s.find("select#parent")){for(e=t.responses[1].supplemental,n="",a=0;a<t.responses[1].position;a++)n+="&nbsp;&nbsp;&nbsp;";s.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+n+e.name+"</option>")}r('input[type="text"]:visible, textarea:visible',s).val("")}}))),!1})}); jQuery(function(r){var o=!1;r("#the-list").on("click",".delete-tag",function(){var t,e=r(this),n=e.parents("tr"),a=!0;return(a="undefined"!=showNotice?showNotice.warn():a)&&(t=e.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag"),r.post(ajaxurl,t,function(e){"1"==e?(r("#ajax-response").empty(),n.fadeOut("normal",function(){n.remove()}),r('select#parent option[value="'+t.match(/tag_ID=(\d+)/)[1]+'"]').remove(),r("a.tag-link-"+t.match(/tag_ID=(\d+)/)[1]).remove()):("-1"==e?r("#ajax-response").empty().append('<div class="error"><p>'+wp.i18n.__("Sorry, you are not allowed to do that.")+"</p></div>"):r("#ajax-response").empty().append('<div class="error"><p>'+wp.i18n.__("Something went wrong.")+"</p></div>"),n.children().css("backgroundColor",""))}),n.children().css("backgroundColor","#f33")),!1}),r("#edittag").on("click",".delete",function(e){return"undefined"==typeof showNotice||void(showNotice.warn()||e.preventDefault())}),r("#submit").on("click",function(){var s=r(this).parents("form");return validateForm(s)&&(o||(o=!0,s.find(".submit .spinner").addClass("is-active"),r.post(ajaxurl,r("#addtag").serialize(),function(e){var t,n,a;if(o=!1,s.find(".submit .spinner").removeClass("is-active"),r("#ajax-response").empty(),(t=wpAjax.parseAjaxResponse(e,"ajax-response"))&&!t.errors){if(0<(e=s.find("select#parent").val())&&0<r("#tag-"+e).length?r(".tags #tag-"+e).after(t.responses[0].supplemental.noparents):r(".tags").prepend(t.responses[0].supplemental.parents),r(".tags .no-items").remove(),s.find("select#parent")){for(e=t.responses[1].supplemental,n="",a=0;a<t.responses[1].position;a++)n+="&nbsp;&nbsp;&nbsp;";s.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+n+e.name+"</option>")}r('input[type="text"]:visible, textarea:visible',s).val("")}}))),!1})});

View File

@ -328,7 +328,7 @@ wp.themePluginEditor = (function( $ ) {
* @return {void} * @return {void}
*/ */
codeEditorSettings.onTabPrevious = function() { codeEditorSettings.onTabPrevious = function() {
$( '#templateside' ).find( ':tabbable' ).last().focus(); $( '#templateside' ).find( ':tabbable' ).last().trigger( 'focus' );
}; };
/** /**
@ -339,7 +339,7 @@ wp.themePluginEditor = (function( $ ) {
* @return {void} * @return {void}
*/ */
codeEditorSettings.onTabNext = function() { codeEditorSettings.onTabNext = function() {
$( '#template' ).find( ':tabbable:not(.CodeMirror-code)' ).first().focus(); $( '#template' ).find( ':tabbable:not(.CodeMirror-code)' ).first().trigger( 'focus' );
}; };
/** /**

File diff suppressed because one or more lines are too long

View File

@ -2061,7 +2061,7 @@ themes.RunInstaller = {
}; };
// Ready... // Ready...
$( document ).ready(function() { $( function() {
if ( themes.isInstall ) { if ( themes.isInstall ) {
themes.RunInstaller.init(); themes.RunInstaller.init();
} else { } else {
@ -2089,7 +2089,7 @@ $( document ).ready(function() {
})( jQuery ); })( jQuery );
// Align theme browser thickbox. // Align theme browser thickbox.
jQuery(document).ready( function($) { jQuery( function($) {
window.tb_position = function() { window.tb_position = function() {
var tbWindow = $('#TB_window'), var tbWindow = $('#TB_window'),
width = $(window).width(), width = $(window).width(),

File diff suppressed because one or more lines are too long

View File

@ -1803,7 +1803,7 @@
$( 'body' ).removeClass( 'modal-open' ); $( 'body' ).removeClass( 'modal-open' );
if ( wp.updates.$elToReturnFocusToFromCredentialsModal ) { if ( wp.updates.$elToReturnFocusToFromCredentialsModal ) {
wp.updates.$elToReturnFocusToFromCredentialsModal.focus(); wp.updates.$elToReturnFocusToFromCredentialsModal.trigger( 'focus' );
} }
}; };

File diff suppressed because one or more lines are too long

View File

@ -319,7 +319,7 @@
} }
} }
$(document).ready( function() { $( function() {
var $colorpicker, $stylesheet, user_id, current_user_id, var $colorpicker, $stylesheet, user_id, current_user_id,
select = $( '#display_name' ), select = $( '#display_name' ),
current_name = select.val(), current_name = select.val(),
@ -374,7 +374,7 @@
return; return;
} }
var display_name = $.trim( this.value ) || current_name; var display_name = this.value.trim() || current_name;
greeting.text( display_name ); greeting.text( display_name );
} ); } );
@ -466,7 +466,7 @@
* to avoid double clicking the button to retrieve the first generated password. * to avoid double clicking the button to retrieve the first generated password.
* See ticket #39638. * See ticket #39638.
*/ */
$( document ).ready( function() { $( function() {
if ( $( '.reset-pass-submit' ).length ) { if ( $( '.reset-pass-submit' ).length ) {
$( '.reset-pass-submit button.wp-generate-pw' ).trigger( 'click' ); $( '.reset-pass-submit button.wp-generate-pw' ).trigger( 'click' );
} }

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@
(function( $ ) { (function( $ ) {
var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : ''; var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
$(document).ready( function() { $( function() {
var position = { offset: '0, -1' }; var position = { offset: '0, -1' };
if ( typeof isRtl !== 'undefined' && isRtl ) { if ( typeof isRtl !== 'undefined' && isRtl ) {
position.my = 'right top'; position.my = 'right top';

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
!function(i){var n="undefined"!=typeof current_site_id?"&site_id="+current_site_id:"";i(document).ready(function(){var a={offset:"0, -1"};"undefined"!=typeof isRtl&&isRtl&&(a.my="right top",a.at="right bottom"),i(".wp-suggest-user").each(function(){var e=i(this),t=void 0!==e.data("autocompleteType")?e.data("autocompleteType"):"add",o=void 0!==e.data("autocompleteField")?e.data("autocompleteField"):"user_login";e.autocomplete({source:ajaxurl+"?action=autocomplete-user&autocomplete_type="+t+"&autocomplete_field="+o+n,delay:500,minLength:2,position:a,open:function(){i(this).addClass("open")},close:function(){i(this).removeClass("open")}})})})}(jQuery); !function(a){var n="undefined"!=typeof current_site_id?"&site_id="+current_site_id:"";a(function(){var i={offset:"0, -1"};"undefined"!=typeof isRtl&&isRtl&&(i.my="right top",i.at="right bottom"),a(".wp-suggest-user").each(function(){var e=a(this),t=void 0!==e.data("autocompleteType")?e.data("autocompleteType"):"add",o=void 0!==e.data("autocompleteField")?e.data("autocompleteField"):"user_login";e.autocomplete({source:ajaxurl+"?action=autocomplete-user&autocomplete_type="+t+"&autocomplete_field="+o+n,delay:500,minLength:2,position:i,open:function(){a(this).addClass("open")},close:function(){a(this).removeClass("open")}})})})}(jQuery);

View File

@ -741,7 +741,7 @@ window.wpWidgets = {
} }
}; };
$document.ready( function(){ wpWidgets.init(); } ); $( function(){ wpWidgets.init(); } );
})(jQuery); })(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -551,13 +551,13 @@ wp.mediaWidgets = ( function( $ ) {
// Update the title. // Update the title.
control.$el.on( 'input change', '.title', function updateTitle() { control.$el.on( 'input change', '.title', function updateTitle() {
control.model.set({ control.model.set({
title: $.trim( $( this ).val() ) title: $( this ).val().trim()
}); });
}); });
// Update link_url attribute. // Update link_url attribute.
control.$el.on( 'input change', '.link', function updateLinkUrl() { control.$el.on( 'input change', '.link', function updateLinkUrl() {
var linkUrl = $.trim( $( this ).val() ), linkType = 'custom'; var linkUrl = $( this ).val().trim(), linkType = 'custom';
if ( control.selectedAttachment.get( 'linkUrl' ) === linkUrl || control.selectedAttachment.get( 'link' ) === linkUrl ) { if ( control.selectedAttachment.get( 'linkUrl' ) === linkUrl || control.selectedAttachment.get( 'link' ) === linkUrl ) {
linkType = 'post'; linkType = 'post';
} else if ( control.selectedAttachment.get( 'url' ) === linkUrl ) { } else if ( control.selectedAttachment.get( 'url' ) === linkUrl ) {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* @deprecated 3.5.0 * @deprecated 3.5.0
* @output wp-admin/js/xfn.js * @output wp-admin/js/xfn.js
*/ */
jQuery( document ).ready(function( $ ) { jQuery( function( $ ) {
$( '#link_rel' ).prop( 'readonly', true ); $( '#link_rel' ).prop( 'readonly', true );
$( '#linkxfndiv input' ).on( 'click keyup', function() { $( '#linkxfndiv input' ).on( 'click keyup', function() {
var isMe = $( '#me' ).is( ':checked' ), inputs = ''; var isMe = $( '#me' ).is( ':checked' ), inputs = '';

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(n){n("#link_rel").prop("readonly",!0),n("#linkxfndiv input").on("click keyup",function(){var e=n("#me").is(":checked"),i="";n("input.valinp").each(function(){e?n(this).prop("disabled",!0).parent().addClass("disabled"):(n(this).removeAttr("disabled").parent().removeClass("disabled"),n(this).is(":checked")&&""!==n(this).val()&&(i+=n(this).val()+" "))}),n("#link_rel").val(e?"me":i.substr(0,i.length-1))})}); jQuery(function(l){l("#link_rel").prop("readonly",!0),l("#linkxfndiv input").on("click keyup",function(){var e=l("#me").is(":checked"),i="";l("input.valinp").each(function(){e?l(this).prop("disabled",!0).parent().addClass("disabled"):(l(this).removeAttr("disabled").parent().removeClass("disabled"),l(this).is(":checked")&&""!==l(this).val()&&(i+=l(this).val()+" "))}),l("#link_rel").val(e?"me":i.substr(0,i.length-1))})});

View File

@ -582,7 +582,7 @@ window.autosave = function() {
* Don't run if the post type supports neither 'editor' (textarea#content) nor 'excerpt'. * Don't run if the post type supports neither 'editor' (textarea#content) nor 'excerpt'.
*/ */
if ( checkStorage() && blog_id && ( $('#content').length || $('#excerpt').length ) ) { if ( checkStorage() && blog_id && ( $('#content').length || $('#excerpt').length ) ) {
$document.ready( run ); $( run );
} }
return { return {
@ -798,7 +798,9 @@ window.autosave = function() {
* *
* @return {void} * @return {void}
*/ */
$document.on( 'heartbeat-send.autosave', function( event, data ) { $( function() {
_schedule();
}).on( 'heartbeat-send.autosave', function( event, data ) {
var autosaveData = save(); var autosaveData = save();
if ( autosaveData ) { if ( autosaveData ) {
@ -848,8 +850,6 @@ window.autosave = function() {
}).on( 'heartbeat-connection-restored.autosave', function() { }).on( 'heartbeat-connection-restored.autosave', function() {
$('#lost-connection-notice').hide(); $('#lost-connection-notice').hide();
enableButtons(); enableButtons();
}).ready( function() {
_schedule();
}); });
return { return {
@ -873,7 +873,10 @@ window.autosave = function() {
* *
* @return {void} * @return {void}
*/ */
$document.on( 'tinymce-editor-init.autosave', function( event, editor ) { $( function() {
// Set the initial compare string in case TinyMCE is not used or not loaded first.
setInitialCompare();
}).on( 'tinymce-editor-init.autosave', function( event, editor ) {
// Reset the initialCompare data after the TinyMCE instances have been initialized. // Reset the initialCompare data after the TinyMCE instances have been initialized.
if ( 'content' === editor.id || 'excerpt' === editor.id ) { if ( 'content' === editor.id || 'excerpt' === editor.id ) {
window.setTimeout( function() { window.setTimeout( function() {
@ -881,9 +884,6 @@ window.autosave = function() {
setInitialCompare(); setInitialCompare();
}, 1000 ); }, 1000 );
} }
}).ready( function() {
// Set the initial compare string in case TinyMCE is not used or not loaded first.
setInitialCompare();
}); });
return { return {

File diff suppressed because one or more lines are too long

View File

@ -197,7 +197,7 @@ window.wp = window.wp || {};
$.extend( this, options || {} ); $.extend( this, options || {} );
this.set = $.proxy( this.set, this ); this.set = this.set.bind( this );
}, },
/* /*
@ -734,7 +734,7 @@ window.wp = window.wp || {};
* This will prevent every Messenger's receive function from being * This will prevent every Messenger's receive function from being
* unbound when calling $.off( 'message', this.receive ); * unbound when calling $.off( 'message', this.receive );
*/ */
this.receive = $.proxy( this.receive, this ); this.receive = this.receive.bind( this );
this.receive.guid = $.guid++; this.receive.guid = $.guid++;
$( window ).on( 'message', this.receive ); $( window ).on( 'message', this.receive );

File diff suppressed because one or more lines are too long

View File

@ -234,7 +234,7 @@
window.setInterval( checkUserActivity, 30000 ); window.setInterval( checkUserActivity, 30000 );
// Start one tick after DOM ready. // Start one tick after DOM ready.
$document.ready( function() { $( function() {
settings.lastTick = time(); settings.lastTick = time();
scheduleNextTick(); scheduleNextTick();
}); });

File diff suppressed because one or more lines are too long

View File

@ -4533,7 +4533,7 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
} }
// Pause current audio/video even after closing the modal. // Pause current audio/video even after closing the modal.
$( '.mejs-pause button' ).click(); $( '.mejs-pause button' ).trigger( 'click' );
// Enable page scrolling. // Enable page scrolling.
$( 'body' ).removeClass( 'modal-open' ); $( 'body' ).removeClass( 'modal-open' );
@ -4555,7 +4555,7 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
// Fallback to the admin page main element. // Fallback to the admin page main element.
$( '#wpbody-content' ) $( '#wpbody-content' )
.attr( 'tabindex', '-1' ) .attr( 'tabindex', '-1' )
.focus(); .trigger( 'focus' );
} }
this.propagate('close'); this.propagate('close');
@ -5475,7 +5475,7 @@ UploaderInline = View.extend(/** @lends wp.media.view.UploaderInline.prototype *
this.controller.$uploaderToggler this.controller.$uploaderToggler
.attr( 'aria-expanded', 'false' ) .attr( 'aria-expanded', 'false' )
// Move focus back to the toggle button when closing the uploader. // Move focus back to the toggle button when closing the uploader.
.focus(); .trigger( 'focus' );
} }
} }
@ -9566,7 +9566,8 @@ EmbedUrl = View.extend(/** @lends wp.media.view.EmbedUrl.prototype */{
}, },
url: function( event ) { url: function( event ) {
this.model.set( 'url', $.trim( event.target.value ) ); var url = event.target.value || '';
this.model.set( 'url', url.trim() );
} }
}); });

File diff suppressed because one or more lines are too long

View File

@ -57,7 +57,7 @@ window.edToolbar = function(){};
var t, i, DOMContentLoaded, _tryReady; var t, i, DOMContentLoaded, _tryReady;
if ( typeof jQuery !== 'undefined' ) { if ( typeof jQuery !== 'undefined' ) {
jQuery(document).ready(func); jQuery( func );
} else { } else {
t = _domReady; t = _domReady;
t.funcs = []; t.funcs = [];

File diff suppressed because one or more lines are too long

View File

@ -65,6 +65,6 @@ window.wpAjax = jQuery.extend( {
}, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } ); }, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } );
// Basic form validation. // Basic form validation.
jQuery(document).ready( function($){ jQuery( function($){
$('form.validate').on( 'submit', function() { return wpAjax.validateForm( $(this) ); } ); $('form.validate').on( 'submit', function() { return wpAjax.validateForm( $(this) ); } );
}); });

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
window.wpAjax=jQuery.extend({unserialize:function(e){var r,t,n,a,i={};if(!e)return i;for(n in t=(e=(r=e.split("?"))[1]?r[1]:e).split("&"))"function"==typeof t.hasOwnProperty&&!t.hasOwnProperty(n)||(i[(a=t[n].split("="))[0]]=a[1]);return i},parseAjaxResponse:function(a,e,i){var o={},e=jQuery("#"+e).empty(),s="";return a&&"object"==typeof a&&a.getElementsByTagName("wp_ajax")?(o.responses=[],o.errors=!1,jQuery("response",a).each(function(){var e=jQuery(this),r=jQuery(this.firstChild),n={action:e.attr("action"),what:r.get(0).nodeName,id:r.attr("id"),oldId:r.attr("old_id"),position:r.attr("position")};n.data=jQuery("response_data",r).text(),n.supplemental={},jQuery("supplemental",r).children().each(function(){n.supplemental[this.nodeName]=jQuery(this).text()}).length||(n.supplemental=!1),n.errors=[],jQuery("wp_error",r).each(function(){var e=jQuery(this).attr("code"),r={code:e,message:this.firstChild.nodeValue,data:!1},t=jQuery('wp_error_data[code="'+e+'"]',a);t&&(r.data=t.get()),(t=jQuery("form-field",t).text())&&(e=t),i&&wpAjax.invalidateForm(jQuery("#"+i+' :input[name="'+e+'"]').parents(".form-field:first")),s+="<p>"+r.message+"</p>",n.errors.push(r),o.errors=!0}).length||(n.errors=!1),o.responses.push(n)}),s.length&&e.html('<div class="error">'+s+"</div>"),o):isNaN(a)?!e.html('<div class="error"><p>'+a+"</p></div>"):-1===(a=parseInt(a,10))?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0!==a||!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>")},invalidateForm:function(e){return jQuery(e).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(e){return e=jQuery(e),!wpAjax.invalidateForm(e.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).length}},wpAjax||{noPerm:"Sorry, you are not allowed to do that.",broken:"Something went wrong."}),jQuery(document).ready(function(e){e("form.validate").on("submit",function(){return wpAjax.validateForm(e(this))})}); window.wpAjax=jQuery.extend({unserialize:function(e){var r,t,n,i,a={};if(!e)return a;for(n in t=(e=(r=e.split("?"))[1]?r[1]:e).split("&"))"function"==typeof t.hasOwnProperty&&!t.hasOwnProperty(n)||(a[(i=t[n].split("="))[0]]=i[1]);return a},parseAjaxResponse:function(i,e,a){var o={},e=jQuery("#"+e).empty(),s="";return i&&"object"==typeof i&&i.getElementsByTagName("wp_ajax")?(o.responses=[],o.errors=!1,jQuery("response",i).each(function(){var e=jQuery(this),r=jQuery(this.firstChild),n={action:e.attr("action"),what:r.get(0).nodeName,id:r.attr("id"),oldId:r.attr("old_id"),position:r.attr("position")};n.data=jQuery("response_data",r).text(),n.supplemental={},jQuery("supplemental",r).children().each(function(){n.supplemental[this.nodeName]=jQuery(this).text()}).length||(n.supplemental=!1),n.errors=[],jQuery("wp_error",r).each(function(){var e=jQuery(this).attr("code"),r={code:e,message:this.firstChild.nodeValue,data:!1},t=jQuery('wp_error_data[code="'+e+'"]',i);t&&(r.data=t.get()),(t=jQuery("form-field",t).text())&&(e=t),a&&wpAjax.invalidateForm(jQuery("#"+a+' :input[name="'+e+'"]').parents(".form-field:first")),s+="<p>"+r.message+"</p>",n.errors.push(r),o.errors=!0}).length||(n.errors=!1),o.responses.push(n)}),s.length&&e.html('<div class="error">'+s+"</div>"),o):isNaN(i)?!e.html('<div class="error"><p>'+i+"</p></div>"):-1===(i=parseInt(i,10))?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0!==i||!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>")},invalidateForm:function(e){return jQuery(e).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(e){return e=jQuery(e),!wpAjax.invalidateForm(e.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).length}},wpAjax||{noPerm:"Sorry, you are not allowed to do that.",broken:"Something went wrong."}),jQuery(function(e){e("form.validate").on("submit",function(){return wpAjax.validateForm(e(this))})});

View File

@ -144,15 +144,7 @@
* @param {Object} e The heartbeat-tick event that has been triggered. * @param {Object} e The heartbeat-tick event that has been triggered.
* @param {Object} data Response data. * @param {Object} data Response data.
*/ */
$( document ).on( 'heartbeat-tick.wp-auth-check', function( e, data ) { $( function() {
if ( 'wp-auth-check' in data ) {
if ( ! data['wp-auth-check'] && wrap.hasClass( 'hidden' ) && ! tempHidden ) {
show();
} else if ( data['wp-auth-check'] && ! wrap.hasClass( 'hidden' ) ) {
hide();
}
}
}).ready( function() {
/** /**
* Hides the authentication form popup when the close icon is clicked. * Hides the authentication form popup when the close icon is clicked.
@ -166,6 +158,14 @@
hide(); hide();
setShowTimeout(); setShowTimeout();
}); });
}).on( 'heartbeat-tick.wp-auth-check', function( e, data ) {
if ( 'wp-auth-check' in data ) {
if ( ! data['wp-auth-check'] && wrap.hasClass( 'hidden' ) && ! tempHidden ) {
show();
} else if ( data['wp-auth-check'] && ! wrap.hasClass( 'hidden' ) ) {
hide();
}
}
}); });
}(jQuery)); }(jQuery));

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
!function(i){var h,d,e;function r(){var e=window.adminpage,a=window.wp;i(window).off("beforeunload.wp-auth-check"),("post-php"===e||"post-new-php"===e)&&a&&a.heartbeat&&a.heartbeat.connectNow(),h.fadeOut(200,function(){h.addClass("hidden").css("display",""),i("#wp-auth-check-frame").remove(),i("body").removeClass("modal-open")})}i(document).on("heartbeat-tick.wp-auth-check",function(e,a){var o,t,n,c,s;"wp-auth-check"in a&&(a["wp-auth-check"]||!h.hasClass("hidden")||d?a["wp-auth-check"]&&!h.hasClass("hidden")&&r():(t=i("#wp-auth-check"),n=i("#wp-auth-check-form"),c=h.find(".wp-auth-fallback-expired"),s=!1,n.length&&(i(window).on("beforeunload.wp-auth-check",function(e){e.originalEvent.returnValue=window.wp.i18n.__("Your session has expired. You can log in again from this page or go to the login page.")}),(o=i('<iframe id="wp-auth-check-frame" frameborder="0">').attr("title",c.text())).on("load",function(){var e,a;s=!0,n.removeClass("loading");try{e=(a=i(this).contents().find("body")).height()}catch(e){return h.addClass("fallback"),t.css("max-height",""),n.remove(),void c.focus()}e?a&&a.hasClass("interim-login-success")?r():t.css("max-height",e+40+"px"):a&&a.length||(h.addClass("fallback"),t.css("max-height",""),n.remove(),c.focus())}).attr("src",n.data("src")),n.append(o)),i("body").addClass("modal-open"),h.removeClass("hidden"),o?(o.focus(),setTimeout(function(){s||(h.addClass("fallback"),n.remove(),c.focus())},1e4)):c.focus()))}).ready(function(){(h=i("#wp-auth-check-wrap")).find(".wp-auth-check-close").on("click",function(){r(),d=!0,window.clearTimeout(e),e=window.setTimeout(function(){d=!1},3e5)})})}(jQuery); !function(i){var h,d,e;function r(){var e=window.adminpage,a=window.wp;i(window).off("beforeunload.wp-auth-check"),("post-php"===e||"post-new-php"===e)&&a&&a.heartbeat&&a.heartbeat.connectNow(),h.fadeOut(200,function(){h.addClass("hidden").css("display",""),i("#wp-auth-check-frame").remove(),i("body").removeClass("modal-open")})}i(function(){(h=i("#wp-auth-check-wrap")).find(".wp-auth-check-close").on("click",function(){r(),d=!0,window.clearTimeout(e),e=window.setTimeout(function(){d=!1},3e5)})}).on("heartbeat-tick.wp-auth-check",function(e,a){var o,t,n,c,s;"wp-auth-check"in a&&(a["wp-auth-check"]||!h.hasClass("hidden")||d?a["wp-auth-check"]&&!h.hasClass("hidden")&&r():(t=i("#wp-auth-check"),n=i("#wp-auth-check-form"),c=h.find(".wp-auth-fallback-expired"),s=!1,n.length&&(i(window).on("beforeunload.wp-auth-check",function(e){e.originalEvent.returnValue=window.wp.i18n.__("Your session has expired. You can log in again from this page or go to the login page.")}),(o=i('<iframe id="wp-auth-check-frame" frameborder="0">').attr("title",c.text())).on("load",function(){var e,a;s=!0,n.removeClass("loading");try{e=(a=i(this).contents().find("body")).height()}catch(e){return h.addClass("fallback"),t.css("max-height",""),n.remove(),void c.focus()}e?a&&a.hasClass("interim-login-success")?r():t.css("max-height",e+40+"px"):a&&a.length||(h.addClass("fallback"),t.css("max-height",""),n.remove(),c.focus())}).attr("src",n.data("src")),n.append(o)),i("body").addClass("modal-open"),h.removeClass("hidden"),o?(o.focus(),setTimeout(function(){s||(h.addClass("fallback"),n.remove(),c.focus())},1e4)):c.focus()))})}(jQuery);

View File

@ -93,7 +93,7 @@
// If URL wasn't corrected last time and doesn't start with http:, https:, ? # or /, prepend http://. // If URL wasn't corrected last time and doesn't start with http:, https:, ? # or /, prepend http://.
correctURL: function () { correctURL: function () {
var url = $.trim( inputs.url.val() ); var url = inputs.url.val().trim();
if ( url && correctedURL !== url && ! /^(?:[a-z]+:|#|\?|\.|\/)/.test( url ) ) { if ( url && correctedURL !== url && ! /^(?:[a-z]+:|#|\?|\.|\/)/.test( url ) ) {
inputs.url.val( 'http://' + url ); inputs.url.val( 'http://' + url );
@ -238,7 +238,7 @@
linkText = linkNode.text(); linkText = linkNode.text();
href = linkNode.attr( 'href' ); href = linkNode.attr( 'href' );
if ( ! $.trim( linkText ) ) { if ( ! linkText.trim() ) {
linkText = text || ''; linkText = text || '';
} }
@ -312,7 +312,7 @@
wpLink.correctURL(); wpLink.correctURL();
return { return {
href: $.trim( inputs.url.val() ), href: inputs.url.val().trim(),
target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : null target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : null
}; };
}, },
@ -425,7 +425,7 @@
if ( ! $link.length ) { if ( ! $link.length ) {
editor.execCommand( 'mceInsertLink', false, { href: '_wp_link_placeholder', 'data-wp-temp-link': 1 } ); editor.execCommand( 'mceInsertLink', false, { href: '_wp_link_placeholder', 'data-wp-temp-link': 1 } );
$link = editor.$( 'a[data-wp-temp-link="1"]' ).removeAttr( 'data-wp-temp-link' ); $link = editor.$( 'a[data-wp-temp-link="1"]' ).removeAttr( 'data-wp-temp-link' );
hasText = $.trim( $link.text() ); hasText = $link.text().trim();
} }
if ( ! $link.length ) { if ( ! $link.length ) {
@ -483,7 +483,8 @@
} }
} }
selection = $.trim( selection ); selection = selection || '';
selection = selection.trim();
if ( selection && emailRegexp.test( selection ) ) { if ( selection && emailRegexp.test( selection ) ) {
// Selection is email address. // Selection is email address.
@ -797,5 +798,5 @@
} }
}); });
$( document ).ready( wpLink.init ); $( wpLink.init );
})( jQuery, window.wpLinkL10n, window.wp ); })( jQuery, window.wpLinkL10n, window.wp );

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.8-alpha-50546'; $wp_version = '5.8-alpha-50547';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.