| Server IP : 27.254.66.5 / Your IP : 216.73.217.39 Web Server : Apache/2 System : Linux cs82.hostneverdie.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 User : technic2 ( 1951) PHP Version : 7.4.30 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,sleep,pcntl_exec,virtual,suexec,dbmopen,dl,symlink,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/technic2/public_html/old-website/wp-content/plugins/tablepress/admin/js/ |
Upload File : |
/**
* JavaScript code for the "Export" screen
*
* @package TablePress
* @subpackage Views JavaScript
* @author Tobias Bäthge
* @since 1.0.0
*/
jQuery( document ).ready( function( $ ) {
'use strict';
/**
* Check, whether inputs are valid
*
* @since 1.0.0
*/
$( '#tablepress-page' ).find( 'form' ).on( 'submit', function( /* event */ ) {
var selected_tables = $( '#tables-export' ).val(),
num_selected = ( selected_tables ) ? selected_tables.length : 0;
// only submit form, if at least one table was selected
if ( 0 === num_selected ) {
return false;
}
// at this point, the form is valid and will be submitted
// add selected tables as a list to a hidden field
$( '#tables-export-list' ).val( selected_tables.join( ',' ) );
// on form submit: Enable disabled fields, so that they are transmitted in the POST request
$( '#tables-export-zip-file' ).prop( 'disabled', false );
} );
/**
* Show export delimiter dropdown box only if export format is CSV
*
* @since 1.0.0
*/
$( '#tables-export-format' ).on( 'change', function() {
var non_csv_selected = ( 'csv' !== $(this).val() );
$( '#tables-export-csv-delimiter' ).prop( 'disabled', non_csv_selected );
$( '#tables-export-csv-delimiter-description' ).toggle( non_csv_selected );
} )
.change();
/**
* Automatically check and disable the "ZIP file" checkbox whenever more than one table is selected
*
* @since 1.0.0
*/
var zip_file_manually_checked = false;
$( '#tables-export-zip-file' ).on( 'change', function() {
zip_file_manually_checked = $(this).prop( 'checked' );
} );
$( '#tables-export' ).on( 'change', function() {
var selected_tables = $(this).val(),
num_selected = ( selected_tables ) ? selected_tables.length : 0,
zip_file_required = ( num_selected > 1 );
$( '#tables-export-zip-file' )
.prop( 'disabled', zip_file_required )
.prop( 'checked', zip_file_required || zip_file_manually_checked );
$( '#tables-export-zip-file-description' ).toggle( zip_file_required );
// set state of "Select all" checkbox
$( '#tables-export-select-all' ).prop( 'checked', 0 === $(this).find( 'option' ).not( ':selected' ).length );
} )
.change();
/**
* Select all entries from the multiple-select dropdown on checkbox change
*
* @since 1.0.0
*/
$( '#tables-export-select-all' ).on( 'change', function() {
var $tables = $( '#tables-export' );
$tables.find( 'option' ).prop( 'selected', $(this).prop( 'checked' ) );
$tables.change(); // to update ZIP file checkbox
} );
/**
* Automatically focus the tables dropdown
*
* @since 1.0.0
*/
$( '#tables-export' ).focus();
} );