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 / tinymce-button.js

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

52 lines 1.2 KB
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 /* global tinymce , tablepress_editor_button*/
11
12 ( function() {
13
14 'use strict';
15
16 // only do this if TinyMCE is available
17 if ( 'undefined' === typeof( tinymce ) ) {
18 return;
19 }
20
21 /**
22 * Register a button for the TinyMCE (aka Visual Editor) toolbar
23 *
24 * @since 1.0.0
25 */
26 tinymce.create( 'tinymce.plugins.TablePressPlugin', {
27 init: function( ed, url ) {
28 ed.addCommand( 'TablePress_insert_table', window.tablepress_open_shortcode_thickbox );
29
30 ed.addButton( 'tablepress_insert_table', {
31 title: tablepress_editor_button.title,
32 cmd: 'TablePress_insert_table',
33 image: url.slice( 0, url.length - 2 ) + 'img/tablepress-editor-button.png'
34 } );
35 }
36 /* // no real need for getInfo(), as it is not displayed/used anywhere
37 ,
38 getInfo: function() {
39 return {
40 longname: 'TablePress',
41 author: 'Tobias Bäthge',
42 authorurl: 'https://tobias.baethge.com/',
43 infourl: 'https://tablepress.org/',
44 version: '1.0.0'
45 };
46 }
47 */
48 } );
49 tinymce.PluginManager.add( 'tablepress_tinymce', tinymce.plugins.TablePressPlugin );
50
51 } )();
52