PageSourceSearch

https://www.gps-tour.info/redx/ext/forms/js/ajaxformsubmit.min.js?ct=169ba7316

js gps-tour.info collected 2026-10-02 07:06:52 UTC 4,096 bytes, 1 lines download raw bytes

1!function(){"use strict";class t{constructor(t){this._modalElement=null,this._formElement=t,t.closest("xtx-modal")&&(this._modalElement=t.closest("xtx-modal"))}static initForms(){xtxJs.eachElement("form[data-form-ajax-endpoint]:not(.form-ajax-submit-initialized)",e=>{e.closest(".QuickInquiryForm")||new t(e).init()})}init(){this._formElement.classList.add("form-ajax-submit-initialized"),this.addFormSubmitEvent(this._formElement)}addFormSubmitEvent(t){t.addEventListener("submit",e=>{if(e.preventDefault(),!t.classList.contains("form-loading")){t.classList.add("form-loading");const e=t.getAttribute("data-form-ajax-endpoint");this.changeFormContent(e)}})}changeFormContent(t){var e;const o=this._formElement,n=document.createElement("xtx-loading-spinner");n.classList.add("ajax-form-submit-loading"),o.prepend(n);const i=o.closest(".RedxElementWrapper");if(i){const s=i.querySelector(".redx_forms_status_msg");s&&s.remove(),this.scrollElementToView(i);const r=null==(e=o.querySelector(".tabInputLabel.active"))?void 0:e.getAttribute("data-tab-id");if(t){const e=new FormData(o);fetch(t,{method:"POST",body:e}).then(t=>{const e=t.headers.get("X-Show-Captcha-Overlay");if(!t.ok||e)return Promise.reject();const o=t.headers.get("X-Redirect-URL");return o?(window.location.replace(o),new Promise(()=>{})):t.json()}).then(t=>{if(this._modalElement){const t=this._modalElement.querySelector(".content_wrapper");if(t&&"XTX-MODAL"===this._modalElement.tagName&&"auto"===this._modalElement.getAttribute("size")){const e=t.offsetWidth,o=t.offsetHeight;t.style.width=e+"px",t.style.height=o+"px"}}const n=o.getAttribute("action");i.innerHTML=t.data.content;const s=i.querySelector("form[data-form-ajax-endpoint]");if(s&&(n&&s.setAttribute("action",n),e)){const t=e.get("form_id");if(t&&"string"==typeof t){if(!window.location.href.includes("form_id=")){const e=this.getActiveFormTabFromForm(o);this.setFormIdAndTabIdToUrl(e,t)}const e=this.getActiveFormTabFromForm(s);e&&r&&e!==r&&this.setFormIdAndTabIdToUrl(e,t);const n=s.closest(".RedxElementWrapper");n&&!n.querySelector('.redx_forms_status_msg[role="alert"]')&&this.focusFirstElementInsideActiveTabElement(e,s)}}const a=new Event("xtx.content.changed",{bubbles:!0,cancelable:!0});i.dispatchEvent(a)}).catch(()=>{HTMLFormElement.prototype.submit.call(o)}).finally(()=>{n.remove(),o.classList.remove("form-loading")})}}}getActiveFormTabFromForm(t){const e=t.querySelector('[name="form_tab"]');if(e){const t=e.getAttribute("value");if(t)return t}return null}focusFirstElementInsideActiveTabElement(t,e){const o=e.querySelector('.tabInputLabel[data-tab-id="'+t+'"]');if(o){const t=o.getAttribute("for"),n=e.querySelector('.tabInput[id="'+t+'"]');if(n){const t='input:not([type="hidden"]), select, xtx-select, xtx-multi-select, textarea',e=n.nextElementSibling.querySelector(t);if(e)if(""===e.value){const t=e.tagName.toLowerCase();"xtx-select"===t||"xtx-multi-select"===t?xtxWebComponents.ready(e).then(t=>{t.open()}):e.focus({preventScroll:!0})}else if("radio"===e.type||"checkbox"===e.type){const t=e.closest(".redx_form_checkbox, .redx_form_radioselect");if(t){const e=xtxJs.getElements('input:not([type="hidden"])',t);e.some(t=>t.checked)||e[0].focus({preventScroll:!0})}}}}}setFormIdAndTabIdToUrl(t,e){const o=window.location.href;let n=o.split("#")[0],i=!1;""!==e.trim()&&(o.includes("form_id=")||(n+=(o.includes("?")?"&":"?")+"form_id="+encodeURIComponent(e),i=!0),t&&(n.includes("tab_id=")?n=n.replace(/tab_id=[^&]*/,"tab_id="+encodeURIComponent(t)):n+="&tab_id="+encodeURIComponent(t),i?window.history.replaceState({},"",n):window.history.pushState({},"",n)))}scrollElementToView(t){const e=getComputedStyle(document.documentElement).getPropertyValue("--headerHeight"),o=t.closest("[data-offcanvas-content]");if(!e||o)t.scrollIntoView({behavior:"smooth",block:"start"});else{const o=t.getBoundingClientRect().top+window.scrollY-parseInt(e)-20;window.scrollTo({top:o,behavior:"smooth"})}}}document.addEventListener("DOMContentLoaded",()=>{t.initForms()}),window.addEventListener("xtx.content.changed",function(){t.initForms()}),t.initForms()}();

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.