PluginProbe
Snippet Shortcodes / 5.1.2
Snippet Shortcodes v5.1.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 5.1.2, at assets/js/tinymce.js

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