PluginProbe
TablePress – Tables in WordPress made easy / trunk
TablePress – Tables in WordPress made easy vtrunk
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 / tinymce-button.js

tinymce-button.js in TablePress – Tables in WordPress made easy trunk, at admin/js/tinymce-button.js

34 lines 933 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * JavaScript code for the "Table" button in the TinyMCE editor toolbar.
3 *
4 * @package TablePress
5 * @subpackage Views JavaScript
6 * @author Tobias Bäthge
7 * @since 1.0.0
8 */
9
10 /* globals tinymce, tablepress_editor_button */
11
12 /* jshint strict: global */
13 'use strict'; // Necessary as this file does not use "import".
14
15 /**
16 * Register a button for the TinyMCE (aka Visual Editor) toolbar
17 *
18 * @since 1.0.0
19 */
20 if ( 'undefined' !== typeof tinymce ) {
21 tinymce.create( 'tinymce.plugins.TablePressPlugin', {
22 init( ed, url ) {
23 ed.addCommand( 'TablePress_insert_table', window.tablepress_open_shortcode_thickbox );
24
25 ed.addButton( 'tablepress_insert_table', {
26 title: tablepress_editor_button.title,
27 cmd: 'TablePress_insert_table',
28 image: url.slice( 0, url.length - 8 ) + 'img/tablepress-editor-button.svg',
29 } );
30 },
31 } );
32 tinymce.PluginManager.add( 'tablepress_tinymce', tinymce.plugins.TablePressPlugin );
33 }
34