1window.moAddToWishlist = (event) => { 2 const target = event.target.closest('.wishlist'); 3 let targetUrl = new URL(target.dataset.href); 4 const addToList = !target.classList.contains('wished'); 5 const aid = target.dataset.aid; 6 7 targetUrl.searchParams.append('anid', aid); 8 if (target.classList.contains('redirect')) { 9 targetUrl.searchParams.append('sourcetowishlist', aid); 10 window.location = targetUrl.href; 11 return; 12 } 13 targetUrl.searchParams.append('aid', aid); 14 const amount = addToList ? '1' : '0'; 15 targetUrl.searchParams.append('am', amount); 16 fetch( 17 targetUrl.href, 18 { 19 method: 'POST', 20 headers: { 21 'Accept': 'application/json' 22 }, 23 } 24 ).then((response) => { 25 if (!response.ok) { 26 throw {message: 'HTTP status code ' + response.status}; 27 } 28 return response.json(); 29 }).then((body) => { 30 $(target).toggleClass('wished', addToList); 31 const onWishlist = parseInt(body.total); 32 $('.js_wishlist').toggleClass('hidden', !onWishlist).text(onWishlist); 33 window.moWishlistArticleIds = body.articleIds; 34 }).catch((error) => { 35 console.error(error); 36 }); 37}; 38 39window.moGetWishlistArticlesAction = () => { 40 fetch( 41 `${location.origin}?cl=alist&fnc=getWishlistArticlesAction`, 42 { 43 method: 'POST', 44 headers: { 45 'Accept': 'application/json' 46 }, 47 } 48 ).then((response) => { 49 if (!response.ok) { 50 throw {message: 'HTTP status code ' + response.status}; 51 } 52 return response.json(); 53 }).then((body) => { 54 const onWishlist = body.length; 55 $('.js_wishlist').toggleClass('hidden', !onWishlist).text(onWishlist); 56 window.moWishlistArticleIds = body; 57 window.moWishlistArticleIds.forEach(id => { 58 let icon = document.querySelector(`[data-aid="${id}"]`); 59 if (icon) { 60 icon.classList.add('wished'); 61 } 62 }); 63 }).catch((error) => { 64 console.error(error); 65 }) 66}; 67 68window.moRemoveWishlistElement = (event) =>{ 69 const animateIt=event.target.animate([{fontSize:'14px'}, {fontSize:'1px'}], {duration: 2000, delay: 200}); 70 animateIt.play(); 71 const target = event.target.closest('.wishlist'); 72 const wishlistElement=event.target.closest('.notice_wrapper') 73 let targetUrl = new URL(target.dataset.href); 74 const addToList = !target.classList.contains('wished'); 75 const aid = target.dataset.aid; 76 77 targetUrl.searchParams.append('anid', aid); 78 if (target.classList.contains('redirect')) { 79 targetUrl.searchParams.append('sourcetowishlist', aid); 80 window.location = targetUrl.href; 81 return; 82 } 83 targetUrl.searchParams.append('aid', aid); 84 const amount = addToList ? '1' : '0'; 85 targetUrl.searchParams.append('am', amount); 86 fetch( 87 targetUrl.href, 88 { 89 method: 'POST', 90 headers: { 91 'Accept': 'application/json' 92 }, 93 } 94 ).then((response) => { 95 if (!response.ok) { 96 throw {message: 'HTTP status code ' + response.status}; 97 } 98 return response.json(); 99 }).then((body) => { 100 const onWishlist = parseInt(body.total); 101 $('.js_wishlist').toggleClass('hidden', !onWishlist).text(onWishlist); //responsible for number near merkzettel icon in header/footer 102 window.moWishlistArticleIds = body.articleIds; 103 wishlistElement.remove(); 104 if (onWishlist==0){ 105 document.querySelector('.box.info ').classList.remove('hidden'); 106 } 107 animateIt.cancel(); 108 }).catch((error) => { 109 console.error(error); 110 animateIt.cancel(); 111 }); 112 113};
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.