PageSourceSearch

https://greenspoon.co.ke/wp-content/plugins/greenspoon-product-carousel/assets/js/carousel.min.js?ver=1.2.18

js greenspoon.co.ke collected 2026-10-01 15:12:52 UTC 4,538 bytes, 1 lines download raw bytes

1jQuery(document).ready(function(t){function e(t){t.removeClass("loading").addClass("ready"),t.find(".swiper-wrapper").fadeIn(300)}function n(e){const n=e.find("form.variations_form");0!==n.length&&(void 0!==t.fn.wc_variation_form?n.wc_variation_form():"undefined"!=typeof wc_variation_form?wc_variation_form(n):function(e){e.addClass("variations_form");const n=e.find('input[name="variation_id"]');n.length&&e.find("select").on("change",function(){const n=t(this);n.attr("name"),n.val();o(e)})}(n),"undefined"!=typeof wc_quantity_buttons&&e.find(".quantity").each(function(){t(this).wc_quantity_buttons()}),t(document.body).trigger("wc_fragments_refreshed"),t(document.body).trigger("wc_fragments_loaded"),n.on("woocommerce_variation_has_changed",function(){o(n)}),n.find("select").on("change",function(){setTimeout(()=>{o(n)},100)}))}function o(t){const e=t.find(".single_add_to_cart_button"),n=t.find('input[name="variation_id"]').val();n&&""!==n?(e.removeClass("disabled wc-variation-selection-needed"),e.prop("disabled",!1)):(e.addClass("disabled wc-variation-selection-needed"),e.prop("disabled",!0))}t(".gs-product-carousel").each(function(){const n=t(this);n.find(".swiper-wrapper").hide(),n.addClass("loading"),setTimeout(()=>{e(n)},800)}),function(){if("undefined"==typeof Swiper)return console.warn("Swiper.js is not loaded. Carousel will not function."),void t(".gs-product-carousel").each(function(){e(t(this))});t(".gs-product-carousel").each(function(){const n=t(this);if(!n.length||!n[0])return;const o=parseInt(n.attr("data-slides-to-show"))||4,a="true"===n.attr("data-autoplay"),i="true"===n.attr("data-arrows"),s="true"===n.attr("data-dots"),r="true"===n.attr("data-infinite"),d=n.find(".swiper-slide").length,c=o>1,u={slidesPerView:c?2.2:1,spaceBetween:10,loop:r&&d>o,autoplay:!!a&&{delay:6e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},navigation:!!i&&{nextEl:n.find(".gs-nav-next")[0],prevEl:n.find(".gs-nav-prev")[0]},pagination:!!s&&{el:n.find(".swiper-pagination")[0],clickable:!0},breakpoints:{480:{slidesPerView:c?2.35:1,spaceBetween:12},768:{slidesPerView:c?Math.min(3,o):1,spaceBetween:15},1024:{slidesPerView:o,spaceBetween:20}},on:{init:function(){e(n)},afterInit:function(){n.hasClass("loading")&&e(n)}}};try{const t=new Swiper(n[0],u);a&&t.autoplay&&setTimeout(()=>{try{t.autoplay.start()}catch(t){console.warn("Swiper autoplay failed:",t)}},1e3)}catch(t){console.error("Swiper initialization failed:",t),e(n)}})}(),t(document).on("click",".gs-quick-shop-link",function(e){e.preventDefault();const n=t(this),o=n.data("product-id"),a=n.html();n.text("Adding...").css("color","#008600");const i=()=>{n.text("Added ").css("color","#008600").addClass("gs-added-success"),setTimeout(()=>{n.html(a).css("color","").removeClass("gs-added-success")},2e3)},s=(t="Error!")=>{n.text(t).css("color","#ff0000"),setTimeout(()=>{n.html(a).css("color","")},2e3)};if("undefined"==typeof wpApiSettings||!wpApiSettings.root||!wpApiSettings.nonce)return void s("Missing API settings");const r=wpApiSettings.root+"greenspoon/gs_quick_shop_save",d={product_id:o},c={"X-WP-Nonce":wpApiSettings.nonce};t.ajax({url:r,type:"POST",data:d,headers:c}).done((t,e,n)=>{i()}).fail((t,e,n)=>{console.error("[QuickShop] REST error",{status:t&&t.status,statusText:t&&t.statusText,responseText:t&&t.responseText,responseJSON:t&&t.responseJSON,textStatus:e,errorThrown:n}),t&&t.responseJSON&&"already_added"===t.responseJSON.code?i():s("Something went wrong")})}),t(document).on("submit",".gs-product-card form.cart",function(e){const n=t(this),o=n.find('input[name="quantity"]'),a=n.find('button[name="add-to-cart"]'),i=n.find('input[name="add-to-cart"]');if(o.length&&a.length){const t=o.val()||"1";a.attr("data-quantity",t),i.length&&i.val(t)}}),t(document).on("change",'.gs-product-card input[name="quantity"]',function(){const e=t(this),n=e.closest("form"),o=n.find('button[name="add-to-cart"]'),a=n.find('input[name="add-to-cart"]');if(o.length){const t=e.val()||"1";o.attr("data-quantity",t),a.length&&a.val(t)}}),function(){if("undefined"!=typeof MutationObserver){const o=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEac
1h(function(e){if(1===e.nodeType){const o=t(e);o.hasClass("gs-variation-form-wrapper")?n(o):o.find(".gs-variation-form-wrapper").each(function(){n(t(this))})}})})});function e(){t(".gs-product-carousel").each(function(){o.observe(this,{childList:!0,subtree:!0})})}"loading"===document.readyState?t(document).ready(e):e()}t(".gs-variation-form-wrapper").each(function(){n(t(this))})}()});

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.