1 2jQuery('#oum_add_location').submit(function(event){jQuery('#oum_submit_btn').addClass('oum-loading');event.preventDefault();if(window.oumMap2&&typeof window.oumMap2.getZoom==='function'){const zoomField=document.getElementById('oum_location_zoom');if(zoomField){zoomField.value=window.oumMap2.getZoom()}} 3if(typeof OUMFormMap!=='undefined'&&typeof OUMFormMap.syncGeometryFields==='function'){OUMFormMap.syncGeometryFields()} 4let formData=new FormData(this);const openingHoursInputs=document.querySelectorAll('.oum-opening-hours-input');openingHoursInputs.forEach(function(input){const fieldName=input.name;const fieldIndexMatch=fieldName.match(/\[(\d+)\]/);if(!fieldIndexMatch){return} 5const fieldIndex=fieldIndexMatch[1];const hoursValue=input.value.trim();formData.delete(fieldName);if(hoursValue!==''){if(typeof OUMOpeningHours!=='undefined'&&OUMOpeningHours.validateFormat(hoursValue)){formData.append(`oum_location_custom_fields[${fieldIndex}][hours]`,hoursValue)}else{oumShowError([{message:(typeof oum_opening_hours!=='undefined'&&oum_opening_hours.invalid_format)?oum_opening_hours.invalid_format:'Invalid opening hours format. Expected format: Mo 09:00-18:00 or Mo 9:00 AM-5:00 PM'}]);jQuery('#oum_submit_btn').removeClass('oum-loading');return!1}}});const previewContainer=document.getElementById('oum_location_images_preview');let imageOrder=[];if(previewContainer){const previewItems=previewContainer.querySelectorAll('.image-preview-item');previewItems.forEach((item,index)=>{if(item.classList.contains('existing-image')){const existingImageInput=item.querySelector('[name="existing_images[]"]');if(!existingImageInput){return} 6let imgUrl=existingImageInput.value;if(imgUrl.startsWith('http')){try{const urlObj=new URL(imgUrl);imgUrl=urlObj.pathname}catch(e){console.log('Could not parse URL:',imgUrl)}} 7formData.append('existing_images[]',imgUrl);imageOrder.push('existing:'+imgUrl)}else{const fileName=item.dataset.fileName;const file=window.oumSelectedFiles.find(f=>f.name===fileName);if(file){formData.append('oum_location_images[]',file);imageOrder.push('new:'+fileName)}}});formData.append('image_order',JSON.stringify(imageOrder))} 8formData.append('action','oum_add_location_from_frontend');jQuery.ajax({type:'POST',url:oum_ajax.ajaxurl,cache:!1,contentType:!1,processData:!1,data:formData,success:function(response,textStatus,XMLHttpRequest){jQuery('#oum_submit_btn').removeClass('oum-loading');if(response.success==!1){oumShowError(response.data)} 9if(response.success==!0){jQuery('#oum_add_location').trigger('reset');const deleteLocationInput=document.getElementById('oum_delete_location');const postIdInput=document.getElementById('oum_post_id');if(deleteLocationInput&&deleteLocationInput.value==='true'){OUMFormController.showFormMessage('success',oum_custom_strings.location_deleted,oum_custom_strings.delete_success,oum_custom_strings.close_and_refresh,function(){window.location.reload()})}else if(postIdInput&&postIdInput.value){OUMFormController.showFormMessage('success',oum_custom_strings.changes_saved,oum_custom_strings.changes_saved_message,oum_custom_strings.close_and_refresh,function(){window.location.reload()})}else{if(typeof oum_action_after_submit!=='undefined'){if(oum_action_after_submit==='refresh'){window.location.reload()}else if(oum_action_after_submit==='redirect'&&typeof thankyou_redirect!=='undefined'&&thankyou_redirect!==''){window.location.href=thankyou_redirect}else{const thankyouDiv=document.getElementById('oum_add_location_thankyou');const thankyouHeadline=thankyouDiv?.querySelector('h3')?.textContent||oum_custom_strings.thank_you;const thankyouText=thankyouDiv?.querySelector('.oum-add-location-thankyou-text')?.textContent||oum_custom_strings.thank_you_message;OUMFormController.showFormMessage('success',thankyouHeadline,thankyouText,oum_custom_strings.close_and_refresh,function(){window.location.reload()})}}else{const thankyouDiv=document.getElementById('oum_add_location_thankyou');const thankyouHeadline=thankyouDiv?.querySelector('h3')?.textContent||oum_custom_strings.thank_you;const thankyouText=thankyouDiv?.querySelector('.oum-add-location-thankyou-text')?.textContent||oum_custom_strings.thank_you_message;OUMFormController.showFormMessage('success',thankyouHeadline,thankyouText,oum_custom_strings.close_and_refresh,function(){window.location.reload()})}}}},error:function(XMLHttpRequest,textStatus,errorThrown){console.log(errorThrown)}})});function oumShowError(errors){const errorWrapEl=jQuery('#oum_add_location_error');errorWrapEl.html('');
9errors.forEach(error=>{errorWrapEl.append(error.message+'<br>')});errorWrapEl.show()}; 10 11 12 13const OUMCarousel=(function(){function initializeCarousel(){const observer=new MutationObserver((mutations)=>{mutations.forEach((mutation)=>{if(mutation.addedNodes.length){mutation.addedNodes.forEach((node)=>{setupCarouselsInNode(node)})} 14setupCarouselsInNode(mutation.target)})});observer.observe(document.body,{childList:!0,subtree:!0,characterData:!0});document.querySelectorAll('.open-user-map-locations-list .oum-carousel').forEach(carousel=>{setupCarousel(carousel)});document.querySelectorAll('.oum-location-value .oum-carousel').forEach(carousel=>{setupCarousel(carousel)})} 15function setupCarouselsInNode(node){if(!node||node.nodeType!==1)return;if(node.classList&&node.classList.contains("oum-carousel")){setupCarousel(node)} 16node.querySelectorAll(".oum-carousel").forEach((carousel)=>{setupCarousel(carousel)})} 17function setupCarousel(carouselEl){if(!carouselEl)return;if(carouselEl.dataset.oumCarouselInitialized==="1")return;const items=carouselEl.querySelectorAll(".oum-carousel-item");if(items.length<=1)return;carouselEl.dataset.oumCarouselInitialized="1";let currentIndex=0;const{prevBtn,nextBtn,counter}=createCarouselControls();carouselEl.appendChild(prevBtn);carouselEl.appendChild(nextBtn);carouselEl.appendChild(counter);setupCarouselNavigation(items,prevBtn,nextBtn,counter,currentIndex);items[0].classList.add("active");updateCounter();function updateCounter(){counter.textContent=`${currentIndex + 1}/${items.length}`}} 18function createCarouselControls(){const prevBtn=document.createElement("button");prevBtn.className="oum-carousel-prev";prevBtn.setAttribute("aria-label","Previous image");const nextBtn=document.createElement("button");nextBtn.className="oum-carousel-next";nextBtn.setAttribute("aria-label","Next image");const counter=document.createElement("div");counter.className="oum-carousel-counter";return{prevBtn,nextBtn,counter}} 19function setupCarouselNavigation(items,prevBtn,nextBtn,counter,currentIndex){function goToSlide(index){items[currentIndex].classList.remove("active");currentIndex=index;if(currentIndex<0)currentIndex=items.length-1;if(currentIndex>=items.length)currentIndex=0;items[currentIndex].classList.add("active");counter.textContent=`${currentIndex + 1}/${items.length}`} 20prevBtn.addEventListener("click",()=>goToSlide(currentIndex-1));nextBtn.addEventListener("click",()=>goToSlide(currentIndex+1));document.addEventListener("keydown",(e)=>{if(!items[currentIndex].closest(".leaflet-popup-content-wrapper"))return;if(e.key==="ArrowLeft")goToSlide(currentIndex-1);if(e.key==="ArrowRight")goToSlide(currentIndex+1);});let touchStartX=0;items[0].parentElement.addEventListener("touchstart",(e)=>{touchStartX=e.changedTouches[0].screenX},!1);items[0].parentElement.addEventListener("touchend",(e)=>{const touchEndX=e.changedTouches[0].screenX;const diff=touchStartX-touchEndX;if(Math.abs(diff)>50){if(diff>0)goToSlide(currentIndex+1);else goToSlide(currentIndex-1)}},!1)} 21return{init:function(){initializeCarousel()}}})();jQuery(document).ready(function($){OUMCarousel.init()}); 22 23
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.