1window.jQuery(document).ready(function() { 2 var $ = window.jQuery; 3 4 if ($('.cupo-modal-ask_question').length > 1) { 5 for (let i = 1; i < $('.cupo-modal-ask_question').length; i++) { 6 $('.cupo-modal-ask_question')[i].remove(); 7 } 8 } 9 10 $('.cupo-modal-ask_question').detach().appendTo('body'); 11 12 $('form.cupo-modal-ask_question_content').on('submit', function(e) { 13 e.preventDefault(); 14 e.stopPropagation(); 15 16 var subject = $('#question-subject').val() ?? ""; 17 var message = $('#question-message').val() ?? ""; 18 var travelId = $('#question_travel_id').val() ?? null; 19 var maxMessageLength = 64000; 20 21 $('.cupo-modal-ask_question .cupo-modal-input-error-message').remove(); 22 23 if (typeof subject !== 'string' || subject.trim().length === 0) { 24 $('#question-subject').closest('.cupo-input-wrapper').append('<span class="cupo-modal-input-error-message">Bitte geben Sie einen Betreff an!</span>'); 25 return; 26 } 27 28 if (typeof message !== 'string' || message.trim().length === 0) { 29 $('#question-message').closest('.cupo-input-wrapper').append('<span class="cupo-modal-input-error-message">Bitte geben Sie eine Nachricht ein!</span>'); 30 return; 31 } 32 33 if (message.length > maxMessageLength) { 34 $('#question-message').closest('.cupo-input-wrapper').append(`<span class="cupo-modal-input-error-message">Die Nachricht darf maximal ${maxMessageLength} Zeichen lang sein.</span>`); 35 return; 36 } 37 38 $('.cupo-modal-ask_question .cupo-modal-loader').css('display', 'flex'); 39 40 $.ajax({ 41 type: 'POST', 42 url: cupo_question_dialog_script.ajax_url, 43 data: { 44 'action': 'cupoQuestion', 45 'data': { subject: subject, message: message, travelId: travelId } 46 }, 47 success: function(data) { 48 data = typeof data === 'string' ? JSON.parse(data) : data; 49 50 $('.cupo-modal-ask_question .cupo-modal-loader').hide(); 51 $('.cupo-modal-ask_question .cupo-modal-ask_question_content').hide(); 52 53 if (data && data.status === 'success') { 54 $('.cupo-modal-ask_question .cupo-popup-heading').html('Anfrage gesendet'); 55 $('.cupo-modal-ask_question .cupo-modal-success-message').show(); 56 } else { 57 $('.cupo-modal-ask_question .cupo-modal-error-message').show(); 58 } 59 }, 60 error: function() { 61 $('.cupo-modal-ask_question .cupo-modal-loader').hide(); 62 $('.cupo-modal-ask_question .cupo-modal-ask_question_content').hide(); 63 $('.cupo-modal-ask_question .cupo-modal-error-message').show(); 64 } 65 }); 66 }); 67});
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.