Instead of having static HTML create the FCKEditor and plugin dialogs it would be nice if all dialogs was described using the following syntax (just a roughly example):
dialogLayout = {
title : 'Dialog title',
buttons : [{
text : 'Save / Set',
handler : function() {
// functionality
}
},{
text : 'Cancel,
handler : function() {
// functionality
}
}],
panels : [{
text : 'Tab #1',
type : 'borderlayout',
items : [{
...
}]
},{
text : 'Tab #2',
layout : [{
...
}]
}]
}
Take a look at how ExtJS does this.
Why would we want this? Well... as said earlier I would like to use ExtJS's popups, someone else will use FCKEditor standard popups and others will use popups from other APIs. The core FCKEditor should load a plugin to render its dialogs based on this syntax, and I will load another plugin to render it using ExtJS.
Maybe this could also be implemented for toolbars, buttons etc....
dialogLayout = {
title : 'Dialog title',
buttons : [{
text : 'Save / Set',
handler : function() {
// functionality
}
},{
text : 'Cancel,
handler : function() {
// functionality
}
}],
panels : [{
text : 'Tab #1',
type : 'borderlayout',
items : [{
...
}]
},{
text : 'Tab #2',
layout : [{
...
}]
}]
}
Take a look at how ExtJS does this.
Why would we want this? Well... as said earlier I would like to use ExtJS's popups, someone else will use FCKEditor standard popups and others will use popups from other APIs. The core FCKEditor should load a plugin to render its dialogs based on this syntax, and I will load another plugin to render it using ExtJS.
Maybe this could also be implemented for toolbars, buttons etc....
Re: Dialog layouts... (and buttons, toolbars etc.)
One of the ideas I have in mind is making it possible to download FCKeditor from a CDN. So, http://www.example.com can download FCKeditor from cdn.fckeditor.net (this is an example only
).
In the above scenario, there are some things we have to consider, regarding the way browser's download, render and execute resources:
So, for HTML files, we have a limitation on using CDNs. This is not a CDN only issue, but a limit to any effort on using a central domain to deliver FCKeditor.
The solution would be avoiding using HTML files at all. So, FCKeditor should be composed by image files, CSS files and JavaScript files only. And here we have many layout related issues.
All layout definitions should come from JavaScript files, instead of HTML files. For that, we would have two options:
1) Include the entire HTML of the dialog in a single string variable.
Advantages:
Disadvantages:
2) Define the dialog structure by defining a rich components definition (something similar to your proposal).
Advantages:
Disadvantages:
I'm sure many points are missing in the above considerations. I'm still not sure though which solution would be applicable, feasible and adequate "considering all aspects".
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn