HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux sci 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: tpdc (1002)
PHP: 7.4.3-4ubuntu2.29
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/nsci/wp-content/plugins/tablepress/admin/js/common.js
/**
 * JavaScript code for all TablePress admin screens.
 *
 * @package TablePress
 * @subpackage Views JavaScript
 * @author Tobias Bäthge
 * @since 1.0.0
 */

/* globals confirm, postboxes, pagenow, jQuery */

/**
 * WordPress dependencies.
 */
import { _n } from '@wordpress/i18n';

/**
 * Enable toggle/order functionality for post meta boxes.
 * For TablePress, pagenow has the form "tablepress_{$action}".
 *
 * @since 1.0.0
 */
postboxes.add_postbox_toggles( pagenow );

/**
 * Turn off the collapsing feature of postboxes when directly clicking on the postbox header bar.
 * This causes confusion to many users that accidentally click this.
 * After this, the postboxes can only be collapsed/expanded via the arrow icon in their header bar.
 *
 * @since 2.1.0
 */
jQuery( '.postbox .hndle' ).off( 'click.postboxes', postboxes.handle_click );

document.getElementById( 'tablepress-page' ).addEventListener( 'click', ( event ) => {
	if ( ! event.target ) {
		return;
	}

	/**
	 * Show an AYS warning when a "Delete" link is clicked.
	 *
	 * @since 1.0.0
	 */
	if ( event.target.matches( '.delete-link' ) ) {
		if ( ! confirm( _n( 'Do you really want to delete this table?', 'Do you really want to delete these tables?', 1, 'tablepress' ) ) ) {
			event.preventDefault();
			return;
		}

		// Prevent onunload warning, by calling unset method from edit.js (if defined).
		window?.tp?.helpers?.unsaved_changes?.unset?.();

		return;
	}
} );