HEX
Server: LiteSpeed
System: Linux chromium.pvtwebs.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User: plandeptncgov (1317)
PHP: 8.3.31
Disabled: exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/plandeptncgov/public_html/wp-content/plugins/tablepress/admin/js/codemirror.js
/**
 * JavaScript code for the CodeMirror handling on the "Options" screen.
 *
 * @package TablePress
 * @subpackage Views JavaScript
 * @author Tobias Bäthge
 * @since 1.9.0
 */

/* globals tp, wp */

/* jshint strict: global */
'use strict'; // Necessary as this file does not use "import".

// Ensure the global `tp` object exists.
window.tp = window.tp || {};

/**
 * Invoke CodeMirror on the "Custom CSS" textarea.
 *
 * @since 1.9.0
 */
tp.CM_custom_css = wp.codeEditor.initialize( 'option-custom-css', {} ).codemirror;
const $CM_wrapper = tp.CM_custom_css.getWrapperElement();

/**
 * Let CodeMirror textarea grow on first focus (with mouse click), if it is not disabled.
 *
 * @since 1.0.0
 */
const CM_wrapper_mousedown_handler = function () {
	if ( ! this.classList.contains( 'disabled' ) ) {
		this.classList.add( 'large' );
		tp.CM_custom_css.refresh();
		this.removeEventListener( 'mousedown', CM_wrapper_mousedown_handler ); // No need to keep checking for clicks after the textarea height was increased.
	}
};
$CM_wrapper.addEventListener( 'mousedown', CM_wrapper_mousedown_handler );

/**
 * Enable/disable CodeMirror according to state of "Load Custom CSS" checkbox.
 *
 * @since 1.0.0
 */
const $cb_use_custom_css = document.getElementById( 'option-use-custom-css' );
$cb_use_custom_css.addEventListener( 'change', function () {
	tp.CM_custom_css.setOption( 'readOnly', ! this.checked );
	$CM_wrapper.classList.toggle( 'disabled', ! this.checked );
} );
$cb_use_custom_css.dispatchEvent( new Event( 'change' ) );