1(function ($) { 2 3 function initUacf7Progressbar($scope) { 4 $scope.find('.wpcf7-form').each(function () { 5 var form_id = $(this).find("input[name=_wpcf7]").val(), 6 navListItems = $(this).find('.uacf7-steps div.setup-panel div a[data-form-id="' + form_id + '"]'), 7 allWells = $(this).find('.uacf7-step'), 8 allNextBtn = $(this).find('.uacf7-next[data-form-id="' + form_id + '"]'), 9 allPrevBtn = $(this).find('.uacf7-prev[data-form-id="' + form_id + '"]'), 10 allStepTitle = $(this).find('.step-title[data-form-id="' + form_id + '"]'); 11 12 allWells.hide(); 13 14 navListItems.click(function (e) { 15 e.preventDefault(); 16 var $target = $($(this).attr('href')), 17 title = $($(this).attr('title-id')), 18 $item = $(this); 19 if(!$item.hasClass('completed')){ 20 21 var validated_steps = parseInt($item.attr('data-current-steps')) - 1 ; 22 if(!$('#'+form_id+'step-'+validated_steps+'').hasClass('completed')){ 23 $('#'+form_id+'step-'+validated_steps+'').find('.uacf7-next').trigger('click'); 24 }else{ 25 navListItems.removeClass('uacf7-btn-active').addClass('uacf7-btn-default'); 26 $item.addClass('uacf7-btn-active'); 27 allWells.hide(); 28 $target.show(); 29 allStepTitle.hide(); 30 title.show(); 31 $target.find('input:eq(0)').focus(); 32 } 33 }else{ 34 if (!$item.hasClass('disabled')) { 35 navListItems.removeClass('uacf7-btn-active').addClass('uacf7-btn-default'); 36 $item.addClass('uacf7-btn-active'); 37 allWells.hide(); 38 $target.show(); 39 allStepTitle.hide(); 40 title.show(); 41 $target.find('input:eq(0)').focus(); 42 } 43 } 44 45 }); 46 47 allPrevBtn.click(function () { 48 var curStep = $(this).closest(".uacf7-step"), 49 curStepBtn = curStep.attr("id"), 50 prevStepSteps = $('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().prev().children("a"); 51 52 prevStepSteps.removeAttr('disabled').trigger('click'); 53 }); 54 55 allNextBtn.click(function () { 56 var curStep = $(this).closest(".uacf7-step"), 57 curStepBtn = curStep.attr("id"), 58 nextStepWizard = $('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().next().children("a"), 59 curInputs = curStep.find("input[type='text'],input[type='url']"), 60 isValid = true; 61 62 $(".form-group").removeClass("has-error"); 63 for (var i = 0; i < curInputs.length; i++) { 64 if (!curInputs[i].validity.valid) { 65 isValid = false; 66 $(curInputs[i]).closest(".form-group").addClass("has-error"); 67 } 68 } 69 70 //if (isValid) 71 //nextStepWizard.removeAttr('disabled').trigger('click'); 72 }); 73 74 //$('div.setup-panel div a.uacf7-btn-active').trigger('click'); 75 $('#'+form_id+'step-1.uacf7-step.step-content.step-start').show(); 76 }); 77 78 } 79 80 // Run on normal page load 81 $(document).ready(function () { 82 initUacf7Progressbar($(document)); 83 }); 84 85 // Run again when Elementor popup opens 86 $(document).on('elementor/popup/show', function (event, id, instance) { 87 var $popup = $(instance.$element); 88 initUacf7Progressbar($popup); 89 }); 90 91})(jQuery);
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.