PluginProbe
Snippet Shortcodes / 5.2.1
Snippet Shortcodes v5.2.1
5.2.1 5.2 5.1.8 5.1.6 5.1.7 5.1.5 trunk 1.0 1.1 1.2 1.3 1.3.1 1.4 1.5 1.5.1 1.6 1.6.1 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.8 2.0 2.0.1 All 74 releases
shortcode-variables / assets / js / tinymce.js

tinymce.js in Snippet Shortcodes 5.2.1, at assets/js/tinymce.js

53 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function() {
2
3 tinymce.PluginManager.add( 'sh_cd_tinymce_button', function( editor, url ) {
4
5 editor.addButton( 'sh_cd_tinymce_button', {
6 title: sh_cd_tinymce[ 'button-text' ],
7 image: sh_cd_tinymce[ 'button-image' ],
8 type: 'menubutton',
9 icon: false,
10 menu: [
11 {
12 text: 'Your shortcodes',
13 onclick: function() {
14 sh_cd_tinymce_popup( editor, sh_cd_tinymce[ 'values-your' ] );
15 }
16 },
17 {
18 text: 'Premade shortcodes',
19 onclick: function() {
20 sh_cd_tinymce_popup( editor, sh_cd_tinymce[ 'values-premade' ] );
21 }
22 }
23 ]
24 });
25 });
26
27 /**
28 * Render pop up
29 * @param editor
30 * @param values
31 */
32 function sh_cd_tinymce_popup( editor, values ) {
33
34 editor.windowManager.open( {
35 title: sh_cd_tinymce[ 'dialog-title' ],
36 width: 400,
37 height:80,
38 body: [
39 {
40 type: 'listbox',
41 width: 400,
42 name: 'shortcode',
43 label: sh_cd_tinymce[ 'dialog-label' ],
44 'values': values
45 }
46 ],
47 onsubmit: function( e ) {
48 editor.insertContent( e.data.shortcode );
49 }
50 });
51 }
52
53 })();