PageSourceSearch

https://www.map-tours.com/wp-content/themes/traveler/v2/js/car-tranfer.js

js map-tours.com collected 2026-10-08 00:05:40 UTC 7,700 bytes, 224 lines download raw bytes

1/*Carstranfer*/
2jQuery(function($) {
3  var st_with_search_location_transfer = $(
4    ".tab-pane.active#st_cartranfer .destination-pickup-carstranfer"
5  ).outerWidth();
6  $("#transfer_from")
7    .select2()
8    .on("select2:open", function() {
9      $.fn.niceScroll && $(".select2-results__options").niceScroll({
10        cursorcolor: "#5fdfe8",
11        cursorwidth: "8px",
12        autohidemode: false,
13        cursorborder: "1px solid #5fdfe8",
14        horizrailenabled: false
15      });
16    });
17  $("#transfer_to")
18    .select2()
19    .on("select2:open", function() {
20      $.fn.niceScroll && $(".select2-results__options").niceScroll({
21        cursorcolor: "#5fdfe8",
22        cursorwidth: "8px",
23        autohidemode: false,
24        cursorborder: "1px solid #5fdfe8",
25        horizrailenabled: false
26      });
27    });
28
29  $("#transfer_from").select2({
30    tags: true,
31    width: st_with_search_location_transfer + "px"
32  });
33  $("#transfer_to").select2({
34    tags: true,
35    width: st_with_search_location_transfer + "px"
36  });
37  $(document).on("select2:open", "select#transfer_from", function() {
38    setTimeout(function() {
39      if ($(".select2-result").length) {
40        $(".select2-result")
41          .getNiceScroll()
42          .resize();
43      }
44    }, 1000);
45  });
46  $(document).on("select2:open", "select#transfer_to", function() {
47    var st_with_search_location_transfer = $(
48      ".tab-pane.active#st_cartranfer .destination-pickup-carstranfer"
49    ).outerWidth();
50
51    setTimeout(function() {
52      if ($(".select2-dropdown .select2-result").length) {
53      }
54    }, 1000);
55  });
56  $(".select2-result").each(function() {
57    $(this).niceScroll();
58  });
59
60  $("select#transfer_from").on("change", function(e) {
61    var parent_from = $(this).closest(".field-destination-carstranfer");
62
63    var car_from_value = this.value;
64    var data = $("#transfer_from").select2("data");
65    if (data) {
66      var car_from_name = data[0].text;
67      car_from_name = $.trim(car_from_name);
68    }
69    console.log(car_from_name);
70    var from = parent_from.find(".destination-pickup .render .destination");
71    from.text(car_from_name);
72  });
73  $("select#transfer_to").on("change", function(e) {
74    var parent_from = $(this).closest(".field-destination-carstranfer");
75
76    var car_from_value = this.value;
77    var data = $("#transfer_to").select2("data");
78    if (data) {
79      var car_from_name = data[0].text;
80      car_from_name = $.trim(car_from_name);
81    }
82    console.log(car_from_name);
83    var from = parent_from.find("#dropdown-dropoff .render .destination");
84    from.text(car_from_name);
85  });
86
87  $(
88    ".search-result-page .search-form-wrapper .search-form .field-destination-carstranfer .destination-pickup"
89  ).on("click", function(e) {
90    console.log("close");
91
92    // $(this).find('.select2-selection__rendered').trigger('click');
93    e.preventDefault();
94  });
95
96  var modal = document.querySelector(".st-tooltip");
97  //var trigger = document.querySelector(".st_click_choose_service");
98  //var closeButton = document.querySelector(".close-button");
99
100  function toggleModal() {
101    modal.classList.toggle("show-modal");
102  }
103
104  function windowOnClick(event) {
105    if (event.target === modal) {
106      toggleModal();
107    }
108  }
109  $(".modern-search-result").each(function() {
110    $(this).on("click", function(e) {
111      if ($(e.target).is(".st_click_choose_service")) {
112        let btnClick = $(e.target);
113        var st_item_modal = btnClick.closest(".item-service-car");
114        st_item_modal
115          .find(".sroom-extra-service .st-tooltip")
116          .toggleClass("show-modal");
117        var st_modal = st_item_modal.find(".sroom-extra-service .st-tooltip");
118      }
119      if ($(e.target).is(".st-close-button i")) {
120        let btnClickClose = $(e.target);
121        var st_item_modal = btnClickClose.closest(".item-service-car");
122        st_item_modal
123          .find(".sroom-extra-service .st-tooltip")
124          .toggleClass("show-modal");
125        st_item_modal
126          .find(".sroom-extra-service .st-tooltip")
127          .removeClass("show-modal");
128      }
129    });
130  });
131
132  $(".modern-search-result").each(function() {
133    $(this).on("click", function(e) {
134      if ($(e.target).is(".st_click_choose_passenger")) {
135        let btnClick = $(e.target);
136        var st_item_modal = btnClick.closest(".item-service-car");
137        st_item_modal
138          .find(".sroom-passenger .st-tooltip")
139          .toggleClass("show-modal");
140        var st_modal = st_item_modal.find(".sroom-passenger .st-tooltip");
141      }
142      if ($(e.target).is(".st-close-button i")) {
143        let btnClickClose = $(e.target);
144        var st_item_modal = btnClickClose.closest(".item-service-car");
145        st_item_modal
146          .find(".sroom-passenger .st-tooltip")
147          .toggleClass("show-modal");
148        st_item_modal
149          .find(".sroom-passenger .st-tooltip")
150          .removeClass("show-modal");
151      }
152    });
153  });
154
155  //Return
156  $(".modern-search-result").each(function() {
157    $(this).on("click", function(e) {
158      if ($(e.target).is(".st_click_choose_return")) {
159        let btnClick = $(e.target);
160        var st_item_modal = btnClick.closest(".item-service-car");
161        st_item_modal
162          .find(".sroom-return .st-tooltip")
163          .toggleClass("show-modal");
164        var st_modal = st_item_modal.find(".sroom-return .st-tooltip");
165      }
166      if ($(e.target).is(".st-close-button i")) {
167        let btnClickClose = $(e.target);
168        var st_item_modal = btnClickClose.closest(".item-service-car");
169        st_item_modal
170          .find(".sroom-return .st-tooltip")
171          .toggleClass("show-modal");
172        st_item_modal
173          .find(".sroom-return .st-tooltip")
174          .removeClass("show-modal");
175      }
176    });
177  });
178	/*Date rangpicker*/
179	loadDateRangePicker()
180	var body = $("body.page-template-template-transfer-search");
181	$('.modern-search-result', body).on('change', function() {
182		loadDateRangePicker()
183	})
184
185	function loadDateRangePicker() {
186		var body = $("body.page-template-template-transfer-search");
187		$(".item-service.item-service-car", body).each(function() {
188			var parent = $(this),
189				button_date = $(".st_click_choose_datetime", parent),
190				time_start = $("input[name='start-time']", parent),
191				date_start = $("input[name='start']", parent);
192
193			var options = {
194				singleDatePicker: true,
195				showCalendar: false,
196        		sameDate: true,
197				autoApply: false,
198				disabledPast: true,
199				dateFormat: "DD/MM/YYYY",
200				customClass: "popup-date-custom-cartranfer",
201				enableLoading: true,
202				showEventTooltip: true,
203				classNotAvailable: ["disabled", "off"],
204				disableHightLight: true,
205				timePicker: true,
206				timePicker24Hour: (st_params.time_format == '12h') ? false : true,
207			};
208			if (typeof locale_daterangepicker == "object") {
209				options.locale = locale_daterangepicker;
210      		}
211
212      button_date.on('click',function(){
213        $('.page-template-template-transfer-search .st-popup.popup-date').show();
214        button_date.trigger('show.daterangepicker');
215      });
216      button_date.daterangepicker(options, function(start, end, label) {
217        $(".page-template-template-transfer-search .st-popup.popup-date").hide();
218        time_start.val(start.format(parent.data('time-format')));
219        button_date.html(start.format(parent.data('date-format')) + " " + start.format(parent.data('time-format')));
220        date_start.val(start.format(parent.data('date-format')));
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.