PageSourceSearch

https://www.appleking.cz/cache/jsmini/e18457c0c8dbaaa98f40476ed5518f46-global.js?ts=1790154542

js appleking.cz collected 2026-10-02 20:01:42 UTC 29,924 bytes, 82 lines download raw bytes

1var ajaxPopovers = null; var deviceDetector = { isMobile: function() { var check = false; (function(a){ if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true })(navigator.userAgent||navigator.vendor||window.opera); return check; }, isTouchable: function() { return 'ontouchstart' in window || navigator.maxTouchPoints > 0; } }; var countDowner = { els: [], int: null, init: function() { this.els = document.querySelectorAll('.countdowner[data-date]'); this.start(); }, start: function() { if (this.int) { clearInterval(this.int); }
2 this.int = setInterval(function(){ countDowner.render(); }, 1000); countDowner.render(); }, render: function() { var s = this; if (this.els.length >
2 0) { this.els.forEach(function(el){ try { var diff = Math.round(((new Date(el.getAttribute('data-date'))).getTime()-(new Date()).getTime())/1000); if (diff < 0) { diff = 0; }
3 var formated = s.formatDiff(diff); el.innerHTML = formated; } catch (err) { console.error(err) } }); } }, formatDiff: function(date_diff) { var d = Math.floor(date_diff/86400), h = Math.floor((date_diff%86400)/3600), rest_h = date_diff%3600, i = Math.floor(rest_h/60), s = rest_h%60, time = ('0'+h).substr(-2)+':'+('0'+i).substr(-2)+':'+('0'+s).substr(-2), msg = null; if (d > 5) { msg = countdown_five; } else if (d > 1) { msg = countdown_two; } else if (d == 1) { msg = countdown_one; }
4 return (!msg ? time : msg.replace('%s', d).replace('%s', time)) } }; $(document).ready(function(){ highdpiInit(); if (navigator.userAgent.match(/Android/i)){ var viewport = document.querySelector('meta[name="viewport"]'); viewport.setAttribute('content', 'initial-scale=1.0, width=device-width'); window.scrollTo(0, 1); }
5 dropDown(); countDowner.init(); $(document).on('click', '#advantages_block .pros_item.clickable', function(e){ if (e.target.tagName != 'A' &&
6 $(this).find('a').attr('href') != null) { window.location.href = $(this).find('a').attr('href'); } }); $(document).on('click', '#pagination_bottom a', function() { var allowed_ajax_pagination = ['category'], content_sortPagiBar = this.closest('.content_sortPagiBar'), product_list = (content_sortPagiBar != null ? content_sortPagiBar.parentNode.querySelector('.product_list') : null), page = this.href.match(/(\?|\&)p=(\d+)(\&|$)/); if (page != null) { page = page[2]; } else { page = 1; }
7 if (allowed_ajax_pagination.indexOf(document.body.id) != -1) { if (product_list != null) { product_list.classList.add('loading'); var overlay = document.createElement('div'); overlay.classList.add('loading_overlay'); overlay.innerHTML = '<i></i>'; product_list.appendChild(overlay); }
8 var scrollTo = $('.product_list, .af_pl_wrapper').prev('.content_sortPagiBar'); if (scrollTo.length == 0) { scrollTo = $('.product_list'); }
9 $('html, body').animate({ scrollTop: scrollTo.offset().top }, 300); var data = {}, url = this.href, success = function(res) { if (typeof res.pagination != 'undefined' &&
10 typeof res.product_list != 'undefined'
11 ) { var pagination_block = this.content_sortPagiBar.querySelector('.pagination_block'); pagination_block.innerHTML = $('<div>'+res.pagination+'</div>').find('.pagination_block').html(); this.product_list.innerHTML = $('<div>'+res.product_list+'</div>').find('.product_list').html(); this.product_list.classList.remove('loading'); window.history.pushState(null, null, this.url); var page = pagination_block.querySelector('li.active, li.current'), next_page = pagination_block.querySelector('li.active + li a, li.current + li a'), infinitescroll = document.querySelector('#infinitescroll[data-page]'); if (infinitescroll != null) { if (next_page != null) { var match = page.innerText.match(/^\s*(\d+)\s*$/); if (match != null) { infinitescroll.style.display = ''; infinitescroll.setAttribute('data-page', match[1]); } } else { infinitescroll.style.display = 'none'; } } } }; if (typeof af != 'undefined' &&
12 typeof af.defineVariables == typeof function () { }
13 ) { af.$pageInput.val(page); success = function(r) { af.forcedBaseURL = ''; af.updateContent(r, '', true); af.updateURL(af.prepareUrlAndVerifyParams()); }; var params = $('#af_form').serialize()+'&primary_filter='+af_primary_filter['trigger']+ '&page='+page+'&page_from='+page+'&page_to='+page; data = { params: params, current_url: af.prepareUrlAndVerifyParams(), trigger: 'p_type' }; url = af_ajax_path; } else { data.action = 'getProductListPage'; }
14 $.ajax({ type:"POST", url: url, async: true, dataType: "json", data: data, product_list: product_list, content_sortPagiBar: content_sortPagiBar, success : success }); return false; } }); if (typeof page_name != 'undefined' && !in_array(page_name, ['index', 'product'])){ $('select[name="in_warehouse"]').on('change', function(){ if ($('.sorting-bar a.active').length > 0)
15 $('.sorting-bar a.active').click(); else
16 $('.sorting-bar a').first().click(); }); $(document).on('click', '.sorting-bar a', function(e){ e.preventDefault(); if ($("#module-landingpages-landingpage").size() > 0) { return false; }
17 if (typeof request != 'undefined' && request)
18 var requestSortProducts = request; if ($('#amazzing_filter').length > 0) { requestSortProducts = window.location.href; var splitData = $(this).data("order").split(':'); url = requestSortProducts ; if (typeof splitData[0] !== 'undefined' && splitData[0]){ $old_search = window.location.search.substr(1); $split_data = $old_search.split('&'); $data = {}; for (var i in $split_data) { if ($split_data[i].indexOf('=') >= 0) { $split_data[i] = $split_data[i].split('='); $data[$split_data[i][0]] = $split_data[i][1]; } }
19 $data['orderby'] = splitData[0]; if (splitData[1]) { $data['orderway'] = splitData[1]; } else { if (typeof $data['orderway'] != 'undefined') { delete $data['orderway']; } }
20 if ($('select[name="in_warehouse"]').length > 0 && $('select[name="in_warehouse"]').val() != '') { $data['in_warehouse'] = $('select[name="in_warehouse"]').val(); } else { if (typeof $data['in_warehouse'] != 'undefined') { delete $data['in_warehouse']; } }
21 $new_search = []; for (var i in $data) { $new_search.push(i+"="+$data[i]); }
22 $new_search = $new_search.join('&'); if ($old_search != '') { url = url.replace($old_search, $new_search); } else { url += (url.indexOf('?') < 0 ? '?' : '&') + $new_search; } }
23 document.location.href = url; } else { var splitData = $(this).data("order").split(':'); var url = ''; if (typeof requestSortProducts != 'undefined' && requestSortProducts){ url += requestSortProducts ; if (typeof splitData[0] !== 'undefined' && splitData[0]){ url += ( requestSortProducts.indexOf('?') < 0 ? '?' : '&') + 'orderby=' + splitData[0] + (splitData[1] ? '&orderway=' + splitData[1] : ''); }
24 if ($('select[name="in_warehouse"]').val() != '')
25 url += '&in_warehouse='+($('select[name="in_warehouse"]').val() ? $('select[name="in_warehouse"]').val() : 0); document.location.href = url; } } }); $(document).on('change', 'select[name="n"]', function(){ $(this.form).submit(); }); $(document).on('change', 'select[name="currency_payment"]', function(){ setCurrency($(this).val()); }); }
26 $(document).on('change', 'select[name="manufacturer_list"], select[name="supplier_list"]', function(){ if (this.value != '')
27 location.href = this.value; }); $(document).on('click', '.back', function(e){ e.preventDefault(); history.back(); }); jQuery.curCSS = jQuery.css; if (!!$.prototype.cluetip)
28 $('a.cluetip').cluetip({ local:true, cursor: 'pointer', dropShadow: false, dropShadowSteps: 0, showTitle: false, tracking: true, sticky: false, mouseOutClose: true, fx: { open: 'fadeIn', openSpeed: 'fast' } }).css('opacity', 0.8); if (!!$.prototype.bxSlider)
29 $(".brands-inner").bxSlider({ useCSS: false, maxSlides: 5, moveSlides: 1, slideWidth: 210, infiniteLoop: true, pager: false, controls: true, auto: true }); if (typeof(FancyboxI18nClose) !== 'undefined' && typeof(FancyboxI18nNext) !== 'undefined' && typeof(FancyboxI18nPrev) !== 'undefined' && !!$.prototype.fancybox)
30 $.extend($.fancybox.defaults.tpl, { closeBtn : '<a title="' + FancyboxI18nClose + '" class="fancybox-item fancybox-close" href="javascript:;"></a>', next : '<a title="' + FancyboxI18nNext + '" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', prev : '<a title="' + FancyboxI18nPrev + '" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>' }); $(".alert.alert-danger").on('click', this, function(e){ if (e.offsetX >= 16 && e.offsetX <= 39 && e.offsetY >= 16 && e.offsetY <= 34)
31 $(this).fadeOut(); }); $(document).on("click", ".product_list .availability_block > a.in-stock", function() { addAjaxPopover($(this)); return false; }); $(".product-availability-delivery .availability u").on("click", function() { addPopover($(this)); }); manageToggleFooter(); $('#lang_toogler').click(function(){ var $toggle = $(this); var $list = $(this).siblings("div"); if ($list.hasClass("open")) { $list.slideUp(function() { $toggle.removeClass("open"); $list.removeClass("open"); }); } else { $list.slideDown(function() { $toggle.addClass("open"); $list.addClass("open"); }); } }); $('ul.sf-menu > li > a.hasChild').click(function(){ return false; }); $('.go-top [href*="#"]').click(function(){ $('html,body').animate({ scrollTop:$($(this).attr('href')).offset().top }, 'slow', 'swing'); return false; }); $(document).click(function(e){ if($('body').hasClass('box_select_close') && !($(e.target).hasClass('box_select_device_input') || $(e.target).parents('.box_select_device_input').length > 0)){ $('.box_select_device_option').stop().slideUp(300); } }); $('.box_select_device_input').click(function(){ $(this).find('.box_select_device_option').stop().slideDown(300, function(){ $('body').addClass('box_select_close'); }); }); if (!$('body').hasClass('order-opc')) { $("#header .shopping_cart a:first").hover( function(){ if (mobilecheck()) { return; window.location.href = $(this).attr('href'); }
32 if ($('.cart_block .products dt').length > 0 || parseInt($('.ajax_cart_quantity').html()) > 0) { $("#header .shopping_cart").addClass("open"); $("#header .cart_block").addClass("open").show(); refreshTopCart(); $(document).trigger('ajaxCartOpen'); } }, function(){ setTimeout(function(){ if (!$('.shopping_cart').is(':hover')) { $("#header .cart_block").removeClass("open").hide(); $("#header .shopping_cart").removeClass("open"); } }, 200); }
33 ); $("#header .shopping_cart .cart_block ").mouseout(function(){ setTimeout(function(){ if (!$('.shopping_cart').is(':hover')) { $("#header .cart_block").removeClass("open").hide(); $("#header .shopping_cart").removeClass("open"); } }, 200); }); if (typeof mobilecheck == 'undefined')
34 var mobilecheck = function() { var check = false; (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
34sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera); return check; }; }
35 $(document).on('click', '.popup-content.deliveridates .close, .popup-content.deliveridates .closeBtn', function(){ $('.lightModal-overlay').click(); }); if ($('.mobile-amazzingfilter').length > 0 && $('#amazzing_filter').length > 0) { $('.mobile-amazzingfilter').removeClass('hidden'); $('.mobile-amazzingfilter .btn').click(function(){ if ($('#amazzing_filter .compact-toggle').length > 0) { $('#amazzing_filter .compact-toggle').click(); } }); }
36 if (typeof svetmovano_redirection != 'undefined' &&
37 svetmovano_redirection == 1 &&
38 $.cookie('svetmovano_info_closed') != '1'
39 ) { $('#svetmovano_info').slideDown(300); }
40 if (typeof lazyframe != 'undefined') { lazyframe(".lazyframe"); }
41 $(document).on('click', '#header_infobar_hide', function(){ $.cookie($(this).data('cookie-name'), $(this).data('cookie-value'), { expires : 30 }); $('#header_infobar').slideUp(300); return false; }); }); $(window).resize(function() { manageToggleFooter(); }); function addPopover($el) { var modal = $el.parent().children(".popup-content"); $('body').lightModal({ open: false, width: "300px", content: modal, overlay: true, closeClass: '.close, .closeBtn', keyboard: true }); $el.trigger('open'); }
42function addAjaxPopover($el) { $href = $el.attr('href'); $old = $el.hasClass('link-old') ? 1 : 0; if (typeof $href == 'undefined' || $href == '') { alert('Bad data'); }
43 if (ajaxPopovers != null) { ajaxPopovers.abort(); ajaxPopovers = null; }
44 modal = '' + '<div class="modal popup-content deliveridates">'+ '<div class="modal-dialog" role="document">'+ '<div class="modal-content">'+ '<div class="modal-header">'+ '<button type="button" class="close"><span aria-hidden="true">&times;</span></button>'+ '<h4 class="modal-title placeholder" id="exampleModalLabel"> </h4>'+ '</div>'+ '<div class="modal-body clearfix">' + '<div class="loader text-center"></div>' + '</div>'+ '</div>'+ '</div>'+ '</div>'; modal = $(modal); modal.hide(); if ($('.popup-content.deliveridates').length > 0) { $('.popup-content.deliveridates').html(modal.html()); }
45 $('body').lightModal({ open: false, width: "300px", content: modal, overlay: true, closeClass: '.close, .closeBtn', keyboard: true }); $el.trigger('open'); $href = $el.attr('href'); $id_product = $el.data('id_product'); $id_product_attribute = $el.data('id_product_attribute'); ajaxPopovers = $.ajax({ type:"POST", url: $href, async: true, dataType: "json", data: { process: 'geDeliveryDetail', get_old: $old, id_product: $id_product, id_product_attribute: $id_product_attribute }, success : function(res){ if (res.success == 1) { modal = $(res.result); modal.hide().insertAfter($el); $('.popup-content.deliveridates').html(modal.html()); } else { alert('Data error, something is wrong.'); }
46 ajaxPopovers = null; } }); }
47function highdpiInit(){ if (typeof highDPI === 'undefined')
48 return; if(highDPI && $('.replace-2x').css('font-size') == "1px"){ var els = $("img.replace-2x").get(); for(var i = 0; i < els.length; i++){ src = els[i].src; extension = src.substr( (src.lastIndexOf('.') +1) ); src = src.replace("." + extension, "2x." + extension); var img = new Image(); img.src = src; img.height != 0 ? els[i].src = src : els[i].src = els[i].src; } } }
49function dropDown() { elementClick = '#header .current'; elementSlide = 'ul.toogle_content'; activeClass = 'active'; $(elementClick).on('click', function (e) { e.stopPropagation(); var subUl = $(this).next(elementSlide); if (subUl.is(':hidden')) { subUl.slideDown(); $(this).addClass(activeClass); } else { subUl.slideUp(); $(this).removeClass(activeClass); }
50 $(elementClick).not(this).next(elementSlide).slideUp(); $(elementClick).not(this).removeClass(activeClass); e.preventDefault(); }); $(elementSlide).on('click', function (e) { e.stopPropagation(); }); $(document).on('click', function (e) { e.stopPropagation(); var elementHide = $(elementClick).next(elementSlide); $(elementHide).slideUp(); $(elementClick).removeClass('active'); }); }
51function bindUniform(){ if (!!$.prototype.uniform)
52 $("select.form-control,input[type='radio'],input[type='checkbox']").not(".not_uniform").uniform(); }
53function manageToggleFooter() { $(".footer-left-block .content-block").each(function() { $(this).children(".footer-list").each(function() { if ($(window).width() <= 767 && $("body").hasClass("responsive")) { if (!$(this).hasClass("open")) { $(this).hide(); } } else { $(this).show(); } }); $(".footer-list-title").on("click", function () { if ($(window).width() <= 767 && $("body").hasClass("responsive")) { var $toggle = $(this); var $list = $(this).parent().children(".footer-list"); if ($list.hasClass("open")) { $list.slideUp(function() { $toggle.removeClass("open"); $list.removeClass("open"); }); } else { $list.slideDown(function() { $toggle.addClass("open"); $list.addClass("open"); }); } } else { } }); }) }
54function refreshTopCart() { if (typeof first_cart_load!= 'undefined' && !first_cart_load &&
55 typeof ajaxCart != 'undefined' && typeof ajaxCart.refresh != 'undefined') { $loading_products = '' + '<span class="animate-cart-search"></span>'; $($loading_products).insertBefore('#header .cart_block .cart_block_no_products'); $('#header .cart_block .cart_block_no_products').hide(); ajaxCart.refresh(); first_cart_load = true; } }
56function closeSvetmovanoInfo() { $('#svetmovano_info').slideUp(300); $.cookie('svetmovano_info_closed', 1); }
57const newHpAppScroller = { bar: null, list: null, rider: null, block: null, container: null, move_active: false, bar_container: null, _s_move_x: null, s_move_x: null, _s_move_y: null, move_first: false, scrollElement: null, wasMoved: false, timer: null, time: null, target: null, next_arrow: null, prev_arrow: null, velocityX: 0, lastTouchX: 0, lastTouchTime: 0, inertiaFrame: null, options: { scrollerOverflow: true, arrows: false }, setDefaultOptions: function(options) { this.extendOption(options); }, ini: function(target, _class, options) { if (!target) { return null; }
58 if (typeof target.hpBanner == 'undefined') { target.hpBanner = {...newHpAppScroller}; target.hpBanner.load(target, _class, options); }
59 return target.hpBanner; }, load: function(target, _class, options) { this.target = target; this.extendOption(options); if (target.classList.contains(_class)) { this.list = target; } else { var list = target.querySelector('.' + _class); if (list != null) { this.list = list; } }
60 if (this.list != null) { this.bar_container = document.createElement('div'); this.block = document.createElement('div'); this.container = document.createElement('div'); this.block.appendChild(this.container); var footer_element = this.target.querySelector('.footer_element'); if (footer_element != null) { footer_element.parentNode.appendChild(this.bar_container); } else { this.block.appendChild(this.bar_container); }
61 this.block.classList.add('newhomepageapp_scroll_block'); this.bar_container.classList.add('newhomepageapp_scroll_bar'); this.bar_container.innerHTML = '<span class="scroll_bar"><span class="scroll_bar_rider"></span></span>'; this.bar = this.bar_container.querySelector('.scroll_bar'); this.rider = this.bar_container.querySelector('.scroll_bar_rider'); this.list.parentNode.insertBefore(this.block, this.list); this.container.appendChild(this.list); this.checkDisplay(); if (this.options.arrows) { this.next_arrow = document.createElement('span'); this.prev_arrow = document.createElement('span'); this.next_arrow.classList.add('newhomepageapp_next'); this.prev_arrow.classList.add('newhomepageapp_prev'); this.container.appendChild(this.next_arrow); this.container.appendChild(this.prev_arrow); }
62 var ele = this.list.querySelectorAll('img, a'); if (ele.length > 0) { ele.forEach(function(el){ el.setAttribute('draggable', false); }); }
63 var time = parseInt(target.getAttribute('data-autoplay')); if (!isNaN(time) &&
64 time > 0
65 ) { this.time = time*1000; }
66 var self = this; $(window).resize(function(){ self.checkDisplay(); }); if (this.options.arrows) { this.prev_arrow.onclick = function(){ self.stopTimer(); self.prevSlide(); }; this.next_arrow.onclick = function(){ self.stopTimer(); self.nextSlide(); }; }
67 $([this.rider, this.container]).on('mousedown touchstart', function(e){ self.move_active = true; self.move_first = true; self._s_move_x = self.getEventClientX(e); self.s_move_x = self.getEventClientX(e); self._s_move_y = self.getEventClientY(e); self.scrollElement = this; self.lastTouchX = self.getEventClientX(e); self.lastTouchTime = performance.now(); self.velocityX = 0; cancelAnimationFrame(self.inertiaFrame); }); $(this.container).on('mouseup mouseleave touchend click', function(e){ self.move_active = false; self.move_first = false; self.s_move_x = null; if (Math.abs(self.velocityX) > 0.01) { self.startInertiaScroll(); }
68 setTimeout(function() { self.wasMoved = false; }, 50); if (!self.timer) { self.startTimer(); } }); $(window).on('mouseup touchend', function(e){ if (self.scrollElement == self.rider) { self.move_active = false; self.move_first = false; self.s_move_x = null; if (!self.timer) { self.startTimer(); } } }); $(document).on('mousemove', function(e){ if (self.move_active) { var move_x = self.getEventClientX(e), move_y = self.getEventClientY(e); const now = performance.now(); const dx = move_x - self.lastTouchX; const dt = now - self.lastTouchTime || 16; self.velocityX = dx / dt; self.lastTouchX = move_x; self.lastTouchTime = now; self.scrollX(move_x); } }); document.addEventListener('touchmove', function(e){ if (self.move_active) { var move_x = self.getEventClientX(e), move_y = self.getEventClientY(e); e.preventDefault(); self.move_first = false; const now = performance.now(); const dx = move_x - self.lastTouchX; const dt = now - self.lastTouchTime || 16; self.velocityX = dx / dt; self.lastTouchX = move_x; self.lastTouchTime = now; self.scrollX(move_x); } }, { passive: false }); this.list.querySelectorAll('a').forEach(function(a){ a.addEventListener('click', function(e){ if (self.wasMoved) { e.preventDefault(); e.stopImmediatePropagation(); } }); }); self.startTimer(); } }, startInertiaScroll: function() { const self = this; let velocity = self.velocityX; const friction = 0.95; const minVelocity = 0.02; let lastFrame = performance.now(); function step(now) { const dt = now - lastFrame; lastFrame = now; if (Math.abs(velocity) > minVelocity) { self.container.scrollLeft -= velocity * dt; self.updateRiderPosition(); velocity *= friction; self.inertiaFrame = requestAnimationFrame(step); } }
69 self.inertiaFrame = requestAnimationFrame(step); }, updateRiderPosition: function() { const scrollLeft = this.container.scrollLeft; const scrollWidth = this.list.scrollWidth; const containerWidth = this.container.clientWidth; if (scrollLeft > 0) { this.rider.style.marginLeft = ((scrollLeft / scrollWidth) * this.bar.clientWidth) + 'px'; } else { this.rider.style.marginLeft = '0px'; } }, extendOption: function(option) { if (typeof option == typeof { }) { for (var i in option) { this.options[i] = option[i]; } } }, getEventClientX: function(e) { if (typeof e.clientX == 'undefined') { if (typeof e.originalEvent != 'undefined') { return e.originalEvent.touches[0].clientX; }
70 return e.touches[0].clientX; } else { return e.clientX; } }, getEventClientY: function(e) { if (typeof e.clientY == 'undefined') { if (typeof e.originalEvent != 'undefined') { return e.originalEvent.touches[0].clientY; }
71 return e.touches[0].clientY; } else { return e.clientY; } }, scrollX: function(clientX) { this.stopTimer(); var diff = clientX-this.s_move_x, move_p = 0, bar_width = this.rider.clientWidth, con_width = this.bar.clientWidth, left = this.getRiderLeft(); if (Math.abs(this._s_move_x-this.s_move_x) > 5) { this.wasMoved = true; }
72 if (!this.scrollElement.classList.contains('scroll_bar_rider')) { diff = -1*diff; bar_width = this.container.clientWidth; con_width = this.list.clientWidth; left = this.getContainerLeft(); }
73 if (isNaN(diff) ||
74 diff == 0
75 ) { return; }
76 if (diff > 0) { if (con_width-bar_width-left < diff) { move_p = con_width-bar_width; } else { move_p = left + diff; } } else { if (left > Math.abs(diff)) { move_p = left+diff; } else { move_p = 0; } }
77 this.s_move_x = clientX; if (move_p > 0) { this.rider.style.marginLeft = ((move_p/con_width)*this.bar.clientWidth)+'px'; this.container.scrollLeft = (move_p/con_width)*this.list.clientWidth; } else { this.rider.style.marginLeft = '0px'; this.container.scrollLeft = 0; } }, getRiderLeft: function() { if (this.rider.style.marginLeft == '') { return 0; } else if ((/[0-9]\s*%/).test(this.rider.style.marginLeft)) { return (this.rider.clientWidth*parseInt(this.rider.style.marginLeft)); }
78 return parseInt(this.rider.style.marginLeft); }, getContainerLeft: function() { return this.container.scrollLeft; }, checkDisplay: function() { this.container.style.width = ''; if (this.block.clientWidth < this.list.scrollWidth) { this.container.classList.add('scroller'); if (this.options.scrollerOverflow) { this.container.style.width = ($(window).width()-$(this.container).offset().left)+'px'; }
79 this.rider.style.width = Math.round(100*this.container.clientWidth/this.list.scrollWidth)+'%'; } else { this.container.classList.remove('scroller'); }
80 if (this.container.clientWidth < this.list.scrollWidth) { this.bar.style.display = ''; } else { this.bar.style.display = 'none'; this.rider.style.marginLeft = '0px'; this.container.scrollLeft = 0; } }, nextSlide: function() { var _break = false, childs = this.list.querySelectorAll('& > *'), cont_left = $(this.container).offset().left, scroll_left = this.container.scrollLeft, move_to = 0; childs.forEach(function(child){ if (!_break) { var left = $(child).offset().left-cont_left; if (left > 0) { move_to = Math.abs(scroll_left+left); _break = true; } } }); this.animateSlide(move_to); this.startTimer(); }, prevSlide: function() { var childs = this.list.querySelectorAll('& > *'), cont_left = $(this.container).offset().left, scroll_left = this.container.scrollLeft, move_to = this.container.scrollWidth; childs.forEach(function(child){ var left = $(child).offset().left-cont_left; if ($(child).offset().left < cont_left) { move_to = Math.abs(scroll_left+left); } }); this.animateSlide(move_to); this.startTimer(); }, animateSlide: function(slideTo) { if (slideTo+this.container.clientWidth > this.container.scrollWidth) { if (this.container.scrollLeft == this.container.scrollWidth-this.container.clientWidth) { slideTo = 0; } else { slideTo = this.container.scrollWidth-this.container.clientWidth; } }
81 $(this.container).animate({ scrollLeft: slideTo }, 500); $(this.rider).animate({ marginLeft: (slideTo == 0 ? slideTo : (slideTo/this.container.scrollWidth)*this.bar.clientWidth) }, 500); }, startTimer: function() { this.stopTimer(); if (this.time > 0) { var self = this; this.timer = setTimeout(function(){ self.nextSlide(); }, this.time); } }, stopTimer: function() { if (this.timer != null) { clearTimeout(this.timer); this.timer = null; } } }; var psJsHook = { fcs: {}, trigger: function(h, ...args) { if (Array.isArray(this.fcs[h])) { this.fcs[h].forEac
81h(function(callable) { if (Array.isArray(callable)) { const [obj, method] = callable; if (obj && typeof obj[method] === 'function') { obj[method](...args); } } else if (typeof callable === 'function') { callable(...args); } }); } }, register: function(h, fce) { if (!this.fcs[h]) { this.fcs[h] = []; }
82 if (this.fcs[h].indexOf(fce) === -1) { this.fcs[h].push(fce); } } };

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.