PageSourceSearch

https://www.wemtoyota.com/wp-content/themes/magnetis-dealer/dist/js/testDriveForm.C2eQIEmq.js

js wemtoyota.com collected 2026-10-01 23:53:09 UTC 2,955 bytes, 1 lines download raw bytes

1jQuery(document).ready(t=>{const s={selectedVehicles:[],currentStep:1,init:function(){this.bindEvents()},bindEvents:function(){t(document).on("click",".vehicle-card",e=>{e.preventDefault(),s.toggleVehicleSelection(t(e.currentTarget))}),t(document).on("click","#test-drive-next",e=>{e.preventDefault(),s.goToNextStep()}),t(document).on("click","#test-drive-back",e=>{e.preventDefault(),s.goToPreviousStep()}),t(document).on("submit",".wpcf7-form",e=>{s.handleFormSubmission()})},toggleVehicleSelection:function(e){const c=e.data("vehicle-id"),i=e.data("model-name"),l=e.data("make"),n=e.data("model"),o=e.data("year"),h={id:c,name:i,make:l,model:n,year:o,$card:e},d=this.selectedVehicles.findIndex(a=>a.id===c);d>=0?(this.selectedVehicles.splice(d,1),e.removeClass("selected")):(this.selectedVehicles.push(h),e.addClass("selected")),this.updateSidebar(),this.updateVehicleModelInput()},updateSidebar:function(){const e=t("#empty-state"),c=t("#selected-vehicles-list");this.selectedVehicles.length===0?(e.show(),c.empty()):(e.hide(),c.empty(),this.selectedVehicles.forEach(i=>{const l=document.getElementById("selected-vehicle-template"),n=t(l.content.cloneNode(!0)).children().first(),o=i.$card.find("img").clone().addClass("img-fluid");n.find(".selected-vehicle-image img").replaceWith(o),n.find(".selected-vehicle-name").text(i.name),n.find(".remove-vehicle").attr("data-vehicle-id",i.id),c.append(n)}),c.find(".remove-vehicle").off("click").on("click",i=>{i.preventDefault(),i.stopPropagation();const l=t(i.currentTarget).data("vehicle-id");s.removeVehicle(l)}))},removeVehicle:function(e){const c=this.selectedVehicles.findIndex(i=>i.id===e);c>=0&&(this.selectedVehicles[c].$card.removeClass("selected"),this.selectedVehicles.splice(c,1),this.updateSidebar(),this.updateVehicleModelInput())},updateVehicleModelInput:function(){const e=this.selectedVehicles.map(i=>i.id).join(","),c=this.selectedVehicles.map(i=>i.name).join(", ");t("#model_name_input").val(c),t('.wpcf7-form input[name="vehicle_model"]').val(c),t('.wpcf7-form input[name="showroom_vehicles"]').val(e)},goToNextStep:function(){this.currentStep===1?(t("#step-vehicle-selection").hide(),t("#step-contact-form").show(),t("#test-drive-back").show(),t("#test-drive-next").text("Submit"),this.currentStep=2,this.ensureVehicleModelInput()):this.currentStep===2&&t(".wpcf7-form").submit()},goToPreviousStep:function(){this.currentStep===2&&(t("#step-contact-form").hide(),t("#step-vehicle-selection").show(),t("#test-drive-back").hide(),t("#test-drive-next").text("Next →"),this.currentStep=1)},ensureVehicleModelInput:function(){if(t('.wpcf7-form input[name="showroom_vehicles"]').length===0){const e=t('<input type="hidden" name="showroom_vehicles" value="" />');t(".wpcf7-form").append(e)}this.updateVehicleModelInput()},handleFormSubmission:function(){this.updateVehicleModelInput(),console.log("Test drive form submitted with models:",this.selectedVehicles.map(e=>e.name))}};s.init()});

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.