PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 12.1.3
Jetpack – WP Security, Backup, Speed, & Growth v12.1.3
12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 14.4.2 All 500 releases
jetpack / modules / contact-form / js / tinymce-plugin-form-button.js
tinymce-plugin-form-button.js
38 lines 900 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global grunionEditorView, tinymce */
2 ( function () {
3 tinymce.create( 'tinymce.plugins.grunion_form', {
4 init: function ( editor ) {
5 editor.addButton( 'grunion', {
6 title: grunionEditorView.labels.tinymce_label,
7 cmd: 'grunion_add_form',
8 icon: 'grunion',
9 } );
10 editor.addCommand( 'grunion_add_form', function () {
11 if ( grunionEditorView.default_form ) {
12 editor.execCommand(
13 'mceInsertContent',
14 0,
15 '[contact-form]' + grunionEditorView.default_form + '[/contact-form]'
16 );
17 } else {
18 editor.execCommand( 'mceInsertContent', 0, '[contact-form /]' );
19 }
20 } );
21 },
22
23 createControl: function () {
24 return null;
25 },
26
27 getInfo: function () {
28 return {
29 longname: 'Grunion Contact Form',
30 author: 'Automattic',
31 version: '1',
32 };
33 },
34 } );
35
36 tinymce.PluginManager.add( 'grunion_form', tinymce.plugins.grunion_form );
37 } )();
38