PageSourceSearch

https://concertinisrael.com/templates/default/js/orslider.js?c=3

js concertinisrael.com collected 2026-09-26 03:11:24 UTC 11,936 bytes, 321 lines download raw bytes

1var on_slider_list_load_functions = [];
2window.on_slider_list_load = function (f) {
3    on_slider_list_load_functions.push(f);
4};
5
6// 1> add on each add for the preview at selected page. (JS?)
7// 2> on PUBLISH glatticket -> add glatticket new events to bekef sliders, and so on to the tickchak sliders.
8
9
10
11function or_slider(first){
12    var swiper=false;
13    window.tickchak_slider_array = [[],[],[]];
14    var $section = $('.section-orslider');
15    var event_category = {'0':'כללי'};
16    var swiper_array = [];
17    var is_mobile = false;//TICKCHAK.is_mobile === undefined ? ($(window).width() < 800) : TICKCHAK.is_mobile;
18    var num_s = 6, num_grp = 3;
19    if(is_mobile){
20        num_grp = 1;
21        num_s = 3;
22    }
23    if($(window).width() > 800 && $(window).width() < 1431){
24        num_grp = 2;
25        num_s = 5;
26    } else if($(window).width() < 800) {
27        num_s = 2;
28    }
29
30    var sec_len = $section.find('.orslider-container').length;
31    var images_path = TICKCHAK.orslider[$section.find('.or-slider-wraper').attr('data-id')];
32
33    var cur_url = getQueryString();
34    var suggestions_offset = [0,0,0];
35    var no_more_events = [false,false,false];
36
37    var event_link_target = TICKCHAK.event.is_design ? '_blank' : '_self';
38
39    $section.find('.wscbt-settings').css({'pointer-events':'none'});
40
41    $section.find('.orslider-container').each(function (k, v) {
42
43        var num_s=6;
44
45        if($(window).width() > 800 && $(window).width() < 1431){
46            num_grp = 2;
47            num_s = 5;
48        } else if($(window).width() < 800) {
49            //num_s = $(this).hasClass('small')?2:3;
50            num_s = 2;
51        }
52
53
54        $(this).addClass('swiper-container');
55        var events = [];
56        var i = parseInt($(this).attr('data-index'));
57        if($(v).attr('data-token') === ''){
58            return true;
59        }
60        $(v).find('.orslider-wraper').append('<div class="loader-gif" style="width:100%;height:100%;"></div>');
61
62        if(typeof TICKCHAK != 'undefined' && typeof TICKCHAK.event != 'undefined' && typeof TICKCHAK.event.events_data != 'undefined' && typeof TICKCHAK.event.events_data['orslider'] != 'undefined' && TICKCHAK.event.events_data['orslider']){
63            post_get_events_suggestions(TICKCHAK.event.events_data['orslider'][k]);
64            if(TICKCHAK.event.events_data['orslider'][k].events.length < 12){
65                no_more_events[k] = true;
66            }
67        } else {
68            $.post('/ajax/api/get_events_suggestions',
69                {   p:$(v).attr('data-token'),
70                    category: $(v).attr('data-category-select'),
71                    eid: TICKCHAK.event.eid,
72                    offset:suggestions_offset[k],
73                    limit: 200
74                },function(data){
75                    post_get_events_suggestions(data);
76                });
77        }
78        function post_get_events_suggestions(data){
79            $(v).find('.orslider-wraper .loader-gif').remove();
80            $section.find('.wscbt-settings').css({'pointer-events':'all'});
81            //events = [];
82            //data['events']=[...data['events'],...data['events'],...data['events'],...data['events']];
83            $.each(data['events'], function(k,v){
84                if(is_null_event(v)){
85                    return;
86                }
87                if((TICKCHAK.event.eid+'') === v['eid']){
88                    return;
89                }
90                if(first !== undefined && first){
91                    if(v['pid'] == parent.TICKCHAK.event.pid)
92                        events.push(v);
93                }else {
94                    events.push(v);
95                }
96            });
97
98            $.each(data['categories'], function (k,v) {
99                event_category[v['cat_id']] = v['title'];
100            })
101
102            if(!events.length){
103                return true;
104            }
105
106
107            window.tickchak_slider_array[i]=events;
108
109            $.each(events, function (i, val) {
110                var img_path = val['fb_img_mobile'] || val['fb_img'];
111                $.each(images_path, function (i, g) {
112                    if(g.eid==val["eid"])
113                        img_path=g.path;
114                });
115                var category = (val['category'] != null) ? event_category[val['category']]:'כללי';
116
117                var link = val['link'];
118                if(cur_url['ref'] !== undefined)
119                    link = val['link'].replace('ref=1B1O','_ref='+TICKCHAK.event.eid+'_'+cur_url['ref']);
120                if(TICKCHAK.event.type === 'frontpage') {
121                    link = val['link'].replace('ref=1B1O','_ref='+TICKCHAK.event.eid);
122                    if(cur_url['ref'] !== undefined)
123                        link = link + '_'+cur_url['ref'];
124                }
125
126                var background_image_path = img_path ? 'url('+ img_path +')' : 'none';
127                $(v).find(".orslider-wraper").append('<div class="orslider-slide swiper-slide slide-'+i+'" data-eid="'+val["eid"]+'">' +
128                    '<div class="orslider-bg" style="background-image: '+ background_image_path +';">' +
129                    '<div class="slider-hover-ctr">' +
130                    '<div class="slider-hover-top-ctr">' +
131                    '<div class="slider-hover-category">' +
132                    '<div class="slider-hover-cat-text">'+(category?category:'')+'</div>' +
133                    '</div>' +
134                    '</div>' +
135                    '<div class="slider-hover-middle-ctr">' +
136                    '<div class="slider-hover-title">'+val['title']+'</div>' +
137                    '<div class="slider-hover-description">'+val['description']+'</div>' +
138                    '</div>' +
139                    '<div class="slider-hover-bottom-ctr">' +
140                    '<div class="slider-hover-open-date">'+(val['time_openstart_date']?val['time_openstart_date']:'')+'</div>' +
141                    '<div class="slider-hover-time-open'+(val['time_openstart_time']?'':' no-before')+'">'+(val['time_openstart_time']?val['time_openstart_time']:'')+'</div>' +
142                    '<div class="slider-hover-event-link">' + t(4)+
143                    '</div>' +
144                    '</div>' +
145                    '<a href="'+link+'" target="'+event_link_target+'"></a>' +
146                    '</div>' +
147                    '</div></div>');
148            });
149
150
151
152            if(events.length > 0){
153                setTimeout(function(){
154                    reinitSwiper(swiper_array[k], num_s,false,$(v));
155                },i*750);
156            }else{
157
158            }
159
160            $.each(on_slider_list_load_functions,function(i,f){
161                f($(v));
162            });
163            if(($(window).width() < 800)){
164                $(v).on('click','.slider-hover-ctr',function () {
165                    var index = parseInt($(this).parents('.orslider-container').attr('data-index'));
166                    var my_event = get_obj_by_eid(tickchak_slider_array[parseInt(index)], $(this).parent().parent().attr('data-eid'));
167                    build_event_on_mob(my_event, index);
168                })
169            }
170
171            if(is_mobile){
172                setTimeout(function () {
173                    swiper.params.slidesOffsetAfter = 20 * events.length;
174                    swiper.params.loop = false;
175                    swiper.update();
176                }, 500);
177            }
178        }
179
180
181
182        if(is_mobile){
183            swiper_array[k].on('slideChange', function () {
184                on_slide_change()
185            });
186        }else{
187            $(v).find('.swiper-button-next').click(function () {
188                on_slide_change()
189            });
190        }
191
192
193        function on_slide_change(){
194            if(no_more_events[k])
195                return;
196            suggestions_offset[k] = $(v).find('.swiper-slide').length + 1;
197            $(v).find('.swiper-button-next').css('pointer-events','none');
198
199            $.post('/ajax/api/get_events_suggestions',
200                {   p:$(v).attr('data-token'),
201                    category: $(v).attr('data-category-select'),
202                    eid: TICKCHAK.event.eid,
203                    offset:suggestions_offset[k],
204                    limit: (200)
205                },function(data){
206                    if(data['events'].length)
207                        post_get_events_suggestions(data);
208                    else
209                        no_more_events[k] = true;
210                    $(v).find('.swiper-button-next').css('pointer-events','all');
211                });
212        }
213
214
215    });
216
217
218    function build_event_on_mob(event, idx) {
219
220        var images_path = TICKCHAK.orslider[$section.find('.or-slider-wraper').attr('data-id')];
221        var img_path = event['fb_img'];
222        $.each(images_path, function (i, g) {
223            if(g.eid==event["eid"])
224                img_path=g.path;
225        });
226        var category = (event['category'] != null) ? event_category[event['category']]:'כללי';
227        $('body').append('<div class="orslider-wraper-slide-mob"><div class="close-slide-mob"></div><div class="orslider-slide-mob" style="background-image: url('+img_path+');">' +
228            '<div class="slider-top-ctr-mob-con">' +
229            '<div class="slider-top-ctr-mob">' +
230            '<div class="slider-category-mob">' +
231            '<div class="slider-category-text-mob">'+category+'</div>' +
232            '</div>' +
233            '</div>' +
234            '<div class="slider-middle-ctr-mob">' +
235            '<div class="slider-title-mob">'+event['title']+'</div>' +
236            '<div class="slider-description-mob">'+event['description']+'</div>' +
237            '</div>' +
238            '<div class="slider-bottom-ctr-mob">' +
239            '<div class="slider-open-date-mob">'+event['time_openstart_date']+'</div>' +
240            '<div class="slider-time-open-mob">'+event['time_openstart_time']+'</div>' +
241            '<div class="slider-event-link-mob">כרטיסים' +
242            '<a href="'+event["link"]+'" target="'+event_link_target+'"></a>' +
243            '</div>' +
244            '</div>' +
245            '</div></div>');
246
247        $('body').find('.close-slide-mob, .orslider-wraper-slide-mob').click(function (e) {
248            if($(e.target).hasClass('orslider-slide-mob') || $(e.target).parents('.orslider-slide-mob').length){
249                return;
250            }
251            $('body .orslider-wraper-slide-mob').remove();
252        });
253
254
255
256    }
257
258
259
260
261    function get_obj_by_eid(arr, eid){
262        var obj = {};
263        $.each(arr, function (k,v) {
264            if(v['eid'] == eid) {
265                obj = v;
266                return false;
267            }
268        })
269        return obj;
270    }
271
272
273    function is_null_event(obj){
274        var ctr =  0;
275        // if(obj['description'] === null){
276        //     ctr++;
277        // }
278        // if(obj['location'] === null){
279        //     ctr++;
280        // }
281
282        if(ctr >= 1){
283            return true;
284        }
285
286    }
287
288
289    function reinitSwiper(swiper, slidesPerView, destroy,$v) {
290        if(!swiper)
291            swiper = new Swiper($v.get(0), {
292                direction: 'horizontal',
293                slidesPerView: slidesPerView,
294                //slidesPerGroup: 1,//Math.max(1,Math.floor(slidesPerView/2)),
295                speed: 1000,
296                watchSlidesVisibility: true,
297                loop: 'true',
298                freeMode: true,
299                //spaceBetween: $(window).width()<800?10:20,
300                //observer: true,
301                //observeParents: true,
302                //parallax:true,
303                navigation: {nextEl: '.swiper-button-next',
304                    prevEl: '.swiper-button-prev'}
305            });
306        swiper_array.push(swiper);
307
308        setTimeout(function () {
309            if(destroy){
310                swiper.destroy(true,false);
311            }else{
312                swiper.params.slidesPerView = slidesPerView;
313                swiper.update();
314            }
315        }, 500);
316    }
317
318
319
320
321}

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.