Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
name: response.name,
|
||||
password: response.password
|
||||
} ) );
|
||||
$( '.new-application-password-notice' ).trigger( 'focus' );
|
||||
$( '.new-application-password-notice' ).attr( 'tabindex', '-1' ).trigger( 'focus' );
|
||||
|
||||
$appPassTbody.prepend( tmplAppPassRow( response ) );
|
||||
|
||||
|
||||
2
wp/wp-admin/js/application-passwords.min.js
vendored
2
wp/wp-admin/js/application-passwords.min.js
vendored
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
!function(o){var a=o("#application-passwords-section"),i=a.find(".create-application-password"),t=i.find(".input"),n=i.find(".button"),p=a.find(".application-passwords-list-table-wrapper"),r=a.find("tbody"),d=r.find(".no-items"),e=o("#revoke-all-application-passwords"),l=wp.template("new-application-password"),c=wp.template("application-password-row"),u=o("#user_id").val();function w(e,s,a){f(a=e.responseJSON&&e.responseJSON.message?e.responseJSON.message:a,"error")}function f(e,s){s=o("<div></div>").attr("role","alert").attr("tabindex","-1").addClass("is-dismissible notice notice-"+s).append(o("<p></p>").text(e)).append(o("<button></button>").attr("type","button").addClass("notice-dismiss").append(o("<span></span>").addClass("screen-reader-text").text(wp.i18n.__("Dismiss this notice."))));return i.after(s),s}function v(){o(".notice",a).remove()}n.on("click",function(e){var s;e.preventDefault(),n.prop("aria-disabled")||(0===(e=t.val()).length?t.trigger("focus"):(v(),n.prop("aria-disabled",!0).addClass("disabled"),s={name:e},s=wp.hooks.applyFilters("wp_application_passwords_new_password_request",s,u),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"POST",data:s}).always(function(){n.removeProp("aria-disabled").removeClass("disabled")}).done(function(e){t.val(""),n.prop("disabled",!1),i.after(l({name:e.name,password:e.password})),o(".new-application-password-notice").trigger("focus"),r.prepend(c(e)),p.show(),d.remove(),wp.hooks.doAction("wp_application_passwords_created_password",e,s)}).fail(w)))}),r.on("click",".delete",function(e){var s,a;e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke this password? This action cannot be undone."))&&(s=o(this),e=(a=s.closest("tr")).data("uuid"),v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords/"+e+"?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(0===a.siblings().length&&p.hide(),a.remove(),f(wp.i18n.__("Application password revoked."),"success").trigger("focus"))}).fail(w))}),e.on("click",function(e){var s;e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke all passwords? This action cannot be undone."))&&(s=o(this),v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(r.children().remove(),a.children(".new-application-password").remove(),p.hide(),f(wp.i18n.__("All application passwords revoked."),"success").trigger("focus"))}).fail(w))}),a.on("click",".notice-dismiss",function(e){e.preventDefault();var s=o(this).parent();s.removeAttr("role"),s.fadeTo(100,0,function(){s.slideUp(100,function(){s.remove(),t.trigger("focus")})})}),t.on("keypress",function(e){13===e.which&&(e.preventDefault(),n.trigger("click"))}),0===r.children("tr").not(d).length&&p.hide()}(jQuery);
|
||||
!function(o){var a=o("#application-passwords-section"),i=a.find(".create-application-password"),t=i.find(".input"),n=i.find(".button"),p=a.find(".application-passwords-list-table-wrapper"),r=a.find("tbody"),d=r.find(".no-items"),e=o("#revoke-all-application-passwords"),l=wp.template("new-application-password"),c=wp.template("application-password-row"),u=o("#user_id").val();function w(e,s,a){f(a=e.responseJSON&&e.responseJSON.message?e.responseJSON.message:a,"error")}function f(e,s){s=o("<div></div>").attr("role","alert").attr("tabindex","-1").addClass("is-dismissible notice notice-"+s).append(o("<p></p>").text(e)).append(o("<button></button>").attr("type","button").addClass("notice-dismiss").append(o("<span></span>").addClass("screen-reader-text").text(wp.i18n.__("Dismiss this notice."))));return i.after(s),s}function v(){o(".notice",a).remove()}n.on("click",function(e){var s;e.preventDefault(),n.prop("aria-disabled")||(0===(e=t.val()).length?t.trigger("focus"):(v(),n.prop("aria-disabled",!0).addClass("disabled"),s={name:e},s=wp.hooks.applyFilters("wp_application_passwords_new_password_request",s,u),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"POST",data:s}).always(function(){n.removeProp("aria-disabled").removeClass("disabled")}).done(function(e){t.val(""),n.prop("disabled",!1),i.after(l({name:e.name,password:e.password})),o(".new-application-password-notice").attr("tabindex","-1").trigger("focus"),r.prepend(c(e)),p.show(),d.remove(),wp.hooks.doAction("wp_application_passwords_created_password",e,s)}).fail(w)))}),r.on("click",".delete",function(e){var s,a;e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke this password? This action cannot be undone."))&&(s=o(this),e=(a=s.closest("tr")).data("uuid"),v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords/"+e+"?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(0===a.siblings().length&&p.hide(),a.remove(),f(wp.i18n.__("Application password revoked."),"success").trigger("focus"))}).fail(w))}),e.on("click",function(e){var s;e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke all passwords? This action cannot be undone."))&&(s=o(this),v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(r.children().remove(),a.children(".new-application-password").remove(),p.hide(),f(wp.i18n.__("All application passwords revoked."),"success").trigger("focus"))}).fail(w))}),a.on("click",".notice-dismiss",function(e){e.preventDefault();var s=o(this).parent();s.removeAttr("role"),s.fadeTo(100,0,function(){s.slideUp(100,function(){s.remove(),t.trigger("focus")})})}),t.on("keypress",function(e){13===e.which&&(e.preventDefault(),n.trigger("click"))}),0===r.children("tr").not(d).length&&p.hide()}(jQuery);
|
||||
@@ -1702,24 +1702,45 @@ $( function() {
|
||||
}
|
||||
} );
|
||||
|
||||
// Close sidebar when focus moves outside of toggle and sidebar.
|
||||
$( '#wp-admin-bar-menu-toggle, #adminmenumain' ).on( 'focusout', function() {
|
||||
var focusIsInToggle, focusIsInSidebar;
|
||||
|
||||
// Close sidebar when target moves outside of toggle and sidebar.
|
||||
$( document ).on( 'click', function( event ) {
|
||||
if ( ! $wpwrap.hasClass( 'wp-responsive-open' ) || ! document.hasFocus() ) {
|
||||
return;
|
||||
}
|
||||
// A brief delay is required to allow focus to switch to another element.
|
||||
setTimeout( function() {
|
||||
focusIsInToggle = $.contains( $( '#wp-admin-bar-menu-toggle' )[0], $( ':focus' )[0] );
|
||||
focusIsInSidebar = $.contains( $( '#adminmenumain' )[0], $( ':focus' )[0] );
|
||||
|
||||
if ( ! focusIsInToggle && ! focusIsInSidebar ) {
|
||||
$( '#wp-admin-bar-menu-toggle' ).trigger( 'click.wp-responsive' );
|
||||
}
|
||||
}, 10 );
|
||||
var focusIsInToggle = $.contains( $( '#wp-admin-bar-menu-toggle' )[0], event.target );
|
||||
var focusIsInSidebar = $.contains( $( '#adminmenuwrap' )[0], event.target );
|
||||
|
||||
if ( ! focusIsInToggle && ! focusIsInSidebar ) {
|
||||
$( '#wp-admin-bar-menu-toggle' ).trigger( 'click.wp-responsive' );
|
||||
}
|
||||
} );
|
||||
|
||||
// Close sidebar when a keypress completes outside of toggle and sidebar.
|
||||
$( document ).on( 'keyup', function( event ) {
|
||||
var toggleButton = $( '#wp-admin-bar-menu-toggle' )[0];
|
||||
if ( ! $wpwrap.hasClass( 'wp-responsive-open' ) ) {
|
||||
return;
|
||||
}
|
||||
if ( 27 === event.keyCode ) {
|
||||
$( toggleButton ).trigger( 'click.wp-responsive' );
|
||||
$( toggleButton ).find( 'a' ).trigger( 'focus' );
|
||||
} else {
|
||||
if ( 9 === event.keyCode ) {
|
||||
var sidebar = $( '#adminmenuwrap' )[0];
|
||||
var focusedElement = event.relatedTarget || document.activeElement;
|
||||
// A brief delay is required to allow focus to switch to another element.
|
||||
setTimeout( function() {
|
||||
var focusIsInToggle = $.contains( toggleButton, focusedElement );
|
||||
var focusIsInSidebar = $.contains( sidebar, focusedElement );
|
||||
|
||||
if ( ! focusIsInToggle && ! focusIsInSidebar ) {
|
||||
$( toggleButton ).trigger( 'click.wp-responsive' );
|
||||
}
|
||||
}, 10 );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Add menu events.
|
||||
$adminmenu.on( 'click.wp-responsive', 'li.wp-has-submenu > a', function( event ) {
|
||||
@@ -2104,3 +2125,123 @@ $( function( $ ) {
|
||||
})();
|
||||
|
||||
}( jQuery, window ));
|
||||
|
||||
/**
|
||||
* Freeze animated plugin icons when reduced motion is enabled.
|
||||
*
|
||||
* When the user has enabled the 'prefers-reduced-motion' setting, this module
|
||||
* stops animations for all GIFs on the page with the class 'plugin-icon' or
|
||||
* plugin icon images in the update plugins table.
|
||||
*
|
||||
* @since 6.4.0
|
||||
*/
|
||||
(function() {
|
||||
// Private variables and methods.
|
||||
var priv = {},
|
||||
pub = {},
|
||||
mediaQuery;
|
||||
|
||||
// Initialize pauseAll to false; it will be set to true if reduced motion is preferred.
|
||||
priv.pauseAll = false;
|
||||
if ( window.matchMedia ) {
|
||||
mediaQuery = window.matchMedia( '(prefers-reduced-motion: reduce)' );
|
||||
if ( ! mediaQuery || mediaQuery.matches ) {
|
||||
priv.pauseAll = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Method to replace animated GIFs with a static frame.
|
||||
priv.freezeAnimatedPluginIcons = function( img ) {
|
||||
var coverImage = function() {
|
||||
var width = img.width;
|
||||
var height = img.height;
|
||||
var canvas = document.createElement( 'canvas' );
|
||||
|
||||
// Set canvas dimensions.
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
|
||||
// Copy classes from the image to the canvas.
|
||||
canvas.className = img.className;
|
||||
|
||||
// Check if the image is inside a specific table.
|
||||
var isInsideUpdateTable = img.closest( '#update-plugins-table' );
|
||||
|
||||
if ( isInsideUpdateTable ) {
|
||||
// Transfer computed styles from image to canvas.
|
||||
var computedStyles = window.getComputedStyle( img ),
|
||||
i, max;
|
||||
for ( i = 0, max = computedStyles.length; i < max; i++ ) {
|
||||
var propName = computedStyles[ i ];
|
||||
var propValue = computedStyles.getPropertyValue( propName );
|
||||
canvas.style[ propName ] = propValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the image onto the canvas.
|
||||
canvas.getContext( '2d' ).drawImage( img, 0, 0, width, height );
|
||||
|
||||
// Set accessibility attributes on canvas.
|
||||
canvas.setAttribute( 'aria-hidden', 'true' );
|
||||
canvas.setAttribute( 'role', 'presentation' );
|
||||
|
||||
// Insert canvas before the image and set the image to be near-invisible.
|
||||
var parent = img.parentNode;
|
||||
parent.insertBefore( canvas, img );
|
||||
img.style.opacity = 0.01;
|
||||
img.style.width = '0px';
|
||||
img.style.height = '0px';
|
||||
};
|
||||
|
||||
// If the image is already loaded, apply the coverImage function.
|
||||
if ( img.complete ) {
|
||||
coverImage();
|
||||
} else {
|
||||
// Otherwise, wait for the image to load.
|
||||
img.addEventListener( 'load', coverImage, true );
|
||||
}
|
||||
};
|
||||
|
||||
// Public method to freeze all relevant GIFs on the page.
|
||||
pub.freezeAll = function() {
|
||||
var images = document.querySelectorAll( '.plugin-icon, #update-plugins-table img' );
|
||||
for ( var x = 0; x < images.length; x++ ) {
|
||||
if ( /\.gif(?:\?|$)/i.test( images[ x ].src ) ) {
|
||||
priv.freezeAnimatedPluginIcons( images[ x ] );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Only run the freezeAll method if the user prefers reduced motion.
|
||||
if ( true === priv.pauseAll ) {
|
||||
pub.freezeAll();
|
||||
}
|
||||
|
||||
// Listen for jQuery AJAX events.
|
||||
( function( $ ) {
|
||||
if ( window.pagenow === 'plugin-install' ) {
|
||||
// Only listen for ajaxComplete if this is the plugin-install.php page.
|
||||
$( document ).ajaxComplete( function( event, xhr, settings ) {
|
||||
|
||||
// Check if this is the 'search-install-plugins' request.
|
||||
if ( settings.data && typeof settings.data === 'string' && settings.data.includes( 'action=search-install-plugins' ) ) {
|
||||
// Recheck if the user prefers reduced motion.
|
||||
if ( window.matchMedia ) {
|
||||
var mediaQuery = window.matchMedia( '(prefers-reduced-motion: reduce)' );
|
||||
if ( mediaQuery.matches ) {
|
||||
pub.freezeAll();
|
||||
}
|
||||
} else {
|
||||
// Fallback for browsers that don't support matchMedia.
|
||||
if ( true === priv.pauseAll ) {
|
||||
pub.freezeAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
} )( jQuery );
|
||||
|
||||
// Expose public methods.
|
||||
return pub;
|
||||
})();
|
||||
|
||||
2
wp/wp-admin/js/common.min.js
vendored
2
wp/wp-admin/js/common.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -7800,11 +7800,11 @@
|
||||
},
|
||||
|
||||
/**
|
||||
* Builds the front preview url with the current state of customizer.
|
||||
* Builds the front preview URL with the current state of customizer.
|
||||
*
|
||||
* @since 4.9
|
||||
* @since 4.9.0
|
||||
*
|
||||
* @return {string} Preview url.
|
||||
* @return {string} Preview URL.
|
||||
*/
|
||||
getFrontendPreviewUrl: function() {
|
||||
var previewer = this, params, urlParser;
|
||||
|
||||
@@ -88,8 +88,6 @@ jQuery( function($) {
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(window).on( 'unload', function () { window.tinymce = window.tinyMCE = window.wpgallery = null; } ); // Cleanup.
|
||||
|
||||
/* gallery settings */
|
||||
window.tinymce = null;
|
||||
|
||||
|
||||
2
wp/wp-admin/js/gallery.min.js
vendored
2
wp/wp-admin/js/gallery.min.js
vendored
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
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(!(i=o.dom.select("img.wpGallery"))||!i[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=i[0]}i=o.dom.getAttrib(n.el,"title"),(i=o.dom.decode(i))?(jQuery("#update-gallery").show(),n.is_update=!0,o=i.match(/columns=['"]([0-9]+)['"]/),e=i.match(/link=['"]([^'"]+)['"]/i),t=i.match(/order=['"]([^'"]+)['"]/i),i=i.match(/orderby=['"]([^'"]+)['"]/i),e&&e[1]&&(n.I("linkto-file").checked="checked"),t&&t[1]&&(n.I("order-desc").checked="checked"),o&&o[1]&&(n.I("columns").value=""+o[1]),i&&i[1]&&(n.I("orderby").value=i[1])):jQuery("#insert-gallery").show()}},update:function(){var e=this,t=e.editor,i="";e.mcemode&&e.is_update?"IMG"===e.el.nodeName&&(i=(i=t.dom.decode(t.dom.getAttrib(e.el,"title"))).replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,""),i+=e.getSettings(),t.dom.setAttrib(e.el,"title",i),e.getWin().tb_remove()):(t="[gallery"+e.getSettings()+"]",e.getWin().send_to_editor(t))},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())}),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(!(i=o.dom.select("img.wpGallery"))||!i[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=i[0]}i=o.dom.getAttrib(n.el,"title"),(i=o.dom.decode(i))?(jQuery("#update-gallery").show(),n.is_update=!0,o=i.match(/columns=['"]([0-9]+)['"]/),e=i.match(/link=['"]([^'"]+)['"]/i),t=i.match(/order=['"]([^'"]+)['"]/i),i=i.match(/orderby=['"]([^'"]+)['"]/i),e&&e[1]&&(n.I("linkto-file").checked="checked"),t&&t[1]&&(n.I("order-desc").checked="checked"),o&&o[1]&&(n.I("columns").value=""+o[1]),i&&i[1]&&(n.I("orderby").value=i[1])):jQuery("#insert-gallery").show()}},update:function(){var e=this,t=e.editor,i="";e.mcemode&&e.is_update?"IMG"===e.el.nodeName&&(i=(i=t.dom.decode(t.dom.getAttrib(e.el,"title"))).replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,""),i+=e.getSettings(),t.dom.setAttrib(e.el,"title",i),e.getWin().tb_remove()):(t="[gallery"+e.getSettings()+"]",e.getWin().send_to_editor(t))},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}};
|
||||
@@ -236,8 +236,40 @@
|
||||
// Open menu and set z-index to appear above image crop area if it is enabled.
|
||||
$target
|
||||
.toggleClass( 'imgedit-popup-menu-open' ).slideToggle( 'fast' ).css( { 'z-index' : 200000 } );
|
||||
// Move focus to first item in menu.
|
||||
$target.find( 'button' ).first().trigger( 'focus' );
|
||||
// Move focus to first item in menu when opening menu.
|
||||
if ( 'true' === $el.attr( 'aria-expanded' ) ) {
|
||||
$target.find( 'button' ).first().trigger( 'focus' );
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Observes whether the popup should remain open based on focus position.
|
||||
*
|
||||
* @since 6.4.0
|
||||
*
|
||||
* @memberof imageEdit
|
||||
*
|
||||
* @param {HTMLElement} el The activated control element.
|
||||
*
|
||||
* @return {boolean} Always returns false.
|
||||
*/
|
||||
monitorPopup : function() {
|
||||
var $parent = document.querySelector( '.imgedit-rotate-menu-container' );
|
||||
var $toggle = document.querySelector( '.imgedit-rotate-menu-container .imgedit-rotate' );
|
||||
|
||||
setTimeout( function() {
|
||||
var $focused = document.activeElement;
|
||||
var $contains = $parent.contains( $focused );
|
||||
|
||||
// If $focused is defined and not inside the menu container, close the popup.
|
||||
if ( $focused && ! $contains ) {
|
||||
if ( 'true' === $toggle.getAttribute( 'aria-expanded' ) ) {
|
||||
imageEdit.togglePopup( $toggle );
|
||||
}
|
||||
}
|
||||
}, 100 );
|
||||
|
||||
return false;
|
||||
},
|
||||
@@ -856,7 +888,7 @@
|
||||
elementToSetFocusTo = $( '.imgedit-wrap' ).find( ':tabbable:first' );
|
||||
}
|
||||
|
||||
elementToSetFocusTo.trigger( 'focus' );
|
||||
elementToSetFocusTo.attr( 'tabindex', '-1' ).trigger( 'focus' );
|
||||
}, 100 );
|
||||
},
|
||||
|
||||
|
||||
2
wp/wp-admin/js/image-edit.min.js
vendored
2
wp/wp-admin/js/image-edit.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -449,13 +449,6 @@ window.wp = window.wp || {};
|
||||
};
|
||||
|
||||
fields = $('#edit-'+id).find(':input').serialize();
|
||||
|
||||
var status = $(':input[name="_status"]').val();
|
||||
|
||||
if ( [ 'draft', 'pending', 'auto-draft' ].includes( status ) ) {
|
||||
params.edit_date = 'false';
|
||||
}
|
||||
|
||||
params = fields + '&' + $.param(params);
|
||||
|
||||
// Make Ajax request.
|
||||
|
||||
2
wp/wp-admin/js/inline-edit-post.min.js
vendored
2
wp/wp-admin/js/inline-edit-post.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -511,7 +511,7 @@ jQuery( function($) {
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event.
|
||||
return __( 'The changes you made will be lost if you navigate away from this page.' );
|
||||
}
|
||||
}).on( 'unload.edit-post', function( event ) {
|
||||
}).on( 'pagehide.edit-post', function( event ) {
|
||||
if ( ! releaseLock ) {
|
||||
return;
|
||||
}
|
||||
|
||||
2
wp/wp-admin/js/post.min.js
vendored
2
wp/wp-admin/js/post.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -225,12 +225,12 @@ jQuery( function( $ ) {
|
||||
$wrapper.addClass( 'green' ).removeClass( 'orange' );
|
||||
|
||||
$progressLabel.text( __( 'Good' ) );
|
||||
wp.a11y.speak( __( 'All site health tests have finished running. Your site is looking good, and the results are now available on the page.' ) );
|
||||
announceTestsProgression( 'good' );
|
||||
} else {
|
||||
$wrapper.addClass( 'orange' ).removeClass( 'green' );
|
||||
|
||||
$progressLabel.text( __( 'Should be improved' ) );
|
||||
wp.a11y.speak( __( 'All site health tests have finished running. There are items that should be addressed, and the results are now available on the page.' ) );
|
||||
announceTestsProgression( 'improvable' );
|
||||
}
|
||||
|
||||
if ( isStatusTab ) {
|
||||
@@ -379,7 +379,7 @@ jQuery( function( $ ) {
|
||||
|
||||
// After 3 seconds announce that we're still waiting for directory sizes.
|
||||
var timeout = window.setTimeout( function() {
|
||||
wp.a11y.speak( __( 'Please wait...' ) );
|
||||
announceTestsProgression( 'waiting-for-directory-sizes' );
|
||||
}, 3000 );
|
||||
|
||||
wp.apiRequest( {
|
||||
@@ -390,7 +390,6 @@ jQuery( function( $ ) {
|
||||
var delay = ( new Date().getTime() ) - timestamp;
|
||||
|
||||
$( '.health-check-wp-paths-sizes.spinner' ).css( 'visibility', 'hidden' );
|
||||
recalculateProgression();
|
||||
|
||||
if ( delay > 3000 ) {
|
||||
/*
|
||||
@@ -405,7 +404,7 @@ jQuery( function( $ ) {
|
||||
}
|
||||
|
||||
window.setTimeout( function() {
|
||||
wp.a11y.speak( __( 'All site health tests have finished running.' ) );
|
||||
recalculateProgression();
|
||||
}, delay );
|
||||
} else {
|
||||
// Cancel the announcement.
|
||||
@@ -452,4 +451,34 @@ jQuery( function( $ ) {
|
||||
$( '.health-check-offscreen-nav-wrapper' ).on( 'click', function() {
|
||||
$( this ).toggleClass( 'visible' );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Announces to assistive technologies the tests progression status.
|
||||
*
|
||||
* @since 6.4.0
|
||||
*
|
||||
* @param {string} type The type of message to be announced.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
function announceTestsProgression( type ) {
|
||||
// Only announce the messages in the Site Health pages.
|
||||
if ( 'site-health' !== SiteHealth.screen ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( type ) {
|
||||
case 'good':
|
||||
wp.a11y.speak( __( 'All site health tests have finished running. Your site is looking good.' ) );
|
||||
break;
|
||||
case 'improvable':
|
||||
wp.a11y.speak( __( 'All site health tests have finished running. There are items that should be addressed.' ) );
|
||||
break;
|
||||
case 'waiting-for-directory-sizes':
|
||||
wp.a11y.speak( __( 'Running additional tests... please wait.' ) );
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
2
wp/wp-admin/js/site-health.min.js
vendored
2
wp/wp-admin/js/site-health.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -291,7 +291,7 @@ wp.textWidgets = ( function( $ ) {
|
||||
onInit = function() {
|
||||
|
||||
// When a widget is moved in the DOM the dynamically-created TinyMCE iframe will be destroyed and has to be re-built.
|
||||
$( editor.getWin() ).on( 'unload', function() {
|
||||
$( editor.getWin() ).on( 'pagehide', function() {
|
||||
_.defer( buildEditor );
|
||||
});
|
||||
|
||||
|
||||
2
wp/wp-admin/js/widgets/text-widgets.min.js
vendored
2
wp/wp-admin/js/widgets/text-widgets.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user