// source --> https://www.emw.com/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=3.5.7 jQuery(function(e){if("undefined"==typeof wc_add_to_cart_params)return!1;var t=function(){e(document.body).on("click",".add_to_cart_button",this.onAddToCart).on("click",".remove_from_cart_button",this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("added_to_cart",this.updateCartPage).on("added_to_cart removed_from_cart",this.updateFragments)};t.prototype.onAddToCart=function(t){var a=e(this);if(a.is(".ajax_add_to_cart")){if(!a.attr("data-product_id"))return!0;t.preventDefault(),a.removeClass("added"),a.addClass("loading");var o={};e.each(a.data(),function(t,a){o[t]=a}),e(document.body).trigger("adding_to_cart",[a,o]),e.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),o,function(t){t&&(t.error&&t.product_url?window.location=t.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?e(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash,a]):window.location=wc_add_to_cart_params.cart_url)})}},t.prototype.onRemoveFromCart=function(t){var a=e(this),o=a.closest(".woocommerce-mini-cart-item");t.preventDefault(),o.block({message:null,overlayCSS:{opacity:.6}}),e.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),{cart_item_key:a.data("cart_item_key")},function(t){t&&t.fragments?e(document.body).trigger("removed_from_cart",[t.fragments,t.cart_hash,a]):window.location=a.attr("href")}).fail(function(){window.location=a.attr("href")})},t.prototype.updateButton=function(t,a,o,r){(r=void 0!==r&&r)&&(r.removeClass("loading"),r.addClass("added"),wc_add_to_cart_params.is_cart||0!==r.parent().find(".added_to_cart").length||r.after(' '+wc_add_to_cart_params.i18n_view_cart+""),e(document.body).trigger("wc_cart_button_updated",[r]))},t.prototype.updateCartPage=function(){var t=window.location.toString().replace("add-to-cart","added-to-cart");e(".shop_table.cart").load(t+" .shop_table.cart:eq(0) > *",function(){e(".shop_table.cart").stop(!0).css("opacity","1").unblock(),e(document.body).trigger("cart_page_refreshed")}),e(".cart_totals").load(t+" .cart_totals:eq(0) > *",function(){e(".cart_totals").stop(!0).css("opacity","1").unblock(),e(document.body).trigger("cart_totals_refreshed")})},t.prototype.updateFragments=function(t,a){a&&(e.each(a,function(t){e(t).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),e.each(a,function(t,a){e(t).replaceWith(a),e(t).stop(!0).css("opacity","1").unblock()}),e(document.body).trigger("wc_fragments_loaded"))},new t}); // source --> https://www.emw.com/wp-content/plugins/wpfront-notification-bar/jquery-plugins/jquery.c.js?ver=1.4.0 /*! * jQuery Cookie Plugin v1.4.0 * https://github.com/carhartl/jquery-cookie * * Copyright 2013 Klaus Hartl * Released under the MIT license */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as anonymous module. define(['jquery'], factory); } else { // Browser globals. factory(jQuery); } }(function ($) { var pluses = /\+/g; function encode(s) { return config.raw ? s : encodeURIComponent(s); } function decode(s) { return config.raw ? s : decodeURIComponent(s); } function stringifyCookieValue(value) { return encode(config.json ? JSON.stringify(value) : String(value)); } function parseCookieValue(s) { if (s.indexOf('"') === 0) { // This is a quoted cookie as according to RFC2068, unescape... s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } try { // Replace server-side written pluses with spaces. // If we can't decode the cookie, ignore it, it's unusable. s = decodeURIComponent(s.replace(pluses, ' ')); } catch(e) { return; } try { // If we can't parse the cookie, ignore it, it's unusable. return config.json ? JSON.parse(s) : s; } catch(e) {} } function read(s, converter) { var value = config.raw ? s : parseCookieValue(s); return $.isFunction(converter) ? converter(value) : value; } var config = $.cookie = function (key, value, options) { // Write if (value !== undefined && !$.isFunction(value)) { options = $.extend({}, config.defaults, options); if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); } return (document.cookie = [ encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // Read var result = key ? undefined : {}; // To prevent the for loop in the first place assign an empty array // in case there are no cookies at all. Also prevents odd result when // calling $.cookie(). var cookies = document.cookie ? document.cookie.split('; ') : []; for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); var name = decode(parts.shift()); var cookie = parts.join('='); if (key && key === name) { // If second argument (value) is a function it's a converter... result = read(cookie, value); break; } // Prevent storing a cookie that we couldn't decode. if (!key && (cookie = read(cookie)) !== undefined) { result[name] = cookie; } } return result; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) !== undefined) { // Must not alter options, thus extending a fresh object... $.cookie(key, '', $.extend({}, options, { expires: -1 })); return true; } return false; }; })); // source --> https://www.emw.com/wp-content/plugins/wpfront-notification-bar/js/wpfront-notification-bar.js?ver=1.7.1 /* WPFront Notification Bar Plugin Copyright (C) 2013, WPFront.com Website: wpfront.com Contact: syam@wpfront.com WPFront Notification Bar Plugin is distributed under the GNU General Public License, Version 3, June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA */ (function() { var $ = jQuery; //displays the notification bar window.wpfront_notification_bar = function(data) { var keep_closed_cookie = "wpfront-notification-bar-keep-closed"; var spacer = $("#wpfront-notification-bar-spacer").show(); var bar = $("#wpfront-notification-bar"); var open_button = $("#wpfront-notification-bar-open-button"); //set the position if (data.position == 1) { var top = 0; if (data.fixed_position && data.is_admin_bar_showing) { top = $("html").css("margin-top"); if (top == "0px") top = $("html").css("padding-top"); top = parseInt(top); } if (data.fixed_position) { top += data.position_offset; } bar.css("top", top + "px"); open_button.css("top", top + "px"); $("body").prepend(spacer); spacer.css("top", data.position_offset + "px"); } else { $("body").append(spacer); bar.css("bottom", "0px"); } var height = bar.height(); if (data.height > 0) { height = data.height; bar.find("table, tbody, tr").css("height", "100%"); } bar.height(0).css({"position": (data.fixed_position ? "fixed" : "relative"), "visibility": "visible"}); open_button.css({"position": (data.fixed_position ? "fixed" : "absolute")}); //function to set bar height based on options var closed = false; var user_closed = false; function setHeight(height, callback, userclosed) { callback = callback || $.noop; if (userclosed) user_closed = true; if (height == 0) { if (closed) return; closed = true; } else { if (!closed) return; closed = false; } var fn = callback; callback = function() { fn(); if (height > 0) { //set height to auto if in case content wraps on resize if (data.height == 0) bar.height("auto"); open_button.hide(); closed = false; } if (height == 0 && data.display_open_button) { open_button.show(); } if (height == 0 && data.keep_closed && userclosed) { if (data.keep_closed_for > 0) $.cookie(keep_closed_cookie, 1, {path: "/", expires: data.keep_closed_for}); else $.cookie(keep_closed_cookie, 1, {path: "/"}); } }; //set animation if (data.animate_delay > 0) { bar.stop().animate({"height": height + "px"}, data.animate_delay * 1000, "swing", callback); if (data.fixed_position) spacer.stop().animate({"height": height + "px"}, data.animate_delay * 1000); } else { bar.height(height); if (data.fixed_position) spacer.height(height); callback(); } } if (data.close_button) { bar.find(".wpfront-close").click(function() { setHeight(0, null, true); }); } //close button action if (data.button_action_close_bar) { bar.find(".wpfront-button").click(function() { setHeight(0, null, true); }); } if (data.display_open_button) { open_button.click(function() { setHeight(height); }); } if (data.keep_closed) { if ($.cookie(keep_closed_cookie)) { setHeight(0); return; } } closed = true; if (data.display_scroll) { setHeight(0); $(window).scroll(function() { if (user_closed) return; if ($(this).scrollTop() > data.display_scroll_offset) { setHeight(height); } else { setHeight(0); } }); } else { //set open after seconds and auto close seconds. setTimeout(function() { setHeight(height, function() { if (data.auto_close_after > 0) { setTimeout(function() { setHeight(0, null, true); }, data.auto_close_after * 1000); } }); }, data.display_after * 1000); } }; })(); // source --> https://www.emw.com/wp-content/plugins/js_composer/assets/js/vendors/woocommerce-add-to-cart.js?ver=5.7 window.jQuery( document ).ready( function ( $ ) { $( 'body' ).on( 'adding_to_cart', function ( event, $button, data ) { $button && $button.hasClass( 'vc_gitem-link' ) && $button .addClass( 'vc-gitem-add-to-cart-loading-btn' ) .parents( '.vc_grid-item-mini' ) .addClass( 'vc-woocommerce-add-to-cart-loading' ) .append( $( '
' ) ); } ).on( 'added_to_cart', function ( event, fragments, cart_hash, $button ) { if ( 'undefined' === typeof($button) ) { $button = $( '.vc-gitem-add-to-cart-loading-btn' ); } $button && $button.hasClass( 'vc_gitem-link' ) && $button .removeClass( 'vc-gitem-add-to-cart-loading-btn' ) .parents( '.vc_grid-item-mini' ) .removeClass( 'vc-woocommerce-add-to-cart-loading' ) .find( '.vc_wc-load-add-to-loader-wrapper' ).remove(); } ); } );