PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.0.1
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.0.1
3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 All 194 releases
convertkit / resources / backend / js / tinymce.js

tinymce.js in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 2.0.1, at resources/backend/js/tinymce.js

82 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Handles registration of TinyMCE buttons.
3 *
4 * @since 1.9.6
5 *
6 * @package ConvertKit
7 * @author ConvertKit
8 */
9
10 /**
11 * Registers the given block as a TinyMCE Plugin, with a button in
12 * the Visual Editor toolbar.
13 *
14 * @since 1.9.6
15 *
16 * @param object block Block
17 */
18 function convertKitTinyMCERegisterPlugin( block ) {
19
20 ( function( $ ) {
21
22 tinymce.PluginManager.add(
23 'convertkit_' + block.name,
24 function( editor, url ) {
25
26 // Add Button to Visual Editor Toolbar.
27 editor.addButton(
28 'convertkit_' + block.name,
29 {
30 title: block.title,
31 image: url + '../../../../' + block.icon,
32 cmd: 'convertkit_' + block.name,
33 }
34 );
35
36 // Load View when button clicked.
37 editor.addCommand(
38 'convertkit_' + block.name,
39 function() {
40
41 // Open the TinyMCE Modal.
42 editor.windowManager.open(
43 {
44 id: 'convertkit-modal-body',
45 title: block.title,
46 width: block.modal.width,
47 height: block.modal.height,
48 inline: 1,
49 buttons:[],
50 }
51 );
52
53 // Perform an AJAX call to load the modal's view.
54 $.post(
55 ajaxurl,
56 {
57 'action': 'convertkit_admin_tinymce_output_modal',
58 'nonce': convertkit_admin_tinymce.nonce,
59 'editor_type': 'tinymce',
60 'shortcode': block.name
61 },
62 function( response ) {
63
64 // Inject HTML into modal.
65 $( '#convertkit-modal-body-body' ).html( response );
66
67 // Initialize color pickers.
68 $( '.convertkit-color-picker' ).wpColorPicker();
69
70 }
71 );
72
73 }
74 );
75
76 }
77 );
78
79 } )( jQuery );
80
81 }
82