editor_plugin.js
34 lines
| 1 | /* |
| 2 | * Shortcoder TinyMCE plugin for inserting Shortcodes |
| 3 | */ |
| 4 | |
| 5 | (function() { |
| 6 | |
| 7 | tinymce.create( 'tinymce.plugins.SCButton',{ |
| 8 | |
| 9 | init : function(ed, url){ |
| 10 | var url = url.replace('/js/tinymce', ''); |
| 11 | ed.addButton( 'shortcoder', { |
| 12 | title : 'Insert shortcodes created using Shortcoder', |
| 13 | image : url + '/images/shortcoder.svg', |
| 14 | onclick : function(){ |
| 15 | if(typeof sc_show_insert !== 'undefined') sc_show_insert(); |
| 16 | } |
| 17 | }); |
| 18 | }, |
| 19 | |
| 20 | getInfo : function(){ |
| 21 | return { |
| 22 | longname : 'Shortcoder', |
| 23 | author : 'Aakash Chakravarthy', |
| 24 | authorurl : 'https://www.aakashweb.com/', |
| 25 | infourl : 'https://www.aakashweb.com/', |
| 26 | version : '1.3' |
| 27 | }; |
| 28 | } |
| 29 | |
| 30 | }); |
| 31 | |
| 32 | tinymce.PluginManager.add( 'shortcoder', tinymce.plugins.SCButton ); |
| 33 | |
| 34 | })(); |