Customizing Tinymce editor. Trying for an image to be displayed on a menu button named IMAGE.
Created
October 1, 2013 20:04
-
-
Save Saminou24/6784283 to your computer and use it in GitHub Desktop.
A Pen by Nithin K.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 " | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment