1//data-post='["a","b","c"]' 2 3jQuery(document).ready(function( $ ) { 4 5 function grabData(trigger, increment){ 6 7 var ongoing = trigger.data("ongoing"); 8 var current_page = trigger.data("page"); 9 var max_pages = trigger.data("maxpages"); 10 var post_type = trigger.data("post"); 11 var orderby = trigger.data("orderby"); 12 13 var data = { 14 'action': 'pagination', 15 'current_page' : current_page + increment, 16 'post_type' : post_type, 17 'orderby' : orderby, 18 'max_pages' : max_pages, 19 'ongoing' : ongoing 20 } 21 22 //Check if we have already filtered by listing type 23 var url_array = window.location.pathname.split("/"); 24 if (url_array.includes("listing-type") ){ 25 data.listing_type = url_array[2]; 26 } 27 if(trigger.data("listingtype")){ 28 data.listing_type = trigger.data("listingtype"); 29 } 30 if(trigger.data("cat_id") ){ 31 data.cat_id = trigger.data("cat_id"); 32 } 33 34 return data; 35 } 36 37 function grabLoader() { 38 var svg = "<svg class='mx-auto ajax-window' width='80px' height='80px' " 39 + "xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='xMidYMid' class='lds-wedges'>" 40 + "<g transform='translate(50,50)'><g transform='scale(0.7)'>" 41 + "<g transform='translate(-50,-50)'><g transform='rotate(239.504 50 50)'>" 42 + "<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>" 43 + "<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>" 44 + "<g transform='rotate(359.628 50.0024 50.0024)'>" 45 + "<animateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;360 50 50' keyTimes='0;1' dur='1s' begin='0s' repeatCount='indefinite'></animateTransform>" 46 + "<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>" 47 + "<g transform='rotate(119.752 50 50)'>" 48 + "<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>" 49 + "<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>" 50 + "<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>" 51 + "<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>" 52 + "</g></g></g></svg>"; 53 return svg; 54 } 55 56 var currentRequest = null; 57 58 if ($('#pagination-trigger').length){ 59 60 $('#pagination-trigger').on('click', function(e){ 61 e.preventDefault(); 62 63 contentHeight = $('#ajaxResponse').outerHeight(true); 64 65 // show previous button (if this button is hit, prev must be visible) 66 $('#pagination-trigger-prev').addClass("show-trigger"); 67 $('#pagination-trigger-prev').removeClass("hide-trigger"); 68 69 // grabs data from html 70 var data = grabData($(this), 1); 71 72 // hide next if we are on last page 73 if (data.current_page == data.max_pages) { 74 $(this).addClass("hide-trigger"); 75 $(this).removeClass("show-trigger"); 76 } 77 78 // update current page in html 79 $(this).data("page", data.current_page); 80 81 // grab date if filtered 82 if ( $('#filter-trigger').data("start_date") ) { 83 data['start_date'] = $('#filter-trigger').data("start_date"); 84 data['end_date'] = $('#filter-trigger').data("end_date"); 85 } 86 else if ($('#filter-trigger').data("upcoming") == true) { 87 var d = new Date(); 88 data['start_date'] = (d.getMonth()+1) + "/" + d.getDate() + "/" + d.getFullYear(); 89 } 90 91 var paginate = $('#paginate'); 92 93 var currentRequest = $.ajax({ 94 url: wordpress_pagination_params.ajaxurl, 95 action: "pagination", 96 type: "POST", 97 data: data, 98 beforeSend : function(){ 99 if(currentRequest != null) { 100 currentRequest.abort(); 101 } 102 else{ 103 var svg = grabLoader(); 104 var svg_markup = "<div class='w-full text-center' style='height:"+ contentHeight +"px'>" 105 +svg+ 106 "</div>"; 107 $('#ajaxResponse').html(svg_markup); 108 } 109 }, 110 success:function(data){ 111 $('.ajax-window').addClass('fadeout'); 112 setTimeout(function(){ 113 $('#ajaxResponse').html(data); // insert data 114 data = []; 115 }, 1000) 116 } 117 }); 118 }); 119 } 120 121 if ($('#pagination-trigger-prev').length){ 122 $('#pagination-trigger-prev').on('click', function(e){ 123 e.preventDefault(); 124 125 var pagination_trigger = $('#pagination-trigger'); 126 127 var data = grabData(pagination_trigger, -1); 128 129 // show next if we are leaving the last page 130 if (data.current_page == (data.max_pages - 1) ) { 131 pagination_trigger.addClass("show-trigger"); 132 pagination_trigger.removeClass("hide-trigger"); 133 } 134 135 // hide if we are approaching the first page 136 if (data.current_page == 1) { 137 $(this).addClass("hide-trigger"); 138 $(this).removeClass("show-trigger"); 139 } 140 141 // grab date if filtered 142 if ( $('#filter-trigger').data("start_date") ) { 143 data['start_date'] = $('#filter-trigger').data("start_date"); 144 data['end_date'] = $('#filter-trigger').data("end_date"); 145 } 146 else if ($('#filter-trigger').data("upcoming") == true) { 147 var d = new Date(); 148 data['start_date'] = (d.getMonth()+1) + "/" + d.getDate() + "/" + d.getFullYear(); 149 } 150 151 // update the data on the page 152 pagination_trigger.data("page", data.current_page); 153 154 155 //Check if we have already filtered by listing type 156 var url_array = window.location.pathname.split("/"); 157 if (url_array.includes("listing-type") ){ 158 data.listing_type = url_array[2]; 159 } 160 161 var paginate = $('#paginate'); 162 var currentRequest = $.ajax({ 163 url: wordpress_pagination_params.ajaxurl, 164 action: paginate.attr('action'), 165 type: paginate.attr('method'), 166 data: data, 167 beforeSend : function(){ 168 if(currentRequest != null) { 169 currentRequest.abort(); 170 } 171 else{ 172 var svg = grabLoader(); 173 var svg_markup = "<div class='w-full text-center' style='height:"+ contentHeight +"px'>" 174 +svg+ 175 "</div>"; 176 $('#ajaxResponse').html(svg_markup); 177 } 178 }, 179 success:function(data){ 180 $('.ajax-window').addClass('fadeout'); 181 setTimeout(function(){ 182 $('#ajaxResponse').html(data); // insert data 183 data = []; 184 }, 1000) 185 } 186 }); 187 }); 188 } 189});
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.