Hey everyone,
In our site, we have a fairly large message board that uses FCKeditor 2.6.3 as its main post editor. I'm trying to implement a new feature for our members that allows them to store their default font settings for the board. Now I've already got the saving and everything working. On the fly, everytime they choose to reply or edit their post, the FCKeditor_OnComplete function has access to all their stored preferences.
What I have available are font name (exactly as it appears in FCKeditor), font color (6 character hex), font size (large, x-large, etc.), bold (true/false), and italic (true/false). Now I am able to enable the bold and italic easily using the following commands:
oEditor.Commands.GetCommand('Bold').Execute();
oEditor.Commands.GetCommand('Italic').Execute();
But I'm not sure how to dynamically load the other 3 options (Font Name, Font Color, Font Size). Running GetCommand('TextColor') returns a class with a SetColor function. But I don't know what the format for passing the color is supposed to be (like should it be #FFFFFF or just FFFFF or some object...). And for FontName and FontSize, the Command instance returned from GetCommand does not have any easily deciphered functions (just GetState, Name, and Execute). Execute takes in 2 parameters according to fckeditorcode_gecko.js (A, B). B is some sort of class instance, from what I can tell. I could not find documentation anywhere on this.
So I'm totally stuck here. How can I fix this? Thanks for the help.
In our site, we have a fairly large message board that uses FCKeditor 2.6.3 as its main post editor. I'm trying to implement a new feature for our members that allows them to store their default font settings for the board. Now I've already got the saving and everything working. On the fly, everytime they choose to reply or edit their post, the FCKeditor_OnComplete function has access to all their stored preferences.
What I have available are font name (exactly as it appears in FCKeditor), font color (6 character hex), font size (large, x-large, etc.), bold (true/false), and italic (true/false). Now I am able to enable the bold and italic easily using the following commands:
oEditor.Commands.GetCommand('Bold').Execute();
oEditor.Commands.GetCommand('Italic').Execute();
But I'm not sure how to dynamically load the other 3 options (Font Name, Font Color, Font Size). Running GetCommand('TextColor') returns a class with a SetColor function. But I don't know what the format for passing the color is supposed to be (like should it be #FFFFFF or just FFFFF or some object...). And for FontName and FontSize, the Command instance returned from GetCommand does not have any easily deciphered functions (just GetState, Name, and Execute). Execute takes in 2 parameters according to fckeditorcode_gecko.js (A, B). B is some sort of class instance, from what I can tell. I could not find documentation anywhere on this.
So I'm totally stuck here. How can I fix this? Thanks for the help.
Re: Loading font settings dynamically - how to?
It's just oEditor.Commands.GetCommand('TextColor').SetColor('XXXXXX');
After much source code reading, I'm still not able to find an API call to force a selection from the FontName and FontSize dropdowns.