1jQuery(document).ready(function($) { 2 3 4 // if ($(".zl-form-control-wrap input").attr('aria-invalid') == 'true') { 5 // $('.zl-form-control-wrap .mfcf7-zl-multifile-name').append(localStorage.getItem('zlfilename')); 6 // $('.zl-form-control-wrap .mfcf7_zl_delete_file').show(); 7 // var erMsg = $('.zl-form-control-wrap .wpcf7-not-valid-tip').text(); 8 // $('.zl-form-control-wrap .wpcf7-not-valid-tip').remove(); 9 // localStorage.removeItem('zlfilename'); 10 // $('.zl-form-control-wrap').append('<span class="wpcf7-not-valid-tip" aria-hidden="true">' + erMsg + '</span>'); 11 // $('.mfcf7-zl-multiline-sample').find('.wpcf7-not-valid-tip').remove(); 12 13 // } 14 // $('.mfcf7_zl_delete_file').on('click', function() { 15 // var get_parent = $(this).parent().remove(); 16 // }); 17 $('#mfcf7_zl_add_file').on('click tap', function() { 18 var zl_filecontainer = '#mfcf7_zl_multifilecontainer'; 19 var dname = $(zl_filecontainer).append($('#mfcf7_zl_multifilecontainer span.mfcf7-zl-multiline-sample').html()); 20 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last').hide(); 21 22 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last input').on('change', function(e) { 23 24 var files = $(this)[0].files; 25 var zlfilename = ''; 26 for (var i = 0; i < files.length; i++) { 27 var seprator = ' '; 28 if (i != (files.length - 1)) { 29 seprator = ' | '; 30 } 31 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last span.mfcf7-zl-multifile-name').append(files[i].name + seprator); 32 zlfilename += files[i].name + " " 33 } 34 // localStorage.removeItem('zlfilename'); 35 // localStorage.setItem('zlfilename', zlfilename); 36 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last').show(); 37 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last input').hide(); 38 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last .mfcf7-zl-multifile-name').show(); 39 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last a.mfcf7_zl_delete_file').show(); 40 }); 41 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last a.mfcf7_zl_delete_file').hide(); 42 var fname = $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last').find('input').trigger('click'); 43 $(zl_filecontainer + ' p.wpcf7-form-control-wrap:last input').hide(); 44 $('.mfcf7_zl_delete_file').on('click', function() { 45 var get_parent = $(this).parent().remove(); 46 }); 47 document.addEventListener('wpcf7mailsent', function(event) { 48 jQuery(zl_filecontainer + '>p').remove(); 49 }); 50 51 //to avoid bad request error in safari when it has empty file input https://stackoverflow.com/questions/49614091/safari-11-1-ajax-xhr-form-submission-fails-when-inputtype-file-is-empty 52 $('.wpcf7-form').submit(function() { 53 //your code here 54 var inputs = $('.wpcf7-form input[type="file"]:not([disabled])'); 55 inputs.each(function(_, input) { 56 if (input.files.length > 0) return 57 $(input).prop('disabled', true); 58 }) 59 }); 60 document.addEventListener('wpcf7submit', function(event) { 61 var inputs = $('.wpcf7-form input[type="file"][disabled]'); 62 inputs.each(function(_, input) { 63 $(input).prop('disabled', false); 64 }) 65 }, false); 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.