PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.7.9
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.7.9
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / js / mce.js

mce.js in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.7.9, at js/mce.js

34 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global tinymce */
2 /* jshint unused:false */
3 (function($) {
4 tinymce.PluginManager.add('visualizer_mce_button', function( editor, url ) {
5 editor.addButton( 'visualizer_mce_button', {
6 title: getTranslation( editor, 'plugin_label' ),
7 label: getTranslation( editor, 'plugin_label' ),
8 icon: 'visualizer-icon',
9 onclick: function() {
10 var frame = wp.media({
11 frame:'post',
12 state:'visualizer'
13 });
14 frame.open( );
15 }
16 });
17 });
18
19 /**
20 * Gets the translation from the editor (when classic editor is enabled)
21 * OR
22 * from the settings array inside the editor (when classic block inside gutenberg)
23 */
24 function getTranslation(editor, slug){
25 var string = editor.getLang('visualizer_tinymce_plugin.' + slug);
26 // if the string is the same as the slug being requested for, look in the settings.
27 if(string === '{#visualizer_tinymce_plugin.' + slug + '}'){
28 string = editor.settings.visualizer_tinymce_plugin[slug];
29 }
30 return string;
31 }
32
33 })(jQuery);
34