1// source --> https://arinakireeva.ru/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js?ver=11.0.1 2function on_keydown_remove_from_cart(e){" "===e.key&&(e.preventDefault(),e.currentTarget.click())}function focus_populate_live_region(){var e=["woocommerce-message","woocommerce-error","wc-block-components-notice-banner"].map(function(e){return"."+e+'[role="alert"]'}).join(", "),o=document.querySelectorAll(e);if(0!==o.length){var t=o[0];t.setAttribute("tabindex","-1");var n=setTimeout(function(){t.focus(),clearTimeout(n)},500)}}function refresh_sorted_by_live_region(){var e=document.querySelector(".woocommerce-result-count"),o=document.querySelector('[data-wp-interactive="woocommerce/product-filters"]');if(e&&window.location.search&&!o){var t=e.innerHTML;e.setAttribute("role","alert"),e.setAttribute("aria-hidden","true");var n=setTimeout(function(){e.setAttribute("aria-hidden","false"),e.innerHTML="",e.innerHTML=t,clearTimeout(n)},2e3)}}function on_document_ready(){focus_populate_live_region(),refresh_sorted_by_live_region()}jQuery(function(e){e(".woocommerce-ordering").on("change","select.orderby",function(){e(this).closest("form").trigger("submit")}),e("input.qty:not(.product-quantity input.qty)").each(function(){var o=parseFloat(e(this).attr("min"));o>=0&&parseFloat(e(this).val())<o&&e(this).val(o)});var o="store_notice"+(e(".woocommerce-store-notice").data("noticeId")||"");if("hidden"===Cookies.get(o))e(".woocommerce-store-notice").hide();else{function t(o){["Enter"," "].includes(o.key)&&(o.preventDefault(),e(".woocommerce-store-notice__dismiss-link").click())}e(".woocommerce-store-notice").show(),e(".woocommerce-store-notice__dismiss-link").on("click",function n(r){Cookies.set(o,"hidden",{path:"/"}),e(".woocommerce-store-notice").hide(),r.preventDefault(),e(".woocommerce-store-notice__dismiss-link").off("click",n).off("keydown",t)}).on("keydown",t)}e(".woocommerce-input-wrapper span.description").length&&e(document.body).on("click",function(){e(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),e(".woocommerce-input-wrapper").on("click",function(e){e.stopPropagation()}),e(".woocommerce-input-wrapper :input").on("keydown",function(o){var t=e(this).parent().find("span.description");if(27===o.which&&t.length&&t.is(":visible"))return t.prop("aria-hidden",!0).slideUp(250),o.preventDefault(),!1}).on("click focus",function(){var o=e(this).parent(),t=o.find("span.description");o.addClass("currentTarget"),e(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),t.length&&t.is(":hidden")&&t.prop("aria-hidden",!1).slideDown(250),o.removeClass("currentTarget")}),e.scroll_to_notices=function(o){o.length&&e("html, body").animate({scrollTop:o.offset().top-100},1e3)},e('.woocommerce form .woocommerce-Input[type="password"]').wrap('<span class="password-input"></span>'),e(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),e(".password-input").each(function(){const o=e(this).find("input").attr("id");e(this).append('<button type="button" class="show-password-input" aria-label="'+woocommerce_params.i18n_password_show+'" aria-describedBy="'+o+'"></button>')}),e(".show-password-input").on("click",function(o){o.preventDefault(),e(this).hasClass("display-password")?(e(this).removeClass("display-password"),e(this).attr("aria-label",woocommerce_params.i18n_password_show)):(e(this).addClass("display-password"),e(this).attr("aria-label",woocommerce_params.i18n_password_hide)),e(this).hasClass("display-password")?e(this).siblings(['input[type="password"]']).prop("type","text"):e(this).siblings('input[type="text"]').prop("type","password"),e(this).siblings("input").focus()}),e("a.coming-soon-footer-banner-dismiss").on("click",function(o){var t=e(o.target);e.ajax({type:"post",url:t.data("rest-url"),data:{woocommerce_meta:{coming_soon_banner_dismissed:"yes"}},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",t.data("rest-nonce"))},complete:function(){e("#coming-soon-footer-banner").hide()}})}),"undefined"==typeof wc_add_to_cart_params&&e(document.body).on("keydown",".remove_from_cart_button",on_keydown_remove_from_cart),e(document.body).on("item_removed_from_classic_cart updated_wc_div",focu
2s_populate_live_region)}),document.addEventListener("DOMContentLoaded",on_document_ready); 3// source --> https://arinakireeva.ru/wp-content/plugins/wr-custom-attributes/assets/js/front-end.js?ver=7.1.2 4/** 5 * @version 1.0 6 * @package WR_Custom_Attributes 7 * @author WooRockets Team <[email protected]> 8 * @copyright Copyright (C) 2014 WooRockets.com. All Rights Reserved. 9 * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html 10 * 11 * Websites: http://www.woorockets.com 12 */ 13 14( function( $ ) { 15 $.init_wr_custom_attributes = function() { 16 // Replace default attribute select box with custom attribute selector. 17 $('select[data-attribute_name]').each(function(i, e) { 18 var selector = $('#' + $(e).attr('id') + '_custom_attribute_selector'); 19 20 if (selector.length) { 21 $(e).before(selector.text()); 22 selector.remove(); 23 } else if ( ! $(e).prev('.wr-custom-attribute').length ) { 24 $(e).addClass('active-attribute-selector'); 25 } 26 }); 27 28 // Preload data for variation image gallery. 29 var 30 colors = $( '.wr-custom-attribute .has-image-gallery[data-value]' ), 31 selected = $( '.wr-custom-attribute .selected .has-image-gallery[data-value]' ); 32 33 delete window.wr_custom_attribute_data; 34 35 if ( selected.length ) { 36 // Load image gallery of the selected variation. 37 switch_image_gallery( selected[0], false, true ); 38 } 39 40 if ( colors.length ) { 41 // Load default image gallery of the product. 42 switch_image_gallery( colors[0], true, false ); 43 44 for (var i = 0; i < colors.length; i++) { 45 if ( ! selected.length || colors[i] != selected[0] ) { 46 setTimeout( (function(color) { 47 return function() { 48 switch_image_gallery( color, false, true ); 49 }; 50 })(colors[i]), 200 ); 51 } 52 } 53 } 54 55 else { 56 // No variation image gallery available, show product image gallery. 57 $( '.woocommerce-product-gallery' ).addClass( 'active-product-gallery' ); 58 } 59 60 // Initialize once... 61 if (window._wr_custom_attributes_initialized) { 62 return; 63 } 64 65 // Define function to switch between product image and variation image. 66 window.wr_set_variation_attr = window.wr_set_variation_attr || $.fn.wc_variations_image_update; 67 68 // Override WooCommerce function to update variation image. 69 $.fn.wc_variations_image_update = function( variation ) { 70 if ( variation && variation.thumb_image_src == null ) { 71 return; 72 } 73 74 // Store variation data. 75 window.wr_custom_variation = variation; 76 77 // Update variation image. 78 $( '.variations_form' ).each( function() { 79 window.wr_set_variation_attr.call( $(this), variation ); 80 } ); 81 }; 82 83 // Define function to switch product image gallery. 84 function switch_image_gallery( elm, reset, preload ) { 85 switch_image_gallery.preloading = switch_image_gallery.preloading || []; 86 87 if ( $( elm ).hasClass( 'has-image-gallery' ) ) { 88 // Get data from cache first. 89 var 90 cache = window.wr_custom_attribute_data || {}, 91 option = $( elm ).closest( '[data-attribute]' ).attr( 'data-attribute' ), 92 key = option + '::' + ( reset ? 'default' : $( elm ).attr( 'data-value' ) ); 93 94 if ( cache[ key ] ) { 95 // Switch image gallery. 96 if ( preload ) { 97 if ( $( elm ).parent().hasClass( 'selected' ) ) { 98 $( elm ).trigger('click'); 99 } 100 } else { 101 var 102 html = $( cache[ key ] ), 103 orig = $( '.' + html.attr('class').replace( /\s+/g, '.' ) ); 104 105 if ( orig.length ) { 106 var html_gallery = $( cache[ key ] ); 107 108 // Update gallery HTML. 109 orig.parent().html( html_gallery.addClass('active-product-gallery') ); 110 html_gallery.flexslider({ 111 animation: "slide", 112 controlNav: false, 113 animationLoop: false, 114 slideshow: false, 115 itemWidth: 90, 116 itemMargin: 10, 117 asNavFor: '.woocommerce-product-gallery--with-images' 118 }); 119 // Update variation image. 120 $( '.variations_form' ).each( function() { 121 window.wr_set_variation_attr.call( $(this), window.wr_custom_variation ); 122 } ); 123 124 // Init product image gallery. 125 if ( $.fn.wc_product_gallery ) { 126 html_gallery.wc_product_gallery(); 127 } 128 } 129 } 130 } 131 132 // No cached data found, request server for data once. 133 else if (switch_image_gallery.preloading.indexOf(key) < 0) { 134 var data = {}; 135 136 if ( ! reset ) { 137 data[ 'attribute_' + option ] = $( elm ).attr( 'data-value' ); 138 } 139 140 $.ajax( { 141 url: $( elm ).attr( 'data-href' ), 142 type: 'post', 143 data: data, 144 complete: function( response ) { 145 // Update cache. 146 var 147 option = $( this ).closest( '[data-attribute]' ).attr( 'data-attribute' ), 148 key = option + '::' + ( reset ? 'default' : $( this ).attr( 'data-value' ) ); 149 150 window.wr_custom_attribute_data = window.wr_custom_attribute_data || {}; 151 152 window.wr_custom_attribute_data[ key ] = response.responseText; 153 154 // Switch image gallery. 155 switch_image_gallery( this, reset, preload ); 156 }, 157 context: elm 158 } ); 159 160 switch_image_gallery.preloading.push(key); 161 } 162 } 163 164 if ( $( '.flex-control-thumbs' ).length > 0 ) { 165 var thumb = $( '.flex-control-thumbs li' ).length; 166 167 if ( thumb > 5 ) { 168 $( '.flex-control-thumbs' ).scrollbar(); 169 } 170 } 171 } 172 173 // Setup custom attribute selection. 174 $(document).on( 'click', '.wr-custom-attribute [data-value]', function() { 175 var 176 option = $( this ).closest( '[data-attribute]' ).attr( 'data-attribute' ), 177 select = $( 'select#' + option ); 178 179 $( this ).parent().addClass( 'selected' ).siblings().removeClass( 'selected' ); 180 181 // Update hidden option field. 182 select.val( $( this ).attr( 'data-value' ) ).trigger( 'change' ); 183 184 // Switch image gallery if available. 185 switch_image_gallery( this ); 186 } ); 187 188 // Setup variation form selection. 189 $( '.variations_form' ).addClass( 'wr_variations_form' ).on( 'change', 'select[data-attribute_name]', function() { 190 // Auto-select option that has only 1 choice available. 191 setTimeout( function() { 192 $( '.variations_form select[data-attribute_name]' ).each( function( i, e ) { 193 if ( $( e ).val() == '' && $( e ).children( '[value!=""]' ).length == 1 ) { 194 $( e ).val( $( e ).children( '[value!=""]' ).attr( 'value' ) ).trigger( 'change' ); 195 } 196 } ); 197 }, 50 ); 198 199 // Refresh options available. 200 $( '.wr-custom-attribute[data-attribute]' ).each( function( i, e ) { 201 ( function( e ) { 202 setTimeout( function() { 203 var 204 option = $( e ).attr( 'data-attribute' ), 205 select = $( 'select#' + option ); 206 207 $( e ).children().each( function( i2, e2 ) { 208 if ( !select.children( '[value="' + $( e2 ).find( '[data-value]' ).attr( 'data-value' ) + '"]' ).length ) { 209 $( e2 ).hide(); 210 } else { 211 $( e2 ).show(); 212 } 213 } ); 214 }, 50 ); 215 } )( e ); 216 } ); 217 } ); 218 219 // Handle reset action. 220 $( document ).on( 'click', 'a.reset_variations', function() { 221 // Reset product image. 222 $.fn.wc_variations_image_update(); 223 224 // Reset product image gallery. 225 switch_image_gallery( $( '.wr-custom-attribute .selected' ).children( '[data-value]' ), true ); 226 227 // Reset custom attribute selection. 228 $( '.wr-custom-attribute .selected' ).removeClass( 'selected' ); 229 $( '.wr-custom-attribute .available-option' ).removeClass( 'available-option' ); 230 } ); 231 232 // Handle action when click to attribute on product list. 233 $( 'body' ).on( 'click', '.product__attr a', function() { 234 // Get variation image 235 var img = $( this ).data( 'image' ); 236 237 $( this ).parent().parent().parent().parent().find( '.product__image img' ).attr( 'src', img ) 238 } ); 239 240 window._wr_custom_attributes_initialized = true; 241 }; 242 243 if ( $.isReady ) { 244 $.init_wr_custom_attributes(); 245 } else { 246 $( document ).ready( $.init_wr_custom_attributes ); 247 } 248} )( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.