1var wdShop_starRaters; 2 3jQuery(document).ready(function () { 4 jQuery("[data-toggle=tooltip]").not(".modal [data-toggle=tooltip]").tooltip({container: ".wd_shop_tooltip_container"}); 5 wdShop_starRaters = {}; 6 jQuery(".wd_shop_star_rater").each(function () { 7 var productId = parseInt(jQuery(this).closest(".wd_shop_product").attr("product_id")); 8 wdShop_starRaters[productId] = new WdBsStarRater(jQuery(this)); 9 }); 10}); 11 12function wdShop_onBtnQuickViewClick(event, obj) { 13 wdShopQuickViewProductIndex = jQuery(".wd_shop_product").index(jQuery(obj).closest(".wd_shop_product")); 14 jQuery('#wd_shop_product_quick_view').modal(); 15} 16 17function wdShop_onBtnBuyNowClick(event, obj) { 18 var productId = jQuery(obj).closest(".wd_shop_product").attr("product_id"); 19 var count = 1; 20 var parameters = {}; 21 22 wdShop_mainForm_set("product_id", productId); 23 wdShop_mainForm_set("product_count", count); 24 wdShop_mainForm_set("product_parameters_json", JSON.stringify(parameters)); 25 26 wdShop_mainForm_setAction(jQuery(obj).attr("href")); 27 wdShop_mainForm_submit(); 28} 29 30function wdShop_onBtnAddToCartClick(event, obj) { 31 var jq_btn = jQuery(obj); 32 if (option_redirect_to_cart_after_adding_an_item == 2) { 33 if ((jq_btn.attr("disabled") != undefined) || (jq_btn.hasClass("disabled"))) { 34 return false; 35 } 36 jq_btn.addClass("disabled"); 37 } 38 jq_btn.attr("data-original-title", WD_SHOP_TEXT_PLEASE_WAIT); 39 jq_btn.tooltip("show"); 40 41 var productId = jq_btn.closest(".wd_shop_product").attr("product_id"); 42 var count = 1; 43 var parameters = {}; 44 var product_parameters_array = products_parameters; 45 var parameters_objects = product_parameters_array[productId]; 46 for (var key in parameters_objects) { 47 var id = parameters_objects[key]['id']; 48 var value; 49 var type_id = parameters_objects[key]['type_id']; 50 if (id) { 51 switch (type_id) { 52 // Input field 53 case '1': 54 // Radio 55 case '4': 56 value = ''; 57 break; 58 // Select 59 case '3': 60 value = '0'; 61 break; 62 // Checkbox 63 case '5': 64 value = []; 65 break; 66 } 67 } 68 if(id) { 69 parameters[id] = value; 70 } 71 } 72 73 jQuery.ajax({ 74 type: "POST", 75 url: wdShop_urlAddToShoppingCart, 76 data: { 77 "product_id": productId, 78 "product_count": count, 79 "product_parameters_json": JSON.stringify(parameters) 80 }, 81 complete: function () { 82 }, 83 success: function (result) { 84 var data = JSON.parse(result); 85 jq_btn.attr("data-original-title", data["msg"]); 86 jq_btn.tooltip("show"); 87 if (typeof wdShop_updateProductsInCart == 'function') { 88 wdShop_updateProductsInCart(data['products_in_cart']); 89 } 90 if ((data.product_added == true) && (wdShop_redirectToCart == true)) { 91 wdShop_mainForm_setAction(wdShop_urlDisplayShoppingCart); 92 wdShop_mainForm_submit(); 93 } 94 if ( jQuery(".minicart_module_container").length > 0 ) { 95 if (typeof wdef_load == 'function') { 96 wdef_load(window.location, 'minicart_module_container'); 97 } 98 } 99 }, 100 failure: function (errorMsg) { 101 alert(errorMsg); 102 } 103 }); 104}
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.