1/* eslint-disable */ 2(function ($) { 3 4 var set_plan = $('#pricing_plans'); 5 var claimed = $('#claimed_by_admin'); 6 var claim_charge = $('input[name="claim_charge"]'); 7 8 claim_charge.hide(); 9 if($("#clain_with_fee").is(":checked")){ 10 claim_charge.show(); 11 } 12 $('input[name="claim_fee"]').on("change", function () { 13 if($("#clain_with_fee").is(":checked")){ 14 claim_charge.show(); 15 }else{ 16 claim_charge.hide(); 17 } 18 }); 19 20 if(claimed.is(":checked")){ 21 set_plan.hide(); 22 } 23 claimed.on('click', function () { 24 if($(this).is(":checked")){ 25 set_plan.hide(); 26 }else{ 27 set_plan.show(); 28 } 29 }); 30 31 //show plan allowance 32 $('#directorist__plan-allowances').hide(); 33 $('body').on('change', '#directorist-claimer_plan', function (e) { 34 e.preventDefault(); 35 e.stopPropagation(); 36 var data = { 37 'action': 'dcl_plan_allowances', 38 'author_id': $('#directorist__plan-allowances').data('author_id'), 39 'plan_id': $(this).val() 40 }; 41 $.post(dcl_main.ajaxurl, data, function (response) { 42 if (response.html){ 43 $('#directorist__plan-allowances').show(); 44 $('#directorist__plan-allowances').html(response.html); 45 $('.dcl_pricing_plan_name').removeClass('dcl-loading'); 46 }else{ 47 $('#directorist__plan-allowances').html(' '); 48 $('.dcl_pricing_plan_name').removeClass('dcl-loading'); 49 } 50 51 }); 52 }); 53 54 $('#directorist-claimer__form').on('submit', function (e) { 55 56 e.preventDefault(); 57 58 $(this).find('.directorist-modal__footer .directorist-btn').addClass('directorist-loader'); 59 60 var listing_type = $( 'input[type="radio"][name=listing_type]:checked').val(); 61 var plan_id = $('#directorist-claimer_plan').find(":selected").val(); 62 63 var formData = new FormData(); 64 65 formData.append('action', 'dcl_submit_claim'); 66 67 if( $('#directorist__post-id').val() ) { 68 formData.append('post_id', $('#directorist__post-id').val() ); 69 } 70 71 if( $('#directorist-claimer__name').val() ) { 72 formData.append('claimer_name', $('#directorist-claimer__name').val() ); 73 } 74 75 if( $('#directorist-claimer__phone').val() ) { 76 formData.append('claimer_phone', $('#directorist-claimer__phone').val() ); 77 } 78 79 if( $('#directorist-claimer__details').val() ) { 80 formData.append('claimer_details', $('#directorist-claimer__details').val() ); 81 } 82 83 if( plan_id ) { 84 formData.append('plan_id', plan_id ); 85 } 86 87 if( dcl_main.nonce ) { 88 formData.append('nonce', dcl_main.nonce ); 89 } 90 91 if( listing_type ) { 92 formData.append('type', listing_type ); 93 } 94 95 $.ajax({ 96 method: 'POST', 97 processData: false, 98 contentType: false, 99 url: dcl_main.ajaxurl, 100 data: formData, 101 success(response) { 102 $('#directorist-claimer__form .directorist-modal__footer .directorist-btn').removeClass('directorist-loader'); 103 if ( response.take_payment ) { 104 window.location.href = response.checkout_url; 105 } else { 106 // Clear form fields 107 $('.directorist-claimer__form .directorist-form-group').hide(''); 108 109 // Show success message 110 $('#directorist-claimer__submit-notification').addClass('text-success').html(response.message); 111 112 // Auto close modal after 2 seconds 113 setTimeout(() => { 114 // Close the modal 115 $('.directorist-claim-listing-modal').removeClass('directorist-show'); 116 $('body').removeClass('directorist-modal-open'); 117 }, 2000); 118 } 119 if ( response.error_msg ){ 120 $('#directorist-claimer__warning-notification').addClass('text-warning').html(response.error_msg); 121 } 122 }, 123 124 error( error ) { 125 $('#directorist-claimer__form .directorist-modal__footer .directorist-btn').removeClass('directorist-loader'); 126 }, 127 128 }); 129 }); 130 131 //calim listng settings panel - set claim fee 132 var claim_price = $("#claim_listing_price"); 133 claim_price.hide(); 134 135 $('select[name="claim_charge_by"]').on("change", function () { 136 if($(this).val() == "static_fee"){ 137 claim_price.show(); 138 }else{ 139 claim_price.hide(); 140 } 141 }); 142 if($('select[name="claim_charge_by"] option:selected').val() == "static_fee"){ 143 144 claim_price.show(); 145 } 146 147 var dcln = $('.directorist-claim-listing__login-notice'); 148 dcln.hide(); 149 $('.directorist-claim-listing__login-alert ').on('click', function (e) { 150 e.preventDefault(); 151 dcln.slideDown(); 152 }); 153 154})(jQuery); 155
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.