1var wishlistFlag = false; 2var prodId = '', prodName = '', prodPrice = '', prodCatName = ''; 3jQuery(document).ready(function() { 4 /* WISHLIST */ 5 $(document).on('click', '.wishlisht_button', function(event) { 6 if(wishlistFlag){ 7 return false; 8 } 9 wishlistFlag = true; 10 event.preventDefault(); 11 12 var $data = $(this).data(); 13 var $text = $(this).find('label'); 14 var $input = $(this).find('input'); 15 $.ajax({ 16 url: './ext/wishlist/ajax_wishlist.php', 17 type: 'POST', 18 dataType: 'json', 19 data: { 20 request: 'wishlist', 21 action: $input.is(':checked')?'delete':'add', 22 id: $data.id 23 }, 24 success: function(callback) { 25 wishlistFlag = false; 26 $text.html(callback.text); 27 $input.is(':checked')?$input.prop('checked', false):$input.prop('checked', true); 28 if($input.is(':checked') && typeof doHookie != 'undefined'){ 29 //prepare params for analytics 30 //product detail page 31 prodId = document.getElementById('products_id') ? document.getElementById('products_id').value : ''; 32 prodName = $('.product_page .category_heading').text(); 33 prodPrice = document.querySelector('input[name=prod_price_orign]') ? document.querySelector('input[name=prod_price_orign]').value : ""; 34 prodCatName = document.querySelector('input[name=prod_category_name]') ? document.querySelector('input[name=prod_category_name]').value : ""; 35 //others pages 36 prodId = prodId == '' ? $data.id : prodId; 37 prodPrice = prodPrice == '' ? callback.price : prodPrice; 38 prodName = prodName == '' ? callback.name : prodName; 39 prodCatName = prodCatName == '' ? callback.categoryName : prodCatName; 40 doHookie('add_to_wishlist'); 41 } 42 $('[name="wishlist_'+$data.id+'"]').prop('checked',$input.is(':checked'));
43 // Wishlish box 44 $.get('./ext/wishlist/r_wishlist_box2.php', { 45 method: 'ajax', 46 wishlist_id: $data.id 47 }, function(data2) { 48 // if (data2 == '') $('#wishlist_box2').fadeOut(300); 49 // else { 50 $('#wishlist_box2').replaceWith(data2); 51 // if ($('#wishlist_box2').css('display') == 'none') $('#wishlist_box2').fadeIn(300); 52 // } 53 }); 54 } 55 }); 56 }); 57 /* /WISHLIST */ 58});
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.