403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/rasin.ddns.net/wp-content/plugins/tablepress/admin/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/rasin.ddns.net/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 || {};

document.addEventListener( 'DOMContentLoaded', () => {

	/**
	 * 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' ) );

} );

Youez - 2016 - github.com/yon3zu
LinuXploit