PluginProbe
Snippet Shortcodes / 4.2.2
Snippet Shortcodes v4.2.2
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 4.2.2, at assets/js/tinymce.js

70 lines 2.3 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 text: sh_cd_tinymce[ 'button-text' ],
7 type: 'menubutton',
8 icon: false,
9 menu: [
10 {
11 text: 'Your shortcodes',
12 onclick: function() {
13
14 if ( true !== sh_cd_tinymce[ 'premium' ] ) {
15
16 if( true === confirm( sh_cd_tinymce[ 'upgrade-text' ] ) ) {
17 window.location.href = sh_cd_tinymce[ 'upgrade-url' ];
18 }
19
20 } else {
21 sh_cd_tinymce_popup( editor, sh_cd_tinymce[ 'values-your' ] );
22 }
23 }
24 },
25 {
26 text: 'Premade shortcodes',
27 onclick: function() {
28
29 if ( true !== sh_cd_tinymce[ 'premium' ] ) {
30
31 if( true === confirm( sh_cd_tinymce[ 'upgrade-text' ] ) ) {
32 window.location.href = sh_cd_tinymce[ 'upgrade-url' ];
33 }
34
35 } else {
36 sh_cd_tinymce_popup( editor, sh_cd_tinymce[ 'values-premade' ] );
37 }
38 }
39 }
40 ]
41 });
42 });
43
44 /**
45 * Render pop up
46 * @param editor
47 * @param values
48 */
49 function sh_cd_tinymce_popup( editor, values ) {
50
51 editor.windowManager.open( {
52 title: sh_cd_tinymce[ 'dialog-title' ],
53 width: 400,
54 height:80,
55 body: [
56 {
57 type: 'listbox',
58 width: 400,
59 name: 'shortcode',
60 label: sh_cd_tinymce[ 'dialog-label' ],
61 'values': values
62 }
63 ],
64 onsubmit: function( e ) {
65 editor.insertContent( e.data.shortcode );
66 }
67 });
68 }
69
70 })();