1/* 2 * Plugin Name: Themeum Core 3 * Plugin URI: http://www.themeum.com/item/core 4 * Author: Themeum 5 * Author URI: http://www.themeum.com 6 * License - GNU/GPL V2 or Later 7 * Description: Themeum Core is a required plugin for this theme. 8 * Version: 1.0 9 */ 10 11jQuery(document).ready(function ($) { 12 'use strict'; 13 14 15 16 $('select.select2').select2({ 17 minimumResultsForSearch: -1 18 }); 19 20 21 function formatRepo(repo) { 22 if (repo.loading) 23 return repo.text; 24 25 var markup = '<div class="select2-result-repository">' + repo.name + '</div>'; 26 27 return markup; 28 } 29 30 function formatRepoSelection(repo) { 31 return repo.name || repo.text; 32 } 33 34 var app = $(".thm-fs-place").select2({ 35 ajax: { 36 url: thm_flight.ajax_url, 37 dataType: 'json', 38 delay: 250, 39 data: function (params) { 40 return { 41 query: params.term, // search term 42 action: 'get_places_by_query', 43 }; 44 }, 45 processResults: function (data, params) { 46 var places = []; 47 48 $.each(data, function (key, value) { 49 var place = { 50 id: value.city_code, 51 name: value.city_name + " (" + value.country_name + ")" 52 }; 53 54 places.push(place); 55 }); 56 57 return { 58 results: places, 59 }; 60 }, 61 cache: true 62 }, 63 // placeholder: "City or Airport", 64 escapeMarkup: function (markup) { 65 return markup; 66 }, // let our custom formatter work 67 minimumInputLength: 3, 68 templateResult: formatRepo, // omitted for brevity, see the source of this page 69 templateSelection: formatRepoSelection // omitted for brevity, see the source of this page 70 }); 71 72 73 74 /*var $ajax = $(".thm-fs-place"); 75 76 77 78 79 function formatRepo (repo) { 80 if (repo.loading) return repo.text; 81 82 var markup = "<div class='select2-result-repository__title'>" + repo.full_name + "</div>"; 83 84 return markup; 85 } 86 87 function formatRepoSelection (repo) { 88 return repo.full_name || repo.text; 89 } 90 91 $ajax.select2({ 92 ajax: { 93 url: "https://api.github.com/search/repositories", 94 dataType: 'json', 95 delay: 250, 96 data: function (params) { 97 return { 98 q: params.term, // search term 99 }; 100 }, 101 processResults: function (data, params) { 102 103 104 return { 105 results: data.items, 106 }; 107 }, 108 cache: true 109 }, 110 escapeMarkup: function (markup) { return markup; }, 111 minimumInputLength: 1, 112 templateResult: formatRepo, 113 templateSelection: formatRepoSelection 114 });*/ 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 $('.thm-date-picker').datepicker({ 130 dateFormat: "yy-mm-dd", 131 minDate: 0 132 }); 133 134 $('.thm-date-time-picker').each(function () { 135 136 var current = $(this).val(); 137 138 $(this).datetimepicker({ 139 dateFormat: "yy-mm-dd", 140 minDate: 0 141 }).datetimepicker('setDate', current); 142 }); 143 144 145 // Home Slider 146 147 function doAnimations(elems) { 148 var animEndEv = 'webkitAnimationEnd animationend'; 149 150 elems.each(function () { 151 var $this = $(this), 152 $animationType = $this.data('animation'); 153 $this.addClass($animationType).one(animEndEv, function () { 154 $this.removeClass($animationType); 155 }); 156 }); 157 } 158 var $myCarousel = $('.home-two-crousel'); 159 var $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); 160 $myCarousel.carousel(); 161 doAnimations($firstAnimatingElems); 162 $myCarousel.on('slide.bs.carousel', function (e) { 163 var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']"); 164 doAnimations($animatingElems); 165 });
166 167 168 // prettySocial 169 $('.prettySocial').prettySocial(); 170 171 //Animated Number 172 $('.themeum-counter-number').each(function () { 173 var $this = $(this); 174 $({Counter: 0}).animate({Counter: $this.data('digit')}, { 175 duration: $this.data('duration'), 176 step: function () { 177 $this.text(Math.ceil(this.Counter)); 178 } 179 }); 180 }); 181 182 new WOW().init 183 184 185 186 var $partnercarosuel = $('.themeum-partner-carosuel'); 187 $partnercarosuel.owlCarousel({ 188 loop: true, 189 dots: false, 190 nav: false, 191 rtl: true, 192 margin: 140, 193 autoplay: false, 194 autoplayTimeout: 3000, 195 autoplayHoverPause: true, 196 autoHeight: false, 197 lazyLoad: true, 198 responsive: { 199 0: { 200 items: 2 201 }, 202 480: { 203 items: 3 204 }, 205 1000: { 206 items: 5 207 } 208 } 209 }); 210 211 212 213 //Start Photos Gallery 214 $('a[href="#roomtype"], a[href="#gallery"]').on('shown.bs.tab', function () { 215 setTimeout(function () { 216 initialize_owl($('.photos-gallery')); 217 }, 300); 218 }) 219 220 function initialize_owl(gallery) { 221 gallery.owlCarousel({ 222 loop: true, 223 nav: false, 224 rtl: true, 225 autoplay: true, 226 items: 1 227 }); 228 } 229 function destroy_owl(gallery) { 230 if (gallery.data('owlCarousel')) { 231 gallery.data('owlCarousel').destroy(); 232 } 233 } 234 //End Photos Gallery 235 236 var $featurecarosuel = $('.themeum-feature-carosuel'); 237 $featurecarosuel.owlCarousel({ 238 loop:true, 239 dots:false, 240 nav:false, 241 rtl: true, 242 margin:30, 243 autoplay:true, 244 autoplayTimeout:3000, 245 autoplayHoverPause:true, 246 autoHeight: false, 247 lazyLoad:true, 248 responsive:{ 249 0:{ 250 items:1 251 }, 252 600:{ 253 items:1 254 }, 255 1000:{ 256 items:5 257 } 258 }, 259 onInitialized: function() { 260 $('.owl-item.active').first().addClass('last-owl-active-item'); 261 } 262 }); 263 264 $featurecarosuel.on('translated.owl.carousel', function (event) { 265 $(event.target).find('.last-owl-active-item').removeClass('last-owl-active-item'); 266 $(event.target).find('.active').first().addClass('last-owl-active-item'); 267 }); 268 269 if ($(".tour-video").length > 0) { 270 $(".tour-video a").magnificPopup({ 271 disableOn: 0, 272 type: 'iframe', 273 mainClass: 'mfp-fade', 274 rtl:true, 275 removalDelay: 300, 276 preloader: false, 277 fixedContentPos: false, 278 }); 279 } 280 281 // Popup Video 282 if ($('.popup-video').length > 0) { 283 $('.popup-video').magnificPopup({ 284 disableOn: 700, 285 type: 'iframe', 286 mainClass: 'mfp-fade', 287 rtl: true, 288 removalDelay: 160, 289 preloader: false, 290 fixedContentPos: false 291 }); 292 } 293 294 //popup 295 $('.plus-icon').magnificPopup({ 296 type: 'image', 297 mainClass: 'mfp-with-zoom', 298 zoom: { 299 enabled: true, 300 duration: 300, 301 easing: 'ease-in-out', 302 opener: function (openerElement) { 303 return openerElement.next('img') ? openerElement : openerElement.find('img'); 304 } 305 }, 306 gallery: { 307 enabled: true, 308 navigateByImgClick: true, 309 preload: [0, 1] 310 } 311 }); 312 $('.plus-icon').on('click', function () { 313 $('html').css('overflow', 'inherit'); 314 }); 315 316 317 $('.buynowbtn').magnificPopup({ 318 type: 'inline', 319 removalDelay: 500, 320 callbacks: { 321 beforeOpen: function () { 322 this.st.mainClass = this.st.el.attr('data-effect'); 323 } 324 }, 325 midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source. 326 });
327 328 329 (function () { 330 var bsa = document.createElement('script'); 331 bsa.type = 'text/javascript'; 332 bsa.async = true; 333 bsa.src = '//s3.buysellads.com/ac/bsa.js'; 334 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(bsa); 335 })(); 336 337 // end popup 338 339 340 341 342}); 343 344 345jQuery(document).ready(function ($) { 346 347 var Flight = {}; 348 349 Flight.renderTo = function (from, to) { 350 var thm_flights = JSON.parse(localStorage.getItem('thm_flights')); 351 $('ul#all-flights').addClass('active'); 352 for (var i = from; i <= to; i++) { 353 var flightContainer = $('ul#all-flights'), 354 flightData = { 355 position: (i - from), 356 data: thm_flights[i] 357 }; 358 359 var request = $.ajax({ 360 url: thm_flight.ajax_url, 361 method: "POST", 362 data: { 363 action: 'get_flight_html', 364 flight: flightData 365 }, 366 // dataType: "html" 367 }); 368 369 request.done(function (data) { 370 371 var liItem = flightContainer.find('li[data-pos="' + $(data).data('pos') + '"]'); 372 373 liItem.addClass('active'); 374 liItem.html(data); 375 }); 376 } 377 }; 378 379 Flight.pagination = function () { 380 var thm_flights = JSON.parse(localStorage.getItem('thm_flights')), 381 totalFlights = thm_flights.length, 382 numberOfPage = Math.floor(totalFlights / 10), 383 dotDot = false, 384 htmlOutput = '', 385 paginationContainer = $('#flight-pagination'); 386 387 if (thm_flights.length % 10) { 388 numberOfPage++; 389 } 390 391 if (numberOfPage > 5) { 392 dotDot = true; 393 } 394 395 396 htmlOutput += '<li><a href="#" data-type="prev" class="flight-next-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li>'; 397 398 for (var i = 1; i <= numberOfPage; i++) { 399 if (i == 1) { 400 htmlOutput += '<li><a href="#" data-page="' + i + '" class="flight-pagenum active">' + i + '</a></li>'; 401 } else if (numberOfPage == i) { 402 htmlOutput += '<li><a href="#" data-page="' + i + '" class="flight-pagenum thm-last-item">' + i + '</a></li>'; 403 } else { 404 htmlOutput += '<li><a href="#" data-page="' + i + '" class="flight-pagenum">' + i + '</a></li>'; 405 } 406 } 407 408 htmlOutput += '<li><a href="#" data-type="next" class="flight-next-prev"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>'; 409 410 paginationContainer.html(htmlOutput); 411 }; 412 413 /** 414 * 'host' => 'zazat.net', 415 'locale' => 'en', 416 'marker' => '63990', 417 'ip' => '127.0.0.1', 418 'trip_class' => 'Y', 419 'passengers' => array( 420 'adults' => 1, 421 'children' => 0, 422 'infants' => 0 423 ), 424 'segments' => array( 425 array( 426 'date' => "2017-02-16", 427 'destination' => 'DEL', 428 'origin' => 'DAC', 429 ) 430 ) 431 */ 432 433 var TP_Flight_Search = { 434 params: {}, 435 run: function ( params ) { 436 this.params = params;
437 this.getSearchID(); 438 439 }, 440 processParams: function (obj) { 441 442 var temp_obj = {}; 443 444 $.each(obj, function (i, item) { 445 temp_obj[item.name] = item.value; 446 }); 447 448 var params = { 449 'host': '', 450 'locale': '', 451 'ip': '', 452 'trip_class': '', 453 'passengers': { 454 'adults': 0, 455 'children': 0, 456 'infants': 0 457 }, 458 'segments': [] 459 }; 460 461 params.locale = temp_obj.locale; 462 params.ip = temp_obj.ip; 463 params.host = temp_obj.host; 464 params.trip_class = temp_obj.cabinclass; 465 params.passengers.adults = temp_obj.adults; 466 params.passengers.children = temp_obj.children; 467 468 if (temp_obj.outbounddate) { 469 var out_seg = { 470 'date': temp_obj.outbounddate, 471 'destination': temp_obj.destinationplace, 472 'origin': temp_obj.originplace, 473 }; 474 475 params.segments.push(out_seg); 476 } 477 478 if (temp_obj.inbounddate) { 479 var in_seg = { 480 'date': temp_obj.inbounddate, 481 'destination': temp_obj.originplace, 482 'origin': temp_obj.destinationplace, 483 }; 484 485 params.segments.push(in_seg); 486 } 487 488 return params; 489 }, 490 getSearchID: function () { 491 var request = $.ajax({ 492 url: thm_flight.ajax_url, 493 method: "POST", 494 data: { 495 action: 'get_search_id', 496 search: this.params 497 }, 498 // dataType: "json" 499 }); 500 501 request.done(function (data, textStatus, jqXHR) { 502 if (data) { 503 $('body').data('search_id', data); 504 $('body').trigger('tp_search_id'); 505 } else { 506 $('.flight-loader').removeClass('active'); 507 $('.thm-flight-alert').addClass('active'); 508 } 509 }); 510 }, 511 getSearchResult: function () { 512 var self = this; 513 $('body').on('tp_search_id', function () { 514 var search_id = $('body').data('search_id'); 515 516 self.getSearchResultCall(search_id); 517 }); 518 }, 519 getSearchResultCall: function (search_id, results) { 520 var self = this; 521 522 results = results || []; 523 var request = $.ajax({ 524 url: thm_flight.ajax_url, 525 method: "POST", 526 data: { 527 action: 'get_tp_search_result', 528 search_id: search_id 529 }, 530 dataType: "json" 531 }); 532 533 request.done(function (data, textStatus, jqXHR) { 534 535 if ((data.length === 0) || (data[data.length - 1].search_id && !data[data.length - 1].meta)) { 536 var only_valid_results = []; 537 538 $.each(results, function (i, item) { 539 if (item.proposals.length) { 540 only_valid_results.push(item); 541 } 542 }); 543 $('body').data('results', only_valid_results); 544 $('body').trigger('tp_search_completed'); 545 return; 546 } 547 var all_results = results.concat(data); 548 549 self.getSearchResultCall(search_id, all_results); 550 }); 551 }, 552 processData: function () { 553 $('body').on('tp_search_completed', function () { 554 var results = $('body').data('results'), 555 flights = []; 556 557 $.each(results, function (i, item) { 558 $.each(item.proposals, function (index, proposal) { 559 var flight = { 560 'prices': [] 561 }; 562 if (typeof proposal.segment[0] !== 'undefined') { 563 flight['out'] = { 564 'duration': 0, 565 'segments': [], 566 'carriers': [], 567 'operatingCarriers': {}, 568 'destination': { 569 'code': item.segments[0].destination, 570 'name': item.airports[item.segments[0].destination].city, 571 'type': 'Airport' 572 }, 573 'origin': { 574 'code': item.segments[0].origin, 575 'name': item.airports[item.segments[0].origin].city, 576 'type': 'Airport' 577 } 578 }; 579 580 flight.out['stops'] = []; 581 582 if (proposal.max_stops) { 583 $.each(proposal.stops_airports, function (key, airport) { 584 var stop = { 585 'code': airport, 586 'name': item.airports[airport].city, 587 'type': 'Airport' 588 }; 589 590 flight.out.stops.push(stop); 591 }); 592 } 593 594 $.each(proposal.segment[0].flight, function (i, flight_seg) { 595 if (!i) { 596 flight['out']['arrival'] = flight_seg.arrival_date+'T'+flight_seg.arrival_time+':00'; 597 } 598 flight['out']['departure'] = flight_seg.departure_date+'T'+flight_seg.departure_time+':00'; 599 600 flight.out.duration = flight.out.duration + flight_seg.duration + flight_seg.delay; 601 602 var segment = { 603 'arrival': '', 604 'departure': '', 605 'carrier': {}, 606 'duration': 0, 607 'number': 0, 608 'destination': { 609 'code': '', 610 'name': '', 611 'type': 'Airport' 612 }, 613 'origin': { 614 'code': '', 615 'name': '', 616 'type': 'Airport' 617 } 618 }, 619 carrier = { 620 'code': '', 621 'name': '', 622 'displayCode': '', 623 'logo': '' 624 }; 625 626 segment.arrival = flight_seg.arrival_date+'T'+flight_seg.arrival_time+':00'; 627 segment.departure = flight_seg.departure_date+'T'+flight_seg.departure_time+':00'; 628 629 carrier.code = flight_seg.operating_carrier; 630 carrier.logo = 'http://pics.avs.io/200/70/'+flight_seg.operating_carrier+'.png'; 631 632 if (typeof item.airlines[flight_seg.operating_carrier] !== 'undefined') { 633 carrier.name = item.airlines[flight_seg.operating_carrier].name; 634 } 635 636 segment.carrier = carrier; 637 638 if (!i) { 639 flight.out.operatingCarriers = carrier; 640 } 641 642 segment.duration = flight_seg.duration; 643 segment.number = flight_seg.number; 644 645 646 segment.destination.code = flight_seg.departure; 647 segment.destination.name = item.airports[flight_seg.departure].city; 648 649 segment.origin.code = flight_seg.arrival; 650 segment.origin.name = item.airports[flight_seg.arrival].city; 651 652 653 flight.out.carriers.push(carrier); 654 flight.out.segments.push(segment); 655 }); 656 657 } 658 if (typeof proposal.segment[1] !== 'undefined') { 659 flight['in'] = { 660 'duration': 0, 661 'segments': [], 662 'carriers': [], 663 'operatingCarriers': {}, 664 'destination': { 665 'code': item.segments[0].destination, 666 'name': item.airports[item.segments[0].destination].city, 667 'type': 'Airport' 668 }, 669 'origin': { 670 'code': item.segments[0].origin, 671 'name': item.airports[item.segments[0].origin].city, 672 'type': 'Airport' 673 } 674 }; 675 676 flight.in['stops'] = []; 677 678 if (proposal.max_stops) { 679 $.each(proposal.stops_airports, function (key, airport) { 680 var stop = { 681 'code': airport, 682 'name': item.airports[airport].city, 683 'type': 'Airport' 684 }; 685 686 flight.in.stops.push(stop); 687 }); 688 } 689 690 $.each(proposal.segment[0].flight, function (i, flight_seg) { 691 if (!i) { 692 flight['in']['arrival'] = flight_seg.arrival_date+'T'+flight_seg.arrival_time+':00'; 693 } 694 flight['in']['departure'] = flight_seg.departure_date+'T'+flight_seg.departure_time+':00'; 695 696 flight.in.duration = flight.in.duration + flight_seg.duration + flight_seg.delay; 697 698 var segment = { 699 'arrival': '', 700 'departure': '', 701 'carrier': {}, 702 'duration': 0, 703 'number': 0, 704 'destination': { 705 'code': '', 706 'name': '', 707 'type': 'Airport' 708 }, 709 'origin': { 710 'code': '', 711 'name': '', 712 'type': 'Airport' 713 } 714 }, 715 carrier = { 716 'code': '', 717 'name': '', 718 'displayCode': '', 719 'logo': '' 720 }; 721 722 segment.arrival = flight_seg.arrival_date+'T'+flight_seg.arrival_time+':00'; 723 segment.departure = flight_seg.departure_date+'T'+flight_seg.departure_time+':00'; 724 725 carrier.code = flight_seg.operating_carrier; 726 carrier.logo = 'http://pics.avs.io/200/70/'+flight_seg.operating_carrier+'.png'; 727 728 if (typeof item.airlines[flight_seg.operating_carrier] !== 'undefined') { 729 carrier.name = item.airlines[flight_seg.operating_carrier].name; 730 } 731 732 segment.carrier = carrier; 733 734 if (!i) { 735 flight.in.operatingCarriers = carrier; 736 } 737 738 segment.duration = flight_seg.duration; 739 segment.number = flight_seg.number; 740 741 742 segment.destination.code = flight_seg.departure; 743 segment.destination.name = item.airports[flight_seg.departure].city; 744 745 segment.origin.code = flight_seg.arrival; 746 segment.origin.name = item.airports[flight_seg.arrival].city; 747 748 749 flight.in.carriers.push(carrier); 750 flight.in.segments.push(segment); 751 }); 752 753 754 755 } 756 757 $.each(proposal.terms, function (id, term_data) { 758 var price = { 759 'price': term_data.price, 760 'currency': term_data.currency, 761 'link': 'http://api.travelpayouts.com/v1/flight_searches/'+item.search_id+'/clicks/'+term_data.url+'.json', 762 'agents': [ 763 { 764 'name': item.gates_info[id].label, 765 'logo': '', 766 'type': 'TravelAgent', 767 } 768 ] 769 }; 770 771 flight.prices.push(price); 772 }); 773 774 775 776 777 778 flights.push(flight); 779 }); 780 }); 781 782 783 localStorage.setItem('thm_flights', JSON.stringify(flights)); 784 785 $('.flight-loader').removeClass('active'); 786 787 Flight.renderTo(0, 9); 788 Flight.pagination(); 789 790 $('.thm-titlestandardstyle > .thm-flight-count').html(flights.length); 791 792 $('.thm-flight-results .thm-titlestandardstyle').addClass('active'); 793 }); 794 }, 795 sendToLinkOnClick: function () { 796 $('.thm-flight-results').on('click', '.tp-click-event', function (e) { 797 e.preventDefault(); 798 799 var request = $.ajax({
800 url: thm_flight.ajax_url, 801 method: "POST", 802 data: { 803 action: 'get_tp_deeplink', 804 url: $(this).attr('href') 805 }, 806 dataType: "json" 807 }); 808 809 request.done(function (data, textStatus, jqXHR) { 810 if (typeof data.url !== 'undefined') { 811 window.location.href = data.url; 812 } 813 }); 814 }); 815 } 816 }; 817 818 TP_Flight_Search.sendToLinkOnClick(); 819 TP_Flight_Search.getSearchResult(); 820 TP_Flight_Search.processData(); 821 822 823 824 825 $('ul#all-flights').on('click', '.thm-show-more', function (e) { 826 e.preventDefault(); 827 828 var flightDetails = $(this).parents('.thm-flight').find('.thm-flight-details'), 829 showMore = $(this).parents('.thm-flight').find('.thm-show-more-main'); 830 831 showMore.toggleClass('active'); 832 if (showMore.find('i').hasClass('fa-caret-right')) { 833 showMore.find('i').removeClass('fa-caret-right'); 834 showMore.find('i').addClass('fa-caret-down'); 835 } else { 836 showMore.find('i').removeClass('fa-caret-down'); 837 showMore.find('i').addClass('fa-caret-right'); 838 } 839 flightDetails.toggleClass('active'); 840 }); 841 842 $('#flight-pagination').on('click', 'a.flight-pagenum', function (e) { 843 e.preventDefault(); 844 845 $('html, body').animate({ 846 scrollTop: $(".thm-tk-search").offset().top - 80 847 }, 500); 848 849 var self = this; 850 851 setTimeout(function () { 852 var pageNumber = $(self).data('page'), 853 form = (parseInt(pageNumber) * 10) - 10, 854 to = (parseInt(pageNumber) * 10) - 1, 855 thm_flights = JSON.parse(localStorage.getItem('thm_flights')); 856 857 if ($(self).hasClass('thm-last-item')) { 858 to = to - (10 - (thm_flights.length % 10)); 859 } 860 861 $('ul#all-flights li').each(function () { 862 $(this).html(''); 863 $(this).removeClass('active'); 864 }); 865 866 Flight.renderTo(form, to); 867 868 $('#flight-pagination li a.active').removeClass('active'); 869 $(self).addClass('active'); 870 }, 600); 871 872 }); 873 874 $('#flight-pagination').on('click', 'a.flight-next-prev', function (e) { 875 876 e.preventDefault(); 877 878 var type = $(this).data('type'); 879 880 881 882 if (type == 'next') { 883 if (!$(this).is($('#flight-pagination li a.active').parent().next().find('a'))) { 884 $('#flight-pagination li a.active').parent().next().find('a').trigger('click'); 885 } 886 887 } else if (type == 'prev') { 888 if (!$(this).is($('#flight-pagination li a.active').parent().prev().find('a'))) { 889 $('#flight-pagination li a.active').parent().prev().find('a').trigger('click'); 890 } 891 } 892 }); 893 894 $('#thm-tk-flights-search-form').on('submit', function (e) { 895 e.preventDefault(); 896 897 var tp_api = $('#thm-tk-flights-search-form').data('tp') || 0; 898 899 900 $('html, body').animate({ 901 scrollTop: $(".thm-tk-search").offset().top - 80 902 }, 500); 903 904 $('ul#all-flights li').each(function () { 905 $(this).html(''); 906 $(this).removeClass('active'); 907 }); 908 909 $('#flight-pagination').html(''); 910 911 $('.thm-flight-results .thm-titlestandardstyle').removeClass('active'); 912 913 $('.thm-flight-alert').removeClass('active'); 914 $('.thm-flight-alert-no-result').removeClass('active'); 915 916 $('.thm-flight-results').addClass('active'); 917 918 $('.flight-loader').addClass('active'); 919 920 921 922 if (tp_api) { 923 var data = $(this).serializeArray(); 924 925 var params = TP_Flight_Search.processParams(data); 926 TP_Flight_Search.run(params); 927 928 } else { 929 930 var data = $(this).serialize(); 931 932 933 var request = $.ajax({
934 url: thm_flight.ajax_url, 935 method: "POST", 936 data: { 937 action: 'get_flight_data', 938 search: data 939 }, 940 dataType: "json" 941 }); 942 943 request.done(function (data, textStatus, jqXHR) { 944 $('.flight-loader').removeClass('active'); 945 946 if (data) { 947 localStorage.setItem('thm_flights', JSON.stringify(data)); 948 949 $('.thm-titlestandardstyle > .thm-flight-count').html(data.length); 950 951 $('.thm-flight-results .thm-titlestandardstyle').addClass('active'); 952 953 954 955 956 Flight.renderTo(0, 9); 957 Flight.pagination(); 958 } else { 959 $('.thm-flight-alert-no-result').addClass('active'); 960 } 961 962 if (textStatus != 'success') { 963 $('.thm-flight-alert').addClass('active'); 964 } 965 966 }); 967 968 request.fail(function (jqXHR) { 969 $('.flight-loader').removeClass('active'); 970 $('.thm-flight-alert').addClass('active'); 971 }); 972 973 } 974 975 /*$('.thm-titlestandardstyle > .thm-flight-count').html(data.length); 976 977 $('.thm-flight-results .thm-titlestandardstyle').addClass('active'); 978 979 $('.flight-loader').removeClass('active'); 980 Flight.renderTo(0, 9); 981 Flight.pagination();*/ 982 }); 983 984 985 986 987 988 989 990}); 991 992var submitPaymentForm = function(payData) 993 { 994 995 var data = { 996 'action':'strip_payment_submit', 997 'data' : payData 998 }; 999 1000 jQuery.ajax({ 1001 url: thm_flight.ajax_url, 1002 type: 'POST', 1003 dataType: 'json', 1004 data: data, 1005 }) 1006 .done(function(data) { 1007 console.log(data); 1008 if (data.status == true) { 1009 window.location = data.redirect; 1010 } 1011 }) 1012 .fail(function() { 1013 console.log("error"); 1014 }); 1015};
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.