1jQuery(document).ready(function () { 2 this.data = []; 3 function Banners() { 4 this.updateNewsStyles = function () { 5 $('.news *').remove(); 6 $('.news').css({ 7 'background-image': 'none', 8 'height' : '351px', 9 'overflow' : 'hidden' 10 }); 11 $('.news').addClass('slider'); 12 }; 13 14 this.removeSliders = function () { 15 $('.news *').remove(); 16 $('.news').css({ 17 'background-image': 'none', 18 'height' : '0px', 19 'overflow' : 'hidden' 20 }); 21 }; 22 23 this.addSliders = function ($container, sliders) { 24 for (var sliderNo in sliders) { 25 this.addSlider($container, sliders[sliderNo]); 26 } 27 }; 28 29 this.filterBanners = function (type) { 30 var filteredBanners = []; 31 for (var k in this.data) { 32 var startDate = new Date(this.data[k].start_date.replace(new RegExp("-", 'g'), "/")).getTime(); 33 var stopDate = new Date(this.data[k].stop_date.replace(new RegExp("-", 'g'), "/")).getTime(); 34 var nowDate = new Date().getTime(); 35 if(this.data[k].id_promotion_state == "1" && startDate < nowDate && nowDate < stopDate) { 36 // Workaround after SSL implementation... This field comes from E-kiosk REST service and full URL's with protocol and context are stored in the database... 37 // Replace to https protocol for internal application links. See: EKIOSK-1392 and EKIOSK-1454 38 if (this.data[k].link_eg.indexOf(window.location.host) !== -1) { 39 var link_egWithSSL = this.data[k].link_eg.replace("http://", "https://"); 40 this.data[k].link_eg = link_egWithSSL; 41 } 42 filteredBanners.push(this.data[k]); 43 } 44 } 45 return filteredBanners; 46 }; 47 48 this.addSlider = function ($container, slide) { 49 var arrHostName = { 50 'www.egazety.pl':'e-kiosk.pl', 51 'dev.egazety.pl':'dev.e-kiosk.pl', 52 'egazety.intenso.pl':'e-kiosk.intenso.pl', 53 'localhost:8080':'dev.e-kiosk.pl' 54 } 55 // Workaround because of unimplemented HTTPS protocol in eKiosk DEV server. See: EKIOSK-1231 56 var arrProtocolType = { 57 'www.egazety.pl':'https', 58 'dev.egazety.pl':'http', 59 'egazety.intenso.pl':'http', 60 'localhost:8080':'http' 61 } 62 var slideTemplate = 63 '<div class="slide">' + 64 '<a ' + 65 (slide.link_eg == ''?'':' href="' + slide.link_eg + '"') + 66 '><img class="owl-lazy" data-src="' + arrProtocolType[window.location.host] + '://' + arrHostName[window.location.host] + '/images/' + slide.filename + '"></a>' + 67 '</div>'; 68 $container.append(slideTemplate); 69 } 70 71 if (bannersData) { 72 this.data = bannersData.banners; 73 if (this.data.length > 0) { 74 var filteredBanners = this.filterBanners(1); 75 if (filteredBanners.length > 0) { 76 this.updateNewsStyles(); 77 this.addSliders($('.news'), filteredBanners); 78 $('.news').owlCarousel({ 79 lazyLoad: true, 80 loop: true, 81 items: 1, 82 pagination: true, 83 autoheight: false, 84 nav: true, 85 autoplay: true, 86 autoplayHoverPause: true, 87 transitionStyle: "fade", 88 singleItem: true, 89 slideSpeed: 30000, 90 paginationSpeed: 1000, 91 }); 92 } else { 93 this.removeSliders(); 94 } 95 } 96 } 97 } 98 99 banners = new Banners(); 100}); 101jQuery(document).ready(function () { 102 $('.news').find(".owl-dots").hide(); 103});
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.