1/** Shopify CDN: Minification failed 2 3Line 7:30 Transforming const to the configured target environment ("es5") is not supported yet 4Line 8:58 Expected ";" but found "if" 5 6**/ 7function showNormalBanner() { const sectionSlideshow = 8document.querySelector('.section-slideshow #s_slideshow') if (sectionSlideshow) 9{ sectionSlideshow.style.visibility = 'visible'; } } 10 11function getCookie(name) { let cookies = document.cookie.split(';'); for (let i 12= 0; i < cookies.length; i++) { let cookie = cookies[i]; let cookiePair = 13cookie.split('='); if (name === cookiePair[0].trim()) { return cookiePair[1]; } 14} return null; } function isInTimeRange(start, end) { const currentTime = new 15Date(); return currentTime >= start && currentTime <= end; } 16 17function isVIPPreAccess() { const isVIP = getCookie('discount_code') === 18'V5E9BF' && isInTimeRange(new Date(2023, 10, 19, 9, 0, 0), new Date(2023, 10, 1919, 21, 0, 0)); return isVIP; } function isBlackWeek() { const isBlackWeek = 20isInTimeRange(new Date(2023, 10, 19, 21, 0, 0), new Date(2023, 10, 27, 23, 59, 2159)); return isBlackWeek; } 22 23function isBurda() { return window.location.href.includes('onpower-burda'); } 24 25function isNtvPage() { return window.location.href.includes('onpower-ntv'); } 26 27function isBurdaAktion() { const BUDA_COUPONS = ['focus100']; // 'chip100', 28'efahrer100' 29 30const isBurdaAktionTime = isInTimeRange(new Date(2024, 0, 19, 0, 0, 0), new 31Date(2024, 2, 28, 23, 59, 59)); 32 33if (! isBurdaAktionTime) return false; 34 35const discountCode = getRedeemedCouponCode(); 36 37return discountCode && BUDA_COUPONS.includes(discountCode.toLowerCase()); } 38 39function isFocus100() { return getRedeemedCouponCode() === 'focus100'; } 40function isChip100() { return false; return getRedeemedCouponCode() === 41'chip100'; } function isEFahrer100() { return false; return 42getRedeemedCouponCode() === 'efahrer100'; } function getRedeemedCouponCode() { 43const couponCode = getCookie('discount_code'); return couponCode ? 44couponCode.toLowerCase() : null; } function isBurdaPage() { return 45window.location.href.includes('onpower-burda'); } function isTest() { return 46true; } 47 48function redirectIfProductInQueryParams() { const urlParams = new 49URLSearchParams(window.location.search); const product = 50urlParams.get('product'); if (product == 'onlite') { window.location.href = 51location.origin + '/products/onlite'; } if (product == 'onbasic') { 52window.location.href = location.origin + '/products/onbasic'; } if (product == 53'onbasicxl') { window.location.href = location.origin + '/products/onbasicxl'; } 54if (product == 'onpower') { window.location.href = location.origin + 55'/products/onpower'; } } redirectIfProductInQueryParams(); 56 57function hideId(id) { const element = document.getElementById(id); if (element) 58{ element.style.display = 'none'; } } function detectReviews() { 59 60// Select all elements with the class 'reviewsio-product-ratings' var 61ratingElements = document.querySelectorAll('#codext-rating'); 62 63// Iterate over each element ratingElements.forEach(function(element) { 64 65// Change CSS properties element.style.cursor = 'pointer'; element.style.display 66= 'block'; 67 68// Add click event listener to each element element.addEventListener('click', 69function() { setTimeout(function() { var reviewsSection = 70document.getElementById('reviews'); if (reviewsSection) { // Scroll to the 71'reviews' section reviewsSection.scrollIntoView({ behavior: 'smooth', // Smooth 72scroll block: 'start', // Align to the start of the viewport }); } }, 300); }); 73}); } 74 75async function fetchStoreReviews() { const url = 76'https://api.reviews.io/reviews?store=www.solakon.de'; const response = await 77fetch(url); return response.json(); } 78 79async function fetchProductReviews(sku) { const url = 80`https://api.reviews.io/product/review?store=www.solakon.de&sku=${sku}`; try { 81const response = await fetch(url); if (! response.ok) throw new Error('Product 82review fetch failed'); 83 84return response.json(); } catch (error) { console.error('Error fetching product 85reviews:', error); return null; // Return null in case of failure } } 86 87async function fetchCombinedReviews(sku) { try { const storeReviews = await 88fetchStoreReviews(); const productReviews = await fetchProductReviews(sku); 89 90let combinedReviewCount = storeReviews.stats.company.review_count; let 91combinedAverageRating = parseFloat(storeReviews.stats.company.average_rating); 92 93if (productReviews && productReviews.stats.count > 0) { combinedReviewCount += 94productReviews.stats.count; combinedAverageRating = 95calculateWeightedAverage(storeReviews.review_count, combinedAverageRating, 96productReviews.stats.count, parseFloat(productReviews.stats.average)); } 97 98displayRating(combinedAverageRating, combinedReviewCount); } catch (error) { 99console.error('Error fetching combined reviews:', error); } } 100 101function calculateWeightedAverage(storeReviewCount, storeAverageRating, 102productReviewCount, productAverageRating) { const totalWeight = storeReviewCount 103+ productReviewCount; const weightedAverage = ((storeReviewCount * 104storeAverageRating) + (productReviewCount * productAverageRating)) / 105totalWeight; return weightedAverage.toFixed(2); } 106
107function displayRating(averageRating, reviewCount) { const starFull = 'â '; const 108starEmpty = 'â'; const rating = Math.round(averageRating); let stars = 109starFull.repeat(rating) + starEmpty.repeat(5 - rating); 110 111const icons = []; // To store the star icons let remainingRating = 112averageRating; 113 114// Work with the average rating directly 115 116// Generate full (100%) stars for (let i = 0; i < Math.floor(averageRating); 117i++) { icons.push('<i 118 aria-hidden="true" 119 class="ruk-icon-percentage-star--100"></i 120>'); } 121 122// Determine if there's a need for a half (50%) or quarter (25%) star const 123partialStar = remainingRating - Math.floor(averageRating); if (partialStar >= 1240.75) { icons.push('<i 125 aria-hidden="true" 126 class="ruk-icon-percentage-star--100"></i 127>'); // Round up to a full star } else if (partialStar >= 0.5) { icons.push('<i 128 aria-hidden="true" 129 class="ruk-icon-percentage-star--50"></i 130>'); } else if (partialStar >= 0.25) { icons.push('<i 131 aria-hidden="true" 132 class="ruk-icon-percentage-star--25"></i 133>'); } 134 135// Fill the rest with empty stars to always display 5 stars in total while 136(icons.length < 5) { icons.push('<i 137 aria-hidden="true" 138 class="ruk-icon-empty-star"></i 139>'); } 140 141function updateReviewCount(reviewCount) { const intervalId = setInterval(() => { 142const cardCarousels = document.querySelectorAll('reviewsio-card-carousel 143.cssVar-subheading__number'); if (cardCarousels.length > 0) { // Assuming you 144want to update the second `.cssVar-subheading__number` element in the carousel 145const targetElement = cardCarousels[1]; // Get the second element, if it exists 146if (targetElement) { targetElement.innerHTML = `${reviewCount} `; 147clearInterval(intervalId); // Stop checking once the update is done } } }, 1481000); // Check every second }updateReviewCount(reviewCount); 149 150const ratingElement = document.getElementById('codext-rating'); 151ratingElement.innerHTML = `<span class="codext-rating-stars" 152 >${ icons.join(' ') }</span 153> 154<span class="codext-rating-count">(${reviewCount} Bewertungen)</span> 155${averageRating} / 5.00`; 156 157detectReviews(); } 158 159document.addEventListener('DOMContentLoaded', function() { 160fetch('/browsing_context_suggestions.json') .then(res => res.json()) .then(data 161=> { if(data && data.detected_values.country.handle === "AT") { window.isAT = 162true; } else { window.isAT = false; } }); const skuElement = 163document.getElementById('codext-rating'); if (skuElement && 164!skuElement.hasAttribute('data-static')) { const sku = 165skuElement.getAttribute('data-sku'); fetchCombinedReviews(sku); } 166 167showNormalBanner(); 168 169/* Attach one click listener to #MainContent. Any element inside it with 170data-klaviyo-form-id becomes a trigger. Click interception is delegated: no 171per-element listeners, no rebinding after Shopify section reloads. If the 172clicked element is a link, navigation is blocked. The form ID is read from the 173elementâs data attribute and passed to Klaviyoâs openForm command. Usage: add 174data-klaviyo-form-id="YOUR_FORM_ID" to any button or link you want to open a 175specific Klaviyo popup. */ (function() { var root = 176document.getElementById('wrapper'); if (!root) return; 177 178root.addEventListener('click', function(e) { var el = 179e.target.closest('.data-klaviyo-form'); if (!el || !root.contains(el)) return; 180 181var idClass = Array.from(el.classList) .find(c => 182c.startsWith('klaviyo-form-id-')); if (!idClass) return; 183 184var id = idClass.replace('klaviyo-form-id-', ''); if (!id) return; 185 186if (el.tagName === 'A') e.preventDefault(); 187 188window._klOnsite = window._klOnsite || []; 189 190if (typeof window._klOnsite.openForm === 'function') { 191window._klOnsite.openForm(id); } else { window._klOnsite.push(['openForm', id]); 192} }); })(); 193 194});
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.