PluginProbe
PilotPress / stable
PilotPress vstable
trunk 1.9.2 1.9.3 1.9.5 2.0.7 stable
pilotpress / js / pilotpress_mce_plugin.js

pilotpress_mce_plugin.js in PilotPress stable, at js/pilotpress_mce_plugin.js

50 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 tinymce.PluginManager.add('pilotpress', function(editor, url)
2 {
3
4 editor.addButton('merge_fields', {
5 type: 'listbox',
6
7 text: 'Merge Fields',
8 icon: false,
9 classes: 'fixed-width btn widget',
10 onselect: function(e) {
11 if (this.value() != "" )
12 {
13 editor.insertContent("[pilotpress_field name='"+this.value()+"']");
14 }
15 },
16 values:
17 pilotpress_tiny_mce_plugin_default_fields
18 ,
19 onPostRender: function() {
20 // Select the second item by default
21 }
22 });
23
24 editor.addButton('short_codes', {
25 type: 'listbox',
26
27 text: 'Short Codes',
28 icon: false,
29 classes: 'fixed-width btn widget',
30 onselect: function(e) {
31 if (this.value() != "")
32 {
33 if (this.value() == "pilotpress_sync_contact")
34 {
35 editor.insertContent("["+this.value()+"]");
36 }
37 else
38 {
39 editor.insertContent("[show_if "+this.value()+"]content[/show_if]");
40 }
41 }
42 },
43 values:
44 pilotpress_tiny_mce_plugin_shortcodes
45 ,
46 onPostRender: function() {
47
48 }
49 });
50 });