1jQuery(document).ready(function($) { 2 3 jQuery(".wdgk_donation").on('keyup', function(e) { 4 if (e.keyCode == 13) { 5 jQuery(this).closest('.wdgk_donation_content').find(".wdgk_add_donation").trigger("click"); 6 } 7 }); 8 jQuery('body').on("click", ".wdgk_add_donation", function() { 9 10 var note = ""; 11 12 var price = jQuery(this).closest('.wdgk_donation_content').find("input[name='donation-price']").val(); 13 14 if (jQuery(this).closest('.wdgk_donation_content').find('.donation_note').val()) { 15 var note = jQuery(this).closest('.wdgk_donation_content').find('.donation_note').val(); 16 } 17 var ajaxurl = jQuery('.wdgk_ajax_url').val(); 18 var product_id = jQuery(this).attr('data-product-id'); 19 var redirect_url = jQuery(this).attr('data-product-url'); 20 21 if (price == "") { 22 jQuery(this).closest('.wdgk_donation_content').find(".wdgk_error_front").text("Please enter a value!!"); 23 return false; 24 } else { 25 var pattern = new RegExp(/^[0-9.*]/); 26 if (!pattern.test(price) || price < 0.01) { 27 jQuery(this).closest('.wdgk_donation_content').find(".wdgk_error_front").text("Please enter valid value!!"); 28 return false; 29 } 30 } 31 if (!jQuery.isNumeric(price)) { 32 jQuery(this).closest('.wdgk_donation_content').find(".wdgk_error_front").text("Please enter numeric value!!"); 33 return false; 34 } 35 jQuery(this).closest('.wdgk_donation_content').find('.wdgk_loader').removeClass("wdgk_loader_img"); 36 setCookie('wdgk_product_price', price, 1); 37 setCookie('wdgk_donation_note', note, 2); 38 39 jQuery.ajax({ 40 url: ajaxurl, 41 data: { 42 action: 'wdgk_donation_form', 43 product_id: product_id, 44 price: price, 45 note: note, 46 redirect_url: redirect_url 47 }, 48 type: 'POST', 49 success: function(data) { 50 var redirect = jQuery.parseJSON(data); 51 if (redirect.error == "true") { 52 jQuery(this).closest('.wdgk_donation_content').find(".wdgk_error_front").text("Please enter valid value!!"); 53 jQuery(this).closest('.wdgk_donation_content').find('.wdgk_loader').addClass("wdgk_loader_img"); 54 return false; 55 } else { 56 document.location.href = redirect.url; 57 } 58 } 59 }); 60 }); 61 62 63 64}); 65 66function setCookie(cname, cvalue, exdays) { 67 var d = new Date(); 68 d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000); 69 var expires = "expires=" + d.toUTCString(); 70 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 71} 72 73function getCookie(cname) { 74 var name = cname + "="; 75 var ca = document.cookie.split(";"); 76 for (var i = 0; i < ca.length; i++) { 77 var c = ca[i]; 78 while (c.charAt(0) == " ") { 79 c = c.substring(1); 80 } 81 if (c.indexOf(name) == 0) { 82 return c.substring(name.length, c.length); 83 } 84 } 85 return ""; 86}
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.