Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wpforms-.../assets/js/frontend
File: wpforms.js
/**
[3500] Fix | Delete
* Compare times.
[3501] Fix | Delete
*
[3502] Fix | Delete
* @since 1.7.1
[3503] Fix | Delete
*
[3504] Fix | Delete
* @param {string} time1 Time 1.
[3505] Fix | Delete
* @param {string} time2 Time 2.
[3506] Fix | Delete
*
[3507] Fix | Delete
* @return {boolean} True if time1 is greater than time2.
[3508] Fix | Delete
*/
[3509] Fix | Delete
compareTimesGreaterThan( time1, time2 ) {
[3510] Fix | Delete
// Proper format time: add space before AM/PM, make uppercase.
[3511] Fix | Delete
time1 = time1.replace( /(am|pm)/g, ' $1' ).toUpperCase();
[3512] Fix | Delete
time2 = time2.replace( /(am|pm)/g, ' $1' ).toUpperCase();
[3513] Fix | Delete
[3514] Fix | Delete
const time1Date = Date.parse( '01 Jan 2021 ' + time1 ),
[3515] Fix | Delete
time2Date = Date.parse( '01 Jan 2021 ' + time2 );
[3516] Fix | Delete
[3517] Fix | Delete
return time1Date >= time2Date;
[3518] Fix | Delete
},
[3519] Fix | Delete
[3520] Fix | Delete
/**
[3521] Fix | Delete
* Determine whether the modern markup setting is enabled.
[3522] Fix | Delete
*
[3523] Fix | Delete
* @since 1.8.1
[3524] Fix | Delete
*
[3525] Fix | Delete
* @return {boolean} True if modern markup is enabled.
[3526] Fix | Delete
*/
[3527] Fix | Delete
isModernMarkupEnabled() {
[3528] Fix | Delete
return !! wpforms_settings.isModernMarkupEnabled;
[3529] Fix | Delete
},
[3530] Fix | Delete
[3531] Fix | Delete
/**
[3532] Fix | Delete
* Initialize token updater.
[3533] Fix | Delete
*
[3534] Fix | Delete
* Maybe update token via AJAX if it looks like outdated.
[3535] Fix | Delete
*
[3536] Fix | Delete
* @since 1.8.8
[3537] Fix | Delete
*/
[3538] Fix | Delete
initTokenUpdater() {
[3539] Fix | Delete
// Attach event handler to all forms with class `wpforms-form`
[3540] Fix | Delete
$( '.wpforms-form' ).on( 'focusin', function( event ) {
[3541] Fix | Delete
const $form = $( event.target.closest( 'form' ) );
[3542] Fix | Delete
const timestamp = Date.now();
[3543] Fix | Delete
if ( ! this.needsTokenUpdate( timestamp, $form ) ) {
[3544] Fix | Delete
return;
[3545] Fix | Delete
}
[3546] Fix | Delete
[3547] Fix | Delete
this.updateToken( timestamp, $form, event );
[3548] Fix | Delete
}.bind( this ) ); // Bind `this` to maintain context inside the function
[3549] Fix | Delete
},
[3550] Fix | Delete
[3551] Fix | Delete
/**
[3552] Fix | Delete
* Check if the form needs a new token.
[3553] Fix | Delete
*
[3554] Fix | Delete
* @param {number} timestamp Timestamp.
[3555] Fix | Delete
* @param {jQuery} $form Form.
[3556] Fix | Delete
*
[3557] Fix | Delete
* @return {boolean} Whether token needs update or not.
[3558] Fix | Delete
*
[3559] Fix | Delete
* @since 1.8.9
[3560] Fix | Delete
*/
[3561] Fix | Delete
needsTokenUpdate( timestamp, $form ) {
[3562] Fix | Delete
const tokenTime = $form.attr( 'data-token-time' ) || 0;
[3563] Fix | Delete
const diff = timestamp - ( tokenTime * 1000 );
[3564] Fix | Delete
[3565] Fix | Delete
// Check if the token is expired.
[3566] Fix | Delete
return diff >= wpforms_settings.token_cache_lifetime * 1000 && ! this.isUpdatingToken;
[3567] Fix | Delete
},
[3568] Fix | Delete
[3569] Fix | Delete
/**
[3570] Fix | Delete
* Update the token for the form.
[3571] Fix | Delete
*
[3572] Fix | Delete
* @param {number} timestamp Timestamp.
[3573] Fix | Delete
* @param {jQuery} $form Form.
[3574] Fix | Delete
* @param {Event} event Event.
[3575] Fix | Delete
*
[3576] Fix | Delete
* @since 1.8.9
[3577] Fix | Delete
*/
[3578] Fix | Delete
updateToken( timestamp, $form, event ) {
[3579] Fix | Delete
const formId = $form.data( 'formid' );
[3580] Fix | Delete
const $submitBtn = $form.find( '.wpforms-submit' );
[3581] Fix | Delete
[3582] Fix | Delete
this.isUpdatingToken = true;
[3583] Fix | Delete
$submitBtn.prop( 'disabled', true );
[3584] Fix | Delete
[3585] Fix | Delete
$.post( wpforms_settings.ajaxurl, {
[3586] Fix | Delete
action: 'wpforms_get_token',
[3587] Fix | Delete
formId,
[3588] Fix | Delete
} ).done( function( response ) {
[3589] Fix | Delete
if ( response.success ) {
[3590] Fix | Delete
$form.attr( 'data-token-time', timestamp );
[3591] Fix | Delete
$form.attr( 'data-token', response.data.token );
[3592] Fix | Delete
[3593] Fix | Delete
// Re-enable the 'submit' button.
[3594] Fix | Delete
$submitBtn.prop( 'disabled', false );
[3595] Fix | Delete
[3596] Fix | Delete
// Trigger form submission if the focus was on the 'submit' button.
[3597] Fix | Delete
if ( event.target === $submitBtn[ 0 ] ) {
[3598] Fix | Delete
$submitBtn.trigger( 'click' );
[3599] Fix | Delete
}
[3600] Fix | Delete
} else {
[3601] Fix | Delete
// eslint-disable-next-line no-console
[3602] Fix | Delete
console.error( 'Failed to update token: ', response );
[3603] Fix | Delete
}
[3604] Fix | Delete
} ).fail( function( jqXHR, textStatus, errorThrown ) {
[3605] Fix | Delete
// eslint-disable-next-line no-console
[3606] Fix | Delete
console.error( 'AJAX request failed: ', textStatus, errorThrown );
[3607] Fix | Delete
} ).always( function() {
[3608] Fix | Delete
this.isUpdatingToken = false;
[3609] Fix | Delete
[3610] Fix | Delete
// Re-enable the 'submit' button.
[3611] Fix | Delete
$submitBtn.prop( 'disabled', false );
[3612] Fix | Delete
}.bind( this ) );
[3613] Fix | Delete
},
[3614] Fix | Delete
[3615] Fix | Delete
/**
[3616] Fix | Delete
* Restore Submit button on Mobile.
[3617] Fix | Delete
*
[3618] Fix | Delete
* @since 1.8.9
[3619] Fix | Delete
*/
[3620] Fix | Delete
restoreSubmitButtonOnEventPersisted() {
[3621] Fix | Delete
window.onpageshow = function( event ) {
[3622] Fix | Delete
// If back/forward button has been clicked, restore submit button for all forms on the page.
[3623] Fix | Delete
if ( event.persisted ) {
[3624] Fix | Delete
$( '.wpforms-form' ).each( function() {
[3625] Fix | Delete
const $form = $( this );
[3626] Fix | Delete
app.restoreSubmitButton( $form, $form.closest( '.wpforms-container' ) );
[3627] Fix | Delete
} );
[3628] Fix | Delete
}
[3629] Fix | Delete
};
[3630] Fix | Delete
},
[3631] Fix | Delete
};
[3632] Fix | Delete
[3633] Fix | Delete
return app;
[3634] Fix | Delete
}( document, window, jQuery ) );
[3635] Fix | Delete
[3636] Fix | Delete
// Initialize.
[3637] Fix | Delete
wpforms.init();
[3638] Fix | Delete
[3639] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function