1jQuery(document).ready(function($){ 2 3 // Fires when an Ajax form submission has completed successfully, and mail has been sent. 4 document.addEventListener( 'wpcf7mailsent', function( event ) { 5 6 // Get input type file element 7 var inputFile = $('.wpcf7-drag-n-drop-file'); 8 var $form = inputFile.parents('form'); 9 10 // Reset upload list for multiple fields 11 if( inputFile.length > 0 ) { 12 $.each( inputFile, function(){ 13 // Reset file counts 14 localStorage.setItem( $(this).attr('data-name') + '_count_files', 1 ); 15 }); 16 }else { 17 // Reset file counts 18 localStorage.setItem( inputFile.attr('data-name') + '_count_files', 1 ); 19 } 20 21 // Remove status / progress bar 22 $('.dnd-upload-status', $form ).remove(); 23 $('.dnd-upload-counter span', $form ).text('0'); 24 $('span.has-error-msg', $form ).remove(); 25 26 }, false ); 27 28 window.initDragDrop = function () { 29 30 // Get text object options/settings from localize script 31 var TextOJB = dnd_cf7_uploader.drag_n_drop_upload; 32 33 // Support Multiple Fileds 34 $('.wpcf7-drag-n-drop-file').CodeDropz_Uploader({ 35 'color' : '#fff', 36 'ajax_url' : dnd_cf7_uploader.ajax_url, 37 'text' : TextOJB.text, 38 'separator' : TextOJB.or_separator, 39 'button_text' : TextOJB.browse, 40 'server_max_error' : TextOJB.server_max_error, 41 'on_success' : function( input, progressBar, response ){ 42 43 // Progressbar Object 44 var $progressDetails = $('#' + progressBar, input.parents('.codedropz-upload-wrapper') ); 45 var $form = input.parents('form'); 46 var $span = $('.wpcf7-acceptance', $form ); 47 var $input = $('input:checkbox', $span); 48 49 // If it's complete remove disabled attribute in button 50 if( $span.hasClass( 'optional' ) || $input.is( ':checked' ) || $span.length == 0 || $form.hasClass('wpcf7-acceptance-as-validation') ) { 51 setTimeout(function(){ $('input:submit', $form ).removeAttr('disabled'); }, 1); 52 } 53 54 // Append hidden input field 55 $progressDetails 56 .find('.dnd-upload-details') 57 .append('<span><input type="hidden" name="'+ input.attr('data-name') +'[]" value="'+ response.data.path +'/'+ response.data.file +'"></span>'); 58 59 // Update counter 60 var $files_counter = ( Number( localStorage.getItem( input.data('name') + '_count_files' ) ) - 1 ); 61 $('.dnd-upload-counter span', input.parents('.codedropz-upload-wrapper')).text( $files_counter ); 62 } 63 }); 64 65 } 66 67 window.initDragDrop(); 68 69});
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.