PageSourceSearch

https://cross-sendai.jp/cms/wp-content/cache/autoptimize/js/autopt…_single_6f3695fc132534397009c90ac0dd0387.js

js cross-sendai.jp collected 2026-10-05 01:31:45 UTC 6,772 bytes, 19 lines download raw bytes

1$(function(){const $inputArea=$(".input_area");const $confirmArea=$(".confirm_area");const $requiredInputs=$('[aria-required="true"]');const $confirmButton=$(".confirm_button");const $backButton=$(".back_button");function convertToHalfWidth(value,removeHyphen=false){let converted=value.replace(/[A-Za-z0-9@.]/g,function(s){return String.fromCharCode(s.charCodeAt(0)-0xfee0);});if(removeHyphen){converted=converted.replace(/[--﹣−‐⁃‑‒–—﹘―ー]/g,"");}
2return converted;}
3function convertToFullWidthKatakana(str){let result=str.replace(/[\u3041-\u3096]/g,function(match){const chr=match.charCodeAt(0)+0x60;return String.fromCharCode(chr);});const halfKatakana={'ガ':'ガ','ギ':'ギ','グ':'グ','ゲ':'ゲ','ゴ':'ゴ','ザ':'ザ','ジ':'ジ','ズ':'ズ','ゼ':'ゼ','ゾ':'ゾ','ダ':'ダ','ヂ':'ヂ','ヅ':'ヅ','デ':'デ','ド':'ド','バ':'バ','ビ':'ビ','ブ':'ブ','ベ':'ベ','ボ':'ボ','パ':'パ','ピ':'ピ','プ':'プ','ペ':'ペ','ポ':'ポ','ヴ':'ヴ','ヷ':'ヷ','ヺ':'ヺ','ア':'ア','イ':'イ','ウ':'ウ','エ':'エ','オ':'オ','カ':'カ','キ':'キ','ク':'ク','ケ':'ケ','コ':'コ','サ':'サ','シ':'シ','ス':'ス','セ':'セ','ソ':'ソ','タ':'タ','チ':'チ','ツ':'ツ','テ':'テ','ト':'ト','ナ':'ナ','ニ':'ニ','ヌ':'ヌ','ネ':'ネ','ノ':'ノ','ハ':'ハ','ヒ':'ヒ','フ':'フ','ヘ':'ヘ','ホ':'ホ','マ':'マ','ミ':'ミ','ム':'ム','メ':'メ','モ':'モ','ヤ':'ヤ','ユ':'ユ','ヨ':'ヨ','ラ':'ラ','リ':'リ','ル':'ル','レ':'レ','ロ':'ロ','ワ':'ワ','ヲ':'ヲ','ン':'ン','ァ':'ァ','ィ':'ィ','ゥ':'ゥ','ェ':'ェ','ォ':'ォ','ャ':'ャ','ュ':'ュ','ョ':'ョ','ッ':'ッ','ー':'ー','゙':'゛','゚':'゜'};for(let key in halfKatakana){result=result.replace(new RegExp(key,'g'),halfKatakana[key]);}
4result=result.replace(/[\uff66-\uff9f]/g,function(match){return halfKatakana[match]||match;});return result;}
5function applyHalfWidthConversion($field){const fieldValue=$field.val();const fieldName=$field.attr("name");const removeHyphen=fieldName==="form_tel";const convertedValue=convertToHalfWidth(fieldValue,removeHyphen);$field.val(convertedValue);}
6function applyKatakanaConversion($field){const fieldValue=$field.val();const convertedValue=convertToFullWidthKatakana(fieldValue);$field.val(convertedValue);}
7const fieldsToConvert=['input[name="form_tel"]','input[name="form_mail"]',];$(document).on("blur",fieldsToConvert.join(","),function(){applyHalfWidthConversion($(this));});$(document).on("blur",'input[name="form_kana"]',function(){applyKatakanaConversion($(this));});$(".input_area").on("change",fieldsToConvert.join(","),function(){applyHalfWidthConversion($(this));updateConfirmationArea($(this));});$(".input_area").on("change",'input[name="form_kana"]',function(){applyKatakanaConversion($(this));updateConfirmationArea($(this));});function updateConfirmationArea($input){const id=$input.attr("id");const type=$input.attr("type");let val=$input.val();if(type==="radio"){const $confirm=$(".confirm_"+$input.parents("[id]").attr("id"));$confirm.text(val);}else if(type==="checkbox"){const $confirm=$(".confirm_"+$input.parents("[id]").attr("id"));$confirm.append(val+" / ");}else if($input.is("textarea")){val=val.replace(/\n/g,"<br>");$(".confirm_"+id).html(val);}else{$(".confirm_"+id).text(val);if($input.hasClass("p-postal-code")){$(".confirm_form_address").text($(".p-region").val());$(".confirm_form_address").text($(".p-locality").val());}}}
8$("input[readonly='readonly']").each((_,el)=>updateConfirmationArea($(el)));$inputArea.on("change","input, select, textarea",function(){updateConfirmationArea($(this));});$inputArea.on("blur","input, select, textarea",function(){validateField($(this));});$confirmButton.on("click",function(event){event.preventDefault();let isValid=true;$inputArea.find("input, select, textarea").each(function(){if(!validateField($(this))){isValid=false;}});if(isValid){$inputArea.hide();$confirmArea.show();$(window).scrollTop(0);}else{scrollToError();}});$backButton.on("click",function(){$inputArea.show();$confirmArea.hide();$(window).scrollTop(0);});function validateField($field){const fieldName=$field.attr("name");const fieldValue=$field.val().trim();let isValid=true;if(fieldName==="form_company"){if(fieldValue===""){showErrorMessage($field,"会社名を入力してください");isValid=false;}else{removeErrorMessage($field);}}
9if(fieldName==="form_name"){if(fieldValue===""){showErrorMessage($field,"お名前を入力してください");isValid=false;}else{removeErrorMessage($field);}}
10if(fieldName==="form_kana"){if(fieldValue===""){showErrorMessage($field,"お名前 (フリガナ)を入力してください");isValid=false;}else{removeErrorMessage($field);}}
11if(fieldName==="form_tel"){if(fieldValue===""){showErrorMessage($field,"電話番号を入力してください");isValid=false;}else{removeErrorMessage($field);}}
12if(fieldName==="form_mail"){if(fieldValue===""){showErrorMessage($field,"メールアドレスを入力してください");isValid=false;}else if(!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(fieldValue)){showErrorMessage($field,"正しいメールアドレスを入力してください");isValid=false;}else{removeErrorMessage($field);}}
13if(fieldName==="form_content"){if(fieldValue===""){showErrorMessage($field,"お問い合わせ内容を入力してください");isValid=false;}else{removeErrorMessage($field);}}
14return isValid;}
15function showErrorMessage($field,message){const fieldName=$field.attr("name");$field.siblings(".custom_wpcf7-not-valid-tip").remove();$field.after(`<span class="custom_wpcf7-not-valid-tip" aria-hidden="true">`+
16message+"</span>");}
17function removeErrorMessage($field){$field.siblings(".custom_wpcf7-not-valid-tip").remove();}});document.addEventListener("wpcf7mailsent",function(){location.href="/contact/thanks/";},false);function scrollToError(){const form=document.querySelector(".wpcf7-form");if(form){const errorMessages=form.querySelectorAll(".inputBox span.custom_wpcf7-not-valid-tip");if(errorMessages.length>0){const firstErrorMessage=errorMessages[0];const inputBox=firstErrorMessage.closest(".inputBox");if(inputBox){const position=inputBox.getBoundingClientRect().top+window.scrollY-94;window.scrollTo({top:position,behavior:"smooth",});}}}}
18function submitStop(e){if(!e)e=window.event;if(e.keyCode==13)return false;}
19window.onload=function(){const list=document.getElementsByTagName("input");for(let i=0;i<list.length;i++){if(list[i].type=="email"||list[i].type=="password"||list[i].type=="text"||list[i].type=="number"||list[i].type=="tel"){list[i].onkeypress=function(event){return submitStop(event);};}}};

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.