javascript - TinyMCE - how to add custom insert template button for each template -


for keeping site responsiveness , applying standard grid system (i'm using zurb foundation) on custom user data entered on web application have defined templates in tinymce insert custom user data , pages on web application. includes 1 button in toolbar showing dialog selecting template , pressing ok after selected. default button provided templates plugin:

enter image description here

this dialog shown:

enter image description here

but need define custom toolbar buttons add custom templates when user press them without showing dialog. there right way on simple way in tinymce without writing of javascript codes?

referring comment

without writing of javascript codes

you have write javascript create in tinymce, doesn't have complicated. simple , straightforward approach write plugin each toolbar button create.

for instance plugin named "insert template x" be:

tinymce.pluginmanager.add('test', function(editor, url) {     editor.addbutton('test', {         text: 'test',         icon: true,         onclick: function() {             editor.insertcontent('this inserted');         }     }); }); 

find more information building , using own plugin's here: http://www.tinymce.com/wiki.php/tutorials:creating_a_plugin


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -