Skip to content

Instantly share code, notes, and snippets.

@Saminou24
Created October 1, 2013 20:04
Show Gist options
  • Save Saminou24/6784283 to your computer and use it in GitHub Desktop.
Save Saminou24/6784283 to your computer and use it in GitHub Desktop.
A Pen by Nithin K.
<script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
<form method="post" action="something">
<textarea name="content" cols="100" rows="15">content</textarea>
<input type="submit" value="Save" />
</form>
tinymce.init({
selector: "textarea",
setup: function(editor) {
editor.addButton('report_design', {
type: 'menubutton',
text: 'IMAGE',
icon: false,
menu: [
{text:'Data', menu:[{text:'sub1'},{text:'sub2'}], onclick: function() {editor.insertContent('$%<i><%= "menu2" %></i>%');}}
]
});
},
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | emoticons | forecolor backcolor | print | report_design "
});

TinyMce sub menu

Customizing Tinymce editor. Trying for an image to be displayed on a menu button named IMAGE.

A Pen by Nithin K on CodePen.

License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment