PageSourceSearch

https://prepper1cense.com/js/date-filter.js

js prepper1cense.com collected 2026-09-26 12:11:18 UTC 13,520 bytes, 224 lines download raw bytes

1
2jQuery(document).ready(function( $ ) {
3
4  var currentRequest = null;
5
6  if ($('#date-trigger').length){
7
8    /*
9
10    $('#date-trigger').click(function(e){
11      e.stopPropagation();
12      if($('.date-from').html() == "Start Date" || $('.date-to').html() == "End Date"){
13        if ($('.date-to').html() == "End Date") {
14          $('.date-to').css("borderColor", "red");
15        }
16        if ($('.date-from').html() == "Start Date") {
17          $('.date-from').css("borderColor", "red");
18        }
19      }
20      else {
21        var start_date = $('.date-from').html();
22        var end_date = $('.date-to').html();
23
24        // Show Selected Dates
25        $('.datepicker .filter-title div.flex').html(start_date + " - " + end_date);
26
27        // Show Clear Button
28        $('#filter-clear').parent().animate( {height: "24px"}, 500);
29        $('#filter-clear').animate( {opacity: 1}, 1000);
30
31        var data = {
32          'action': 'date_filter',
33          'start_date' : start_date,
34          'end_date' : end_date
35        }
36
37        // Integration with cateogry filter
38        if ($('#date-trigger').data('cat_id')) {
39          data['cat_id'] = $('#date-trigger').data('cat_id');
40        }
41        // Integration with date filtering
42        if ($('#filter-trigger').length) {
43          $('#filter-trigger').data('start_date', start_date);
44          $('#filter-trigger').data('end_date', end_date);
45        }
46
47        contentHeight = $('#ajaxResponse').outerHeight(true);
48
49        var filter = $('#date_filter');
50        var currentRequest = $.ajax({
51          url: wordpress_loadmore_params.ajaxurl, //TODO
52          action: filter.attr('action'),
53          type: filter.attr('method'),
54          data: data, //TODO
55          beforeSend : function(){
56            if(currentRequest != null) {
57                currentRequest.abort();
58            }
59            else{ //LOADING
60              var svg = "<svg class='mx-auto ajax-window' width='80px'  height='80px'  xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='xMidYMid' class='lds-wedges'><g transform='translate(50,50)'><g transform='scale(0.7)'><g transform='translate(-50,-50)'><g transform='rotate(239.504 50 50)'><animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='0.75s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c1}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' fill-opacity='0.8' fill='#005A55'></path></g><g transform='rotate(359.628 50.0024 50.0024)'> <animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='1s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c2}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(90 50 50)' fill-opacity='0.8' fill='#00C7CD'></path></g><g transform='rotate(119.752 50 50)'> <animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='1.5s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c3}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(180 50 50)' fill-opacity='0.8' fill='#ED592A'></path></g><g transform='rotate(239.876 50 50)'><animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='3s' begin='0s' repeatCount='indefinite'></animateTransform> <path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c4}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(270 50 50)' fill-opacity='0.8' fill='#F9B7B6'></path></g></g></g></g></svg>";
61              var svg_markup = "<div class='w-full text-center' style='height:"+ contentHeight +"px'>"
62                                              +svg+
63                                            "</div>";
64              $('#ajaxResponse').html(svg_markup);
65            }
66          },
67          success:function(data){
68            $('#ajaxResponse').html(data); // insert data
69            data = [];
70
71            //re-adjust max pages for filter
72            $('#pagination-trigger').data("page", 1);
73            var new_max = $('.ajaxloaded').data("maxpages");
74            $('#pagination-trigger').data("maxpages", new_max);
75            $('#pagination-trigger').data("ongoing", false);
76            if (new_max == 0){
77              $('#pagination-trigger').addClass("hide-trigger");
78              $('#pagination-trigger').removeClass("show-trigger");
79            }
80            else{
81              $('#pagination-trigger').addClass("show-trigger");
82              $('#pagination-trigger').removeClass("hide-trigger");
83            }
84            $('#pagination-trigger-prev').addClass("hide-trigger");
85            $('#pagination-trigger-prev').removeClass("show-trigger");
86          }
87        });
88      }
89    })
90
91    */
92
93    $('#showOngoingEvents').click(function(e){
94      $(".datepicker").addClass("inactive");
95
96      if ( !$(this).hasClass("active") ) {
97
98        $(".datepicker").addClass("inactive");
99        $('.datepicker .filter-title div.flex').html("By Date");
100
101        $(this).addClass("active")
102        $('#showUpcomingEvents').removeClass("active")
103
104        var data = {
105          'action': 'show_ongoing_events',
106        }
107
108        // Integration with cateogry filter
109        if ($('#date-trigger').data('cat_id')) {
110          data['cat_id'] = $('#date-trigger').data('cat_id');
111        }
112
113        // grab date if filtered
114        if ( $('#filter-trigger').data("start_date") ) {
115          data['start_date'] = $('#filter-trigger').data("start_date");
116          data['end_date'] = $('#filter-trigger').data("end_date");
117        }
118
119        var contentHeight = $('#ajaxResponse').outerHeight(true);
120        var filter = $('#show_ongoing_events');
121
122        var currentRequest = $.ajax({
123          url: wordpress_loadmore_params.ajaxurl, //TODO
124          action: filter.attr('action'),
125          type: filter.attr('method'),
126          data: data, //TODO
127          beforeSend : function(){
128            if(currentRequest != null) {
129                currentRequest.abort();
130            }
131            else{ //LOADING
132              var svg = "<svg class='mx-auto ajax-window' width='80px'  height='80px'  xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='xMidYMid' class='lds-wedges'><g transform='translate(50,50)'><g transform='scale(0.7)'><g transform='translate(-50,-50)'><g transform='rotate(239.504 50 50)'><animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='0.75s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c1}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' fill-opacity='0.8' fill='#005A55'></path></g><g transform='rotate(359.628 50.0024 50.0024)'> <animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='1s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c2}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(90 50 50)' fill-opacity='0.8' fill='#00C7CD'></path></g><g transform='rotate(119.752 50 50)'> <animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='1.5s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c3}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(180 50 50)' fill-opacity='0.8' fill='#ED592A'></path></g><g transform='rotate(239.876 50 50)'><animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='3s' begin='0s' repeatCount='indefinite'></animateTransform> <path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c4}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(270 50 50)' fill-opacity='0.8' fill='#F9B7B6'></path></g></g></g></g></svg>";
133              var svg_markup = "<div class='w-full text-center' style='height:"+ contentHeight +"px'>"
134                                              +svg+
135                                            "</div>";
136              $('#ajaxResponse').html(svg_markup);
137            }
138          },
139          success:function(data){
140            $('#ajaxResponse').html(data); // insert data
141            data = [];
142
143            //re-adjust max pages for filter
144            $('#pagination-trigger').data("page", 1);
145            var new_max = $('.ajaxloaded').data("maxpages");
146            $('#pagination-trigger').data("maxpages", new_max);
147            $('#pagination-trigger').data("ongoing", true);
148            if (new_max == 0){
149              $('#pagination-trigger').addClass("hide-trigger");
150              $('#pagination-trigger').removeClass("show-trigger");
151            }
152            else{
153              $('#pagination-trigger').addClass("show-trigger");
154              $('#pagination-trigger').removeClass("hide-trigger");
155            }
156            $('#pagination-trigger-prev').addClass("hide-trigger");
157            $('#pagination-trigger-prev').removeClass("show-trigger");
158          }
159        });
160
161      }
162    })
163
164    $('#showUpcomingEvents').click(function(e){
165      if ( !$(this).hasClass("active") ) {
166
167        $(this).addClass("active")
168        $('#showOngoingEvents').removeClass("active")
169        $(".datepicker").removeClass("inactive");
170
171        var data = {
172          'action': 'reset_events',
173        }
174
175        // Integration with cateogry filter
176        if ($('#date-trigger').data('cat_id')) {
177          data['cat_id'] = $('#date-trigger').data('cat_id');
178        }
179
180        var contentHeight = $('#ajaxResponse').outerHeight(true);
181        var filter = $('#reset_events');
182        var currentRequest = $.ajax({
183          url: wordpress_loadmore_params.ajaxurl, //TODO
184          action: filter.attr('action'),
185          type: filter.attr('method'),
186          data: data, //TODO
187          beforeSend : function(){
188            if(currentRequest != null) {
189                currentRequest.abort();
190            }
191            else{ //LOADING
192              var svg = "<svg class='mx-auto ajax-window' width='80px'  height='80px'  xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='xMidYMid' class='lds-wedges'><g transform='translate(50,50)'><g transform='scale(0.7)'><g transform='translate(-50,-50)'><g transform='rotate(239.504 50 50)'><animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='0.75s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c1}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' fill-opacity='0.8' fill='#005A55'></path></g><g transform='rotate(359.628 50.0024 50.0024)'> <animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='1s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c2}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(90 50 50)' fill-opacity='0.8' fill='#00C7CD'></path></g><g transform='rotate(119.752 50 50)'> <animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='1.5s' begin='0s' repeatCount='indefinite'></animateTransform><path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c3}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(180 50 50)' fill-opacity='0.8' fill='#ED592A'></path></g><g transform='rotate(239.876 50 50)'><animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='3s' begin='0s' repeatCount='indefinite'></animateTransform> <path ng-attr-fill-opacity='{{config.opacity}}' ng-attr-fill='{{config.c4}}' d='M50 50L50 0A50 50 0 0 1 100 50Z' transform='rotate(270 50 50)' fill-opacity='0.8' fill='#F9B7B6'></path></g></g></g></g></svg>";
193              var svg_markup = "<div class='w-full text-center' style='height:"+ contentHeight +"px'>"
194                                              +svg+
195                                            "</div>";
196              $('#ajaxResponse').html(svg_markup);
197            }
198          },
199          success:function(data){
200            $('#ajaxResponse').html(data); // insert data
201            data = [];
202
203            //re-adjust max pages for filter
204            $('#pagination-trigger').data("page", 1);
205            var new_max = $('.ajaxloaded').data("maxpages");
206            $('#pagination-trigger').data("maxpages", new_max);
207            $('#pagination-trigger').data("ongoing", false);
208            if (new_max == 0){
209              $('#pagination-trigger').addClass("hide-trigger");
210              $('#pagination-trigger').removeClass("show-trigger");
211            }
212            else{
213              $('#pagination-trigger').addClass("show-trigger");
214              $('#pagination-trigger').removeClass("hide-trigger");
215            }
216            $('#pagination-trigger-prev').addClass("hide-trigger");
217            $('#pagination-trigger-prev').removeClass("show-trigger");
218          }
219        });
220
221      }
222    })
223  }
224});

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.