PageSourceSearch

https://lizzadromuseum.org/wp-content/plugins/event-calendar-wd/js/scripts.js

js lizzadromuseum.org collected 2026-10-02 06:57:50 UTC 43,467 bytes, 852 lines download raw bytes

1/* global jQuery, ecwd, ecwd_calendar */
2
3/**
4 * Public JS functions
5 */
6
7var functions_interval, filterTimeout;
8
9ecwd_load_styles = function () {
10    setTimeout(function () {
11        if (jQuery('#ecwd-calendar-main-css').length == 0) {
12            jQuery("<link/>", {
13                id: 'ecwd-calendar-main-css',
14                rel: "stylesheet",
15                type: "text/css",
16                href: ecwd.plugin_url + '/css/calendar.css?ver=1'
17            }).appendTo("head");
18        }
19        jQuery('.ecwd_theme_file').each(function (k, el) {
20            if (jQuery('#ecwd-calendar-theme_' + jQuery(el).val() + '-css').length == 0 && jQuery(el).val().indexOf("calendar") == -1) {
21                jQuery("<link/>", {
22                    id: 'ecwd-calendar-theme_' + jQuery(el).val() + '-css',
23                    rel: "stylesheet",
24                    type: "text/css",
25                    href: ecwd.plugin_url + '/css/themes/' + jQuery(el).val() + '.css?ver=1'
26                }).appendTo("head");
27            }
28        });
29    }, 400);
30};
31
32if (typeof ecwd_js_init_call != "object")
33    var ecwd_js_init_call;
34if (typeof ecwd_js_init != "function")
35    var ecwd_js_init;
36(function ($) {
37    'use strict';
38    ecwd_js_init = function () {
39        ecwd_eventsOff();
40        ecwd_load_styles();
41        var cwidth = $(".calendar_main .ecwd_calendar").width();
42        var view_click = 1;
43        var click = 1;
44        $('a[href="#ecwd-modal-preview"]').click(function () {
45            setTimeout(function () {
46                showFilterSliderArrow();
47            }, 1);
48        });
49        clearTimeout(functions_interval);
50        functions_interval = setTimeout(function () {
51            show_filters(0);
52            showMiniCalendarEventOnHover();
53            showFullCalendarEventOnHover();
54            showWidgetEventDesc();
55            calendarFullResponsive();
56            showFilterSliderArrow();
57            createSearchForm();
58            upcomingEventsSlider();
59            doMasonry();
60        }, 350);
61
62        this.showMap = function () {
63
64            if (ecwd.gmap_key == "") {
65                jQuery(".ecwd_map_div").each(function (k, v) {
66                    var $this = jQuery(this);
67                    if ($this.closest('.ecwd-show-map').length == 1) {
68                        $this.closest('.ecwd-show-map').hide();
69                    }
70                    $this.hide();
71                });
72                return;
73            }
74
75            if (typeof google == 'undefined' || typeof google.maps == "undefined") {
76                var script = document.createElement('script');
77                script.type = 'text/javascript';
78                script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&callback=ecwd_js_init_call.showMap&key='+ecwd.gmap_key;
79                document.body.appendChild(script);
80            } else {
81                var maps = [];
82                jQuery(".ecwd_map_div").each(function (k, v) {
83                    maps[k] = this;
84                    var locations = JSON.parse($(maps[k]).next('textarea').val());
85                    var locations_len = Object.keys(locations).length;
86                    $(maps[k]).gmap3();
87
88                    var markers = [];
89                    var zoom = 17;
90                    if (locations_len > 0 && typeof locations[0] != 'undefined' && typeof locations[0]['zoom'] != 'undefined') {
91                        zoom = parseInt(locations[0]['zoom']);
92                    } else {
93                        zoom = 2;
94                    }
95                    for (var i = 0; i < locations_len; i++) {
96                        if (locations[i]) {
97                            var marker = new Object();
98                            marker.lat = locations[i].latlong[0];
99                            marker.lng = locations[i].latlong[1];
100                            marker.data = locations[i].infow;
101                            marker.options = new Object();
102                            marker.options.google_map_url = locations[i]['google_map_url']
103                            markers.push(marker);
104                        }
105
106                    }
107
108                    if (ecwd.gmap_type == 'SATELLITE') {
109                        var gmap_type = google.maps.MapTypeId.SATELLITE;
110                    } else {
111                        var gmap_type = google.maps.MapTypeId.ROADMAP;
112                    }
113                    
114                    $(maps[k]).gmap3({
115                        map: {
116                            options: {
117                                zoom: zoom,
118                                zoomControl: true,
119                                mapTypeId: gmap_type,
120                                styles: (ecwd.gmap_style !== "") ? JSON.parse(ecwd.gmap_style) : null,
121                            }
122                        },
123                        marker: {
124                            values: markers,
125                            options: {
126                                draggable: false
127                            },
128                            events: {
129                                click: function (marker, event, context) {
130                                    if (ecwd.gmap_redirect == "1" && $(this).hasClass('ecwd_map_div')) {
131                                        var url = "";
132                                        if (typeof marker.google_map_url != "undefined" && marker.google_map_url !== '') {
133                                            url = marker.google_map_url;
134                                            url += ","+marker.map.zoom+"z";
135                                        } else {
136                                            url = marker.map.mapUrl;
137                                        }                                        
138                                        window.open(url, '_blank');
139                                    } else {
140                                        var map = $(maps[k]).gmap3("get"),
141                                                infowindow = $(maps[k]).gmap3({get: {name: "infowindow"}});
142                                        if (infowindow) {
143                                            infowindow.open(map, marker);
144                                            infowindow.setContent(context.data);
145                                        } else {
146                                            $(maps[k]).gmap3({
147                                                infowindow: {
148                                                    anchor: marker,
149                                                    options: {content: context.data}
150                                                }
151                                            });
152                                        }
153                                    }
154                                }
155                            }
156                        },
157                        autofit: {maxZoom: zoom}
158                    });
159
160                });
161
162            }
163        }
164
165        jQuery('.ecwd_reset_filters').click(function () {
166            $(this).closest('.ecwd_filters').find('input:checkbox').attr('checked', false);
167        });
168        $('.ecwd-calendar-more-event').each(function () {
169            $(this).find('.ecwd-more-events-container').ecwd_popup({
170                button: $(this).find('.more_events_link'),
171                title: $(this).find('.ecwd-more-event-title').val(),
172                body_id: "ecwd-modal-preview",
173                body_class: "ecwd-excluded-events",
174                container_class: "ecwd_more_event",
175                after_popup_show: function (el) {
176                    el.find('li.inmore').show();
177                    el.find('.more_events').find('li').on('click', function () {
178                        el.find('li').find('.event-details-container').slideUp();
179                        if ($(this).find('.event-details-container').is(":visible"))
180                            $(this).find('.event-details-container').slideUp();
181                        else
182                            $(this).find('.event-details-container').slideDown();
183                    });
184                    add_single_events_popup();
185                },
186            });
187        });
188
189        add_single_events_popup();
190
191        jQuery('.ecwd_select_all').on('click', function (e) {
192            var obj = this;
193            if (jQuery(obj).attr("checked") == "checked") {
194                jQuery(obj).closest(".ecwd_filters").find(".ecwd_filter").each(function () {
195                    jQuery(this).attr("checked", true);
196                });
197            } else {
198                jQuery(obj).closest(".ecwd_filters").find(".ecwd_filter").each(function () {
199                    jQuery(this).attr("checked", false);
200                });
201            }
202        });
203        jQuery('.ecwd_calendar_prev_next .next, .ecwd_calendar_prev_next .previous, .ecwd_calendar .type, .cpage, .current-month a, .ecwd_filter, .ecwd_select_all, .ecwd_reset_filters').on('click', function (e) {
204            var days = $('input[name="ecwd_weekdays[]"]:checked').map(function () {
205                return this.value;
206            }).get();
207            var cats = $('input[name="ecwd_categories[]"]:checked').map(function () {
208                return this.value;
209            }).get();
210            var tags = $('input[name="ecwd_tags[]"]:checked').map(function () {
211                return this.value;
212            }).get();
213            var venues = $('input[name="ecwd_venues[]"]:checked').map(function () {
214                return this.value;
215            }).get();
216            var organizers = $('input[name="ecwd_organizers[]"]:checked').map(function () {
217                return this.value;
218            }).get();
219            var el = $(this);
220            if (!$(this).is(':checkbox')) {
221                e.preventDefault();
222            }
223            var navLink = $(this);
224            if ((!navLink.attr('href') || navLink.attr('href') == 'undefined') && !navLink.is(':checkbox') && navLink.attr('class') != 'ecwd_reset_filters') {
225                navLink = $(this).find('a');
226            }
227            var main_div = navLink.closest('.calendar_main');
228
229            var calendar_ids_class = $(main_div).find('div.ecwd_calendar').find('div:first-child').attr('class').split('-');
230            var display = $(main_div).find('div.ecwd_calendar').attr('class').split(' ')[0].split('-')[2];
231            var calendar_ids = calendar_ids_class[2];
232            var query = $(main_div).find('input.ecwd-search').val();
233            var tag = $('.ecwd_tags').val();
234            var venue = $('.ecwd_venues').val();
235            var organizer = $('.ecwd_organizers').val();
236            var category = $('.ecwd_categories').val();
237            var displays = $(main_div).find('.ecwd_displays').val();
238            var date = $(main_div).find('.ecwd_date').val();
239            var page_items = $(main_div).find('.ecwd_page_items').val();
240            var event_search = $(main_div).find('.event_search').val();
241            var filters = $(main_div).find('.ecwd_filters').val();
242            var start_date = $(main_div).find('.event_start_date').val();
243            var end_date = $(main_div).find('.event_end_date').val();
244            var calendar_head = $(main_div).find('.calendaer_head').val();
245
246            $(main_div).find('.ecwd_loader').show();
247            jQuery.post(ecwd.ajaxurl, {
248                action: 'ecwd_ajax',
249                ecwd_calendar_ids: calendar_ids,
250                ecwd_link: navLink.attr('href'),
251                ecwd_type: calendar_ids_class[1],
252                ecwd_query: query,
253                ecwd_weekdays: days,
254                ecwd_categories: cats,
255                ecwd_tags: tags,
256                ecwd_venues: venues,
257                ecwd_organizers: organizers,
258                ecwd_category: category,
259                ecwd_tag: tag,
260                ecwd_venue: venue,
261                ecwd_organizer: organizer,
262                ecwd_displays: displays,
263                ecwd_prev_display: display,
264                ecwd_page_items: page_items,
265                ecwd_event_search: event_search,
266                ecwd_filters: filters,
267                ecwd_date: 1,
268                ecwd_date_filter: date,
269                ecwd_calendar_head: calendar_head,
270                ecwd_start_date: start_date,
271                ecwd_end_date: end_date,
272                ecwd_next_date:$(this).hasClass("next"),
273                ecwd_prev_date:$(this).hasClass("previous"),
274                ecwd_nonce: ecwd.ajaxnonce
275            }, function (data) {
276                $(main_div).find('div.ecwd_calendar').replaceWith(data);
277                if ($(main_div).find('.ecwd_filters').length > 0 && $(main_div).find('.ecwd_filters').css('max-width') !== '100%' && $(main_div).find('.ecwd_filters').is(':visible')) {
278                    $(main_div).find('div.ecwd_calendar').css({
279                        "max-width": "71%",
280                        "float": "left"
281                    });
282                    show_filters(main_div);
283                }
284                $(main_div).find('.ecwd_loader').hide();
285                if ($('.ecwd_open_event_popup').length > 0) {
286                    $('.ecwd_open_event_popup').css({
287                        'cursor': 'pointer'
288                    });
289                }
290            })
291            e.stopPropagation();
292        });
293
294
295        function createSearchForm() {
296            var scinpt = document.getElementById("ecwd-search-submit");
297            if (scinpt !== null) {
298                //scinpt.addEventListener('focus', doSearch, false);
299            }
300            jQuery('.ecwd-search').on("keyup", function (e) {
301                if (e.keyCode == 13) {
302                    doSearch(this);
303                }
304            });
305            jQuery('.ecwd-search-submit').on("focus", function (e) {
306                doSearch(this);
307            });
308
309            jQuery('.ecwd-tag-container .ecwd-dropdown-menu > div').click(function (e) {
310                $('.ecwd_tags').val($(this).attr("data-term-tag"));
311                doSearch(this);
312            });
313            jQuery('.ecwd-category-container .ecwd-dropdown-menu > div').click(function (e) {
314                $('.ecwd_categories').val($(this).attr("data-term-category"));
315                doSearch(this);
316            });
317            jQuery('.ecwd-venue-container .ecwd-dropdown-menu > div').click(function (e) {
318                $('.ecwd_venues').val($(this).attr("data-term-venue"));
319                doSearch(this);
320            });
321            jQuery('.ecwd-organizer-container .ecwd-dropdown-menu > div').click(function (e) {
322                $('.ecwd_organizers').val($(this).attr("data-term-organizer"));
323                doSearch(this);
324            });
325        }
326
327
328        function doSearch(el) {
329
330            var main_div = $(el).closest('.calendar_main');
331            var navLink = $(main_div).find('.ecwd_current_link');
332            var query = $(main_div).find('input.ecwd-search').val();
333            var tag = $(main_div).find('.ecwd_tags').val();
334            var venue = $(main_div).find('.ecwd_venues').val();
335            var organizer = $(main_div).find('.ecwd_organizers').val();
336            var category = $(main_div).find('.ecwd_categories').val();
337            var calendar_ids_class = $(main_div).find('div.ecwd_calendar').find('div:first-child').attr('class').split('-');
338            var calendar_ids = calendar_ids_class[2];
339            var displays = $(main_div).find('.ecwd_displays').val();
340            var page_items = $(main_div).find('.ecwd_page_items').val();
341            var event_search = $(main_div).find('.event_search').val();
342            var filters = $(main_div).find('.ecwd_filters').val();
343            $(main_div).find('.ecwd_loader').show();
344            $.post(ecwd.ajaxurl, {
345                action: 'ecwd_ajax',
346                ecwd_query: query,
347                ecwd_category: category,
348                ecwd_tag: tag,
349                ecwd_venue: venue,
350                ecwd_organizer: organizer,
351                ecwd_displays: displays,
352                ecwd_filters: filters,
353                ecwd_page_items: page_items,
354                ecwd_link: navLink.val(),
355                ecwd_calendar_ids: calendar_ids,
356                ecwd_event_search: event_search,
357                ecwd_date: 1,
358                ecwd_type: calendar_ids_class[1],
359                ecwd_calendar_search:1,//not filter
360                ecwd_nonce: ecwd.ajaxnonce
361            }, function (data) {
362                $(main_div).find('div.ecwd_calendar').replaceWith(data);
363                if ($(main_div).find('.ecwd_filters').length > 0 && $(main_div).find('.ecwd_filters').css('max-width') !== '100%' && $(main_div).find('.ecwd_filters').is(':visible')) {
364                    $(main_div).find('div.ecwd_calendar').css({
365                        "max-width": "71%",
366                        "float": "left"
367                    });
368                }
369            });
370            $('.ecwd-search-submit').blur();
371        }
372
373        function showMiniCalendarEventOnHover() {
374        }
375
376
377        var ulEvent, day;
378        var ulEventFull, dayFull;
379        jQuery('div.ecwd_calendar .has-events').on('click', function (e) {
380            dayFull = $(this).attr('data-date').split('-');
381            dayFull = dayFull[2];
382            ulEventFull = $(this).find('ul.events');
383
384            if (parseInt($(this).closest('.ecwd_calendar').width()) <= 300 || parseInt($(window).width()) <= 768 || $(this).closest('.ecwd_calendar').hasClass('ecwd-widget-mini') || $(this).closest('.ecwd_calendar').hasClass('ecwd-page-mini')) {
385                if (dayFull == $(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').attr('data-dayNumber')
386                        && $(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').is(':empty') == false) {
387                    $(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').html('');
388                } else {
389                    showEvent(ulEventFull, this);
390                }
391                $(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').attr('data-dayNumber', dayFull);
392            }
393        });
394
395        function showEvent(el, calendar) {
396            if (el.parent().parent().parent().parent().attr('class').indexOf("full") != -1) {
397                var obj = el;
398                if (el.length > 1) {
399                    el.each(function () {
400                        if ($(this).hasClass('more_events')) {
401                            obj = $(this);
402                            return;
403                        }
404                    });
405                }
406                $(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-detail
406s').html(obj.find('.event-details').clone().css('display', 'block'));
407            } else if (el.parent().parent().parent().parent().attr('class').indexOf("mini") != -1) {
408                $(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(el.clone());
409            }
410            add_single_events_popup();
411        }
412
413        function showFullCalendarEventOnHover() {
414            if (parseInt($(window).width()) >= 768) {
415                $('div.ecwd-page-full .has-events ul.events:not(.more_events) > li:not(.ecwd-calendar-more-event)').on('mouseover', function (e) {
416                    $(this).find('ul.events').show();
417                    var show_event_hover_info = $(".show_event_hover_info");
418                    if (show_event_hover_info.length > 0) {
419                        $(this).find('div.event-details-container').show();
420                    }
421                });
422
423                $('div.ecwd-page-full .has-events ul.events:not(.more_events) > li:not(.ecwd-calendar-more-event)').on('mouseleave', function (e) {
424                    $(this).find('div.event-details-container').hide();
425                });
426            }
427
428            $('div.ecwd-page-full .has-events ul.more_events > li').on('click', function (e) {
429                $('div.ecwd-page-full .has-events ul.more_events > li').find('.event-details-container').slideUp();
430                if ($(this).find('.event-details-container').is(":visible"))
431                    $(this).find('.event-details-container').slideUp();
432                else
433                    $(this).find('.event-details-container').slideDown();
434            });
435        }
436
437
438
439        $('.ecwd-show-map-span').click(function () {
440            $('.ecwd-show-map').show();
441        });
442
443
444
445        function doMasonry() {
446            var $container = $('.ecwd-poster-board');
447            if ($container.length && $('.ecwd-poster-board').find('.ecwd-poster-item').length > 0) {
448                $container.imagesLoaded(function () {
449                    $container.masonry({
450                        itemSelector: '.ecwd-poster-item'
451                    });
452                });
453            }
454
455        }
456
457
458        function showFilterSliderArrow() {
459            var li_position, li_width, last_child;
460            $(".calendar_main:not([class^='ecwd_widget'] .calendar_main) .ecwd_calendar_view_tabs").each(function (key, element) {
461                var cwidth = $(element).closest('.ecwd_calendar').outerWidth();
462                if (cwidth == 0)
463                    cwidth = 600;
464                if ($(this).find('.ecwd-search').length != 0)
465                    var ecwd_calendar_view_tabs_width = parseInt(cwidth) - 50;
466                else
467                    var ecwd_calendar_view_tabs_width = parseInt(cwidth);
468                if (parseInt(jQuery('body').width()) <= 768 || $(".calendar_full_content .ecwd_calendar").width() < 600) {
469                    var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 110);
470                } else if (parseInt(jQuery('body').width()) <= 500 || $(".calendar_full_content .ecwd_calendar").width() < 400) {
471                    var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 90);
472                } else {
473                    var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 150);
474                }
475                $(element).find('.filter-container').width(ecwd_calendar_view_tabs_width);
476                $(element).find('ul li').each(function (keyli, elementli) {
477                    if ($(elementli).hasClass('ecwd-selected-mode')) {
478                        li_position = keyli;
479                        li_width = $(elementli).outerWidth();
480                    }
481                });
482                if ($(element).find(".filter-arrow-right").css("display") == "block" || last_child == 1)
483                    $(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width - 30) / ecwd_calendar_view_visible_count);
484                else
485                    $(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width) / ecwd_calendar_view_visible_count);
486                var ecwd_view_item_width = $(element).find('.filter-container ul li').eq(0).innerWidth() - 1;
487                if (!(ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt($(element).find('.filter-container ul li').length) && !($(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))))
488                    $(element).find('.filter-arrow-right').hide();
489                if (ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt($(element).find('.filter-container ul li').length) && !($(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))) {
490                    $(element).find('.filter-arrow-right').show();
491                } else if ($(element).find("ul li:last-child").hasClass("ecwd-selected-mode")) {
492                    last_child = 1;
493                }
494                if (ecwd_calendar_view_visible_count <= li_position && li_position != 0) {
495                    $(element).find('ul li').css({left: "-" + ((li_position + 1 - ecwd_calendar_view_visible_count) * ecwd_view_item_width) + "px"});
496                    $(element).find('.filter-arrow-left').show();
497                } else
498                    $(element).find('ul li').css({left: "0px"});
499            });
500
501            $('.ecwd_calendar_view_tabs .filter-arrow-right').click(function () {
502                var view_filter_width = $(this).parent().find('ul li').eq(0).outerWidth();
503                var cwidth = $(this).closest('.ecwd_calendar').outerWidth();
504                if (cwidth == 0)
505                    cwidth = 600;
506                if ($(this).find('.ecwd-search').length != 0)
507                    var view_filter_container_width = parseInt(cwidth) - 50;
508                else
509                    var view_filter_container_width = parseInt(cwidth);
510                var view_filter_count = parseInt($(this).parent().find('ul li').length);
511                $(this).parent().find('.filter-arrow-left').show();
512                if (parseInt($(this).parent().find('ul li').css('left')) <= -((view_filter_width * view_filter_count) - view_filter_container_width) + view_filter_width)
513                    $(this).hide();
514                if (click && view_filter_container_width < view_filter_width * view_filter_count && parseInt($(this).parent().find('ul li').css('left')) >= -(view_filter_width * (view_filter_count) - view_filter_container_width)) {
515                    click = 0;
516                    $(this).parent().find('ul li').animate({left: "-=" + view_filter_width}, 400, function () {
517                        click = 1
518                    });
519                }
520            });
521            $('.ecwd_calendar_view_tabs .filter-arrow-left').click(function () {
522                var view_filter_width = $(this).parent().find('ul li').eq(0).outerWidth();
523                if ($(this).parent().find('.filter-arrow-right').css('display') == 'none')
524                    $(this).parent().find('.filter-arrow-right').show();
525                if (parseInt($(this).parent().find('ul li').css('left')) == -view_filter_width)
526                    $(this).hide();
527                if (click && parseInt($(this).parent().find('ul li').css('left')) < 0) {
528                    click = 0;
529                    $(this).parent().find('ul li').animate({left: "+=" + view_filter_width}, 400, function () {
530                        click = 1
531                    });
532                }
533            });
534        }
535
536        function upcomingEventsSlider() {
537            var current_date = Date.parse(Date());
538
539            var upcoming_events_slider_main = $('.upcoming_events_slider').width();
540            $('.upcoming_events_slider .upcoming_events_item').width(upcoming_events_slider_main);
541
542
543            $('.upcoming_events_slider .upcoming_event_container').width(parseInt(upcoming_events_slider_main) - 80);
544            $('.upcoming_events_slider > ul').width(upcoming_events_slider_main * $('.upcoming_events_slider .upcoming_events_item').length);
545
546            if ($(".upcoming_events_slider").width() < $('.upcoming_events_slider > ul').width()) {
547                $('.upcoming_events_slider .upcoming_events_slider-arrow-right').show();
548            }
549
550
551            var min = 0;
552            $('.upcoming_events_slider .upcoming_events_item').each(function () {
553                var item_date = Date.parse($(this).data('date'));
554                if (item_date < current_date) {
555                    min++;
556                } else {
557                    return false;
558                }
559            });
560
561            if (min && min == $('.upcoming_events_slider .upcoming_events_item').length) {
562                min--;
563            }
564            $('.upcoming_events_slider .upcoming_events_item').css('left', -upcoming_events_slider_main * min);
565
566            if (parseInt($('.upcoming_events_slider .upcoming_events_item').css('left')) < 0) {
567                $('.upcoming_events_slider').parent().find('.upcoming_events_slider-arrow-left').show();
568            }
569            if (parseInt($('.upcoming_events_slider .upcoming_events_item').css('left')) == -($('.upcoming_events_slider > ul').width() - upcoming_events_slider_main)) {
570                $('.upcoming_events_slider').parent().find('.upcoming_events_slider-arrow-right').hide();
571            }
572
573            $('.upcoming_events_slider .upcoming_events_slider-arrow-right').click(function () {
574                var events_item_width = $(this).parent().find('ul li').eq(0).width();
575
576                var events_item_count = parseInt($(this).parent().find('ul li').length);
577                if ($(this).parent().find('.upcoming_events_slider-arrow-left').css('display') == 'none')
578                    $(this).parent().find('.upcoming_events_slider-arrow-left').show();
579                if (click && upcoming_events_slider_main < events_item_width * events_item_count && parseInt($(this).parent().find('ul li').css('left')) >= -(events_item_width * (events_item_count) - upcoming_events_slider_main)) {
580                    click = 0;
581                    $(this).parent().find('ul li').animate({left: "-=" + events_item_width}, 400, function () {
582                        click = 1
583                    });
584                }
585                if (parseInt($(this).parent().find('ul li').css('left')) <= -($('.upcoming_events_slider > ul').width() - (2 * events_item_width)))
586                    $(this).hide();
587            });
588            $('.upcoming_events_slider .upcoming_events_slider-arrow-left').click(function () {
589                var events_item_width = $(this).parent().find('ul li').eq(0).width();
590                if ($(this).parent().find('.upcoming_events_slider-arrow-right').css('display') == 'none')
591                    $(this).parent().find('.upcoming_events_slider-arrow-right').show();
592                if (parseInt($(this).parent().find('ul li').css('left')) == -events_item_width)
593                    $(this).hide();
594                if (click && parseInt($(this).parent().find('ul li').css('left')) < 0) {
595                    click = 0;
596                    $(this).parent().find('ul li').animate({left: "+=" + events_item_width}, 400, function () {
597                        click = 1
598                    });
599                }
600
601            });
602        }
603
604        function showWidgetEventDesc() {
605            $('.ecwd_upcomming_expandable ul li .event-main-content, .ecwd-widget-mini .event-container, .ecwd-widget-mini .ecwd_list .event-main-content').each(function () {
606
607                if ($(this).find('.arrow-down').length == 0) {
608
609                    $(this).find('.ecwd-list-date-cont').append("<span class='arrow-down'>&nbsp</span>");
610                    $(this).find('.ecwd-list-date-cont').after("<div class='event_dropdown_cont'></div>");
611                    $(this).find('.event_dropdown_cont').append($(this).children(".event-venue, .event-content, .event-organizers, .event_repeat_rate"));
612
613                    $(this).find('.arrow-down').click(function () {
614                        if ($(this).hasClass('open')) {
615                            $(this).parent().parent().find('.event_dropdown_cont').slideUp(400);
616                            $(this).removeClass('open');
617                        } else {
618                            $(this).parent().parent().find('.event_dropdown_cont').slideDown(400);
619                            $(this).addClass('open');
620                        }
621                    });
622                }
623            })
624        }
625
626        function calendarFullResponsive() {
627            if ($(window).width() <= 500) {
628                $('div[class^="ecwd-page"] .event-container, div[class^="ecwd-page"] .ecwd_list .event-main-content').each(function () {
629                    if ($(this).find('.arrow-down').length == 0) {
630                        var content = $(this).find('.event-content').html();
631                        if ($(this).hasClass("event-container")) {
632                            $(this).find('.event-content').html($(this).find('.ecwd-list-img').html() + content);
633                            $(this).find('.ecwd-list-img').remove();
634                        } else {
635                            var content = $(this).find('.event-content').html();
636                            $(this).find('.event-content').html($(this).prev().html() + content);
637                            $(this).prev().remove();
638
639                        }
640                        $(this).find('.ecwd-list-date-cont').append("<span class='arrow-down'>&nbsp</span>");
641                        $(this).find('.ecwd-list-date-cont').after("<div class='event_dropdown_cont'></div>");
642                        $(this).find('.event_dropdown_cont').append($(this).children(".event-venue,.event-content, .event-organizers"));
643                        $(this).find('.arrow-down').each(function () {
644                            $(this).click(function () {
645                                if ($(this).hasClass('open')) {
646                                    $(this).parent().parent().find('.event_dropdown_cont').slideUp(400);
647                                    $(this).removeClass('open');
648                                } else {
649                                    $(this).parent().parent().find('.event_dropdown_cont').slideDown(400);
650                                    $(this).addClass('open');
651                                }
652                            });
653                        })
654                    }
655                })
656            } else if (jQuery(window).width() > 500) {
657                $('div[class^="ecwd-page"] .event-container, div[class^="ecwd-page"] .ecwd_list .event-main-content').each(function () {
658                    if ($(this).find('.arrow-down').length != 0) {
659                        //  $(this).css('height','auto');
660                        if ($(this).hasClass("event-container")) {
661                            $(this).find('.event-title').before('<div class="ecwd-list-img"><div class="ecwd-list-img-container">' + $(this).find('.ecwd-list-img-container').html() + '</div></div>');
662                            $(this).find('.event-content .ecwd-list-img-container').remove();
663                            $(this).find('.ecwd-list-date-cont').after($(this).find('.event_dropdown_cont').html());
664                            $(this).find('.event_dropdown_cont').remove();
665                        } else {
666                            $(this).parent().find('.ecwd-list-date.resp').after('<div class="ecwd-list-img"><div class="ecwd-list-img-container">' + $(this).find('.ecwd-list-img-container').html() + '</div></div>');
667                            $(this).find('.event-content .ecwd-list-img-container').remove();
668                            $(this).find('.ecwd-list-date-cont').after($(this).find('.event_dropdown_cont').html());
669                            $(this).find('.event_dropdown_cont').remove();
670                        }
671
672                        $(this).find('.arrow-down').remove();
673                    }
674                })
675
676            }�
676
677
678        }
679        function add_single_events_popup() {
680            if(jQuery('.ecwd_open_event_popup').length == 0){
681                return;
682            }
683            jQuery('.single_event_popup').ecwd_popup({
684                button: jQuery('.ecwd_open_event_popup'),
685                body_class: "ecwd-excluded-events ecwd_popup_body_scroll",
686                title: ecwd.event_popup_title_text,
687                remove_popup_after_closing: true,
688                get_ajax_data: function (el) {
689                    var start_date = el.attr('start-date-data');
690                    var end_date = el.attr('end-date-data');
691                    if (start_date && end_date) {
692                        var data = {
693                            action: 'ecwd_event_popup_ajax',
694                            id: el.attr('class').split('event')[2],
695                            start_date: start_date,
696                            end_date: end_date,
697                        };
698                        return data;
699                    } else {
700                        return {};
701                    }
702                }
703            });
704        }
705
706        clearTimeout(filterTimeout);
707        filterTimeout = setTimeout(function () {
708            if (parseInt($('body').width()) <= 768 || $(".calendar_full_content").width() <= 550) {
709                $('.calendar_main').each(function (k, v) {
710                    $(this).find('.ecwd_show_filters').click(function () {
711                        if ($(this).find('span').hasClass('open')) {
712                            $(this).find('span').html($('.ecwd_show_filters_text').val());
713                            $(this).next().hide();
714                            $(this).find('span').removeClass('open');
715                        } else {
716                            $(this).find('span').html($('.ecwd_hide_filters_text').val());
717                            $(this).next().show();
718                            $(this).find('span').addClass('open');
719                        }
720                    });
721                });
722            } else {
723                $('.calendar_main').each(function () {
724                    $(this).find('.ecwd_show_filters span').click(function () {
725                        if ($(this).hasClass('open')) {
726                            $(this).html($('.ecwd_show_filters_text').val());
727                            $(this).closest(".calendar_full_content").find(".ecwd_calendar").css({
728                                "max-width": "100%",
729                                "width": "100%"
730                            });
731                            $(this).parent().next().hide();
732                            $(this).removeClass('open');
733                            showFilterSliderArrow();
734                            if ($('.ecwd-poster-board').length > 0) {
735                                doMasonry();
736                            }
737                        } else {
738                            $(this).html($('.ecwd_hide_filters_text').val());
739                            $(this).closest(".calendar_full_content").find(".ecwd_filters").css({
740                                "max-width": "27%",
741                                "width": "27%",
742                                "float": "left"
743                            });
744                            $(this).closest(".calendar_full_content").find(".ecwd_calendar").css({
745                                "max-width": "71%",
746                                "float": "left"
747                            });
748                            $(this).parent().next().show();
749                            $(this).addClass('open');
750                            showFilterSliderArrow();
751                            if ($('.ecwd-poster-board').length > 0) {
752                                doMasonry();
753                            }
754                        }
755                    });
756                });
757                $(".month-name").show();
758            }
759            $('.ecwd_filter_item').each(function () {
760                $(this).find('.ecwd_filter_heading').click(function () {
761                    if ($(this).hasClass('open')) {
762                        $(this).next().slideUp(400);
763                        $(this).removeClass('open');
764                    } else {
765                        $(this).next().slideDown(400);
766                        $(this).addClass('open');
767                    }
768                });
769            });
770        }, 100);
771
772        function show_filters(main_div) {
773
774            if (parseInt($('body').width()) <= 768 || $(".calendar_full_content").width() <= 550) {
775                $(".calendar_full_content .ecwd_calendar").css("max-width", "100%");
776                $(".calendar_full_content .ecwd_filters, .calendar_full_content .ecwd_calendar").css({
777                    "max-width": "100%",
778                    "width": "100%",
779                    "float": "none"
780                });
781                $(".ecwd_show_filters").removeClass('ecwd_show_filters_left').addClass('ecwd_show_filters_top');
782                if (!main_div) {
783                    $(".ecwd_show_filters span").html($('.ecwd_show_filters_text').val());
784                    $(".ecwd_show_filters span").removeClass("open");
785                    $(".ecwd_filters").hide();
786                }
787            } else {
788
789                if (!main_div) {
790                    $(".ecwd_show_filters").removeClass('ecwd_show_filters_top').addClass('ecwd_show_filters_left');
791                } else {
792                    if (main_div.find(".ecwd_calendar").hasClass('ecwd-widget-mini') === false) {
793                        if (main_div.find(".ecwd_show_filters span").hasClass('open')) {
794                            main_div.find(".ecwd_calendar").css({"max-width": "71%", "float": "left"});
795                            main_div.find(".ecwd_filters").css({"max-width": "27%", "width": "27%", "float": "left"});
796                        } else {
797
798                            main_div.find(".ecwd_filters").css({"max-width": "100%", "width": "100%", "float": "none"});
799
800                            main_div.find(".ecwd_calendar").css({"max-width": "100%", "width": "100%", "float": "none"});
801                        }
802                    }
803                }
804            }
805
806        }
807
808        // $('#ecwd_back_link').on('click', function (e) {
809        //     e.preventDefault();
810        //     window.history.back();
811        // });
812
813        if ($('.ecwd_map_div').length > 0) {
814            this.showMap();
815        }
816        $(".ecwd_filter").change(function () {
817            if ($(this).attr("checked") != "checked") {
818                $(this).closest(".ecwd_filters").find(".ecwd_select_all").attr("checked", false);
819            } else {
820                var selected = true;
821                $(this).closest('ul').find(".ecwd_filter").each(function () {
822                    var _this = $(this);
823                    if (_this.attr("checked") != "checked") {
824                        selected = false;
825                        return;
826                    }
827                });
828                if (selected == true) {
829                    $(this).closest(".ecwd_filters").find(".ecwd_select_all").attr("checked", true);
830                }
831            }
832        });
833    }
834
835    ecwd_js_init_call = new ecwd_js_init();
836
837}(jQuery));
838
839function ecwd_eventsOff() {
840    jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").find("*").off();
841    jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").children().off();
842}
843
844jQuery(window).resize(function () {
845    var window_width = jQuery(window).width();
846    if (typeof checkw == 'undefined')
847        checkw = window_width;
848    if (window_width != checkw) {
849        ecwd_js_init_call = new ecwd_js_init();
850        checkw = window_width;
851    }
852});

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.