| 1 |
(function() { |
| 2 |
tinymce.create('tinymce.plugins.buttonPlugin', { |
| 3 |
init : function(ed, url) { |
| 4 |
var post_id = jQuery('input#post_ID').val(); |
| 5 |
// Register commands |
| 6 |
ed.addCommand('mcebutton', function() { |
| 7 |
ed.windowManager.open({ |
| 8 |
file : ajaxurl + '?action=accua_shortcode_button_popup&post='+ post_id, // file that contains HTML for our modal window |
| 9 |
width : 450, |
| 10 |
height : 200, |
| 11 |
inline : 1 |
| 12 |
}, { |
| 13 |
plugin_url : url |
| 14 |
}); |
| 15 |
}); |
| 16 |
|
| 17 |
// Register buttons |
| 18 |
ed.addButton('accua_fancy_button', {title : 'WordPress Contact Forms by Cimatti', cmd : 'mcebutton', image: url + '/img/cimatti-20-icon.png' }); |
| 19 |
}, |
| 20 |
|
| 21 |
getInfo : function() { |
| 22 |
return { |
| 23 |
longname : 'WordPress Contact Forms by Cimatti', |
| 24 |
author : 'Cimatti', |
| 25 |
authorurl : 'http://www.cimatti.it', |
| 26 |
infourl : 'http://www.cimatti.it/wordpress/contact-forms/', |
| 27 |
version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 28 |
}; |
| 29 |
} |
| 30 |
}); |
| 31 |
|
| 32 |
// Register plugin |
| 33 |
// first parameter is the button ID and must match ID elsewhere |
| 34 |
// second parameter must match the first parameter of the tinymce.create() function above |
| 35 |
tinymce.PluginManager.add('accua_fancy_button', tinymce.plugins.buttonPlugin); |
| 36 |
|
| 37 |
})(); |