PageSourceSearch

https://www.stajets.com/wp-content/themes/sta-jets/assets/JS/site.js?ver=2025.05.30

js stajets.com collected 2026-10-05 05:50:47 UTC 8,724 bytes, 314 lines download raw bytes

1////// Site Main JavaScript File //////
2var $ = jQuery.noConflict();
3var pageURI = document.location.href;
4var screen_width = $(window).width();
5var screen_height = $(window).height();
6var protocol = location.protocol.replace(":", "");
7var url = pageURI.replace(
8  protocol + "://" + window.location.hostname + "/",
9  ""
10);
11console.log("Site by Twelve12.com");
12/**
13 * Window > LOAD
14 */
15$(window).on("load", function () {
16  console.log("Window loaded!");
17});
18
19/**
20 * Window > RESIZE
21 */
22$(window).on("resize", function () {
23  console.log("Window Resized!");
24});
25
26
27// AOS Animate Functions
28AOS.init();
29AOS.init({
30  disable: function () {
31    var maxWidth = 992;
32    return screen_width < maxWidth;
33  },
34  once: true,
35});
36
37//Sliders
38var mySwiper = new Swiper(".planes-slider", {
39  slidesPerView: "auto",
40  freeMode: true,
41  mousewheel: false,
42  navigation: {
43    nextEl: ".swiper-button-next",
44    prevEl: ".swiper-button-prev",
45  },
46});
47
48var mySwiper2 = new Swiper(".team-slider", {
49  slidesPerView: "auto",
50  freeMode: true,
51  mousewheel: false,
52  navigation: {
53    nextEl: ".swiper-button-next",
54    prevEl: ".swiper-button-prev",
55  },
56});
57
58var mySwiper4 = new Swiper(".blogs-slider", {
59  slidesPerView: "auto",
60  freeMode: true,
61  mousewheel: false,
62  spaceBetween: 64,
63  navigation: {
64    nextEl: ".swiper-button-next",
65    prevEl: ".swiper-button-prev",
66  },
67});
68
69//Modal Slider Function
70function initSlider() {
71  var swiper = new Swiper(".modalSlider", {
72    slidesPerView: 1,
73    navigation: {
74      nextEl: ".swiper-button-next",
75      prevEl: ".swiper-button-prev",
76    },
77  });
78}
79
80//Contact Form Placeholders
81const inputElements = document.querySelectorAll(".inputWrapper input");
82const textarea = document.getElementById("textarea");
83const select = document.getElementById("fleet-select");
84
85
86inputElements.forEach(input => {
87  input.addEventListener("input", function () {
88      const customPlaceholder = this.closest(".inputWrapper").querySelector(".customPlaceholder");
89      if (this.value === "" && customPlaceholder) {
90          customPlaceholder.classList.remove("hidden");
91      } else if (customPlaceholder) {
92          customPlaceholder.classList.add("hidden");
93      }
94  });
95});
96
97if (textarea) {
98  textarea.addEventListener("input", function () {
99      const customPlaceholder = this.closest(".textareaWrapper").querySelector(".customPlaceholder");
100      if (this.value === "" && customPlaceholder) {
101          customPlaceholder.classList.remove("hidden");
102      } else if (customPlaceholder) {
103          customPlaceholder.classList.add("hidden");
104      }
105  });
106}
107
108
109if (select) {
110  select.addEventListener("change", function () {
111      const customPlaceholder = this.closest(".inputWrapper").querySelector(".customPlaceholder");
112      if (this.value === "-1") {
113          customPlaceholder.classList.remove("hidden");
114      } else {
115          customPlaceholder.classList.add("hidden");
116      }
117  });
118}
119
120
121inputElements.forEach((input) => {
122  input.addEventListener("focus", function () {
123    const customPlaceholder =
124      this.closest(".inputWrapper").querySelector(".customPlaceholder");
125    if (customPlaceholder) {
126      customPlaceholder.classList.add("hidden");
127    }
128  });
129
130  input.addEventListener("blur", function () {
131    const customPlaceholder =
132      this.closest(".inputWrapper").querySelector(".customPlaceholder");
133    if (this.value === "" && customPlaceholder) {
134      customPlaceholder.classList.remove("hidden");
135    }
136  });
137
138  input.addEventListener("input", function () {
139    const customPlaceholder =
140      this.closest(".inputWrapper").querySelector(".customPlaceholder");
141    if (this.value === "" && customPlaceholder) {
142      customPlaceholder.classList.remove("hidden");
143    } else if (customPlaceholder) {
144      customPlaceholder.classList.add("hidden");
145    }
146  });
147});
148
149if (textarea) {
150  textarea.addEventListener("focus", function () {
151    const customPlaceholder =
152      this.closest(".textareaWrapper").querySelector(".customPlaceholder");
153    if (customPlaceholder) {
154      customPlaceholder.classList.add("hidden");
155    }
156  });
157
158  textarea.addEventListener("blur", function () {
159    const customPlaceholder =
160      this.closest(".textareaWrapper").querySelector(".customPlaceholder");
161    if (this.value === "" && customPlaceholder) {
162      customPlaceholder.classList.remove("hidden");
163    }
164  });
165
166  textarea.addEventListener("input", function () {
167    const customPlaceholder =
168      this.closest(".textareaWrapper").querySelector(".customPlaceholder");
169    if (this.value === "" && customPlaceholder) {
170      customPlaceholder.classList.remove("hidden");
171    } else if (customPlaceholder) {
172      customPlaceholder.classList.add("hidden");
173    }
174  });
175}
176
177if (select) {
178  select.addEventListener("change", function () {
179    const customPlaceholder =
180      this.closest(".inputWrapper").querySelector(".customPlaceholder");
181    if (this.value === "-1") {
182      customPlaceholder.classList.remove("hidden");
183    } else {
184      customPlaceholder.classList.add("hidden");
185    }
186  })
187}
188
189//Modal Functions
190function openAboutModal(item) {
191  aboutModal = document.getElementById("aboutModal" + item);
192  aboutModal.style.display = "flex";
193  window.addEventListener("click", function (event) {
194    if (event.target == aboutModal) {
195      aboutModal.style.display = "none";
196    }
197  });
198}
199
200function closeAboutModal(item) {
201  aboutModal = document.getElementById("aboutModal" + item);
202  aboutModal.style.display = "none";
203}
204
205function openPlaneModal() {
206  planeModal = document.getElementById("planeModal");
207  planeModal.style.display = "flex";
208  initSlider();
209}
210
211function closePlaneModal() {
212  $('.planeModalOuter').remove();
213}
214
215//Load More Function
216
217document.addEventListener("DOMContentLoaded", function () {
218  const wrapper = document.querySelector(".planesWrapperArea");
219  const button = document.getElementById("loadMore");
220  const originalSvgContent = `
221  <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
222    <path d="M20 28.3334V11.6667" stroke="white" stroke-width="1.5" stroke-linecap="round" />
223    <path d="M11.6663 20L28.333 20" stroke="white" stroke-width="1.5" stroke-linecap="round" />
224  </svg>
225`;
226  if (wrapper && button) {
227    button.addEventListener("click", function () {
228      if (wrapper.classList.contains("show")) {
229        wrapper.classList.remove("show");
230        button.innerHTML = "Load more " + originalSvgContent;
231        // button.scrollIntoView({ behavior: "smooth" });
232        window.scrollTo({ top: button.getBoundingClientRect().top + window.scrollY - 550, behavior: "smooth" });
233
234      } else {
235        wrapper.classList.add("show");
236        button.innerText = "Show less";
237      }
238    });
239  }
240
241});
242
243//Modal
244jQuery(document).ready(function ($) {
245  $('.fetch-data-button').on('click', function () {
246    var dataId = $(this).data('id');
247
248    $('.loading-overlay').show();
249
250    $.ajax({
251      url: jsdata.ajaxurl,
252      type: 'post',
253      data: {
254        action: 'custom_ajax_action',
255        data_id: dataId,
256      },
257      success: function (response) {
258
259        var result = JSON.parse(response);
260
261        if (result.status === 'success') {
262          var modalContent = result.modal_content;
263
264          $('body').append(modalContent);
265
266          openPlaneModal();
267
268          $('.loading-overlay').hide();
269        } else {
270
271          $('.loading-overlay').hide();
272          console.error(result.error);
273        }
274
275      }
276    });
277  });
278});
279
280//Filter
281jQuery(document).ready(function ($) {
282  $('input[name="category_checkbox[]"]').on('change', function () {
283    updateFilteredResults();
284  });
285
286  function updateFilteredResults() {
287    var selectedCategories = [];
288    $('input[name="category_checkbox[]"]:checked').each(function () {
289      selectedCategories.push($(this).val());
290    });
291
292    if (selectedCategories.length === 0) {
293
294      $('.planeSlideItem').show();
295    } else {
296
297      $('.planeSlideItem').each(function () {
298        var itemCategories = $(this).data('filter');
299        var categoriesArray = itemCategories.split(' ');
300        console.log(categoriesArray);
301        var showItem = false;
302        for (var i = 0; i < categoriesArray.length; i++) {
303          if ($.inArray(categoriesArray[i], selectedCategories) !== -1) {
304
305            showItem = true;
306            break;
307          }
308        }
309
310        showItem ? $(this).show() : $(this).hide();
311      });
312    }
313  }
314});

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.