var somevar = new FCKEditor.core.addButton({
text:"Bold",
tooltip:"",
listeners:{
'click' : function() {
// Do some stuff here....
},
'activate' : function() {
// Do some stuff here....
},
'inactivate' : function() {
// Do some stuff here....
}
}
});
That's certainly a bad example. FCKeditor does provide a way to handle events without caring about the browser, but you know, there are people that take the easy route, just copy and paste something that they have used in other place and then try to help other people with that code that is far from ideal.
Writing good docs and examples is a very important task, not only have the functions available in the API.
Okay, so I might have found a bad example. Maybe we can work together to build a better documentation for V3. I will be happy to contribute ideas.
I can't say that I like the way the current implementation work. Why have more than one global variable? I'm refering to FCKEditorAPI and FCKEditor_OnComplete? Why not have only one name in the global space? I know that there will probably never be any other APIs using any of these global names... Please consider having events before, during and after all actions that might be extended. It could make FCKEditor stand out from the rest.
Re: Event-driven API
Re: Event-driven API
http://docs.fckeditor.net/FCKeditor_2.x ... OnkeyEvent
var somevar = new FCKEditor.core.addButton({ text:"Bold", tooltip:"", listeners:{ 'click' : function() { // Do some stuff here.... }, 'activate' : function() { // Do some stuff here.... }, 'inactivate' : function() { // Do some stuff here.... } } });Re: Event-driven API
FCKeditor does provide a way to handle events without caring about the browser, but you know, there are people that take the easy route, just copy and paste something that they have used in other place and then try to help other people with that code that is far from ideal.
Writing good docs and examples is a very important task, not only have the functions available in the API.
Re: Event-driven API
http://docs.fckeditor.net/FCKeditor_2.x ... API#Events
http://docs.fckeditor.net/index.php?tit ... ent_Driven
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: Event-driven API
I can't say that I like the way the current implementation work. Why have more than one global variable? I'm refering to FCKEditorAPI and FCKEditor_OnComplete? Why not have only one name in the global space? I know that there will probably never be any other APIs using any of these global names... Please consider having events before, during and after all actions that might be extended. It could make FCKEditor stand out from the rest.