HEX
Server: Apache
System: Linux ebs-107629 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64
User: shredder (65669)
PHP: 8.3.8
Disabled: link,symlink
Upload Files
File: /home/wwwroot/shredder/wwwroot/wp-content/plugins/tablepress/admin/js/options.js
/**
 * JavaScript code for the "Options" screen, without the CodeMirror handling
 *
 * @package TablePress
 * @subpackage Views JavaScript
 * @author Tobias Bäthge
 * @since 1.0.0
 */

/* global confirm, tablepress_strings */

jQuery( function( $ ) {

	'use strict';

	/**
	 * Enable/disable the regular textarea according to state of "Load Custom CSS" checkbox.
	 *
	 * @since 1.0.0
	 */
	$( '#option-use-custom-css' ).on( 'change', function() {
		$( '#option-custom-css' ).prop( 'disabled', ! $(this).prop( 'checked' ) );
	} ).trigger( 'change' );

	/**
	 * On form submit: Enable disabled fields, so that they are transmitted in the POST request.
	 *
	 * @since 1.0.0
	 */
	$( '#tablepress-page' ).on( 'submit', 'form', function() {
		$(this).find( 'input, select, textarea' ).prop( 'disabled', false );
	} );

	/**
	 * Require double confirmation when wanting to uninstall TablePress.
	 *
	 * @since 1.0.0
	 */
	$( '#uninstall-tablepress' ).on( 'click', function() {
		if ( confirm( tablepress_strings.uninstall_warning_1 ) ) {
			return confirm( tablepress_strings.uninstall_warning_2 );
		}

		return false;
	} );

} );