Very new to tinymce and attempting a sizeable (for me) customization - tried a search, but not clear enough to know what I'm looking for... working with the code below (just showing top half), everything is working great, except I cannot get the Shortcodes items to insert at the cursor loc upon click - I have tried a number of variations but nothing has worked. Is onclick still the appropriate method? Any thoughts greatly appreciated.
TxtEdit = new tinymce.Editor(id, {
inline: true,
plugins: [
"autolink lists link image charmap code insertdatetime table",
"contextmenu paste textcolor colorpicker textpattern",
],
toolbar: "undo redo | styleselect | formatselect | pastetext | bold italic underline | alignleft aligncenter alignright | forecolor backcolor | bullist numlist | link | removeformat | fontselect fontsizeselect | code",
menubar: false,
paste_word_valid_elements: "b,strong,i,em,h1,h2",
relative_urls : false,
convert_urls : false,
style_formats: [
{title: "Shortcodes", items: [
{title: 'Name', onclick: function() {editor.insertContent('[st_user_name_style target= ]');}},
{title: 'Email', onclick: function() {editor.insertContent('[st_user_email_1_style target= ]');}}
]},
{title: "Inline", items: [
{title: "Strikethrough", icon: "strikethrough", format: "strikethrough"},
{title: "Superscript", icon: "superscript", format: "superscript"},
{title: "Subscript", icon: "subscript", format: "subscript"},
{title: "Code", icon: "code", format: "code"}
]},
{title: "Blocks", items: [
{title: "Blockquote", format: "blockquote"},
{title: "Div", format: "div"},
{title: "Pre", format: "pre"}
]},