PageSourceSearch

https://www.puntagorda.es/wp-content/plugins/event-calendar-wd/js/scripts.js?ver=1.1.49_5c6162f25686d

js puntagorda.es collected 2026-10-02 23:40:12 UTC 39,644 bytes, 762 lines download raw bytes

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

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.