Lets say I have CKEditor 4.3 installed (which I do) with the jquery loader. I've loaded a plugin (lets called it 'foobar') which almost does what I want it to. There is a function within the plugin's plugin.js file which I would like to call manually in-page. For this example, lets call the function hello().
I want to call it when a particular link is clicked.
How can I reference the function within the ckeditor plugin?
Here is the plugin.js structure:
(function() {
if (!supportsLocalStorage()) {
CKEDITOR.plugins.add("foobar", {}); //register a dummy plugin to pass CKEditor plugin initialization process
return;
}
CKEDITOR.plugins.add("foobar", {
lang: 'de,en,jp,pl,pt-br,sv,zh,zh-cn', // %REMOVE_LINE_CORE%
version: 0.10,
init: function(editor) {
CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(CKEDITOR.plugins.getPath('foobar') + 'css/foobar.min.css'));
if (typeof (jQuery) === 'undefined') {
CKEDITOR.scriptLoader.load('//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', function() {
jQuery.noConflict();
loadPlugin(editor);
});
} else {
CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(CKEDITOR.plugins.getPath('foobar') + 'js/extensions.min.js'), function() {
loadPlugin(editor);
});
}
}
});
function loadPlugin(editorInstance) {
/*
load of random stuff that isn't important for this example..
*/
}
var hello = function() {
alert('hello!');
};
}