plugin updates

This commit is contained in:
Tony Volpe
2024-07-16 13:57:46 +00:00
parent 41f50eacc4
commit 8f93917880
1529 changed files with 259452 additions and 25451 deletions

View File

@@ -267,5 +267,34 @@
$( this ).addClass( 'is-busy' );
}
} );
/**
* Support conditionally displaying a settings field description when another element
* is set to a specific value.
*
* This logic is subject to change, and is not intended for use by other plugins.
* Note that we can't avoid jQuery here, because of our current dependence on Select2
* for various controls.
*/
document.querySelectorAll( 'body.woocommerce_page_wc-settings #mainform .conditional.description' ).forEach( description => {
const $underObservation = $( description.dataset.dependsOn );
const showIfEquals = description.dataset.showIfEquals;
if ( undefined === showIfEquals || $underObservation.length === 0 ) {
return;
}
/**
* Set visibility of the description element according to whether its value
* matches that of showIfEquals.
*/
const changeAgent = () => {
description.style.visibility = $underObservation.val() === showIfEquals ? 'visible' : 'hidden';
};
// Monitor future changes, and take action based on the current state.
$underObservation.on( 'change', changeAgent );
changeAgent();
} );
} );
} )( jQuery, woocommerce_settings_params, wp );

View File

@@ -1 +1 @@
!function(t,e,i){t(function(){t("select#woocommerce_allowed_countries").on("change",function(){"specific"===t(this).val()?(t(this).closest("tr").next("tr").hide(),t(this).closest("tr").next().next("tr").show()):"all_except"===t(this).val()?(t(this).closest("tr").next("tr").show(),t(this).closest("tr").next().next("tr").hide()):(t(this).closest("tr").next("tr").hide(),t(this).closest("tr").next().next("tr").hide())}).trigger("change"),t("select#woocommerce_ship_to_countries").on("change",function(){"specific"===t(this).val()?t(this).closest("tr").next("tr").show():t(this).closest("tr").next("tr").hide()}).trigger("change"),t("input#woocommerce_manage_stock").on("change",function(){t(this).is(":checked")?t(this).closest("tbody").find(".manage_stock_field").closest("tr").show():t(this).closest("tbody").find(".manage_stock_field").closest("tr").hide()}).trigger("change"),t(".colorpick").iris({change:function(e,i){t(this).parent().find(".colorpickpreview").css({backgroundColor:i.color.toString()})},hide:!0,border:!0}).on("click focus",function(e){e.stopPropagation(),t(".iris-picker").hide(),t(this).closest("td").find(".iris-picker").show(),t(this).data("originalValue",t(this).val())}).on("change",function(){t(this).is(".iris-error")&&(t(this).data("originalValue").match(/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/)?t(this).val(t(this).data("originalValue")).trigger("change"):t(this).val("").trigger("change"))}),t("body").on("click",function(){t(".iris-picker").hide()}),t(function(){var i=!1;let o=t(".wp-list-table .check-column");t("input, textarea, select, checkbox").on("change",function(t){o.length&&o.has(t.target)||i||(window.onbeforeunload=function(){return e.i18n_nav_warning},i=!0)}),t(".submit :input, input#search-submit").on("click",function(){window.onbeforeunload=""})}),t("table.wc_gateways tbody, table.wc_shipping tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(e,i){return i.children().each(function(){t(this).width(t(this).width())}),i.css("left","0"),i},start:function(t,e){e.item.css("background-color","#f6f6f6")},stop:function(t,e){e.item.removeAttr("style"),e.item.trigger("updateMoveButtons")}}),t(".woocommerce").on("click",".select_all",function(){return t(this).closest("td").find("select option").prop("selected",!0),t(this).closest("td").find("select").trigger("change"),!1}),t(".woocommerce").on("click",".select_none",function(){return t(this).closest("td").find("select option").prop("selected",!1),t(this).closest("td").find("select").trigger("change"),!1}),t(".wc-item-reorder-nav").find(".wc-move-up, .wc-move-down").on("click",function(){var o=t(this),n=o.closest("tr");o.trigger("focus");var c=o.is(".wc-move-up"),s=o.is(".wc-move-down");if(c){var r=n.prev("tr");r&&r.length&&(r.before(n),i.a11y.speak(e.i18n_moved_up))}else if(s){var a=n.next("tr");a&&a.length&&(a.after(n),i.a11y.speak(e.i18n_moved_down))}o.trigger("focus"),o.closest("table").trigger("updateMoveButtons")}),t(".wc-item-reorder-nav").closest("table").on("updateMoveButtons",function(){var e=t(this),i=t(this).find("tbody tr:last"),o=t(this).find("tbody tr:first");e.find(".wc-item-reorder-nav .wc-move-disabled").removeClass("wc-move-disabled").attr({tabindex:"0","aria-hidden":"false"}),o.find(".wc-item-reorder-nav .wc-move-up").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"}),i.find(".wc-item-reorder-nav .wc-move-down").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"})}),t(".wc-item-reorder-nav").closest("table").trigger("updateMoveButtons"),t(".submit button").on("click",function(){if("specific"===t("select#woocommerce_allowed_countries").val()&&!t('[name="woocommerce_specific_allowed_countries[]"]').val())return!!window.confirm(woocommerce_settings_params.i18n_no_specific_countries_selected)}),t("#settings-other-payment-methods").on("click",function(e){"undefined"==typeof window.wcTracks.recordEvent&&"undefined"==typeof window.wc.tracks.recordEvent||(window.wc.tracks.recordEvent||window.wcTracks.recordEvent)("settings_payments_recommendations_other_options",{available_payment_methods:t.map(t("td.wc_payment_gateways_wrapper tbody tr[data-gateway_id] "),function(e){return t(e).attr("data-gateway_id")})})}),t(".woocommerce-save-button.components-button").on("click",function(e){t(this).attr("disabled")||t(this).addClass("is-busy")})})}(jQuery,woocommerce_settings_params,wp);
!function(t,e,i){t(function(){t("select#woocommerce_allowed_countries").on("change",function(){"specific"===t(this).val()?(t(this).closest("tr").next("tr").hide(),t(this).closest("tr").next().next("tr").show()):"all_except"===t(this).val()?(t(this).closest("tr").next("tr").show(),t(this).closest("tr").next().next("tr").hide()):(t(this).closest("tr").next("tr").hide(),t(this).closest("tr").next().next("tr").hide())}).trigger("change"),t("select#woocommerce_ship_to_countries").on("change",function(){"specific"===t(this).val()?t(this).closest("tr").next("tr").show():t(this).closest("tr").next("tr").hide()}).trigger("change"),t("input#woocommerce_manage_stock").on("change",function(){t(this).is(":checked")?t(this).closest("tbody").find(".manage_stock_field").closest("tr").show():t(this).closest("tbody").find(".manage_stock_field").closest("tr").hide()}).trigger("change"),t(".colorpick").iris({change:function(e,i){t(this).parent().find(".colorpickpreview").css({backgroundColor:i.color.toString()})},hide:!0,border:!0}).on("click focus",function(e){e.stopPropagation(),t(".iris-picker").hide(),t(this).closest("td").find(".iris-picker").show(),t(this).data("originalValue",t(this).val())}).on("change",function(){t(this).is(".iris-error")&&(t(this).data("originalValue").match(/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/)?t(this).val(t(this).data("originalValue")).trigger("change"):t(this).val("").trigger("change"))}),t("body").on("click",function(){t(".iris-picker").hide()}),t(function(){var i=!1;let o=t(".wp-list-table .check-column");t("input, textarea, select, checkbox").on("change",function(t){o.length&&o.has(t.target)||i||(window.onbeforeunload=function(){return e.i18n_nav_warning},i=!0)}),t(".submit :input, input#search-submit").on("click",function(){window.onbeforeunload=""})}),t("table.wc_gateways tbody, table.wc_shipping tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(e,i){return i.children().each(function(){t(this).width(t(this).width())}),i.css("left","0"),i},start:function(t,e){e.item.css("background-color","#f6f6f6")},stop:function(t,e){e.item.removeAttr("style"),e.item.trigger("updateMoveButtons")}}),t(".woocommerce").on("click",".select_all",function(){return t(this).closest("td").find("select option").prop("selected",!0),t(this).closest("td").find("select").trigger("change"),!1}),t(".woocommerce").on("click",".select_none",function(){return t(this).closest("td").find("select option").prop("selected",!1),t(this).closest("td").find("select").trigger("change"),!1}),t(".wc-item-reorder-nav").find(".wc-move-up, .wc-move-down").on("click",function(){var o=t(this),n=o.closest("tr");o.trigger("focus");var s=o.is(".wc-move-up"),c=o.is(".wc-move-down");if(s){var r=n.prev("tr");r&&r.length&&(r.before(n),i.a11y.speak(e.i18n_moved_up))}else if(c){var a=n.next("tr");a&&a.length&&(a.after(n),i.a11y.speak(e.i18n_moved_down))}o.trigger("focus"),o.closest("table").trigger("updateMoveButtons")}),t(".wc-item-reorder-nav").closest("table").on("updateMoveButtons",function(){var e=t(this),i=t(this).find("tbody tr:last"),o=t(this).find("tbody tr:first");e.find(".wc-item-reorder-nav .wc-move-disabled").removeClass("wc-move-disabled").attr({tabindex:"0","aria-hidden":"false"}),o.find(".wc-item-reorder-nav .wc-move-up").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"}),i.find(".wc-item-reorder-nav .wc-move-down").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"})}),t(".wc-item-reorder-nav").closest("table").trigger("updateMoveButtons"),t(".submit button").on("click",function(){if("specific"===t("select#woocommerce_allowed_countries").val()&&!t('[name="woocommerce_specific_allowed_countries[]"]').val())return!!window.confirm(woocommerce_settings_params.i18n_no_specific_countries_selected)}),t("#settings-other-payment-methods").on("click",function(e){"undefined"==typeof window.wcTracks.recordEvent&&"undefined"==typeof window.wc.tracks.recordEvent||(window.wc.tracks.recordEvent||window.wcTracks.recordEvent)("settings_payments_recommendations_other_options",{available_payment_methods:t.map(t("td.wc_payment_gateways_wrapper tbody tr[data-gateway_id] "),function(e){return t(e).attr("data-gateway_id")})})}),t(".woocommerce-save-button.components-button").on("click",function(e){t(this).attr("disabled")||t(this).addClass("is-busy")}),document.querySelectorAll("body.woocommerce_page_wc-settings #mainform .conditional.description").forEach(e=>{const i=t(e.dataset.dependsOn),o=e.dataset.showIfEquals;if(undefined===o||0===i.length)return;const n=()=>{e.style.visibility=i.val()===o?"visible":"hidden"};i.on("change",n),n()})})}(jQuery,woocommerce_settings_params,wp);

View File

@@ -65,8 +65,8 @@
var namespace = slider.vars.namespace,
touch = (( "ontouchstart" in window ) || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch,
// deprecating this idea, as devices are being released with both of these events
eventType = "click touchend keyup",
// we add a custom event so we can differentiate manually triggering events when needed.
eventType = "click touchend keyup flexslider-click",
watchedEvent = "",
watchedEventClearTimer,
easing = easings[slider.vars.easing] || "ease",
@@ -301,7 +301,7 @@
}
// setup flags to prevent event duplication
if (watchedEvent === "") {
if (watchedEvent === "" && event.type !== "flexslider-click") {
watchedEvent = event.type;
}
methods.setToClearWatchedEvent();
@@ -326,7 +326,7 @@
}
// setup flags to prevent event duplication
if (watchedEvent === "") {
if (watchedEvent === "" && event.type !== "flexslider-click") {
watchedEvent = event.type;
}
methods.setToClearWatchedEvent();
@@ -379,7 +379,7 @@
}
// setup flags to prevent event duplication
if (watchedEvent === "") {
if (watchedEvent === "" && event.type !== "flexslider-click") {
watchedEvent = event.type;
}
methods.setToClearWatchedEvent();
@@ -433,7 +433,7 @@
}
// setup flags to prevent event duplication
if (watchedEvent === "") {
if (watchedEvent === "" && event.type !== "flexslider-click") {
watchedEvent = event.type;
}
methods.setToClearWatchedEvent();
@@ -496,7 +496,7 @@
if ( ! scrolling || Number( new Date() ) - startT > fxms ) {
e.preventDefault();
if (!fade && slider.transitions) {
if (!fade) {
if (!slider.vars.animationLoop) {
dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1);
}
@@ -684,7 +684,7 @@
slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension;
}
slider.setProps(slideString, "", slider.vars.animationSpeed);
if (slider.transitions) {
if (!slider.vars.animationLoop || !slider.atEnd) {
slider.animating = false;
slider.currentSlide = slider.animatingTo;
@@ -703,20 +703,6 @@
slider.wrapup(dimension);
}, slider.vars.animationSpeed + 100);
} else {
var prop = slider.prop;
slider.container.each(function() {
var container = this;
var currentStyle = {};
currentStyle[prop] = container.style[prop];
container.animate([currentStyle, slider.args], { duration: slider.vars.animationSpeed, easing: easing }).onfinish = function() {
container.style[prop] = slider.args[prop];
slider.wrapup(dimension);
};
});
}
} else { // FADE:
// if (!touch) calls slider.wrapup() on fade animation end; if (touch) calls slider.wrapup() immediately
if (!touch) {
@@ -824,16 +810,17 @@
return (posCalc * ((slider.vars.rtl)?1:-1)) + "px";
}());
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
slider.container.css("transition-duration", dur);
if (slider.transitions) {
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + (parseInt(target)+'px') + ",0,0)";
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
slider.container.css("transition-duration", dur);
} else {
slider.container.css("transition-timing-function", easing);
}
slider.args[slider.prop] = target;
if (slider.transitions || dur === undefined) { slider.container.css(slider.args); }
slider.container.css('transform',target);
slider.container.css(slider.args);
};
slider.setup = function(type) {

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
/* global Cookies */
jQuery( function( $ ) {
// Select all elements with the class [role="alert"] attribute that contain text
var notices = $('[role="alert"]').filter(function() {
return $(this).text().trim().length > 0;
});
if (notices.length > 0) {
/**
* Queuing the focus event at last of the event queue
* to override any other focus events in case of critical error.
* For example, "Skip to content" was being focused just after
* the error, resulting in the voiceover breaking the message
* in between.
*/
setTimeout(function() {
$(notices[0]).attr('tabindex', '-1').focus();
});
}
});

View File

@@ -0,0 +1 @@
jQuery(function(t){var e=t('[role="alert"]').filter(function(){return t(this).text().trim().length>0});e.length>0&&setTimeout(function(){t(e[0]).attr("tabindex","-1").focus()})});

View File

@@ -668,7 +668,7 @@
var slideToImage = $gallery_nav.find( 'li img[src="' + variation.image.gallery_thumbnail_src + '"]' );
if ( slideToImage.length > 0 ) {
slideToImage.trigger( 'click' );
slideToImage.trigger( 'flexslider-click' );
$form.attr( 'current-image', variation.image_id );
window.setTimeout( function() {
$( window ).trigger( 'resize' );

File diff suppressed because one or more lines are too long