1$(function GC__Fix__Header(){ 2 if(gc__info_bar_placement == 1 && $('div#gc__info_box').length){ 3 $('body').addClass('gc__header__optimisation__off'); 4 } 5 if($('div#gc__info_box').length == 0){ 6 $('body').addClass('gc__no__infobox'); 7 } 8}); 9$(function GC__Fix(){ 10 if(gc__rounded == 1){ 11 $('body').addClass('gc__rounded'); 12 } 13 if(gc__bigger__listing == 1){ 14 $('body').addClass('gc__bigger__listing'); 15 } 16}); 17 18var gc__bestsellers__list = []; 19var gc__stored__bestsellers = JSON.parse(localStorage.getItem("gc__bestsellers__list")); 20var gc__favorites = JSON.parse(localStorage.getItem('gc__favorites')) || []; 21 $("#gc__info_box").addClass("owl-carousel"); 22 23function GC__Generate__Mask(){ 24 if($('.gc__custom__mask').length == 0){ 25 $('<div class="mask gc__custom__mask gc__notactive"></div>').appendTo($('body')); 26 } 27} 28 29 30function GC__Turn__Off__Menu(){ 31 if($('.menu .innermenu .menu-list').hasClass('gc__active')){ 32 $('div.submenu > ul').removeClass('gc__active_submenu'); 33 $('.menu .innermenu .menu-list').removeClass('gc__active'); 34 $('.mask.gc__custom__mask').toggleClass('gc__notactive gc__menu__on'); 35 } 36} 37function GC__Turn__Off__Search(){ 38 if($('.gc__search__container').hasClass('gc__active__search') && $('.rwd header .logo-bar .search_open').hasClass('search_open')){ 39 $('.gc__search__container').removeClass('gc__active__search'); 40 $('.rwd header .logo-bar .js__search').removeClass('search_open visible_block').addClass('none'); 41 }else if ($('.gc__search__container').hasClass('.gc__active__search') && $('.rwd header .logo-bar .search_open:not(.search_open)').length > 0){ 42 $('.gc__search__container').toggleClass('gc__active__search'); 43 } 44 45 else if ($('.gc__search__container:not(.gc__active__search)').length > 0 && $('.leftcol.s-grid-3.gc__active').length == 0 || $('.rwd header .logo-bar .search_open').hasClass('none')){ 46 47 if($('.search_open').length > 0){ 48 $('.rwd header .logo-bar .search_open').addClass('search_open visible_block').removeClass('none'); 49 $('.gc__search__container').toggleClass('gc__active__search'); 50 } else { 51 $('.rwd header .logo-bar .js__search:not(.search_open)').addClass('search_open visible_block').removeClass('none'); 52 $('.gc__search__container').toggleClass('gc__active__search'); 53 } 54 } 55 else { 56 if ($('.leftcol.s-grid-3.gc__active').length == 0){ 57 $('.gc__search__container').toggleClass('gc__active__search'); 58 $('.rwd header .logo-bar .js__search').toggleClass('search_open visible_block none'); 59 } 60 } 61} 62function GC__Turn__Off__Basket(){ 63 if($('.basket-contain').hasClass('gc__active__basket')){ 64 $('.mask.gc__basket__on').toggleClass('gc__notactive gc__basket__on'); 65 $('.basket-contain').removeClass('gc__active__basket'); 66 } 67} 68 69 70 $('.gc__social__container').clone().insertAfter($('#box_newsletter')).addClass('gc__footer__socials'); 71 $('<p class="gc__watch__us">' + gc__watch__us[Shop.lang.name] + '</p>').insertBefore($('.gc__footer__socials')); 72 73$(document).ready(function () { 74 $('html .consents__modal .consents__heading').text(gc__cookie__management[Shop.lang.name]); 75 $("button[class*='owl']").attr('title','Dalej').attr('type','button'); 76 $('header .logo-bar .search-form .btn').attr('title','Szukaj'); 77 $('.gc__icon__1 .gc__trustbadges__text').text(function (i, txt) { return txt.replace(/\d+/, gc__free__delivery__amount); }); 78 if(gc__4__products__listing == 1){ 79 if($('body').hasClass('shop_product_list')){ 80 $('body').addClass('gc__4__desktop'); 81 } else if($('body').hasClass('shop_index')){ 82 $('body').addClass('gc__5__desktop'); 83 } 84 } 85 if(gc__sticky__menu__desktop == 1){ 86 $('.menu').addClass('gc__sticky'); 87 } 88 $('#box_description [title~="YouTube"]').addClass('gc__video').parent().addClass('gc__video__holder'); 89 90 if (gc__slim__name == 1){ 91 $('.productname').addClass('gc__ellipsis'); 92 } 93 94 if(gc__related__classic == 0){ 95 $('body.shop_product .gc__classic__related').hide(); 96 $('body.shop_product .gc__related__classic__header').hide(); 97 } 98 $('.gc__temp__loupe, .gc__close__search, li#activ-search, .js__search-close-btn').click(function(){ 99GC__Turn__Off__Search(); 100GC__Turn__Off__Basket(); 101GC__Turn__Off__Menu(); 102}); 103 104 $('.gc__temp__loupe').click(function(){ 105 $('.search__input[type="search"]').focus().click(); 106 }); 107
108 $('.box#box_filter ul li.priceinput input').on('change focus', function () { 109 $('.box#box_filter ul li.priceinput .bottombuttons').fadeIn(); 110 }); 111 112 if ($('.gc__shipping .gc__free__delivery').length == 0) { 113 $('<div class="gc__free__delivery">' + gc__free__delivery[Shop.lang.name] + '</div>').appendTo($('.gc__shipping')); 114 } 115 if(gc__paypo == 1){ 116 $('.gc__pay__po').addClass('gc__active__ppo'); 117 } 118 $('.rwd .menu .innermenu li a.fa-user').attr('href', function () { 119 return $('.gc__myaccount__holder a.gc__fav__main').attr('href'); 120 }); 121 122 $('.product').each(function GC__Check() { 123 const gc__current__product = $(this); 124 125 $('<div class="gc__badge__holder"></div>').insertBefore(gc__current__product.find('span.productname').parent()); 126 const gc__prod__id = gc__current__product.attr('data-product-id'); 127 if (gc__prod__id > 1) { 128 if($('p.logout').length !== 0 ){ 129 $('<div class="gc__list__add"><div class="gc__product__badge"><a href="/pl/fav/add/' + gc__prod__id + '" title="'+gc__text__to__favorites[Shop.lang.name]+'" class="gc__addtofav"><span class="gc__span__holder">'+gc__text__to__favorites[Shop.lang.name]+'</span><img src="/skins/user/'+gc__images__version+'/images/user/gc__heart.svg" alt="'+gc__text__to__favorites[Shop.lang.name]+'"></a></div></div>').insertAfter(gc__current__product.find($('a'))) 130 } else{ 131 $('<div class="gc__list__add"><div class="gc__product__badge"><div value="'+gc__prod__id+'" title="'+gc__text__to__favorites[Shop.lang.name]+'" class="gc__addtofav"><div class="gc__span__holder">'+gc__text__to__favorites[Shop.lang.name]+'</div><svg data-v-7df6b261="" data-v-c36c587c="" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" role="presentation" class="svg" data-v-6eb481ef=""><g data-v-7df6b261="" fill="currentColor" stroke="currentColor"><svg data-v-c36c587c="" data-v-7df6b261="" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svg-icon"><path data-v-c36c587c="" data-v-7df6b261="" d="M11.9 7.696C11.9 4.67 9.682 3 6.948 3 3.649 3 2.035 5.348 2 8.478 2 12.783 6.949 16.304 11.9 21c4.95-4.696 9.9-8.217 9.9-12.522C21.765 5.348 20.151 3 16.85 3c-2.734 0-4.95 1.67-4.95 4.696z" stroke-width="2" stroke-linecap="round"></path></svg></g></svg></a></div></div>').appendTo(gc__current__product) 132 } 133 } 134 const gc__product__tags = gc__current__product.find('.tags'); 135 if (gc__product__tags.length > 0) { 136 $(gc__product__tags).appendTo(gc__current__product.find('.gc__badge__holder')); 137 } 138 let gc__box__check = gc__current__product.closest($('.box')).attr('id'); 139 if (gc__box__check == 'box_bestsellers') { 140 if ($.isNumeric(gc__prod__id)) { 141 // if (gc__current__product.find('.bestseller').length > 0) { // dodatkowy warunek 142 gc__bestsellers__list.push(gc__prod__id); 143 //console.log('gc__bestsellers__list.push(gc__prod__id); dodajÄ nowego bestsellera o id '+gc__prod__id); 144 localStorage.setItem("gc__bestsellers__list", JSON.stringify(gc__bestsellers__list)); 145 //} 146 } 147 } if (gc__box__check == 'box_specialoffer') { 148 $('<ul class="tags"><li class="promo"><span>'+gc__promo__badge[Shop.lang.name]+'</span></li></ul>').appendTo($(gc__current__product).find($('.gc__badge__holder'))); 149 } if (gc__box__check == 'box_lastadded') { 150 if ($(gc__current__product).find('.tags').length == 0) { 151 var gc__tag = $('<ul/>', { 152 class: 'tags' 153 }).append($('<li/>', { 154 class: 'new' 155 }).append($('<span/>', { 156 text: gc__tag__translations[Shop.lang.name] 157 }))); 158 gc__tag.appendTo($(gc__current__product).find($('.gc__badge__holder'))); 159 } else{ 160 var gc__tag = $('<li/>', { 161 class: 'new' 162 }).append($('<span/>', { 163 text: gc__tag__translations[Shop.lang.name] 164 })); 165 gc__tag.appendTo($(gc__current__product).find($('.gc__badge__holder .tags'))); 166 } 167 168 } 169 if (jQuery.inArray(gc__prod__id, gc__stored__bestsellers) === -1) { 170 } else { 171 if ($(gc__current__product).find('.tags').length !== 0) { 172 $('<li class="bestseller"><span>'+gc__bestseller__badge[Shop.lang.name]+'</span></li>').appendTo($(gc__current__product).find($('.tags'))); 173 if ($(gc__current__product).find('.promo').length !== 0) { 174 const gc__this = $(gc__current__product); 175 const gc__promo__price = $(gc__this).find("div.price > p > em").text().split(/[ ,]+/)[0].replace(/[^0-9]/g, ''); 176 const gc__regular__price = $(gc__this).find("del.price__inactive").text().split(/[ ,]+/)[0].replace(/[^0-9]/g, ''); 177 const gc__promo = (((gc__promo__price / gc__regular__price)-1)*100).toFixed(0); 178 gc__this.find('.promo').text(gc__promo + '%').addClass('gc__promo__percent'); 179 } 180 } else { 181 $('<ul class="tags"><li class="bestseller"><span>'+gc__bestseller__badge[Shop.lang.name]+'</span></li></ul>').appendTo($(gc__current__product).find($('.gc__badge__holder'))); 182 } 183 } 184 if (gc__new__custom__badge == 1){
185 Object.keys(gc__new__custom__badge__names).forEach(function(gc__new__badge) { 186 if (jQuery.inArray(gc__prod__id, gc__new__custom__badge__names[gc__new__badge]) === -1) { 187 } else { 188 // Pobranie tÅumaczenia dla aktualnego jÄzyka 189 let badgeTranslation = gc__new__badge; 190 191 if (Shop.lang.name !== 'pl_PL' && badge_translations[gc__new__badge]) { 192 badgeTranslation = badge_translations[gc__new__badge][Shop.lang.name]; 193 } 194 195 if ($(gc__current__product).find('.tags').length !== 0) { 196 $('<li class="gc__custom__badge '+gc__new__badge+'"><span>'+badgeTranslation+'</span></li>').appendTo($(gc__current__product).find($('.tags'))); 197 } else { 198 $('<ul class="tags"><li class="gc__custom__badge '+gc__new__badge+'"><span>'+badgeTranslation+'</span></li></ul>').appendTo($(gc__current__product).find($('.gc__badge__holder'))); 199 } 200 } 201 }); 202 } 203 }); 204 205 var gc__body__prod__id = $('body.shop_product').find($('#box_productfull .basket .form-basket fieldset input[type="hidden"][name="product_id"]')).attr('value'); 206 207 if (jQuery.inArray(gc__body__prod__id, gc__stored__bestsellers) === -1) { 208 } else { 209 var gc__body__tags = $('.productimg .tags'); 210 if (gc__body__tags.length !== 0) { 211 $('<li class="bestseller"><span>'+gc__bestseller__badge[Shop.lang.name]+'</span></li>').appendTo(gc__body__tags); 212 } else { 213 $('<ul class="tags"><li class="bestseller"><span>'+gc__bestseller__badge[Shop.lang.name]+'</span></li></ul>').appendTo($('.innersmallgallery')); 214 } 215 } 216 if (gc__new__custom__badge == 1){ 217 for (const [gc__new__badge, gc__new__id] of Object.entries(gc__new__custom__badge__names)) { 218 if (jQuery.inArray(gc__body__prod__id, gc__new__id) === -1) { 219 } else { 220 // Pobranie tÅumaczenia dla aktualnego jÄzyka 221 let badgeTranslation = gc__new__badge; 222 if (Shop.lang.name !== 'pl_PL' && badge_translations[gc__new__badge]) { 223 badgeTranslation = badge_translations[gc__new__badge][Shop.lang.name]; 224 } 225 226 var gc__body__tags = $('.productimg .tags'); 227 if (gc__body__tags.length !== 0) { 228 $('<li class="gc__custom__badge '+gc__new__badge+'"><span>'+badgeTranslation+'</span></li>').appendTo(gc__body__tags); 229 } else { 230 $('<ul class="tags"><li class="gc__custom__badge '+gc__new__badge+'"><span>'+badgeTranslation+'</span></li></ul>').appendTo($('.innersmallgallery')); 231 } 232 } 233 } 234 } 235 236 237}); 238 $('li.promo:not(.gc__promo__percent), li.promo:not(.gc__promo__percent) > span').text(gc__promo__badge[Shop.lang.name]); 239$(function GC__Local__GC__Favorites(){ 240 if($('p.logout').length == 0 ){ 241 $('.gc__favourite__holder a.gc__fav__main').attr('disabled',true); 242 gc__favorites.forEach(function(favorite) { 243 $('.gc__addtofav[value="'+favorite+'"]').addClass('gc__fav').find('.gc__span__holder').text(gc__text__in__fav[Shop.lang.name]); 244 245 }); 246 } 247}); 248$('#box_productfull .basket .form-basket .button_wrap .availability-notifier-btn').parent().addClass('gc__resize'); 249$(function GC__Mobile__WishList(){ 250 251 $('.rwd .menu .innermenu li a.fa-user').attr('disabled',true); 252 $('header .logo-bar .gc__favourite__holder a.gc__fav__main .heartMain, .menu-mobile .small-panel').click(function(){ 253 if ($(window).width() < 767) { 254 $('header .logo-bar .gc__favourite__holder .gc__content').toggleClass('gc__heart__active'); 255 GC__Generate__Mask(); 256 $('.mask.gc__custom__mask').toggleClass('gc__notactive gc__wishlist__on'); 257 } 258 }); 259 260}); 261 262$(function GC__Footer__Fix(){ 263if ($('footer .userfooter').height() > 10 && $(window).width() > 980){ 264 $('footer.footer').addClass('gc__footer__enchanced'); 265} 266}
266); 267 268 269function GC__Close__Filters__Mobile(){ 270 $('.gc__hide__leftbar').text('Pokaż filtry'); 271 $('.leftcol.s-grid-3').toggleClass('gc__active').hide(); 272 $('.s-row .s-grid-9').toggleClass('gc__full'); 273 $('.gc__hide__leftbar').toggleClass('hide'); 274 } 275$(function GrowCommerceNewsletterCheckbox() { 276 let gc__newsletter_button = $('#box_newsletter .innerbox form fieldset button.btn.btn-red'); 277 let gc__val = $('.box#box_newsletter form.gc__new__input fieldset input.newsletter-input'); 278 let gc__mail__error = $('.gc__errors__spacer'); 279 280 function gc__disable() { 281 gc__newsletter_button.prop("disabled", !this.checked) 282 } gc__disable(); 283 284 $('#box_newsletter #gc_check').prop('checked', false).on('change', function () { 285 if (/^[a-z0-9][a-z0-9-_\.]+@([a-z]|[a-z0-9]?[a-z0-9-]+[a-z0-9])\.[a-z0-9]{2,10}(?:\.[a-z]{2,10})?$/.test(gc__val.val())) { 286 if ($('#box_newsletter #gc_check').prop('checked') === false) { 287 gc__disable(); 288 gc__mail__error.text(gc__newsletter__checkbox[Shop.lang.name]).addClass('gc__shown').addClass('gc__red'); 289 } 290 else { 291 gc__newsletter_button.removeAttr("disabled"); 292 gc__mail__error.removeClass('gc__shown').removeClass('gc__red'); 293 } 294 295 } else { 296 gc__mail__error.text(gc__newsletter__error[Shop.lang.name]).addClass('gc__shown').addClass('gc__red'); 297 } 298 }); 299 300 $(gc__val).on('change', function () { 301 if (/^[a-z0-9][a-z0-9-_\.]+@([a-z]|[a-z0-9]?[a-z0-9-]+[a-z0-9])\.[a-z0-9]{2,10}(?:\.[a-z]{2,10})?$/.test(gc__val.val())) { 302 if ($('#box_newsletter #gc_check').prop('checked') === false) { 303 gc__disable(); 304 gc__mail__error.text(gc__newsletter__checkbox[Shop.lang.name]).addClass('gc__shown').removeClass('gc__red'); 305 $('.gc__hide__info').addClass('gc__shown'); 306 } 307 else { 308 gc__newsletter_button.removeAttr("disabled"); 309 gc__mail__error.removeClass('gc__shown').removeClass('gc__red'); 310 ; 311 } 312 } else { 313 gc__mail__error.text(gc__newsletter__error[Shop.lang.name]).addClass('gc__shown').addClass('gc__red'); 314 $('.gc__hide__info').addClass('gc__shown'); 315 } 316 }); 317}); 318 319$(function GC__BlogFixer(){ 320 if($('.article-image').length>0){ 321$('article:nth-child(odd) .readmore').each(function(){ 322$(this).insertBefore($(this).parent().find('.article-image')) 323}); 324 $('article:nth-child(even) .article-header').each(function(){ 325$(this).insertAfter($(this).parent().find('.article-image')) 326}); 327} 328}); 329$(function GC__Fix__Producer__Desc(){ 330if ($('body').hasClass('shop_product_producer')){ 331let gc__long__desc = $('.categorydesc').html().split('[long_desc]')[1]; 332let gc__short__desc = $('.categorydesc').html().split('[long_desc]')[0]; 333$('.categorydesc').html(gc__short__desc); 334$(gc__long__desc).insertAfter($('#box_mainproducts > div.innerbox')).wrap("<div class='categorydesc resetcss row longdesc'></div>"); 335} 336}); 337$(function GC__Hide__Filters(){ 338let gc__leftcol = $('.leftcol.s-grid-3'); 339$('<div class="gc__hide__leftbar btn">'+ gc__hide__filters[Shop.lang.name] +'</div> ').insertBefore(gc__leftcol).click(function(){ 340 if ($(window).width() < 980) { 341 GC__Generate__Mask() 342 $('.mask.gc__custom__mask').toggleClass('gc__notactive gc__filters__on'); 343 } 344if($(this).text() == gc__hide__filters[Shop.lang.name]){ 345 GC__Close__Filters__Mobile(); 346 $(this).text(gc__show__filters[Shop.lang.name]); 347} else { 348 $(this).text(gc__hide__filters[Shop.lang.name]); 349 gc__leftcol.toggleClass('gc__active').show(); 350 $('.gc__hide__leftbar').toggleClass('hide'); 351 $('.s-row .s-grid-9').toggleClass('gc__full'); 352 353}}); 354}); 355 356$(function GC__ExtraSubCategory(){ 357 if ( $('body').hasClass('shop_product_list') == true ){ 358 $('<div />').addClass('gc__category__container').insertAfter($('#box_mainproducts.box .boxhead>h1')); 359 if($('.leftcol div#box_menu .current_parent ul li.current a').length > 0){ 360 $('div#box_menu').find('.current_parent > a').clone().addClass('gc__category__link gc__back').appendTo($('.gc__category__container')).text(''); 361 $('<div class="gc__go__back">Wstecz</div>').appendTo('.gc__back'); 362 } 363 $(".leftcol div#box_menu .current > a").clone().addClass('gc__category__link gc__current').appendTo($('.gc__category__container')); 364 $(".leftcol div#box_menu .current ul li a").each(function(){ $(this).clone().addClass('gc__category__link').appendTo($('.gc__category__container')); 365 }); 366 367 $(".gc__category__container a").each(function(){ 368 $(this).wrapInner('<h2></h2>'); 369 }); 370 371 $('.group-filter').each(function GC__New__Filter__Search(i){ 372 let gc__main__group = $(this); 373 let gc__main__ul = $(this).find('ul'); 374 let gc__filter__amount = gc__main__ul.find('li').length; 375 376 if(gc__filter__amount > 4){ 377 gc__main__group.addClass('gc__box__search__active'); 378 $('<input type="text" class="gc__form__control" placeholder="Szukaj..." id="gc__search__field'+i+'">').insertBefore(gc__main__ul); 379 380 $('#gc__search__field'+i+'').on('keyup', function() { 381 var value = $(this).val(); 382 var patt = new RegExp(value, "i"); 383 384 gc__main__group.find('li').each(function() { 385 var $table = $(this); 386 387 if (!($table.find('span').text().search(patt) >= 0)) { 388 $table.hide(); 389 } 390 if (($table.find('span').text().search(patt) >= 0)) { 391 $(this).show(); 392 } 393 394 }); 395 396 }); 397 398 399 } 400 401 }); 402 $("#filter_price > ul > li > br").remove(); 403 } 404 }); 405 406const gc__orginalTitle = $(document).prop('title'); 407function gc__flashText() { 408 let gc__orginalTitle = document.title; 409 410 if($(document).prop('title') === gc__orginalTitle) { 411 document.title = gc__newTitle[Shop.lang.name]; 412 } else { 413 document.title = gc__orginalTitle; 414 } 415 } 416 417$(function gc__changeTitle() { 418 if(gc__newTitle__on__off == 1){ 419 let nIntervId; 420 $(window).blur(function() { 421 if (!nIntervId) { 422 nIntervId = setInterval(gc__flashText, 1100); 423 } 424 }); 425 $(window).focus(function() { 426 clearInterval(nIntervId); 427 nIntervId = null; 428 $("title").text(gc__orginalTitle); 429 }); 430 } 431}); 432 433 434 435 436 437$(function GC__Reviews(){ 438if ($('body').hasClass('shop_product')){ 439 $('.gc__add__review, .f-grid-6.gc__product__form .row.evaluation').click(function(){ 440 GC__Generate__Mask() 441 $('.gc__can__vote img').click(function(){ 442 const gc__rate = $('.gc__can__vote img.star1').length; 443 if(gc__rate == 1 || gc__rate == 2 ){ 444 $('.gc__sad__message').fadeIn(); 445 } 446}); 447$('.gc__new__review').toggleClass('gc__show'); 448 $('.mask.gc__custom__mask').removeClass('gc__notactive').click(function(){ 449 $(this).addClass('gc__notactive'); 450 $('.gc__new__review').removeClass('gc__show'); 451 }); 452 $('.gc__close__review').click(function(){ 453 $('.mask.gc__custom__mask').addClass('gc__notactive'); 454 $('.gc__new__review').removeClass('gc__show'); 455 }); 456}); 457}}); 458 459 460$(function GC__Mobile__Menu() { 461 const menuSelector = '.rwd .menu .innermenu li.small-menu'; 462 const imageSrcBase = `/skins/user/${gc__images__version}/images/user/`; 463 const gcTurnMenuHtml = `<div class="gc__turn__menu"><img src="${imageSrcBase}gc__menu.svg" alt="${gc__text__menu[Shop.lang.name]}"></div>`; 464 465 $(menuSelector).html(gcTurnMenuHtml); 466 467 const menuHeadHtmlGenerator = (isMain = false) => { 468 const menuBackHolderHtml = isMain ? `<a href="/" rel="nofollow" title="${gc__text__mainpage[Shop.lang.name]}"><img alt="${gc__back[Shop.lang.name]}" src="${imageSrcBase}gc__arrow__down.svg" class="gc__back" title="${gc__back[Shop.lang.name]}"><img src="${imageSrcBase}gc__home.svg" class="gc__home" alt="${gc__text__mainpage[Shop.lang.name]}" title="${gc__text__mainpage[Shop.lang.name]}"></a>` : `<img src="${imageSrcBase}gc__arrow__down.svg" class="gc__back" alt="${gc__text__menu[Shop.lang.name]}">${gc__text__menu[Shop.lang.name]}`;
469 return `<div class="gc__menu__head"><div class="gc__back__holder">${menuBackHolderHtml}</div><div class="gc__close__holder"><img alt="${gc__close[Shop.lang.name]}" src="${imageSrcBase}gc__close.svg" style="height: 16px;" class="gc__close"></div></div>`; 470 } 471 472 const prependMenuHeadHtml = (selector, isMain = false) => { 473 $(selector).prepend(menuHeadHtmlGenerator(isMain)); 474 } 475 476 prependMenuHeadHtml('ul.menu-list.large.standard', true); 477 $('ul.menu-list.large.standard .gc__menu__head').after(`<div class="gc__catname__holder"><span class="gc__menu__catname">${gc__text__menu[Shop.lang.name]}</span></div>`); 478 prependMenuHeadHtml('ul[class*="level"]:not(.menu-list.large.standard)'); 479 480 function updateMenuHeadLink() { 481 $('.submenu > ul').each(function() { 482 var $this = $(this); 483 var gc__current__li = $this.parent('.submenu').parent('li.parent'); 484 485 var gc__menu__cat__name = gc__current__li.find('a').first().text(); // bezpoÅrednie odwoÅanie do 'a' 486 var gc__menu__href = gc__current__li.find('a').first().attr('href'); 487 488 if ($this.find('.gc__catname__holder').length === 0) { 489 var gcCatnameHolderHtml = `<div class="gc__catname__holder"><span class="gc__menu__catname">${gc__menu__cat__name}</span><a href="${gc__menu__href}" title="${gc__menu__cat__name}" id="headlink" class="spanhover mainlevel gc__menu__headlink">${gc__text__seeall[Shop.lang.name]}</a></div>`; 490 $this.find('.gc__menu__head').after(gcCatnameHolderHtml); 491 } else { 492 // Aktualizuj istniejÄ cy element 493 $this.find('.gc__menu__headlink').attr('href', gc__menu__href).attr('title', gc__menu__cat__name).text(`${gc__text__seeall[Shop.lang.name]}`); 494 $this.find('.gc__menu__catname').text(gc__menu__cat__name); // Aktualizuj nazwÄ kategorii 495 } 496 }); 497 } 498 499 // WywoÅaj funkcjÄ przy Åadowaniu strony 500 updateMenuHeadLink(); 501 502 // WywoÅaj funkcjÄ za każdym razem, gdy kategoria jest zmieniana 503 $(document).on('click', '.menu .innermenu .menu-list li.parent > a', function (event) { 504 if (window.matchMedia('(max-width: 980px)').matches) { 505 event.preventDefault(); 506 var $submenu = $(this).next('.submenu').find('ul:first'); 507 $submenu.slideToggle(function() { // Zamiast .toggleClass 508 $submenu.addClass('gc__active_submenu'); // Dodaj klasÄ po ukoÅczeniu animacji 509 updateMenuHeadLink(); // WywoÅaj funkcjÄ po ukoÅczeniu animacji 510 }); 511 } 512 }); 513 514 $(document).on('click', '.gc__turn__menu, .gc__close__holder, .mask.gc__custom__mask.gc__menu__on', function () { 515 GC__Turn__Off__Basket(); 516 $('.menu .innermenu .menu-list').toggleClass('gc__active'); 517 GC__Generate__Mask(); 518 $('.mask.gc__custom__mask').toggleClass('gc__notactive gc__menu__on'); 519 }); 520 521 $(document).on('click', '.menu .innermenu .menu-list li.parent > a', function (event) { 522 if (window.matchMedia('(max-width: 980px)').matches) { 523 event.preventDefault(); 524 $(this).next('.submenu').find('ul:first').toggleClass('gc__active_submenu'); 525 } 526 }); 527 528 $(document).on('click', '.gc__back__holder', function () { 529 $(this).closest('.gc__active_submenu').removeClass('gc__active_submenu'); 530 }); 531}); 532 533$(document).on("click", ".search .js__search-close-btn", function () { 534GC__Turn__Off__Search(); 535GC__Turn__Off__Basket(); 536GC__Turn__Off__Menu(); 537}); 538 539$(document).on("click", ".gc__filters__on", function () { 540$('.mask.gc__custom__mask').toggleClass('gc__notactive gc__filters__on'); 541GC__Turn__Off__Search(); 542GC__Turn__Off__Basket(); 543GC__Turn__Off__Menu(); 544GC__Close__Filters__Mobile(); 545}); 546$(document).on("click", ".search_open-empty .search__content, .search_open .search__input-area .js__search-close-btn", function () { 547GC__Turn__Off__Search(); 548GC__Turn__Off__Basket(); 549GC__Turn__Off__Menu(); 550$('.rwd header .logo-bar .search_open').removeClass('search_open visible_block').addClass('none'); 551}); 552 553 554$(function GC__Basket(){ 555 $('header .basket:not(.empty-basket) > a, .rwd li.small-cart a').click(function() { 556 if( $('.basket-contain ul li').length ){ 557 event.preventDefault(); 558 $('.basket-contain').toggleClass('gc__active__basket'); 559 $(this).toggleClass('gc__basket__is__on'); 560 } 561 GC__Turn__Off__Menu(); 562 GC__Generate__Mask(); 563 $('.mask.gc__custom__mask').toggleClass('gc__notactive gc__basket__on'); 564}); 565 566 567}); 568 569document.addEventListener('DOMContentLoaded', () => { 570 if(gc__favorites.length > 0){ 571 $.getScript("https://dcsaascdn.net/js/front-api-1.4.0.min.js", function() { 572 frontAPI.getProducts(function(gc__favorites) { 573 gc__favorites.list.forEach(e => { 574 let gc__fav__name = e.name; 575 let gc__fav__url = e.url; 576 let gc__fav__image = '/environment/cache/images/150_150_productGfx_'+e.main_image_filename; 577 578 $('<div class="gc__favored__item"><img src="'+gc__fav__image+'" title="'+gc__fav__name+'" alt="'+gc__fav__name+'"><span class="gc__fav__name">'+gc__fav__name+'</span><div class="gc__fav__buttons__holder"><div value="'+e.id+'" title="'+gc__text__to__favorites[Shop.lang.name]+'" class="gc__addtofav gc__fav"><div class="gc__span__holder">
578'+gc__text__in__fav[Shop.lang.name]+'</div><svg data-v-7df6b261="" data-v-c36c587c="" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" role="presentation" class="svg" data-v-6eb481ef=""><g data-v-7df6b261="" fill="currentColor" stroke="currentColor"><svg data-v-c36c587c="" data-v-7df6b261="" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svg-icon"><path data-v-c36c587c="" data-v-7df6b261="" d="M11.9 7.696C11.9 4.67 9.682 3 6.948 3 3.649 3 2.035 5.348 2 8.478 2 12.783 6.949 16.304 11.9 21c4.95-4.696 9.9-8.217 9.9-12.522C21.765 5.348 20.151 3 16.85 3c-2.734 0-4.95 1.67-4.95 4.696z" stroke-width="2" stroke-linecap="round"></path></svg></g></svg></div><span class="gc__check__fav"><a href="'+gc__fav__url+'" title="'+gc__fav__name+'" class="btn">'+gc__check__link[Shop.lang.name]+'</a></span></div></div>').appendTo($('.gc__favored__item__list')); 579 }); 580 }, { 581lang: [Shop.lang.name], 582ids: gc__favorites}); 583 }); 584 585 setTimeout(() =>(function() { 586 $('.gc__myaccount__holder .gc__favourite__holder .gc__content .gc__empty__container').hide(); 587 $('b.count.gc__count').show().find('span').text($('.gc__favored__item').length); 588})(document), 1000); 589 } 590 $('.gc__myaccount__holder .gc__favourite__holder .gc__content .gc__empty__container').show(); 591}); 592 593$(document).on("click", ".gc__basket__on, gc__basket__is__on, .gc__close__menu__holder, .gc__continue__shopping", function GC__BasketMask() { 594GC__Turn__Off__Basket() 595}); 596 597$(document).on("click", ".gc__wishlist__on", function () { 598$('header .logo-bar .gc__favourite__holder .gc__content').toggleClass('gc__heart__active'); 599$('.mask.gc__custom__mask').toggleClass('gc__notactive gc__wishlist__on'); 600}); 601 602$(document).on("click", '.gc__list__add', function(e) { 603if($('p.logout').length == 0 ){ 604var id = $(this).parent().attr('data-product-id'); 605var item = $(this).find('.gc__addtofav'); 606var index = gc__favorites.indexOf(id); 607// return if target doesn't have an id (shouldn't happen) 608if (!id) return; 609// item is not favorite 610if (index == -1) { 611gc__favorites.push(id); 612item.addClass('gc__fav').find('.gc__span__holder').text(gc__text__in__fav[Shop.lang.name]); 613 614// item is already favorite 615} else { 616gc__favorites.splice(index, 1); 617item.removeClass('gc__fav').find('.gc__span__holder').text(gc__text__to__favorites[Shop.lang.name]); 618 619} 620} 621 localStorage.setItem('gc__favorites', JSON.stringify(gc__favorites)); 622}); 623$(document).on("click", '.gc__favored__item .gc__addtofav, .gc__mailfriend .gc__addtofav', function(e) { 624if($('p.logout').length == 0 ){ 625var id = $(this).attr('value'); 626var item = $(this); 627var index = gc__favorites.indexOf(id); 628if (!id) return; 629if (index == -1) { 630gc__favorites.push(id); 631item.addClass('gc__fav').find('.gc__span__holder').text(gc__text__in__fav[Shop.lang.name]); 632} else { 633gc__favorites.splice(index, 1); 634item.removeClass('gc__fav').find('.gc__span__holder').text(gc__text__to__favorites[Shop.lang.name]); 635} 636} 637 localStorage.setItem('gc__favorites', JSON.stringify(gc__favorites)); 638}); 639 640 641 642$(function GC__Floating__Inputs(){ 643 $('body.shop_basket_address tr.address_type').insertAfter($('.client-data .separator')); 644 645 $('tr.address_type td.input > label').each(function(){ 646 let gc__label__text = $(this).text(); 647 let gc__translated_label = gc__label__translations[Shop.lang.name] + gc__label__text; 648 $(this).text(gc__translated_label); 649}); 650 651 $('td.input input[type="text"], td.input input[type="tel"]').each(function() { 652 $(this).attr('placeholder', '') 653 .parent().parent().parent() 654 .addClass('gc__new__input') 655 .find('td.label label') 656 .wrapInner('<span></span>') 657 .find('span') 658 .before(this); 659 }); 660 661 $('#box_basketaddress label[for="comment"]').parent().parent().addClass('gc__comments'); 662 $('<div class="gc__additional__comments"><td class="input"><span class="checkbox-wrap"><input type="checkbox" id="gc__comments"><label for="gc__comments"></label></span><label for="gc__comments">' + gc__comments__label[Shop.lang.name] + '</label></span></td></div>').insertBefore('#box_basketaddress .basket-step-border>
662.f-row .client-add-info.f-grid-6 table:not(.address-different) > tbody>tr:nth-child(1)'); 663 $('#gc__comments').on('change', function() { 664 $('.gc__comments').toggleClass('gc__active__comment'); 665 }); 666}); 667 668 669$(function GC__PlusMinusBasket(){ 670$('.quantity input, .number-wrap input').each(function(){ 671var $this= $(this); 672let more = ('<span class="grow-more">+</span>'); 673let less = ('<span class="grow-less">-</span>'); 674$this.parent().append(more).append(less); 675}); 676let recalc = $('.recount #recalc'); 677 $('.grow-more').on('click', function() { 678 var $qty = $(this).parent().find('input.short'); 679 var currentVal = parseInt($qty.val()); 680 $(this).siblings('.shop_basket .grow-less').addClass('active'); 681 recalc.show(); 682 if (!isNaN(currentVal)) { 683 $qty.val(currentVal + 1); 684 } 685 }); 686 $('.grow-less').on('click', function() { 687 var $qty = $(this).parent().find('input.short'); 688 var currentVal = parseInt($qty.val()); 689 recalc.show(); 690 if (currentVal == 2) { 691 $(this).removeClass('active'); 692 } 693 if (!isNaN(currentVal) && currentVal > 1) { 694 $qty.val(currentVal - 1); 695 } 696 }); 697 698}); 699$(function GC__Auto__Alt() { 700 $("a").each(function() { 701 var gc__title = $(this).attr("title"); 702 var gc__new__title = $(this).html().replace(/(<([^>]+)>)/gi, "").replace(/\s+/g, ""); 703 gc__title || $(this).attr("title", gc__new__title) 704 }), 705 $("img").each(function() { 706 let gc__title = $(this).attr("title"); 707 let gc__alt = $(this).attr("alt"); 708 let gc__parent__a = $(this).parent("a"); 709 710 gc__title || gc__alt || gc__parent__a ? gc__title || gc__alt || !gc__parent__a ? gc__title && !gc__alt ? $(this).attr("alt", "Alt tytuÅ") : gc__alt && !gc__title && $(this).attr("title", gc__alt) : ($(this).attr("title", gc__parent__a.attr("title")), $(this).attr("alt", gc__parent__a.attr("title"))) : ($(this).attr("title", 'TytuÅ grafiki'), $(this).attr("alt", "Alt tekst")) 711 }); 712 713}); 714 715$(function GC__Social__check(){0!=gc__facebook?$(".gc__social__container a.facebook").attr("href",gc__facebook):$(".gc__social__container a.facebook").hide(),0!=gc__instagram?$(".gc__social__container a.instagram").attr("href",gc__instagram):$(".gc__social__container a.instagram").hide(),0!=gc__whatsapp?$(".gc__social__container a.whatsapp").attr("href",gc__whatsapp):$(".gc__social__container a.whatsapp").hide(),0!=gc__tiktok?$(".gc__social__container a.tiktok").attr("href",gc__tiktok):$(".gc__social__container a.tiktok").hide(),0!=gc__youtube?$(".gc__social__container a.youtube").attr("href",gc__youtube):$(".gc__social__container a.youtube").hide(),0==gc__blog&&$(".gc__social__container a.blog").hide()}); 716 717$(document).on("click", ".gc__show__pass", function GC__ShowPassword(){ 718 let gc__show__or__hide = $(this).parent().find('input'); 719 let fieldType = $(gc__show__or__hide).attr('type'); 720 $(gc__show__or__hide).attr('type', (fieldType === 'password' ? 'text' : 'password')); 721 $(this).toggleClass('gc__show'); 722}); 723 724$(function GC__Brand__Logo__Fix(){ 725 let gc__brand__title__container = $('.boxhead.gc__2'); 726if(gc__brand__logo == 0){ 727 gc__brand__title__container.hide(); 728} 729if(gc__brand__logo__name != 0){ 730 gc__brand__title__container.find('span').text(gc__brand__logo__name); 731} 732}); 733 734window.onload = function() { 735if($('.gc__brand__info').length > 0){ 736$('.gc__brand__info').text(gc__brand__info); 737} 738let gc__img__source = $('#box_productfull .productimg .mainimg img').attr('src'); 739$('.gc__product__photo').attr('src', gc__img__source); 740$('.payment .radio-wrap input[type=radio]').change(function(){ 741$('.payment').removeClass('selected'); 742$(this).closest('.payment').toggleClass('selected'); 743 744}); 745if(gc__footer__brand == 1){ 746$('head').append("<style>footer.footer.row:after{content:'"+gc__brand__info+"'}</style>"); 747} 748} 749 750 751!function(){var t,e,a,o,s,$,r,n,i,l,_,c=window.location.href,d=document.title,h=document.querySelector("meta[property='og:url']"),g=document.querySelector("meta[property='og:title']"),b=document.querySelector("meta[property='og:description']");if(h&&g&&b)var u=h.getAttribute("content"),v=g.getAttribute("content"),m=b.getAttribute("content");(t=document.createElement("div")).classList.add("good-share-modal"),t.setAttribute("role","dialog"),t.innerHTML='<button class="close-btn" aria-label="close share modal"></button><div class="good-share-modal-buttons"><button class="btn facebook-btn"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M23.998 12c0-6.628-5.372-12-11.999-12C5.372 0 0 5.372 0 12c0 5.988 4.388 10.952 10.124 11.852v-8.384H7.078v-3.469h3.046V9.356c0-3.008 1.792-4.669 4.532-4.669 1.313 0 2.686.234 2.686.234v2.953H15.83c-1.49 0-1.955.925-1.955 1.874V12h3.328l-.532 3.469h-2.796v8.384c5.736-.9 10.124-5.864 10.124-11.853z"/></svg>
751Facebook</button><button class="btn twitter-btn"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M23.954 4.569a10 10 0 0 1-2.825.775 4.958 4.958 0 0 0 2.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 0 0-8.384 4.482C7.691 8.094 4.066 6.13 1.64 3.161a4.822 4.822 0 0 0-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 0 1-2.228-.616v.061a4.923 4.923 0 0 0 3.946 4.827 4.996 4.996 0 0 1-2.212.085 4.937 4.937 0 0 0 4.604 3.417 9.868 9.868 0 0 1-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 0 0 7.557 2.209c9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63a9.936 9.936 0 0 0 2.46-2.548l-.047-.02z"/></svg>Twitter</button><button class="btn email-btn"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 16"><rect x=".5" y=".5" width="19" height="15" rx="1.609" fill="#fff" stroke="#000" stroke-miterlimit="10"/><path fill="none" stroke="#000" stroke-miterlimit="10" d="M17.124 3.13l-3.562 2.435L10 8 6.438 5.565 2.876 3.13"/></svg>Email</button></div>',document.body.appendChild(t),(e=document.createElement("div")).classList.add("good-share-overlay"),document.body.appendChild(e);var p=navigator.userAgent.match(/SamsungBrowser/i),w=function(t,e,o){navigator.share&&null===p?navigator.share({title:t,text:e,url:o}).then(()=>{console.log("Thanks for sharing!")}).catch(console.error):(document.body.classList.add("good-share-modal-open"),a=document.activeElement,document.querySelector(".good-share-modal-buttons > button").focus())},f=function(){document.body.classList.remove("good-share-modal-open"),a.focus()};document.addEventListener("click",function(t){var e,a,h;t.target.classList.contains("good-share")&&(o=t.target.dataset.shareTitle||v||d,s=t.target.dataset.shareText||m||"",$=t.target.dataset.shareUrl||u||c,null==navigator.share&&(o=encodeURIComponent(o),s=encodeURIComponent(s),$=encodeURIComponent($)),w(o,s,$)),(t.target.classList.contains("close-btn")||t.target.classList.contains("good-share-overlay"))&&f(),t.target.classList.contains("facebook-btn")&&(e=r="https://www.facebook.com/sharer/sharer.php?u="+$,window.open(e,"share-facebook","width=580,height=296")),t.target.classList.contains("twitter-btn")&&(a=n="https://twitter.com/intent/tweet?text="+(l=s?o+" / "+s+"&url="+$:o+"&url="+$),window.open(a,"share-twitter","width=550,height=235")),t.target.classList.contains("email-btn")&&(h=i="mailto:?&body="+(_=s?s+"%0D%0A%0D%0A"+$+"&subject="+o:$+"&subject="+o),window.open(h,"share-email"))},!1),document.addEventListener("keyup",function(t){if(!t.defaultPrevented){var e=t.key||t.keyCode;("Escape"===e||"Esc"===e||27===e)&&f()}})}(); 752 753 754 755$('.pytanie').click(function(e) { 756 var $this = $(this); 757 758 if ($this.next().hasClass('show')) { 759 $this.next().removeClass('show'); 760 } else { 761 $('.odpowiedz').removeClass('show'); $this.next().toggleClass('show'); 762 763 } 764}); 765 766 767$(document).ready(function() { 768if($('body.shop_index').length){ 769$('.floatcenterwrap .paginator li > a').each(function(){ 770$(this).attr('href', function(i, a){ return a + "#box_mainproducts" }); 771}); 772} 773}); 774 775if(gc__second__image == 1){ 776Shop.include({ 777 selectorFunctions: { 778 imgReplace: { 779 selector: '.product', 780 domready: function($img) { 781 $img.on('mouseenter', function() { 782 $('.replace-img-list img', this).attr('src', $('.replace-img-list img', this).data('srcAlt')); 783 }).on('mouseleave', function() { 784 $('.replace-img-list img', this).attr('src', $('.replace-img-list img', this).data('src')); 785 }); 786 } 787 } 788 } 789}); 790} 791 792/*! lozad.js - v1.16.0 - 2020-09-06 793* https://github.com/ApoorvSaxena/lozad.js 794* Copyright (c) 2020 Apoorv Saxena; Licensed MIT */ 795!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict"; 796/** 797 * Detect IE browser 798 * @const {boolean} 799 * @private 800 */var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)}if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=",";if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url
800('")+"')";else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x 801u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}}); 802 803 804$(document).on("ready", function() { 805 if (!('IntersectionObserver' in window) || 806 !('IntersectionObserverEntry' in window) || 807 !('intersectionRatio' in window.IntersectionObserverEntry.prototype)) { 808 $("img.lozad").each(function() { 809 $(this).attr("src", $(this).attr("data-src")); 810 }); 811 } else { 812 var observer = lozad('.lozad', { 813 threshold: 0.1 // ratio of element convergence 814 }); 815 observer.observe(); 816 } 817}); 818 819$(window).on("pageshow", function(event) { 820 if (event.originalEvent.persisted) { 821 console.log('page loaded from cache'); 822 } 823 824 function handleImages() { 825 var imgs = $(document).find('img.clicked'); 826 if (imgs.length) { 827 $(document).find('img.clicked').each(function() { 828 $(this).removeClass('fadeOut').attr('data-hovered', 'false').attr('src', $(this).attr('data-src')) 829 }); 830 } 831 } 832 833 $('.replace-img-list img').on('click', function() { 834 $(this).addClass('clicked'); 835 }); 836 $(window).on("beforeunload pagehide", function() { 837 setTimeout(function() { 838 handleImages(); 839 }, 2000); 840 }); 841 $(window).on("pageshow popstate", function(event) { 842 if (event.originalEvent.persisted) { 843 setTimeout(function() { 844 handleImages(); 845 }, 1); 846 } 847 }); 848 849}); 850 851 852 853$('<span class="none" itemprop="netto-price"></span>').insertAfter($('.basket .price span[itemprop=price]')); 854$('.basket .price span[itemprop=netto-price]').text($('.basket .price-netto em').text().replace(/\s/gm, '').split(/[ zÅ]+/)[0].replace(',', '.')); 855 856function GC__Responsive__Product__Price() { 857 $('.basket .price span[itemprop=price]').text($('.basket .price em.main-price').text().replace(/\s/gm, '').split(/[ zÅ]+/)[0].replace(',', '.')); 858 $('.basket .price span[itemprop=netto-price]').text($('.basket .price-netto em').text().replace(/\s/gm, '').split(/[ zÅ]+/)[0].replace(',', '.')); 859} 860 861function GC__Update__Input__Price() { 862 let newValue = parseInt($("#box_productfull .basket .form-basket .quantity_wrap .number-wrap input").val()).toFixed(0); 863 if (newValue <= 0) newValue.val('1'); 864 let netPrice = $('.basket .price span[itemprop=netto-price]').html(); 865 let grossPrice = $('.basket .price span[itemprop=price]').html(); 866 $('.basket .price em.main-price').html((parseFloat(grossPrice * newValue).toFixed(2) + ' zÅ').replace('.', ',')); 867 $('.basket .price-netto em').text((parseFloat(netPrice * newValue).toFixed(2) + ' zÅ').replace('.', ',')); 868 GC__Update__Whole__Price(); 869} 870 871 872//Aktualizacja przy zmianie iloÅci produktow w podstawowym inpucie - ale bez plusów i minu
872sów 873$('#box_productfull .basket .form-basket .quantity_wrap .number-wrap input').on('change', function() { 874 GC__Update__Input__Price(); 875}); 876 877function GC__Update__Whole__Price() { 878 let brutto_mainprice__backup = $('.basket .price em.main-price').text().replace(/\s/gm, '').split(/[ zÅ]+/)[0].replace(',', '.'); 879 let netto_mainprice__backup = $('.basket .price-netto em').text().replace(/\s/gm, '').split(/[ zÅ]+/)[0].replace(',', '.'); 880 let gc__added__sum = $('.gc__added__sum').text().split(/[ zÅ]+/)[0].replace(',', '.'); 881 let gc__added__sum__netto = $('.gc__added__sum__netto').text().split(/[ zÅ]+/)[0].replace(',', '.'); 882 $('p.gc__final__sum').text((Number(gc__added__sum) + Number(brutto_mainprice__backup)).toFixed(2) + ' zÅ'); 883 $('p.gc__final__sum__netto').text((Number(gc__added__sum__netto) + Number(netto_mainprice__backup)).toFixed(2) + ' zÅ netto'); 884} 885 886function GC__Update__Product__Price() { 887 let gc__base__brutto = 0; 888 let gc__base__netto = 0; 889 $(".gc__new__related__holder .gc__new__related").each(function() { 890 let gc__related__input = $(this).find('input'); 891 let item = $(this).find('.gc__prod__price'); 892 let item__netto = $(this).find('.gc__prod__price__netto'); 893 let itemPrice = (gc__related__input.val() == 0) ? item.attr('data-price') : (item.attr('data-price') * gc__related__input.val()).toFixed(2); 894 let itemPriceNetto = (gc__related__input.val() == 0) ? item__netto.attr('data-netto-price') : (item__netto.attr('data-netto-price') * gc__related__input.val()).toFixed(2); 895 item.text(itemPrice + ' zÅ'); 896 item__netto.text(itemPriceNetto + ' zÅ'); 897 item.attr('data-full_price', (item.attr('data-price') * gc__related__input.val()).toFixed(2)); 898 item__netto.attr('data-netto-full_price', (item__netto.attr('data-netto-price') * gc__related__input.val()).toFixed(2)); 899 900 let fullprice = item.attr('data-full_price'); 901 let netto__fullprice = item__netto.attr('data-netto-full_price'); 902 if (fullprice) gc__base__brutto += parseFloat(fullprice); 903 if (netto__fullprice) gc__base__netto += parseFloat(netto__fullprice); 904 }); 905 //Aktualizacja ceny dodatków 906 $('.gc__added__sum').text(((parseInt(gc__base__brutto * 100, 10)) / 100).toFixed(2) + ' zÅ'); 907 908 $('.gc__added__sum__netto').text(((parseInt(gc__base__netto * 100, 10)) / 100).toFixed(2) + ' zÅ netto'); 909 GC__Update__Whole__Price(); 910} 911 912// Aktualizacja przy zmianie produktów powiÄ zanych 913$(document).on('change', ".gc__new__related .number-wrap input", function() { 914 if ($('body').hasClass("shop_product") && gc__new__related__on__off == 1) { 915 let gc__item__val = $(this); 916 if (gc__item__val.length) { 917 let intVal = parseInt(gc__item__val.val(), 10); 918 gc__item__val.val(intVal.toFixed(0)); 919 if (gc__item__val.val() < 0) gc__item__val.val('0'); 920 GC__Update__Product__Price(); 921 } 922} 923}); 924 925// Aktualizacja przy zmianie wariantów 926$(document).on('change', "#box_productfull .basket .stocks .stock-options", function() { 927 $('#box_productfull .basket .form-basket .quantity_wrap .number-wrap input').val('1'); 928 setTimeout(function() { 929 GC__Responsive__Product__Price(); 930 }, 1000); 931 GC__Update__Whole__Price(); 932}); 933 934//ObsÅuga + i - przy iloÅci 935$(document).on('click touch', ".gc__new__related .number-wrap span", function() { 936 let gc__val__change = $(this).attr('gc__val__change'); 937 let gc__input = $(this).parent().find('input'); 938 if (gc__val__change == 'less' && gc__input.val() > 0) gc__input.val(gc__input.val() - 1); 939 else if (gc__val__change == 'more') gc__input.val(parseInt(gc__input.val(), 10) + 1); 940 GC__Update__Product__Price(); 941}); 942 943// Nowe produkty w popupie dodaj do koszyka 944 945$(document).on('click touch', ".addtobasket-container .addtobasket", function() { 946 let modal = '<div class="gc__new__related__modal">'; 947 let gc__h4__checker = false; 948 $(".gc__new__related").each(function() { 949 let gc__current__related = $(this); 950 if ($(this).find('.number-wrap input').val() > 0) { 951 952 let stock_id = $(this).attr('gc__stock__id'); 953 let quantity = $(this).find('.number-wrap input').val(); 954 955 var addInfo = frontAPI.addToBasket({ 956 lang: [Shop.lang.name], 957 data: { 958 stock_id: stock_id, 959 quantity: quantity 960 } 961 }); 962 963 let gc__basket__checker = addInfo.added.length; 964 if(gc__basket__checker == 0){ 965 // modal += '<span class="gc__basket__error">'+addInfo._flash_messenger.error[0]+'</span>'; 966 let gc__link = gc__current__related.find('a').attr('href'); 967 $('<div class="gc__error__handle"><span class="gc__basket__error">'+addInfo._flash_messenger.error[0]+'</span><a href="'+gc__link+'" rel="noopener noreferrer">'+gc__check__link[Shop.lang.name]+'</a>').insertAfter(gc__current__related); 968 gc__current__related.hide(); 969 } else{ 970 if(!gc__h4__checker){ 971 modal += '<h4>Dodatkowe produkty:</h4>'; 972 gc__h4__checker = true; 973 } 974 975 modal += ' <div class="gc__window__holder">' + 976 '<span class="gc__image__holder" style="' + $(this).find('.gc__prod__img').attr('style') + '"></span>' + 977 '<span class="gc__amount__holder">' + $(this).find('.number-wrap input').val() + '</span> ' + 978 '</div>'; 979 980 } 981 982 983 984 985 } 986 }); 987 modal += '</div>'; 988 setTimeout(function() { 989 $('.ajax-basket-container').append(modal); 990 }, 300); 991}); 992 993 994$(document).on('click touch', "#box_productfull .basket .form-basket .quantity_wrap .number-wrap span", function() { 995 GC__Update__Input__Price(); 996}); 997 998$(function GC__Language__Currency(){ 999 var $box_languages = $('#box_languages'), 1000 $box_currencies = $('#box_currencies'), 1001 $gc_content = $('<div/>', {class: 'gc__content'}),
1002 $gc_language_holder = $('<div/>', {class: 'gc__language__holder'}), 1003 $img = $('<img/>', {src: "/skins/user/"+gc__images__version+"/images/user/gc__language.svg", alt: "Change language", title: "Change language"}), 1004 $target = $('.logo-bar .gc__favourite__holder'); 1005 1006 if($box_languages.length > 0 || $box_currencies.length > 0){ 1007 $gc_language_holder.append($img).append($gc_content).insertBefore($target); 1008 1009 if($box_languages.length > 0){ 1010 $box_languages.appendTo($gc_content); 1011 } 1012 1013 if($box_currencies.length > 0){ 1014 $box_currencies.appendTo($gc_content); 1015 } 1016 } 1017}); 1018 1019if (gc__new__related__show__netto__price == 1) { 1020 $('span.gc__prod__price__netto').removeClass('gc__netto__hide'); 1021} 1022$('.owl-carousel.gc__product__carousel').each(function GC__Run__Slider() { 1023 if ($(this).hasClass('slider_automove')) { 1024 var gc__automove = true; 1025 } 1026 if ($(this).hasClass('f-grid-9')) { 1027 var gc__smaller = 3; 1028 var gc__smaller2 = 2; 1029 } else{ 1030 var gc__smaller = 4; 1031 var gc__smaller2 = 3; 1032 } 1033 1034 $(this).owlCarousel({ 1035 lazyLoad: false, 1036 loop: true, 1037 margin: 10, 1038 autoHeight: true, 1039 responsiveClass: true, 1040 responsive: { 1041 0: { 1042 items: 1, 1043 nav: true 1044 }, 1045 380: { 1046 items: 2, 1047 nav: true 1048 }, 1049 800: { 1050 items: gc__smaller2, 1051 nav: true 1052 }, 1053 1200: { 1054 items: gc__smaller, 1055 nav: true, 1056 } 1057 }, 1058 autoplay: gc__automove, 1059 }); 1060}); 1061 1062let gc__t,gc__e,gc__n,gc__o,gc__i,gc__a=null,gc__s=65,gc__c=new Set;const gc__r=1111;function gc__d(t){gc__o=performance.now();let e=t.target.closest("a");gc__m(e)&&gc__p(e.href,"high")}function gc__u(t){if(performance.now()-gc__o<1111||!("closest"in t.target))return;let e=t.target.closest("a");gc__m(e)&&(e.addEventListener("mouseout",gc__f,{passive:!0}),gc__i=setTimeout(()=>{gc__p(e.href,"high"),gc__i=void 0},gc__s))}function gc__l(t){let e=t.target.closest("a");gc__m(e)&&gc__p(e.href,"high")}function gc__f(t){t.relatedTarget&&t.target.closest("a")==t.relatedTarget.closest("a")||gc__i&&(clearTimeout(gc__i),gc__i=void 0)}function gc__h(t){if(performance.now()-gc__o<1111)return;let e=t.target.closest("a");if(t.which>1||t.metaKey||t.ctrlKey||!e)return;e.addEventListener("click",function(t){1337!=t.detail&&t.preventDefault()},{capture:!0,passive:!1,once:!0});let n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});e.dispatchEvent(n)}function gc__m(t){if(t&&t.href&&(!gc__n||"instant"in t.dataset)&&(t.origin==location.origin||(gc__e||"instant"in t.dataset)&&gc__a)&&["http:","https:"].includes(t.protocol)&&("http:"!=t.protocol||"https:"!=location.protocol)&&(gc__t||!t.search||"instant"in t.dataset)&&!(t.hash&&t.pathname+t.search==location.pathname+location.search||"noInstant"in t.dataset))return!0}function gc__p(t,e="auto"){if(gc__c.has(t))return;let n=document.createElement("link");n.rel="prefetch",n.href=t,n.fetchPriority=e,n.as="document",document.head.appendChild(n),gc__c.add(t)}!function(){if(!document.createElement("link").relList.supports("prefetch"))return;let t="instantVaryAccept"in document.body.dataset||"Shopify"in window,e=navigator.userAgent.indexOf("Chrome/");if(e>
1062-1&&(gc__a=parseInt(navigator.userAgent.substring(e+7))),t&&gc__a&&gc__a<110)return;let n="instantMousedownShortcut"in document.body.dataset;gc__t="instantAllowQueryString"in document.body.dataset,gc__e="instantAllowExternalLinks"in document.body.dataset,gc__n="instantWhitelist"in document.body.dataset;let c={capture:!0,passive:!0},i=!1,a=!1,s=!1;if("instantIntensity"in document.body.dataset){let o=document.body.dataset.instantIntensity;if(o.startsWith("mousedown"))i=!0,"mousedown-only"==o&&(a=!0);else if(o.startsWith("viewport")){let r=navigator.connection&&navigator.connection.saveData,g=navigator.connection&&navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g");r||g||("viewport"==o?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(s=!0):"viewport-all"==o&&(s=!0))}else{let l=parseInt(o);isNaN(l)||(gc__s=l)}}if(a||document.addEventListener("touchstart",gc__d,c),i?n||document.addEventListener("mousedown",gc__l,c):document.addEventListener("mouseover",gc__u,c),n&&document.addEventListener("mousedown",gc__h,c),s){let d=window.requestIdleCallback;d||(d=t=>{t()}),d(function(){let t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let n=e.target;t.unobserve(n),gc__p(n.href)}})});document.querySelectorAll("a").forEach(e=>{gc__m(e)&&t.observe(e)})},{timeout:1500})}}();
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.