PageSourceSearch

https://ktmguide.com/wp-content/themes/dwt-listing/assets/js/event-search/events_simple.js?ver=7.0.4

js ktmguide.com collected 2026-10-02 22:26:14 UTC 8,457 bytes, 197 lines download raw bytes

1(function ($) {
2    "use strict";
3    var ajax_url = $("input#dwt_listing_ajax_url").val();
4    $('button[name=type]').on('click', function () {
5        $('input[name=layout_type]').val($(this).val());
6        $('.sk-circle').show();
7        $(".s_ajax").html('');
8        $("#listing_ajax_pagination").html('');
9        $.post(ajax_url, {action: 'dwt_ajax_search_events', collect_data: $("form#d_events_filters").serialize()}).done(function (response)
10        {
11            $('.sk-circle').hide();
12            if ($.trim(response) != "")
13            {
14                var res = response.split("|");
15                $(".listing-sort__result strong").html(res[0]);
16                $(".s_ajax").html(res[1]);
17                $("#result_reset").html(res[2]);
18                $("#listing_ajax_pagination").html(res[3]);
19                dwt_listing_countDownTimer_ajax();
20            }
21        });
22    });
23
24
25    /*For Title & Location*/
26    $('#get_title,#get_locz,#get_start_date_filter,#get_end_date_filter,#additional_fields_filters').on('click', function () {
27        $('.sk-circle').show();
28        $(".s_ajax").html('');
29        $("#listing_ajax_pagination").html('');
30        var curent_lang = $('#lang').val();
31        $.post(ajax_url, {action: 'dwt_ajax_search_events', lang: curent_lang, collect_data: $("form#d_events_filters").serialize(), }).done(function (response)
32        {
33            $('.sk-circle').hide();
34            if ($.trim(response) != "")
35            {
36                var res = response.split("|");
37                $(".listing-sort__result strong").html(res[0]);
38                $(".s_ajax").html(res[1]);
39                $("#result_reset").html(res[2]);
40                $("#listing_ajax_pagination").html(res[3]);
41                dwt_listing_countDownTimer_ajax();
42            }
43        });
44    });
45
46
47    /*For Category Change*/
48    $('#event_cat,#order_by').on('change', function () { 
49        $('.sk-circle').show();
50        $(".s_ajax").html('');
51        $("#listing_ajax_pagination").html('');
52        var curent_lang = $('#lang').val();
53        $.post(ajax_url, {action: 'dwt_ajax_search_events', lang: curent_lang, collect_data: $("form#d_events_filters").serialize(), }).done(function (response)
54        {
55            $('.sk-circle').hide();
56            if ($.trim(response) != "")
57            {
58                var res = response.split("|");
59                $(".listing-sort__result strong").html(res[0]);
60                $(".s_ajax").html(res[1]);
61                $("#result_reset").html(res[2]);
62                $("#listing_ajax_pagination").html(res[3]);
63                dwt_listing_countDownTimer_ajax();
64            }
65        });
66
67        var cat_parent = $(this).val();
68        $('#dwt_listing_loading').show();
69        $.post(ajax_url, {
70            action: 'exertio_get_custom_fields_search', cat_parent: cat_parent
71        }).done(function (response) {
72            console.log(response);
73            if (response.success) {
74                $('#dwt_listing_loading').hide();
75                $('.additional-fields-search').css("display", "block");
76                $('.additional-fields-search').css("display", "flex");
77                $('.additional-fields-search-container').html(response.data.fields);
78                if ($(".custom-range-slider").length > 0) { $(".custom-range-slider").ionRangeSlider({ skin: "round" }); }
79            }
80            else {
81                $('#dwt_listing_loading').hide();
82                $('.additional-fields-search').css("display", "none");
83            }
84        });
85    });
86
87    $('#toggle-additional-fields').click(function() {
88        $('#additional-fields-container').slideToggle(function() {
89            $('.toggle-icon').html($('#additional-fields-container').is(':visible') ? '▲' : '▼');
90        });
91        $("#additional_fields_filters").slideToggle();
92    });
93
94
95
96
97//pagination
98    $(document).on('click', '.fetch_result', function () {
99        console.log("HEHEHEE EVE SIMP");
100        var page_no = $(this).attr("data-page-no");
101        $(this).addClass("active");
102        $(".fetch_result").not(this).removeClass("active");
103        $(".s_ajax").height('auto');
104        $('.sk-circle').show();
105        $(".s_ajax").html('');
106        $.post(ajax_url, {action: 'dwt_ajax_search_events', collect_data: $("form#d_events_filters").seri
106alize(), page_no: page_no}).done(function (response)
107        {
108            $('.sk-circle').hide();
109            if ($.trim(response) != "")
110            {
111                var res = response.split("|");
112                $(".listing-sort__result strong").html(res[0]);
113                $(".s_ajax").html(res[1]);
114                $("#result_reset").html(res[2]);
115                dwt_listing_countDownTimer_ajax();
116            }
117        });
118    });
119
120
121
122    /* Clear Input */
123    $('.has-clear input[type="text"]').on('input propertychange', function () {
124        var $this = $(this);
125        var visible = Boolean($this.val());
126        $this.siblings('.form-control-clear').toggleClass('hidden', !visible);
127    }).trigger('propertychange');
128
129    $('.form-control-clear').on('click', function () {
130        $(this).siblings('input[type="text"]').val('')
131                .trigger('propertychange').focus();
132        $('.sk-circle').show();
133        $(".s_ajax").html('');
134        $("#listing_ajax_pagination").html('');
135        $.post(ajax_url, {action: 'dwt_ajax_search_events', collect_data: $("form#d_events_filters").serialize(), }).done(function (response)
136        {
137            $('.sk-circle').hide();
138            if ($.trim(response) != "")
139            {
140                var res = response.split("|");
141                $(".listing-sort__result strong").html(res[0]);
142                $(".s_ajax").html(res[1]);
143                $("#result_reset").html(res[2]);
144                $("#listing_ajax_pagination").html(res[3]);
145                dwt_listing_countDownTimer_ajax();
146            }
147        });
148    });
149
150
151
152
153
154
155
156    /*Reset All Resutl*/
157    $(document).on('click', '#reset_ajax_reslut', function () {
158        $("#d_events_filters").trigger('reset');
159        $("#listing_ajax_pagination").html('');
160        $("#event_cat").select2('destroy').val('').select2({width: '100%'});
161        $('input[name="layout_type"]').val('');
162        $('.has-clear input[type="text"]').val('');
163        $('.sk-circle').show();
164        $(".s_ajax").html('');
165        $.post(ajax_url, {action: 'dwt_ajax_search_events', collect_data: $("form#d_events_filters").serialize(), }).done(function (response)
166        {
167            $('.sk-circle').hide();
168            if ($.trim(response) != "")
169            {
170                var res = response.split("|");
171                $(".listing-sort__result strong").html(res[0]);
172                $(".s_ajax").html(res[1]);
173                $("#result_reset").html(res[2]);
174                $("#listing_ajax_pagination").html(res[3]);
175                dwt_listing_countDownTimer_ajax();
176            }
177        });
178    });
179
180    /*Event timer*/
181    function dwt_listing_countDownTimer_ajax() {
182        if ($('.dwt_listing_custom-timer').length) {
183            $('.dwt_listing_custom-timer').each(function () {
184                var countDate = $(this).data('countdown-time'); // getting date
185                $(this).countdown(countDate, function (event) {
186                    $(this).html('<li> <div class="timer-countdown-box"> <span class="timer-days">' + event.strftime('%D') + '</span> <span class="timer-div">' + get_strings.coupon_days + '</span> </div> </li> <li> <div class="timer-countdown-box"> <span class="timer-hours">' + event.strftime('%H') + '</span> <span class="timer-div color-1">' + get_strings.coupon_hours + '</span> </div> </li> <li> <div class="timer-countdown-box"> <span class="timer-minutes">' + event.strftime('%M') + '</span> <span class="timer-div color-2">' + get_strings.coupon_minutes + '</span> </div> </li> <li> <div class="timer-countdown-box"> <span class="timer-seconds">' + event.strftime('%S') + '</span> <span class="timer-div color-3">' + get_strings.coupon_seconds + '</span> </div> </li>');
187                });
188            }).on('finish.countdown', function () {
189                $(this).hide();
190                $('.listing-coupon-block').hide();
191            });
192        }
193    }
194
195
196
197})(jQuery);

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.