1/* global hcaptcha, hCaptchaGetWidgetId */ 2 3document.addEventListener( 'DOMContentLoaded', function () { 4 /** 5 * Reset hCaptcha widget. 6 * 7 * @param {CustomEvent} event Event. 8 */ 9 const hCaptchaResetCF7 = function ( event ) { 10 // noinspection JSVoidFunctionReturnValueUsed 11 hcaptcha.reset( hCaptchaGetWidgetId( event.target ) ); 12 }; 13 14 [ ...document.querySelectorAll( '.wpcf7' ) ].map( ( form ) => { 15 form.addEventListener( 'wpcf7invalid', hCaptchaResetCF7, false ); 16 form.addEventListener( 'wpcf7spam', hCaptchaResetCF7, false ); 17 form.addEventListener( 'wpcf7mailsent', hCaptchaResetCF7, false ); 18 form.addEventListener( 'wpcf7mailfailed', hCaptchaResetCF7, false ); 19 form.addEventListener( 'wpcf7submit', hCaptchaResetCF7, false ); 20 21 return form; 22 } ); 23} );
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.