Hi,
I have a problem when i try to add external plugin to CKEDITOR.
1, Structure directory is :
- MyEditor :
+ ckeditor
+ myCustomPlugins
+ mycustomconfig.js
In ckeditor :
i create a file test.html :
And in the file config.js is :
-in the myCustomPlugins directory : i create a folder helloworld
-in the folder helloworld directory : i create a file helloworld.html and a file plugin.js
helloworld.html :
plugin.js :
also image of button here.
And mycustomconfig.js :
// mypath is directory to folder helloworld plugin
I run test.html and see the firebug notify error :
this.externals is undefined
[Break on this error] m.setAttribute('type','text/javascript...,I){if(/^\/|^\w?:/.test(H))return F;
Anybody help me explain this problem? or how to add external plugin and load external config.js ? Thanks a lot of!
I have a problem when i try to add external plugin to CKEDITOR.
1, Structure directory is :
- MyEditor :
+ ckeditor
+ myCustomPlugins
+ mycustomconfig.js
In ckeditor :
i create a file test.html :
<html > <head> <title>This is test plugin</title> <script type="text/javascript" src="ckeditor.js"></script> </head> <body> <h1>Custome plugin CKEditor</h1> <textarea cols="80" id="test" name="editor1" rows="10"> This is test content ckeditor </textarea> <script type="text/javascript"> var editor = CKEDITOR.replace( 'test' ); </script> </body> </html>
And in the file config.js is :
CKEDITOR.editorConfig = function( config )
{
//config.toolbar = "Basic";
config.customConfig = '../myconfig.js';
};
-in the myCustomPlugins directory : i create a folder helloworld
-in the folder helloworld directory : i create a file helloworld.html and a file plugin.js
helloworld.html :
<html>
<head>
<title>HelloWorl CKEditor</title>
<script type="text/javascript">
var CKEDITOR = window.top.CKEDITOR || {};
</script>
</head>
<body>
<h3>This is test plugin new dialog</h3>
</body>
</html>
plugin.js :
CKEDITOR.plugins.add('helloworld',
{
requires : ['iframedialog'],
init : function(editor) {
var pluginName = 'helloworld';
var mypath = this.path;
editor.ui.addButton(
'helloworld.btn',
{
label : "My Plug-in",
command : 'helloworld.cmd',
icon : this.path + 'helloworld.gif'
}
);
var cmd = editor.addCommand('helloworld.cmd', {exec:showDialogPlugin});
CKEDITOR.dialog.addIframe(
'helloworld.dlg',
'Hello Title',
mypath + 'helloworld.html',
400,
300,
function(){
}
);
}
}
);
function showDialogPlugin(e){
e.openDialog('helloworld.dlg');
}
also image of button here.
And mycustomconfig.js :
(function() {
CKEDITOR.resourceManager.prototype.addExternal('helloworld', mypath+'helloworld/', 'plugin.js');
})();
CKEDITOR.editorConfig = function( config )
{
config.toolbar = 'Basic';
};
// mypath is directory to folder helloworld plugin
I run test.html and see the firebug notify error :
this.externals is undefined
[Break on this error] m.setAttribute('type','text/javascript...,I){if(/^\/|^\w?:/.test(H))return F;
Anybody help me explain this problem? or how to add external plugin and load external config.js ? Thanks a lot of!

Re: External Plugin