PluginProbe
TablePress – Tables in WordPress made easy / 1.14
TablePress – Tables in WordPress made easy v1.14
3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 2.4.4 All 44 releases
tablepress / admin / js / options.js

options.js in TablePress – Tables in WordPress made easy 1.14, at admin/js/options.js

48 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * JavaScript code for the "Options" screen, without the CodeMirror handling
3 *
4 * @package TablePress
5 * @subpackage Views JavaScript
6 * @author Tobias Bäthge
7 * @since 1.0.0
8 */
9
10 /* global confirm, tablepress_strings */
11
12 jQuery( function( $ ) {
13
14 'use strict';
15
16 /**
17 * Enable/disable the regular textarea according to state of "Load Custom CSS" checkbox.
18 *
19 * @since 1.0.0
20 */
21 $( '#option-use-custom-css' ).on( 'change', function() {
22 $( '#option-custom-css' ).prop( 'disabled', ! $(this).prop( 'checked' ) );
23 } ).trigger( 'change' );
24
25 /**
26 * On form submit: Enable disabled fields, so that they are transmitted in the POST request.
27 *
28 * @since 1.0.0
29 */
30 $( '#tablepress-page' ).on( 'submit', 'form', function() {
31 $(this).find( 'input, select, textarea' ).prop( 'disabled', false );
32 } );
33
34 /**
35 * Require double confirmation when wanting to uninstall TablePress.
36 *
37 * @since 1.0.0
38 */
39 $( '#uninstall-tablepress' ).on( 'click', function() {
40 if ( confirm( tablepress_strings.uninstall_warning_1 ) ) {
41 return confirm( tablepress_strings.uninstall_warning_2 );
42 }
43
44 return false;
45 } );
46
47 } );
48