1 2 /* Pagination */ 3jQuery(function($){ 4 5 setTimeout(function () { 6 $('.list_ccv .has-matchHeight').matchHeight({remove: true}); 7 $('.list_ccv .has-matchHeight').matchHeight(); 8 }, 500); 9 var data = URLToArrayNew(); 10 var requestRunning = false; 11 var xhr; 12 var checkOrderBy = false; 13 /*Hotel*/ 14 $(document).on('click', '.st-tab-service-content #st_hotel_ccv .st-pagination-ccv a.page-numbers', function (e) { 15 e.preventDefault(); 16 if (requestRunning) { 17 xhr.abort(); 18 } 19 var posts_per_page = $('#ajax-filter-pag').attr('posts_per_page'); 20 var id_location = $('#ajax-filter-pag').attr('id_location'); 21 var pageNum = 1; 22 if ($(this).hasClass('page-numbers')) { 23 $('.st-tab-service-content #st_hotel_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 24 $(this).addClass('current'); 25 var url = $(this).attr('href'); 26 if (typeof url !== typeof undefined && url !== false) { 27 var arr = url.split('/'); 28 var pageNum = arr[arr.indexOf('page') + 1]; 29 30 if (isNaN(pageNum)) { 31 pageNum = 1; 32 } 33 } else { 34 return false; 35 } 36 } else { 37 $(this).toggleClass('active'); 38 if ($('#st_hotel_ccv ul.page-numbers').length > 0) { 39 $('#st_hotel_ccv ul.page-numbers').find('li').each(function () { 40 if ($(this).children().hasClass('current')) { 41 pageNum = $(this).children().text(); 42 } 43 }); 44 } 45 46 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 47 pageNum = 1; 48 } 49 } 50 51 var arr_tax = []; 52 data['action'] = 'st_filter_hotel_ajax_location'; 53 data['page'] = pageNum; 54 data['isajax_location'] = '1'; 55 data['posts_per_page'] = posts_per_page; 56 data['location_id'] = id_location; 57 var loadmore = $('.st-loader-ccv'); 58 xhr = $.ajax({ 59 url: st_params.ajax_url, 60 dataType: 'json', 61 type: 'get', 62 data: data, 63 beforeSend: function () { 64 window.scrollTo({ 65 top: $('.st-overview-content.st_tab_service').offset().top-30, 66 behavior: 'smooth' 67 }); 68 loadmore.fadeIn(); 69 }, 70 success: function (doc) { 71 $('#st_hotel_ccv .row-wrapper').empty(); 72 $('#st_hotel_ccv .row-wrapper').append(doc.content); 73 $('#ajax-filter-pag').html(doc.pag); 74 }, 75 complete: function () { 76 loadmore.fadeOut(); 77 setTimeout(function () { 78 $('.st-tab-service-content #hotel-search-result .has-matchHeight').matchHeight({remove: true}); 79 $('.st-tab-service-content #hotel-search-result .has-matchHeight').matchHeight(); 80 }, 500); 81 requestRunning = false; 82 }, 83 }); 84 requestRunning = true; 85 }); 86 87 if ($('#st_hotel_ccv .row-wrapper').length > 0) { 88 var loadmore = $('.st-loader-ccv'); 89 window.scrollTo({ 90 top: $('body').offset().top-30, 91 behavior: 'smooth' 92 }); 93 loadmore.fadeIn(); 94 if (requestRunning) { 95 xhr.abort(); 96 } 97 var posts_per_page = $('#ajax-filter-pag').attr('posts_per_page'); 98 var id_location = $('#ajax-filter-pag').attr('id_location'); 99 var pageNum = 1; 100 if ($(this).hasClass('pagination')) { 101 $('.st-tab-service-content #st_hotel_ccv .st-pagination-ccv a.pagination').removeClass('current'); 102 $(this).addClass('current'); 103 var url = $(this).attr('href'); 104 if (typeof url !== typeof undefined && url !== false) { 105 var arr = url.split('/'); 106 var pageNum = arr[arr.indexOf('page') + 1]; 107 108 if (isNaN(pageNum)) { 109 pageNum = 1; 110 } 111 } else { 112 return false; 113 } 114 } else { 115 $(this).toggleClass('active'); 116 if ($('#st_hotel_ccv ul.pagination').length > 0) { 117 $('#st_hotel_ccv ul.pagination').find('li').each(function () { 118 if ($(this).children().hasClass('current')) { 119 pageNum = $(this).children().text(); 120 } 121 }); 122 } 123 124 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 125 pageNum = 1; 126 } 127 } 128 129 var arr_tax = []; 130 data['action'] = 'st_filter_hotel_ajax_location'; 131 data['page'] = pageNum; 132 data['isajax_location'] = '1'; 133 data['posts_per_page'] = posts_per_page; 134 data['id_location'] = id_location; 135 xhr = $.ajax({
136 url: st_params.ajax_url, 137 dataType: 'json', 138 type: 'get', 139 data: data, 140 beforeSend: function () { 141 loadmore.fadeIn(); 142 }, 143 success: function (doc) { 144 $('#st_hotel_ccv .row-wrapper').empty(); 145 $('#st_hotel_ccv .row-wrapper').append(doc.content); 146 $('#ajax-filter-pag').html(doc.pag); 147 }, 148 complete: function () { 149 loadmore.fadeOut(); 150 requestRunning = false; 151 setTimeout(function () { 152 $('.st-tab-service-content #hotel-search-result .has-matchHeight').matchHeight({remove: true}); 153 $('.st-tab-service-content #hotel-search-result .has-matchHeight').matchHeight(); 154 }, 500); 155 156 }, 157 }); 158 requestRunning = true; 159 } 160 161 /*Tour*/ 162 var requestRunning_to = false; 163 var xhr_to; 164 var checkOrderBy_to = false; 165 $(document).on('click', '.st-tab-service-content #st_tours_ccv .st-pagination-ccv a.page-numbers', function (e) { 166 var loadmore = $('.st-loader-ccv'); 167 window.scrollTo({ 168 top: $('.st-overview-content.st_tab_service').offset().top-30, 169 behavior: 'smooth' 170 }); 171 loadmore.fadeIn(); 172 e.preventDefault(); 173 if (requestRunning_to) { 174 xhr_to.abort(); 175 } 176 var posts_per_page = $('#ajax-filter-pag-tour').attr('posts_per_page'); 177 var id_location = $('#ajax-filter-pag-tour').attr('id_location'); 178 var pageNum = 1; 179 if ($(this).hasClass('page-numbers')) { 180 $('.st-tab-service-content #st_tours_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 181 $(this).addClass('current'); 182 var url = $(this).attr('href'); 183 if (typeof url !== typeof undefined && url !== false) { 184 var arr = url.split('/'); 185 var pageNum = arr[arr.indexOf('page') + 1]; 186 187 if (isNaN(pageNum)) { 188 pageNum = 1; 189 } 190 } else { 191 return false; 192 } 193 } else { 194 $(this).toggleClass('active'); 195 if ($('#st_tours_ccv ul.page-numbers').length > 0) { 196 $('#st_tours_ccv ul.page-numbers').find('li').each(function () { 197 if ($(this).children().hasClass('current')) { 198 pageNum = $(this).children().text(); 199 } 200 }); 201 } 202 203 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 204 pageNum = 1; 205 } 206 } 207 208 var arr_tax = []; 209 data['action'] = 'st_filter_tour_ajax_location'; 210 data['page'] = pageNum; 211 data['isajax_location'] = '1'; 212 data['posts_per_page'] = posts_per_page; 213 data['id_location'] = id_location; 214 215 xhr_to = $.ajax({ 216 url: st_params.ajax_url, 217 dataType: 'json', 218 type: 'get', 219 data: data, 220 beforeSend: function () { 221 222 }, 223 success: function (doc) { 224 $('#st_tours_ccv .row-wrapper').empty(); 225 $('#st_tours_ccv .row-wrapper').append(doc.content); 226 $('#ajax-filter-pag-tour').html(doc.pag); 227 }, 228 complete: function () { 229 loadmore.fadeOut(); 230 requestRunning_to = false; 231 setTimeout(function () { 232 $('.st-tab-service-content #tour-search-result .has-matchHeight').matchHeight({remove: true}); 233 $('.st-tab-service-content #tour-search-result .has-matchHeight').matchHeight(); 234 }, 500); 235 }, 236 }); 237 requestRunning_to = true; 238 }); 239 240 if ($('#st_tours_ccv .row-wrapper').length > 0) { 241 var loadmore = $('.st-loader-ccv'); 242 window.scrollTo({ 243 top: $('body').offset().top-30, 244 behavior: 'smooth' 245 }); 246 loadmore.fadeIn(); 247 if (requestRunning_to) { 248 xhr_to.abort(); 249 } 250 var posts_per_page = $('#ajax-filter-pag-tour').attr('posts_per_page'); 251 var id_location = $('#ajax-filter-pag-tour').attr('id_location'); 252 var pageNum_to = 1; 253 if ($(this).hasClass('pagination')) { 254 $('.st-tab-service-content #st_tours_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 255 $(this).addClass('current'); 256 var url_to = $(this).attr('href'); 257 if (typeof url_to !== typeof undefined && url_to !== false) { 258 var arr_to = url_to.split('/'); 259 var pageNum_to = arr_to[arr_to.indexOf('page') + 1]; 260 261 if (isNaN(pageNum_to)) { 262 pageNum_to = 1; 263 } 264 } else { 265 return false; 266 } 267 } else { 268 $(this).toggleClass('active'); 269 if ($('#st_tours_ccv ul.pagination').length > 0) { 270 $('#st_tours_ccv ul.pagination').find('li').each(function () { 271 if ($(this).children().hasClass('current')) { 272 pageNum_to = $(this).children().text(); 273 } 274 }); 275 } 276 277 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 278 pageNum_to = 1; 279 } 280 } 281 282 var arr_tax = []; 283 data['action'] = 'st_filter_tour_ajax_location'; 284 data['page'] = pageNum_to; 285 data['isajax_location'] = '1'; 286 data['posts_per_page'] = posts_per_page; 287 data['id_location'] = id_location; 288 289 xhr_to = $.ajax({
290 url: st_params.ajax_url, 291 dataType: 'json', 292 type: 'get', 293 data: data, 294 beforeSend: function () { 295 loadmore.fadeIn(); 296 }, 297 success: function (doc) { 298 $('#st_tours_ccv .row-wrapper').empty(); 299 $('#st_tours_ccv .row-wrapper').append(doc.content); 300 $('#ajax-filter-pag-tour').html(doc.pag); 301 }, 302 complete: function () { 303 loadmore.fadeOut(); 304 setTimeout(function () { 305 $('.st-tab-service-content #tour-search-result .has-matchHeight').matchHeight({remove: true}); 306 $('.st-tab-service-content #tour-search-result .has-matchHeight').matchHeight(); 307 }, 500); 308 requestRunning_to = false; 309 }, 310 }); 311 requestRunning_to = true; 312 } 313 314 /*Rental*/ 315 var requestRunning_ren = false; 316 var xhr_ren; 317 var checkOrderBy_ren = false; 318 $(document).on('click', '.st-tab-service-content #st_rental_ccv .st-pagination-ccv a.page-numbers', function (e) { 319 var loadmore = $('.st-loader-ccv'); 320 window.scrollTo({ 321 top: $('.st-overview-content.st_tab_service').offset().top-30, 322 behavior: 'smooth' 323 }); 324 loadmore.fadeIn(); 325 e.preventDefault(); 326 if (requestRunning_ren) { 327 xhr_ren.abort(); 328 } 329 var posts_per_page = $('#ajax-filter-pag-rental').attr('posts_per_page'); 330 var id_location = $('#ajax-filter-pag-rental').attr('id_location'); 331 var pageNum = 1; 332 if ($(this).hasClass('page-numbers')) { 333 $('.st-tab-service-content #st_rental_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 334 $(this).addClass('current'); 335 var url = $(this).attr('href'); 336 if (typeof url !== typeof undefined && url !== false) { 337 var arr = url.split('/'); 338 var pageNum = arr[arr.indexOf('page') + 1]; 339 340 if (isNaN(pageNum)) { 341 pageNum = 1; 342 } 343 } else { 344 return false; 345 } 346 } else { 347 $(this).toggleClass('active'); 348 if ($('#st_rental_ccv ul.page-numbers').length > 0) { 349 $('#st_rental_ccv ul.page-numbers').find('li').each(function () { 350 if ($(this).children().hasClass('current')) { 351 pageNum = $(this).children().text(); 352 } 353 }); 354 } 355 356 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 357 pageNum = 1; 358 } 359 } 360 361 var arr_tax = []; 362 data['action'] = 'st_filter_rental_ajax_location'; 363 data['page'] = pageNum; 364 data['isajax_location'] = '1'; 365 data['posts_per_page'] = posts_per_page; 366 data['id_location'] = id_location; 367 368 xhr_ren = $.ajax({ 369 url: st_params.ajax_url, 370 dataType: 'json', 371 type: 'get', 372 data: data, 373 beforeSend: function () { 374 375 }, 376 success: function (doc) { 377 $('#st_rental_ccv .row-wrapper').empty(); 378 $('#st_rental_ccv .row-wrapper').append(doc.content); 379 $('#ajax-filter-pag-rental').html(doc.pag); 380 }, 381 complete: function () { 382 setTimeout(function () { 383 $('.st-tab-service-content #rental-search-result .has-matchHeight').matchHeight({remove: true}); 384 $('.st-tab-service-content #rental-search-result .has-matchHeight').matchHeight(); 385 }, 500); 386 loadmore.fadeOut(); 387 requestRunning_ren = false; 388 }, 389 }); 390 requestRunning_ren = true; 391 }); 392 393 if ($('#st_rental_ccv .row-wrapper').length > 0) { 394 var loadmore = $('.st-loader-ccv'); 395 window.scrollTo({ 396 top: $('body').offset().top-30, 397 behavior: 'smooth' 398 }); 399 loadmore.fadeIn(); 400 if (requestRunning_ren) { 401 xhr_ren.abort(); 402 } 403 var posts_per_page = $('#ajax-filter-pag-rental').attr('posts_per_page'); 404 var id_location = $('#ajax-filter-pag-rental').attr('id_location'); 405 var pageNum = 1; 406 if ($(this).hasClass('pagination')) { 407 $('.st-tab-service-content #st_rental_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 408 $(this).addClass('current'); 409 var url = $(this).attr('href'); 410 if (typeof url !== typeof undefined && url !== false) { 411 var arr = url.split('/'); 412 var pageNum = arr[arr.indexOf('page') + 1]; 413 414 if (isNaN(pageNum)) { 415 pageNum = 1; 416 } 417 } else { 418 return false; 419 } 420 } else { 421 $(this).toggleClass('active'); 422 if ($('#st_rental_ccv ul.pagination').length > 0) { 423 $('#st_rental_ccv ul.pagination').find('li').each(function () { 424 if ($(this).children().hasClass('current')) { 425 pageNum = $(this).children().text(); 426 } 427 }); 428 } 429 430 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 431 pageNum = 1; 432 } 433 } 434 435 var arr_tax = []; 436 data['action'] = 'st_filter_rental_ajax_location'; 437 data['page'] = pageNum; 438 data['isajax_location'] = '1'; 439 data['posts_per_page'] = posts_per_page; 440 data['id_location'] = id_location; 441 442 xhr_ren = $.ajax({
443 url: st_params.ajax_url, 444 dataType: 'json', 445 type: 'get', 446 data: data, 447 beforeSend: function () { 448 loadmore.fadeIn(); 449 }, 450 success: function (doc) { 451 $('#st_rental_ccv .row-wrapper').empty(); 452 $('#st_rental_ccv .row-wrapper').append(doc.content); 453 $('#ajax-filter-pag-rental').html(doc.pag); 454 }, 455 complete: function () { 456 loadmore.fadeOut(); 457 setTimeout(function () { 458 $('.st-tab-service-content #rental-search-result .has-matchHeight').matchHeight({remove: true}); 459 $('.st-tab-service-content #rental-search-result .has-matchHeight').matchHeight(); 460 }, 500); 461 requestRunning_ren = false; 462 }, 463 }); 464 requestRunning_ren = true; 465 } 466 467 /*Activity*/ 468 var requestRunning_ac = false; 469 var xhr_ac; 470 var checkOrderBy_ac = false; 471 $(document).on('click', '.st-tab-service-content #st_activity_ccv .st-pagination-ccv a.page-numbers', function (e) { 472 var loadmore = $('.st-loader-ccv'); 473 window.scrollTo({ 474 top: $('.st-overview-content.st_tab_service').offset().top-30, 475 behavior: 'smooth' 476 }); 477 loadmore.fadeIn(); 478 e.preventDefault(); 479 if (requestRunning_ac) { 480 xhr_ac.abort(); 481 } 482 var posts_per_page = $('#ajax-filter-pag-activity').attr('posts_per_page'); 483 var id_location = $('#ajax-filter-pag-activity').attr('id_location'); 484 var pageNum = 1; 485 if ($(this).hasClass('page-numbers')) { 486 $('.st-tab-service-content #st_activity_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 487 $(this).addClass('current'); 488 var url = $(this).attr('href'); 489 if (typeof url !== typeof undefined && url !== false) { 490 var arr = url.split('/'); 491 var pageNum = arr[arr.indexOf('page') + 1]; 492 493 if (isNaN(pageNum)) { 494 pageNum = 1; 495 } 496 } else { 497 return false; 498 } 499 } else { 500 $(this).toggleClass('active'); 501 if ($('#st_activity_ccv ul.page-numbers').length > 0) { 502 $('#st_activity_ccv ul.page-numbers').find('li').each(function () { 503 if ($(this).children().hasClass('current')) { 504 pageNum = $(this).children().text(); 505 } 506 }); 507 } 508 509 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 510 pageNum = 1; 511 } 512 } 513 514 var arr_tax = []; 515 data['action'] = 'st_filter_activity_ajax_location'; 516 data['page'] = pageNum; 517 data['isajax_location'] = '1'; 518 data['posts_per_page'] = posts_per_page; 519 data['id_location'] = id_location; 520 521 xhr_ac = $.ajax({ 522 url: st_params.ajax_url, 523 dataType: 'json', 524 type: 'get', 525 data: data, 526 beforeSend: function () { 527 528 }, 529 success: function (doc) { 530 $('#st_activity_ccv .row-wrapper').empty(); 531 $('#st_activity_ccv .row-wrapper').append(doc.content); 532 $('#ajax-filter-pag-activity').html(doc.pag); 533 }, 534 complete: function () { 535 loadmore.fadeOut(); 536 setTimeout(function () { 537 $('.st-tab-service-content #activity-search-result .has-matchHeight').matchHeight({remove: true}); 538 $('.st-tab-service-content #activity-search-result .has-matchHeight').matchHeight(); 539 }, 500); 540 requestRunning_ac = false; 541 }, 542 }); 543 requestRunning_ac = true; 544 }); 545 if ($('#st_activity_ccv .row-wrapper').length > 0) { 546 var loadmore = $('.st-loader-ccv'); 547 window.scrollTo({ 548 top: $('body').offset().top-30, 549 behavior: 'smooth' 550 }); 551 loadmore.fadeIn(); 552 if (requestRunning_ac) { 553 xhr_ac.abort(); 554 } 555 var posts_per_page = $('#ajax-filter-pag-activity').attr('posts_per_page'); 556 var id_location = $('#ajax-filter-pag-activity').attr('id_location'); 557 var pageNum = 1; 558 if ($(this).hasClass('page-numbers')) { 559 $('.st-tab-service-content #st_activity_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 560 $(this).addClass('current'); 561 var url = $(this).attr('href'); 562 if (typeof url !== typeof undefined && url !== false) { 563 var arr = url.split('/'); 564 var pageNum = arr[arr.indexOf('page') + 1]; 565 566 if (isNaN(pageNum)) { 567 pageNum = 1; 568 } 569 } else { 570 return false; 571 } 572 } else { 573 $(this).toggleClass('active'); 574 if ($('#st_activity_ccv ul.page-numbers').length > 0) { 575 $('#st_activity_ccv ul.page-numbers').find('li').each(function () { 576 if ($(this).children().hasClass('current')) { 577 pageNum = $(this).children().text(); 578 } 579 }); 580 } 581 582 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 583 pageNum = 1; 584 } 585 } 586 587 var arr_tax = []; 588 data['action'] = 'st_filter_activity_ajax_location'; 589 data['page'] = pageNum; 590 data['isajax_location'] = '1'; 591 data['posts_per_page'] = posts_per_page; 592 data['id_location'] = id_location; 593 594 xhr_ac = $.ajax({
595 url: st_params.ajax_url, 596 dataType: 'json', 597 type: 'get', 598 data: data, 599 beforeSend: function () { 600 loadmore.fadeIn(); 601 }, 602 success: function (doc) { 603 $('#st_activity_ccv .row-wrapper').empty(); 604 $('#st_activity_ccv .row-wrapper').append(doc.content); 605 $('#ajax-filter-pag-activity').html(doc.pag); 606 }, 607 complete: function () { 608 loadmore.fadeOut(); 609 setTimeout(function () { 610 $('.st-tab-service-content #activity-search-result .has-matchHeight').matchHeight({remove: true}); 611 $('.st-tab-service-content #activity-search-result .has-matchHeight').matchHeight(); 612 }, 500); 613 requestRunning_ac = false; 614 }, 615 }); 616 requestRunning_ac = true; 617 } 618 619 /*Car*/ 620 var requestRunning_car = false; 621 var xhr_car; 622 var checkOrderBy_car = false; 623 $(document).on('click', '.st-tab-service-content #st_cars_ccv .st-pagination-ccv a.page-numbers', function (e) { 624 var loadmore = $('.st-loader-ccv'); 625 window.scrollTo({ 626 top: $('.st-overview-content.st_tab_service').offset().top-30, 627 behavior: 'smooth' 628 }); 629 loadmore.fadeIn(); 630 e.preventDefault(); 631 if (requestRunning_car) { 632 xhr_car.abort(); 633 } 634 var posts_per_page = $('#ajax-filter-pag-cars').attr('posts_per_page'); 635 var id_location = $('#ajax-filter-pag-cars').attr('id_location'); 636 var pageNum = 1; 637 if ($(this).hasClass('page-numbers')) { 638 $('.st-tab-service-content #st_cars_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 639 $(this).addClass('current'); 640 var url = $(this).attr('href'); 641 if (typeof url !== typeof undefined && url !== false) { 642 var arr = url.split('/'); 643 var pageNum = arr[arr.indexOf('page') + 1]; 644 645 if (isNaN(pageNum)) { 646 pageNum = 1; 647 } 648 } else { 649 return false; 650 } 651 } else { 652 $(this).toggleClass('active'); 653 if ($('#st_cars_ccv ul.page-numbers').length > 0) { 654 $('#st_cars_ccv ul.page-numbers').find('li').each(function () { 655 if ($(this).children().hasClass('current')) { 656 pageNum = $(this).children().text(); 657 } 658 }); 659 } 660 661 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 662 pageNum = 1; 663 } 664 } 665 666 var arr_tax = []; 667 data['action'] = 'st_filter_cars_ajax_location'; 668 data['page'] = pageNum; 669 data['isajax_location'] = '1'; 670 data['posts_per_page'] = posts_per_page; 671 data['id_location'] = id_location; 672 673 xhr_car = $.ajax({ 674 url: st_params.ajax_url, 675 dataType: 'json', 676 type: 'get', 677 data: data, 678 beforeSend: function () { 679 680 }, 681 success: function (doc) { 682 $('#st_cars_ccv .row-wrapper').empty(); 683 $('#st_cars_ccv .row-wrapper').append(doc.content); 684 $('#ajax-filter-pag-cars').html(doc.pag); 685 }, 686 complete: function () { 687 loadmore.fadeOut(); 688 setTimeout(function () { 689 $('.st-tab-service-content #cars-search-result .has-matchHeight').matchHeight({remove: true}); 690 $('.st-tab-service-content #cars-search-result .has-matchHeight').matchHeight(); 691 }, 500); 692 requestRunning_car = false; 693 }, 694 }); 695 requestRunning_car = true; 696 }); 697 if ($('#st_cars_ccv .row-wrapper').length > 0) { 698 var loadmore = $('.st-loader-ccv'); 699 window.scrollTo({ 700 top: $('body').offset().top-30, 701 behavior: 'smooth' 702 }); 703 loadmore.fadeIn(); 704 if (requestRunning_car) { 705 xhr_car.abort(); 706 } 707 var posts_per_page = $('#ajax-filter-pag-cars').attr('posts_per_page'); 708 var id_location = $('#ajax-filter-pag-cars').attr('id_location'); 709 var pageNum = 1; 710 if ($(this).hasClass('page-numbers')) { 711 $('.st-tab-service-content #st_cars_ccv .st-pagination-ccv a.page-numbers').removeClass('current'); 712 $(this).addClass('current'); 713 var url = $(this).attr('href'); 714 if (typeof url !== typeof undefined && url !== false) { 715 var arr = url.split('/'); 716 var pageNum = arr[arr.indexOf('page') + 1]; 717 718 if (isNaN(pageNum)) { 719 pageNum = 1; 720 } 721 } else { 722 return false; 723 } 724 } else { 725 $(this).toggleClass('active'); 726 if ($('#st_cars_ccv ul.page-numbers').length > 0) { 727 $('#st_cars_ccv ul.page-numbers').find('li').each(function () { 728 if ($(this).children().hasClass('current')) { 729 pageNum = $(this).children().text(); 730 } 731 }); 732 } 733 734 if ($(this).data('type') != 'layout' && $(this).data('type') != 'order') { 735 pageNum = 1; 736 } 737 } 738 739 var arr_tax = []; 740 data['action'] = 'st_filter_cars_ajax_location'; 741 data['page'] = pageNum; 742 data['isajax_location'] = '1'; 743 data['posts_per_page'] = posts_per_page; 744 data['id_location'] = id_location; 745 746 xhr_car = $.ajax({
747 url: st_params.ajax_url, 748 dataType: 'json', 749 type: 'get', 750 data: data, 751 beforeSend: function () { 752 loadmore.fadeIn(); 753 }, 754 success: function (doc) { 755 $('#st_cars_ccv .row-wrapper').empty(); 756 $('#st_cars_ccv .row-wrapper').append(doc.content); 757 $('#ajax-filter-pag-cars').html(doc.pag); 758 }, 759 complete: function () { 760 loadmore.fadeOut(); 761 setTimeout(function () { 762 $('.st-tab-service-content #cars-search-result .has-matchHeight').matchHeight({remove: true}); 763 $('.st-tab-service-content #cars-search-result .has-matchHeight').matchHeight(); 764 }, 500); 765 requestRunning_car = false; 766 }, 767 }); 768 requestRunning_car = true; 769 } 770 771 function URLToArrayNew() { 772 var res = {}; 773 $('.toolbar .layout span').each(function () { 774 if($(this).hasClass('active')){ 775 res['layout'] = $(this).data('value'); 776 } 777 }); 778 res['orderby'] = 'new'; 779 res['check_single_location'] = 'is_location'; 780 var sPageURL = window.location.search.substring(1); 781 if(sPageURL != '') { 782 var sURLVariables = sPageURL.split('&'); 783 if (sURLVariables.length) { 784 for (var i = 0; i < sURLVariables.length; i++) { 785 var sParameterName = sURLVariables[i].split('='); 786 if(sParameterName.length){ 787 let val = decodeURIComponent(sParameterName[1]); 788 res[decodeURIComponent(sParameterName[0])] = val == 'undefined'? '': val; 789 } 790 } 791 } 792 } 793 return res; 794 } 795}) 796
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.