/*! jQuery Migrate v3.4.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ "undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.1";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e\x20\t\r\n\f]*)[^>]*)\/>/gi;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(F,"<$1>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(F,"<$1>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var D,W,_,I=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?I.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(D=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(W=s.Deferred,_=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=W(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(_,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=W.exceptionHook),s}); ; jQuery(document).ready(function($) { /** First Visit Popup Start */ if (jQuery("div").hasClass("wdpgk_donation_modal")) { var user = getCookie("wdpgk_donation_modal"); if (user == "" && user != 1) { var wdpgk_cookie_time = jQuery("input[name=wdpgk_cookie_time]").val(); var wdpgk_delay_time = jQuery("input[name=wdpgk_delay_time]").val(); if (wdpgk_cookie_time == "") { wdpgk_cookie_time = 365; } setTimeout(function() { jQuery(".wdpgk_donation_modal").removeClass("wdpgk_hidden"); jQuery(".wdpgk_donation_modal").fadeIn(); jQuery(".wdpgk_overlay").fadeIn(); setCookie("wdpgk_donation_modal", "1", wdpgk_cookie_time); }, wdpgk_delay_time); } jQuery("body").on("click", ".wdpgk_donation_modal .wdpgk-close-modal", function() { jQuery(".wdpgk_donation_modal").fadeOut(); jQuery(".wdpgk_overlay").fadeOut(); }); } /** First Visit Popup End */ jQuery(".wdpgk_donation").on('keyup', function(e) { if (e.keyCode == 13) { jQuery(this).closest('.wdpgk_donation_content').find(".wdpgk_add_donation").trigger("click"); } }); jQuery('body').on("change", ".wdpgk_donation_select", function() { var cur_opt = jQuery(this).find('option:selected').attr('data-val'); if (cur_opt == "custom-amt") { jQuery(this).closest('.wdpgk_donation_content').find(".wdpgk_predife_cus_val").toggleClass('wdpgk_hidden'); } else { jQuery(this).closest('.wdpgk_donation_content').find(".wdpgk_predife_cus_val").addClass('wdpgk_hidden'); } }); jQuery('body').on("click", ".wdpgk_add_donation", function() { var note = ""; var price = ""; $this = jQuery(this); if (jQuery(this).closest('.wdpgk_donation_content').find('.wdpgk_donation').hasClass('wdpgk_donation_select')) { var price = jQuery(this).closest('.wdpgk_donation_content').find('.wdpgk_donation option:selected').attr('data-val'); if (price == "custom-amt") { var price = jQuery(this).closest('.wdpgk_donation_content').find("input[name='donation-cus-price']").val(); } } if (jQuery(this).closest('.wdpgk_donation_content').find('.wdpgk_donation').hasClass('wdpgk_donation_text')) { var price = jQuery(this).closest('.wdpgk_donation_content').find('.wdpgk_donation').val(); } var displayoption = jQuery(".wdpgk_donation").prop("type"); if (jQuery(this).closest('.wdpgk_donation_content').find('.donation_note').val()) { var note = jQuery(this).closest('.wdpgk_donation_content').find('.donation_note').val(); } var ajaxurl = jQuery('.wdpgk_ajax_url').val(); var product_id = jQuery(this).attr('data-product-id'); var redirect_url = jQuery(this).attr('data-product-url'); var campaignname = jQuery(this).closest('.wdpgk_donation_content').find('select[name=campaign-option]').val(); var min_amt = jQuery(".wdpgk_free_amt").attr('data-min-amt'); var max_amt = jQuery(".wdpgk_free_amt").attr('data-max-amt'); var cur_syambols = jQuery(this).closest('.wdpgk_donation_content').find(".cur_syambols").text(); if (price == "") { jQuery(".wdpgk_error_front").text("Please enter value!!"); return false; } else { var pattern = new RegExp(/^[0-9.*]/); if (!pattern.test(price) || price < 0.01) { jQuery(".wdpgk_error_front").text("Please enter valid value!!"); return false; } else { if (displayoption == "text") { if (parseInt(min_amt) > parseInt(price)) { jQuery(this).closest('.wdpgk_donation_content').find(".wdpgk_error_front").text("Donation amount shoud be greater than " + cur_syambols + "" + min_amt + "."); return false; } else { jQuery(".wdpgk_donation_content .wdpgk_error_front").text(''); } if (parseInt(max_amt) < parseInt(price)) { jQuery(this).closest('.wdpgk_donation_content').find(".wdpgk_error_front").text("Donation amount shoud be less than " + cur_syambols + "" + max_amt + "."); return false; } else { jQuery(".wdpgk_donation_content .wdpgk_error_front").text(''); } } } } if (!jQuery.isNumeric(price)) { jQuery(".wdpgk_error_front").text("Please enter numeric value !!"); return false; } jQuery(this).closest('.wdpgk_donation_content').find('.wdpgk_loader').removeClass("wdpgk_loader_img"); setCookie('wdpgk_product_price', price, 1); setCookie('wdpgk_donation_note', note, 1); setCookie('wdpgk_campaign_name', campaignname, 1); jQuery.ajax({ url: ajaxurl, data: { action: 'wdpgk_donation_form', product_id: product_id, price: price, note: note, redirect_url: redirect_url }, type: 'POST', success: function(data) { var data = jQuery.parseJSON(data); if (data.pro_error == 1) { jQuery(".wdpgk_error_front").text("There is no product for donation."); $this.closest('.wdpgk_donation_content').find('.wdpgk_loader').addClass("wdpgk_loader_img"); $this.closest('.wdpgk_donation_content').find('.wdpgk_loader').addClass("wdpgk_loader_img"); return false; } else { if (data.error == "true") { jQuery(".wdpgk_error_front").text("Please enter valid value!!"); $this.closest('.wdpgk_donation_content').find('.wdpgk_loader').addClass("wdpgk_loader_img"); return false; } else { document.location.href = data.url; } } } }); }); jQuery("body").on("click", ".wdpgk-popup-btn", function() { jQuery(".wdpgk-common-popup").css("display", "inline-flex"); return false; }); jQuery("body").on("click", ".wdpgk-common-popup .wdpgk-close-popup", function() { jQuery(".wdpgk-common-popup").fadeOut(); return false; }); }); function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000); var expires = "expires=" + d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(";"); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == " ") { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }; /*! This file is auto-generated */ !function(){function t(){var t,e=document.createElement("script");return e.src=_zxcvbnSettings.src,e.type="text/javascript",e.async=!0,(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t)}null!=window.attachEvent?window.attachEvent("onload",t):window.addEventListener("load",t,!1)}.call(this);;