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/admin
File: admin.js
[2000] Fix | Delete
$.confirm( {
[2001] Fix | Delete
title: wpforms_admin.heads_up,
[2002] Fix | Delete
content: wpforms_admin.provider_delete_confirm,
[2003] Fix | Delete
icon: 'fa fa-exclamation-circle',
[2004] Fix | Delete
type: 'orange',
[2005] Fix | Delete
buttons: {
[2006] Fix | Delete
confirm: {
[2007] Fix | Delete
text: wpforms_admin.ok,
[2008] Fix | Delete
btnClass: 'btn-confirm',
[2009] Fix | Delete
keys: [ 'enter' ],
[2010] Fix | Delete
action: function() {
[2011] Fix | Delete
[2012] Fix | Delete
$.post( wpforms_admin.ajax_url, data, function( response ) {
[2013] Fix | Delete
[2014] Fix | Delete
if ( response.success ) {
[2015] Fix | Delete
$this.parent().parent().remove();
[2016] Fix | Delete
[2017] Fix | Delete
// Hide Connected status label if no more integrations are linked.
[2018] Fix | Delete
var numberOfIntegrations = $provider.find( '.wpforms-settings-provider-accounts-list li' ).length;
[2019] Fix | Delete
[2020] Fix | Delete
if ( typeof numberOfIntegrations === 'undefined' || numberOfIntegrations === 0 ) {
[2021] Fix | Delete
$provider.removeClass( 'connected' );
[2022] Fix | Delete
}
[2023] Fix | Delete
[2024] Fix | Delete
/**
[2025] Fix | Delete
* Provider account has been removed.
[2026] Fix | Delete
*
[2027] Fix | Delete
* @since 1.7.7
[2028] Fix | Delete
*/
[2029] Fix | Delete
$( document ).trigger( 'wpformsProviderRemoved', [ $provider, response ] );
[2030] Fix | Delete
} else {
[2031] Fix | Delete
[2032] Fix | Delete
if (
[2033] Fix | Delete
Object.prototype.hasOwnProperty.call( response, 'data' ) &&
[2034] Fix | Delete
Object.prototype.hasOwnProperty.call( response.data, 'error_msg' )
[2035] Fix | Delete
) {
[2036] Fix | Delete
errorMessage += '<br>' + response.data.error_msg;
[2037] Fix | Delete
}
[2038] Fix | Delete
[2039] Fix | Delete
WPFormsAdmin.integrationError( errorMessage );
[2040] Fix | Delete
}
[2041] Fix | Delete
} ).fail( function() {
[2042] Fix | Delete
[2043] Fix | Delete
WPFormsAdmin.integrationError( errorMessage );
[2044] Fix | Delete
} );
[2045] Fix | Delete
},
[2046] Fix | Delete
},
[2047] Fix | Delete
cancel: {
[2048] Fix | Delete
text: wpforms_admin.cancel,
[2049] Fix | Delete
keys: [ 'esc' ],
[2050] Fix | Delete
},
[2051] Fix | Delete
},
[2052] Fix | Delete
} );
[2053] Fix | Delete
},
[2054] Fix | Delete
[2055] Fix | Delete
/**
[2056] Fix | Delete
* Error handling.
[2057] Fix | Delete
*
[2058] Fix | Delete
* @since 1.6.4
[2059] Fix | Delete
*
[2060] Fix | Delete
* @param {string} error Error message.
[2061] Fix | Delete
*/
[2062] Fix | Delete
integrationError: function( error ) {
[2063] Fix | Delete
[2064] Fix | Delete
$.alert( {
[2065] Fix | Delete
title: wpforms_admin.something_went_wrong,
[2066] Fix | Delete
content: error,
[2067] Fix | Delete
icon: 'fa fa-exclamation-circle',
[2068] Fix | Delete
type: 'orange',
[2069] Fix | Delete
buttons: {
[2070] Fix | Delete
confirm: {
[2071] Fix | Delete
text: wpforms_admin.ok,
[2072] Fix | Delete
btnClass: 'btn-confirm',
[2073] Fix | Delete
keys: [ 'enter' ],
[2074] Fix | Delete
},
[2075] Fix | Delete
},
[2076] Fix | Delete
} );
[2077] Fix | Delete
},
[2078] Fix | Delete
[2079] Fix | Delete
//--------------------------------------------------------------------//
[2080] Fix | Delete
// Tools.
[2081] Fix | Delete
//--------------------------------------------------------------------//
[2082] Fix | Delete
[2083] Fix | Delete
/**
[2084] Fix | Delete
* Element bindings for Tools page.
[2085] Fix | Delete
*
[2086] Fix | Delete
* @since 1.4.2
[2087] Fix | Delete
*/
[2088] Fix | Delete
initTools() {
[2089] Fix | Delete
// Enable import/export buttons when a value is selected.
[2090] Fix | Delete
$( document ).on( 'change', '#wpforms-tools-form-import, #wpforms-tools-form-other-import, #wpforms-tools-form-export, #wpforms-tools-form-template', function() {
[2091] Fix | Delete
const $field = $( this );
[2092] Fix | Delete
const $button = $field.parents( 'form' ).find( 'button' );
[2093] Fix | Delete
[2094] Fix | Delete
$button.attr( 'aria-disabled', $field.val().length === 0 );
[2095] Fix | Delete
} );
[2096] Fix | Delete
[2097] Fix | Delete
// Copy system information to clipboard.
[2098] Fix | Delete
$( document ).on( 'click', '#wpforms-system-information-copy', function( event ) {
[2099] Fix | Delete
event.preventDefault();
[2100] Fix | Delete
WPFormsAdmin.copySystemInformation();
[2101] Fix | Delete
} );
[2102] Fix | Delete
[2103] Fix | Delete
// Run SSL test.
[2104] Fix | Delete
$( document ).on( 'click', '#wpforms-ssl-verify', function( event ) {
[2105] Fix | Delete
event.preventDefault();
[2106] Fix | Delete
WPFormsAdmin.verifySSLConnection();
[2107] Fix | Delete
} );
[2108] Fix | Delete
[2109] Fix | Delete
// Run import for a specific provider.
[2110] Fix | Delete
$( document ).on( 'click', '#wpforms-importer-forms-submit', function( event ) {
[2111] Fix | Delete
event.preventDefault();
[2112] Fix | Delete
[2113] Fix | Delete
// Check to confirm user as selected a form.
[2114] Fix | Delete
if ( $( '#wpforms-importer-forms input:checked' ).length ) {
[2115] Fix | Delete
const ids = [];
[2116] Fix | Delete
[2117] Fix | Delete
$( '#wpforms-importer-forms input:checked' ).each( function( i ) {
[2118] Fix | Delete
ids[ i ] = $( this ).val();
[2119] Fix | Delete
} );
[2120] Fix | Delete
[2121] Fix | Delete
if ( ! wpforms_admin.isPro ) {
[2122] Fix | Delete
// We need to analyze the forms before starting the actual import.
[2123] Fix | Delete
WPFormsAdmin.analyzeForms( ids );
[2124] Fix | Delete
} else {
[2125] Fix | Delete
// Begin the import process.
[2126] Fix | Delete
WPFormsAdmin.importForms( ids );
[2127] Fix | Delete
}
[2128] Fix | Delete
} else {
[2129] Fix | Delete
// User didn't actually select a form so alert them.
[2130] Fix | Delete
$.alert( {
[2131] Fix | Delete
title: wpforms_admin.heads_up,
[2132] Fix | Delete
content: wpforms_admin.importer_forms_required,
[2133] Fix | Delete
icon: 'fa fa-info-circle',
[2134] Fix | Delete
type: 'blue',
[2135] Fix | Delete
buttons: {
[2136] Fix | Delete
confirm: {
[2137] Fix | Delete
text: wpforms_admin.ok,
[2138] Fix | Delete
btnClass: 'btn-confirm',
[2139] Fix | Delete
keys: [ 'enter' ],
[2140] Fix | Delete
},
[2141] Fix | Delete
},
[2142] Fix | Delete
} );
[2143] Fix | Delete
}
[2144] Fix | Delete
} );
[2145] Fix | Delete
[2146] Fix | Delete
// Continue import after analyzing.
[2147] Fix | Delete
$( document ).on( 'click', '#wpforms-importer-continue-submit', function( event ) {
[2148] Fix | Delete
event.preventDefault();
[2149] Fix | Delete
WPFormsAdmin.importForms( s.formIDs );
[2150] Fix | Delete
} );
[2151] Fix | Delete
},
[2152] Fix | Delete
[2153] Fix | Delete
/**
[2154] Fix | Delete
* Copy system information to clipboard.
[2155] Fix | Delete
*
[2156] Fix | Delete
* @since 1.8.4
[2157] Fix | Delete
*/
[2158] Fix | Delete
copySystemInformation() {
[2159] Fix | Delete
$( '#wpforms-system-information' ).select();
[2160] Fix | Delete
document.execCommand( 'copy' );
[2161] Fix | Delete
},
[2162] Fix | Delete
[2163] Fix | Delete
/**
[2164] Fix | Delete
* Perform test connection to verify that the current web host
[2165] Fix | Delete
* can successfully make outbound SSL connections.
[2166] Fix | Delete
*
[2167] Fix | Delete
* @since 1.4.5
[2168] Fix | Delete
*/
[2169] Fix | Delete
verifySSLConnection() {
[2170] Fix | Delete
const $btn = $( '#wpforms-ssl-verify' );
[2171] Fix | Delete
const btnLabel = $btn.text();
[2172] Fix | Delete
const btnWidth = $btn.outerWidth();
[2173] Fix | Delete
const $settings = $btn.parent();
[2174] Fix | Delete
[2175] Fix | Delete
$btn.css( 'width', btnWidth ).prop( 'disabled', true ).text( wpforms_admin.testing );
[2176] Fix | Delete
[2177] Fix | Delete
const data = {
[2178] Fix | Delete
action: 'wpforms_verify_ssl',
[2179] Fix | Delete
nonce: wpforms_admin.nonce,
[2180] Fix | Delete
};
[2181] Fix | Delete
[2182] Fix | Delete
// Trigger AJAX to test connection
[2183] Fix | Delete
$.post( wpforms_admin.ajax_url, data, function( res ) {
[2184] Fix | Delete
WPFormsAdmin.debug( res );
[2185] Fix | Delete
[2186] Fix | Delete
// Remove any previous alerts.
[2187] Fix | Delete
$settings.find( '.wpforms-notice' ).remove();
[2188] Fix | Delete
[2189] Fix | Delete
if ( res.success ) {
[2190] Fix | Delete
$btn.before( '<div class="notice wpforms-notice notice-success">' + res.data.msg + '</div>' );
[2191] Fix | Delete
}
[2192] Fix | Delete
[2193] Fix | Delete
if ( ! res.success && res.data.msg ) {
[2194] Fix | Delete
$btn.before( '<div class="notice wpforms-notice notice-error">' + res.data.msg + '</div>' );
[2195] Fix | Delete
}
[2196] Fix | Delete
[2197] Fix | Delete
if ( ! res.success && res.data.debug ) {
[2198] Fix | Delete
$btn.before( '<div class="wpforms-ssl-error pre-error">' + res.data.debug + '</div>' );
[2199] Fix | Delete
}
[2200] Fix | Delete
[2201] Fix | Delete
$btn.css( 'width', btnWidth ).prop( 'disabled', false ).text( btnLabel );
[2202] Fix | Delete
} );
[2203] Fix | Delete
},
[2204] Fix | Delete
[2205] Fix | Delete
/**
[2206] Fix | Delete
* Begins the process of analyzing the forms.
[2207] Fix | Delete
*
[2208] Fix | Delete
* This runs for non-Pro installs to check if any of the forms to be
[2209] Fix | Delete
* imported contain fields
[2210] Fix | Delete
* not currently available.
[2211] Fix | Delete
*
[2212] Fix | Delete
* @since 1.4.2
[2213] Fix | Delete
*/
[2214] Fix | Delete
analyzeForms: function( forms ) {
[2215] Fix | Delete
[2216] Fix | Delete
var $processAnalyze = $( '#wpforms-importer-analyze' );
[2217] Fix | Delete
[2218] Fix | Delete
// Display total number of forms we have to import.
[2219] Fix | Delete
$processAnalyze.find( '.form-total' ).text( forms.length );
[2220] Fix | Delete
$processAnalyze.find( '.form-current' ).text( '1' );
[2221] Fix | Delete
[2222] Fix | Delete
// Hide the form select section.
[2223] Fix | Delete
$( '#wpforms-importer-forms' ).hide();
[2224] Fix | Delete
[2225] Fix | Delete
// Show Analyze status.
[2226] Fix | Delete
$processAnalyze.show();
[2227] Fix | Delete
[2228] Fix | Delete
// Create global analyze queue.
[2229] Fix | Delete
s.analyzeQueue = forms;
[2230] Fix | Delete
s.analyzed = 0;
[2231] Fix | Delete
s.analyzeUpgrade = [];
[2232] Fix | Delete
s.formIDs = forms;
[2233] Fix | Delete
[2234] Fix | Delete
// Analyze the first form in the queue.
[2235] Fix | Delete
WPFormsAdmin.analyzeForm();
[2236] Fix | Delete
},
[2237] Fix | Delete
[2238] Fix | Delete
/**
[2239] Fix | Delete
* Analyze a single form from the queue.
[2240] Fix | Delete
*
[2241] Fix | Delete
* @since 1.4.2
[2242] Fix | Delete
*/
[2243] Fix | Delete
analyzeForm: function() {
[2244] Fix | Delete
[2245] Fix | Delete
var $analyzeSettings = $( '#wpforms-importer-analyze' ),
[2246] Fix | Delete
formID = _.first( s.analyzeQueue ),
[2247] Fix | Delete
provider = WPFormsAdmin.getQueryString( 'provider' ),
[2248] Fix | Delete
data = {
[2249] Fix | Delete
action: 'wpforms_import_form_' + provider,
[2250] Fix | Delete
analyze: 1,
[2251] Fix | Delete
form_id: formID,
[2252] Fix | Delete
nonce: wpforms_admin.nonce,
[2253] Fix | Delete
};
[2254] Fix | Delete
[2255] Fix | Delete
// Trigger AJAX analyze for this form.
[2256] Fix | Delete
$.post( wpforms_admin.ajax_url, data, function( res ) {
[2257] Fix | Delete
[2258] Fix | Delete
if ( res.success ) {
[2259] Fix | Delete
[2260] Fix | Delete
if ( ! _.isEmpty( res.data.upgrade_plain ) || ! _.isEmpty( res.data.upgrade_omit ) ) {
[2261] Fix | Delete
s.analyzeUpgrade.push( {
[2262] Fix | Delete
name: res.data.name,
[2263] Fix | Delete
fields: _.union( res.data.upgrade_omit, res.data.upgrade_plain ),
[2264] Fix | Delete
} );
[2265] Fix | Delete
}
[2266] Fix | Delete
[2267] Fix | Delete
// Remove this form ID from the queue.
[2268] Fix | Delete
s.analyzeQueue = _.without( s.analyzeQueue, formID );
[2269] Fix | Delete
s.analyzed++;
[2270] Fix | Delete
[2271] Fix | Delete
if ( _.isEmpty( s.analyzeQueue ) ) {
[2272] Fix | Delete
[2273] Fix | Delete
if ( _.isEmpty( s.analyzeUpgrade ) ) {
[2274] Fix | Delete
[2275] Fix | Delete
// Continue to import forms as no Pro fields were found.
[2276] Fix | Delete
WPFormsAdmin.importForms( s.formIDs );
[2277] Fix | Delete
} else {
[2278] Fix | Delete
[2279] Fix | Delete
// We found Pro fields, so alert the user.
[2280] Fix | Delete
var upgradeDetails = wp.template( 'wpforms-importer-upgrade' );
[2281] Fix | Delete
$analyzeSettings.find( '.upgrade' ).append( upgradeDetails( s.analyzeUpgrade ) );
[2282] Fix | Delete
$analyzeSettings.find( '.upgrade' ).show();
[2283] Fix | Delete
$analyzeSettings.find( '.process-analyze' ).hide();
[2284] Fix | Delete
}
[2285] Fix | Delete
[2286] Fix | Delete
} else {
[2287] Fix | Delete
[2288] Fix | Delete
// Analyze next form in the queue.
[2289] Fix | Delete
$analyzeSettings.find( '.form-current' ).text( s.analyzed + 1 );
[2290] Fix | Delete
WPFormsAdmin.analyzeForm();
[2291] Fix | Delete
}
[2292] Fix | Delete
}
[2293] Fix | Delete
} );
[2294] Fix | Delete
},
[2295] Fix | Delete
[2296] Fix | Delete
/**
[2297] Fix | Delete
* Begins the process of importing the forms.
[2298] Fix | Delete
*
[2299] Fix | Delete
* @since 1.4.2
[2300] Fix | Delete
*/
[2301] Fix | Delete
importForms: function( forms ) {
[2302] Fix | Delete
[2303] Fix | Delete
var $processSettings = $( '#wpforms-importer-process' );
[2304] Fix | Delete
[2305] Fix | Delete
// Display total number of forms we have to import.
[2306] Fix | Delete
$processSettings.find( '.form-total' ).text( forms.length );
[2307] Fix | Delete
$processSettings.find( '.form-current' ).text( '1' );
[2308] Fix | Delete
[2309] Fix | Delete
// Hide the form select and form analyze sections.
[2310] Fix | Delete
$( '#wpforms-importer-forms, #wpforms-importer-analyze' ).hide();
[2311] Fix | Delete
[2312] Fix | Delete
// Show processing status.
[2313] Fix | Delete
$processSettings.show();
[2314] Fix | Delete
[2315] Fix | Delete
// Create global import queue.
[2316] Fix | Delete
s.importQueue = forms;
[2317] Fix | Delete
s.imported = 0;
[2318] Fix | Delete
[2319] Fix | Delete
// Import the first form in the queue.
[2320] Fix | Delete
WPFormsAdmin.importForm();
[2321] Fix | Delete
},
[2322] Fix | Delete
[2323] Fix | Delete
/**
[2324] Fix | Delete
* Imports a single form from the import queue.
[2325] Fix | Delete
*
[2326] Fix | Delete
* @since 1.4.2
[2327] Fix | Delete
*/
[2328] Fix | Delete
importForm: function() {
[2329] Fix | Delete
[2330] Fix | Delete
var $processSettings = $( '#wpforms-importer-process' ),
[2331] Fix | Delete
formID = _.first( s.importQueue ),
[2332] Fix | Delete
provider = WPFormsAdmin.getQueryString( 'provider' ),
[2333] Fix | Delete
data = {
[2334] Fix | Delete
action: 'wpforms_import_form_' + provider,
[2335] Fix | Delete
form_id: formID,
[2336] Fix | Delete
nonce: wpforms_admin.nonce,
[2337] Fix | Delete
};
[2338] Fix | Delete
[2339] Fix | Delete
// Trigger AJAX import for this form.
[2340] Fix | Delete
$.post( wpforms_admin.ajax_url, data, function( res ) {
[2341] Fix | Delete
[2342] Fix | Delete
if ( res.success ) {
[2343] Fix | Delete
var statusUpdate;
[2344] Fix | Delete
[2345] Fix | Delete
if ( res.data.error ) {
[2346] Fix | Delete
statusUpdate = wp.template( 'wpforms-importer-status-error' );
[2347] Fix | Delete
} else {
[2348] Fix | Delete
statusUpdate = wp.template( 'wpforms-importer-status-update' );
[2349] Fix | Delete
}
[2350] Fix | Delete
[2351] Fix | Delete
$processSettings.find( '.status' ).prepend( statusUpdate( res.data ) );
[2352] Fix | Delete
$processSettings.find( '.status' ).show();
[2353] Fix | Delete
[2354] Fix | Delete
// Remove this form ID from the queue.
[2355] Fix | Delete
s.importQueue = _.without( s.importQueue, formID );
[2356] Fix | Delete
s.imported++;
[2357] Fix | Delete
[2358] Fix | Delete
if ( _.isEmpty( s.importQueue ) ) {
[2359] Fix | Delete
[2360] Fix | Delete
$processSettings.find( '.process-count' ).hide();
[2361] Fix | Delete
$processSettings.find( '.forms-completed' ).text( s.imported );
[2362] Fix | Delete
$processSettings.find( '.process-completed' ).show();
[2363] Fix | Delete
[2364] Fix | Delete
} else {
[2365] Fix | Delete
[2366] Fix | Delete
// Import next form in the queue.
[2367] Fix | Delete
$processSettings.find( '.form-current' ).text( s.imported + 1 );
[2368] Fix | Delete
WPFormsAdmin.importForm();
[2369] Fix | Delete
[2370] Fix | Delete
}
[2371] Fix | Delete
}
[2372] Fix | Delete
} );
[2373] Fix | Delete
},
[2374] Fix | Delete
[2375] Fix | Delete
//--------------------------------------------------------------------//
[2376] Fix | Delete
// Upgrades (Tabs view).
[2377] Fix | Delete
//--------------------------------------------------------------------//
[2378] Fix | Delete
[2379] Fix | Delete
/**
[2380] Fix | Delete
* Element bindings for Tools page.
[2381] Fix | Delete
*
[2382] Fix | Delete
* @since 1.4.3
[2383] Fix | Delete
*/
[2384] Fix | Delete
initUpgrades: function() {
[2385] Fix | Delete
[2386] Fix | Delete
// Prepare to run the v1.4.3 upgrade routine.
[2387] Fix | Delete
$( document ).on( 'click', '#wpforms-upgrade-143 button', function( event ) {
[2388] Fix | Delete
[2389] Fix | Delete
event.preventDefault();
[2390] Fix | Delete
[2391] Fix | Delete
var $this = $( this ),
[2392] Fix | Delete
buttonWidth = $this.outerWidth(),
[2393] Fix | Delete
$status = $( '#wpforms-upgrade-143 .status' ),
[2394] Fix | Delete
data = {
[2395] Fix | Delete
action: 'wpforms_upgrade_143',
[2396] Fix | Delete
nonce: wpforms_admin.nonce,
[2397] Fix | Delete
init: true,
[2398] Fix | Delete
incomplete: $this.data( 'incomplete' ),
[2399] Fix | Delete
};
[2400] Fix | Delete
[2401] Fix | Delete
// Change the button to indicate we are doing initial processing.
[2402] Fix | Delete
$this.html( s.iconSpinner ).css( 'width', buttonWidth ).prop( 'disabled', true );
[2403] Fix | Delete
[2404] Fix | Delete
// Get the total number of entries, then kick off the routine.
[2405] Fix | Delete
$.post( wpforms_admin.ajax_url, data, function( res ) {
[2406] Fix | Delete
if ( res.success ) {
[2407] Fix | Delete
[2408] Fix | Delete
// Set initial values.
[2409] Fix | Delete
s.upgraded = Number( res.data.upgraded );
[2410] Fix | Delete
s.upgradeTotal = Number( res.data.total );
[2411] Fix | Delete
var percent = Math.round( ( Number( s.upgraded ) / Number( s.upgradeTotal ) ) * 100 );
[2412] Fix | Delete
[2413] Fix | Delete
// Show the status area.
[2414] Fix | Delete
$this.remove();
[2415] Fix | Delete
$status.find( '.bar' ).css( 'width', percent + '%' );
[2416] Fix | Delete
$status.show().find( '.total' ).text( s.upgradeTotal );
[2417] Fix | Delete
$status.find( '.current' ).text( s.upgraded );
[2418] Fix | Delete
$status.find( '.percent' ).text( percent + '%' );
[2419] Fix | Delete
[2420] Fix | Delete
// Begin the actual upgrade routine.
[2421] Fix | Delete
WPFormsAdmin.upgrade143();
[2422] Fix | Delete
}
[2423] Fix | Delete
} );
[2424] Fix | Delete
} );
[2425] Fix | Delete
},
[2426] Fix | Delete
[2427] Fix | Delete
/**
[2428] Fix | Delete
* The v1.4.3 entry fields upgrade routine.
[2429] Fix | Delete
*
[2430] Fix | Delete
* @since 1.4.3
[2431] Fix | Delete
*/
[2432] Fix | Delete
upgrade143: function() {
[2433] Fix | Delete
[2434] Fix | Delete
var $status = $( '#wpforms-upgrade-143 .status' ),
[2435] Fix | Delete
data = {
[2436] Fix | Delete
action: 'wpforms_upgrade_143',
[2437] Fix | Delete
nonce: wpforms_admin.nonce,
[2438] Fix | Delete
upgraded: s.upgraded,
[2439] Fix | Delete
};
[2440] Fix | Delete
[2441] Fix | Delete
// Get the total number of entries, then kick off the routine.
[2442] Fix | Delete
$.post( wpforms_admin.ajax_url, data, function( res ) {
[2443] Fix | Delete
if ( res.success ) {
[2444] Fix | Delete
[2445] Fix | Delete
s.upgraded = Number( s.upgraded ) + Number( res.data.count );
[2446] Fix | Delete
var percent = Math.round( ( Number( s.upgraded ) / Number( s.upgradeTotal ) ) * 100 );
[2447] Fix | Delete
[2448] Fix | Delete
// Update progress bar.
[2449] Fix | Delete
$status.find( '.bar' ).css( 'width', percent + '%' );
[2450] Fix | Delete
[2451] Fix | Delete
if ( Number( res.data.count ) < 10 ) {
[2452] Fix | Delete
[2453] Fix | Delete
// This batch completed the upgrade routine.
[2454] Fix | Delete
$status.find( '.progress-bar' ).addClass( 'complete' );
[2455] Fix | Delete
$status.find( '.msg' ).text( wpforms_admin.upgrade_completed );
[2456] Fix | Delete
} else {
[2457] Fix | Delete
[2458] Fix | Delete
$status.find( '.current' ).text( s.upgraded );
[2459] Fix | Delete
$status.find( '.percent' ).text( percent + '%' );
[2460] Fix | Delete
[2461] Fix | Delete
// Batch the next round of entries.
[2462] Fix | Delete
WPFormsAdmin.upgrade143();
[2463] Fix | Delete
}
[2464] Fix | Delete
}
[2465] Fix | Delete
} );
[2466] Fix | Delete
},
[2467] Fix | Delete
[2468] Fix | Delete
/**
[2469] Fix | Delete
* Element bindings for Flyout Menu.
[2470] Fix | Delete
*
[2471] Fix | Delete
* @since 1.5.7
[2472] Fix | Delete
*/
[2473] Fix | Delete
initFlyoutMenu: function() {
[2474] Fix | Delete
[2475] Fix | Delete
// Flyout Menu Elements.
[2476] Fix | Delete
var $flyoutMenu = $( '#wpforms-flyout' );
[2477] Fix | Delete
[2478] Fix | Delete
if ( $flyoutMenu.length === 0 ) {
[2479] Fix | Delete
return;
[2480] Fix | Delete
}
[2481] Fix | Delete
[2482] Fix | Delete
var $head = $flyoutMenu.find( '.wpforms-flyout-head' ),
[2483] Fix | Delete
$sullie = $head.find( 'img' ),
[2484] Fix | Delete
menu = {
[2485] Fix | Delete
state: 'inactive',
[2486] Fix | Delete
srcInactive: $sullie.attr( 'src' ),
[2487] Fix | Delete
srcActive: $sullie.data( 'active' ),
[2488] Fix | Delete
};
[2489] Fix | Delete
[2490] Fix | Delete
// Click on the menu head icon.
[2491] Fix | Delete
$head.on( 'click', function( e ) {
[2492] Fix | Delete
[2493] Fix | Delete
e.preventDefault();
[2494] Fix | Delete
[2495] Fix | Delete
if ( menu.state === 'active' ) {
[2496] Fix | Delete
$flyoutMenu.removeClass( 'opened' );
[2497] Fix | Delete
$sullie.attr( 'src', menu.srcInactive );
[2498] Fix | Delete
menu.state = 'inactive';
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function