Im currently trying to write a custom plugin for tinyMCE, and load the plugin from another url.
http://www.tinymce.com/wiki.php/Tutorials:Creating_a_plugin
However, my tinyMCE uses the jQuery plugin for init, and as such I'm finding it difficult to get tinyMCE to load it.
This stackoverflow question illustrates my exact problem , however doesn't seem to have a resolution
Create and register TinyMCE plugin with jQuery
Anyone any idea how to do this? Below is my example plugin inside an anon function.
(function() {
var tinymce = $('textarea.tinymce').tinymce();
// Create a new plugin class
tinymce.create('tinymce.plugins.ExamplePlugin', {
init : function(ed, url) {
// Register an example button
ed.addButton('example', {
title : 'example.desc',
onclick : function() {
// Display an alert when the user clicks the button
ed.windowManager.alert('Hello world!');
},
'class' : 'bold' // Use the bold icon from the theme
});
}
});
// Register plugin with a short name
// Register plugin with a short name
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
})();
Tried registering the plugin on init, but get a.load not defined.
oninit: function(ed) {
ed.PluginManager.load('filemanager', '/js/admin/pub/plugins/hr-core-class.js');
}
Tried just including the file after the tinyMCE js directly, and adding the "plugin" to the plugins param. .TinyMCE continues to try and load it from the plugins folder.
