1ACC.updatewishlistaction = { 2 _autoload: [ 3 "bindChangeEvent", 4 "bindUpdateWishlistEntry", 5 "bindUpdaetRefinement" 6 ], 7 bindUpdateWishlistEntry: function(){ 8 $(".js-wishlist-product > div > button").on("click",function(){ 9 var products = []; 10 $(".wishlist-products .js-wishlist-entry").each(function(){ 11 var inputDOM = $(this).find(".js-qty-selector-input"); 12 var qty = inputDOM.val(); 13 var product = inputDOM.data("productcode"); 14 var priority = $(this).find("input[type='checkbox'][name^='priority_']").is(":checked"); 15 var comment = $(this).find("textarea").val(); 16 // prepare json data 17 if(product != null){ 18 products.push({ 'product':{'code':product}, 19 'quantity' : qty, 20 'priority' : priority, 21 'comment' : comment 22 }); 23 } 24 }); 25 if(products.length){ 26 ACC.donationwishlistaddon.updateWishlist({'key':$(this).data("key"),'products':products}); 27 } 28 }); 29 30 }, 31 bindUpdaetRefinement: function(){ 32 $(".js-wishlist-refinements > div > button").on("click",function(){ 33 var refinements = []; 34 $("input[type='checkbox'][name='refinements']:checked").each(function(){ 35 refinements.push($(this).val()); 36 }); 37 if(refinements.length){ 38 ACC.donationwishlistaddon.updateWishlist({'key':$(this).data("key"),'refinements':refinements}); 39 } 40 41 }); 42 43 }, 44 bindChangeEvent: function(){ 45 $(".js-wishlist-entry input[type='checkbox'][name^='priority_'] , .js-wishlist-entry textarea , .js-wishlist-entry input.js-qty-selector-input").on("change",function(){ 46 ACC.donationwishlistaddon.showSaveButton($('.js-wishlist-product')); 47 }); 48 $("input[type='checkbox'][name='refinements']").on("change",function(){ 49 ACC.donationwishlistaddon.showSaveButton($('.js-wishlist-refinements')); 50 }); 51 } 52 53} 54 55$(document).ready(function () 56{ 57 $('[data-toggle="tooltip"]').tooltip({ trigger: "hover" }); 58 $("#edit_wishListType").click(function(){ 59 var val = $.trim($("#wishListType").html()); 60 $("#wishListType").html('<div class="radio" style="padding-left:40px;"><label for="Private" style="margin-right:30px;padding-left:30px;font-family:Muli, sans-serif;" class="radio-button"><input type="radio" id="Private" name="wishlistType" value="Private">Private<span class="checkmark"></span></label><label for="Public" class="radio-button" style="padding-left:30px;font-family:Muli, sans-serif;" ><input type="radio" id="Public" name="wishlistType" value="Public">Public<span class="checkmark"></span></label></div>'); 61 $(".wishListType").toggle(); 62 $("#"+val).prop("checked",true); 63 }); 64 $("#edit_wishListStatus").click(function(){ 65 $('[data-toggle="tooltip"]').tooltip("disable"); 66 var val = $.trim($("#wishListStatus").html()); 67 $("#wishListStatus").html('<div class="radio" style="padding-left:40px;"><input type="radio" id="Published" name="wishListStatus" value="Publish"><label for="Published" style="margin-right:30px;">Publish</label><input type="radio" id="Not_Published" name="wishListStatus" value="Not Publish"><label for="Not_Published">Not Publish</label></div>'); 68 $(".wishListStatus").toggle(); 69 if(val == 'Not Published'){ 70 val = 'Not_Published'; 71 } 72 $("#"+val).prop("checked",true); 73 }); 74 75 76 $("#wishListType-action").click(function(){ 77 var dataUpdate = { 78 key: $("#wishListType-action").data("key"), 79 isPrivate: $("#Private").prop('checked') 80 } 81 ACC.donationwishlistaddon.updateWishlist(dataUpdate); 82 }); 83 $(".publishCheckbox").click(function(){ 84 var dataUpdate = { 85 key: $(this).data("key"), 86 published: $(this).prop('checked') 87 } 88 ACC.donationwishlistaddon.updateWishlist(dataUpdate); 89 }); 90 var content = $("#share-wishlist-content").html(); 91 if(typeof content !== 'undefined'){ 92 $("#share-wishlist-content").html(truncate(content,150,25)); 93 function truncate( str, n, useWordBoundary ){ 94 if (str.length <= n) { return str; } 95 const subString = str.substr(0, n-1); // the original check 96 return (useWordBoundary 97 ? subString.substr(0, subString.lastIndexOf(" ")) 98 : subString) + "…"; 99 } 100 } 101});
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.