2026シーズンチケットプライオリティリスト
‘; // 新規: オプションの電話同意チェックボックス (灰色のボックスから分離) constphoneConsentHTML = ” + ‘
「+」「+」
‘; function handleAgeVerification() { // ページ上のすべてのフォームを検索 const Forms = document.querySelectorAll(‘.elq-form, form[class*=”elq”]、 形状[id*=”elq”]、 形状’); Forms.forEach(function(form) { // このフォームが年齢確認のためにすでに処理されている場合はスキップします if (form.hasAttribute(‘data-texans-age-processed’)) { return; } // このフォームを年齢確認のために処理済みとしてマークします form.setAttribute(‘data-texans-age-processed’, ‘true’); // 生年月日フィールドを検索します – 複数の共通セレクターを試します const dobSelectors = [
‘input[name*=”birth” i]’, ‘入力[name*=”dob” i]’, ‘入力[name*=”date” i]’, ‘入力[id*=”birth” i]’, ‘入力[id*=”dob” i]’, ‘入力[id*=”date” i]’、’選択[name*=”birth” i]’、’選択[name*=”dob” i]’, ‘入力[type=”date”]’ ]; // 個別の月/日/年のフィールドも検索します const monthSelectors = [‘select[name*=”month” i]’, ‘入力[name*=”month” i]’、’選択[id*=”month” i]’, ‘入力[id*=”month” i]’]; const daySelectors = [‘select[name*=”day” i]’, ‘入力[name*=”day” i]’、’選択[id*=”day” i]’, ‘入力[id*=”day” i]’]; const yearSelectors = [‘select[name*=”year” i]’, ‘入力[name*=”year” i]’、’選択[id*=”year” i]’, ‘入力[id*=”year” i]’]; dobField = null にします。 monthField = null にします。 dayField = null にします。 yearField = null にします。 // 最初に単一の日付フィールドを検索します for (let selector of dobSelectors) { dobField = form.querySelector(selector); if (dobField) ブレーク; } // 単一の日付フィールドがない場合は、別のフィールドを探します if (!dobField) { for (let selector of monthSelectors) { monthField = form.querySelector(selector); if (monthField) ブレーク; } for (daySelectors のセレクターを許可) { dayField = form.querySelector(selector); if (dayField) ブレーク; } for (yearSelectors のセレクター) { yearField = form.querySelector(selector); if (yearField) ブレーク; } } // 送信ボタンを検索します const submitSelectors = [
‘input[type=”submit”]’、 ‘ボタン[type=”submit”]’, ‘.submit-button-style’, ‘.elq-button’, ‘button:not([type=”button”]):ない([type=”reset”])’ ]; submitButtons を実行します = []; for (submitSelectors のセレクタを許可) { const ボタン = form.querySelectorAll(selector); button.forEach(function(button) { if (submitButtons.indexOf(button) === -1) { submitButtons.push(button); } }); } if ((dobField || (monthField && dayField && yearField)) && submitButtons.length > 0) { // 送信ボタンの元の表示スタイルを保存する constoriginalButtonDisplays = submitButtons.map(function(button) { return button.style.display || getComputedStyle(button).display; }); function CalculateAge(birthDate) { const today = new Date(); let age = today.getFull Year() -birthDate.getFull Year(); const monthDiff = today.getMonth() -birthDate.getMonth(); if (monthDiff 0) { submitButtons.push(allInputs[allInputs.length – 1]); } } // 最後の送信ボタン (最終送信である可能性が最も高い) を検索します if (submitButtons.length > 0) { const lastSubmitButton = submitButtons[submitButtons.length – 1]; // このボタンの上に同意書がすでに存在するかどうかを確認します。 constPreviousElement = lastSubmitButton.previousElementSibling; if (previousElement &&PreviousElement.classList &&previousElement.classList.contains(‘texans-submit-agreement’)) { return; // 契約はすでに存在します } // 契約を作成して挿入します (灰色のボックス) const awardElement = document.createElement(‘div’);契約要素.innerHTML = 契約HTML; const 同意Div = 同意要素.firstChild; // 電話による同意を作成して挿入します (灰色のボックスの上の別の行) constphoneElement = document.createElement(‘div’); PhoneElement.innerHTML = PhoneConsentHTML; constphoneDiv =phoneElement.firstChild; // この順序で挿入します (上から下): // 1) 電話同意チェックボックス // 2) 灰色の同意ボックス // 3) 送信ボタン lastSubmitButton.parentNode.insertBefore(phoneDiv, lastSubmitButton); lastSubmitButton.parentNode.insertBefore(agreementDiv, lastSubmitButton); } }); // フォームを処理するたびにメキシコの同意の表示と年齢確認も処理します handleMexicoConsentVisibility(); handleAgeVerification(); } // さまざまな読み込みシナリオに対する複数の実行戦略 // DOM の準備ができたらすぐに実行 if (document.readyState !== ‘loading’) { setTimeout(addAgreementAboveSubmitButtons, 100); } // DOM コンテンツが読み込まれるときに実行 document.addEventListener(‘DOMContentLoaded’, function() { addAgreementAboveSubmitButtons(); // 遅く読み込まれるフォームに対する追加の遅延実行 setTimeout(addAgreementAboveSubmitButtons, 1000); setTimeout(addAgreementAboveSubmitButtons, 3000); setTimeout(addAgreementAboveSubmitButtons, 5000); // ページが完全にロードされたときに実行 window.addEventListener(‘load’, function() { setTimeout(addAgreementAboveSubmitButtons, 500); setTimeout(addAgreementAboveSubmitButtons, 2000); }); // 動的なコンテンツの変更 (AJAX で読み込まれたフォーム) を監視します if (window.MutationObserver) { const observer = new MutationObserver(function(mutations) { let shouldCheck = false; mutations.forEach(function(mutation) { if (mutation.type === ‘childList’) { // 新しいノードにフォームまたはフォーム要素が含まれているかどうかを確認します for (let i = 0; i
#シーズンチケット優先リスト