The forum operates in read-only mode. Please head to StackOverflow for support.
Hi, im working putting the combo box but just for internet explorer.. later to gecko ....put in the config file this (fck_config)::FCKConfig.ToolbarSets["Default"] = .........['FontStyle','-','FontFormat','-','FontName','-','FontSize']......// Example Font StylesFCKConfig.FontStyleNames = ';Main Header;Blue Title;Centered Title' ;FCKConfig.FontStyleValues = ';MainHeader;BlueTitle;CenteredTitle' ;In the command file put:://### Other Commands....FCKCommands['FontStyle'] = new FCKFontStyleCommand() ;FCKCommands['FontName'] = new FCKFontNameCommand() ;In the fckeditorcode_ie_2 put ::var FCKFontStyleCommand = function() { this.Name = 'FontStyle' ;}FCKFontStyleCommand.prototype.Execute = function( fontStyle ){ var oTextRange=FCK.EditorDocument.selection.createRange(); var oFont = document.createElement("FONT") ; oFont.innerHTML = oTextRange.htmlText ; var oParent = oTextRange.parentElement() ; var oFirstChild = oFont.firstChild; if (oFirstChild.nodeType == 1 && oFirstChild.outerHTML == oFont.innerHTML && (oFirstChild.tagName == "SPAN" || oFirstChild.tagName == "FONT" || oFirstChild.tagName == "P" || oFirstChild.tagName == "DIV")) { oParent.className = fontStyle ; } else { oFont.className = fontStyle ; oTextRange.pasteHTML( oFont.outerHTML ) ; }}// FCKFontStyleCommand.prototype.ExecuteFCKFontStyleCommand.prototype.GetState = function(){return FCK.GetNamedCommandValue('FontStyle');}And ready !!Bye
RE: CSS Style in FCKEditor 2.0
>How can I add a CSS combo to the editor so that I can apply styles while editing ??
RE: CSS Style in FCKEditor 2.0
RE: CSS Style in FCKEditor 2.0
RE: CSS Style in FCKEditor 2.0
Hi, im working putting the combo box but just for internet explorer.. later to gecko
....
put in the config file this (fck_config)::
FCKConfig.ToolbarSets["Default"] = ...
...
...
['FontStyle','-','FontFormat','-','FontName','-','FontSize']
...
...
// Example Font Styles
FCKConfig.FontStyleNames = ';Main Header;Blue Title;Centered Title' ;
FCKConfig.FontStyleValues = ';MainHeader;BlueTitle;CenteredTitle' ;
In the command file put::
//### Other Commands.
...
FCKCommands['FontStyle'] = new FCKFontStyleCommand() ;
FCKCommands['FontName'] = new FCKFontNameCommand() ;
In the fckeditorcode_ie_2 put ::
var FCKFontStyleCommand = function()
{
this.Name = 'FontStyle' ;
}
FCKFontStyleCommand.prototype.Execute = function( fontStyle )
{
var oTextRange=FCK.EditorDocument.selection.createRange();
var oFont = document.createElement("FONT") ;
oFont.innerHTML = oTextRange.htmlText ;
var oParent = oTextRange.parentElement() ;
var oFirstChild = oFont.firstChild;
if (oFirstChild.nodeType == 1 && oFirstChild.outerHTML == oFont.innerHTML &&
(oFirstChild.tagName == "SPAN"
|| oFirstChild.tagName == "FONT"
|| oFirstChild.tagName == "P"
|| oFirstChild.tagName == "DIV"))
{
oParent.className = fontStyle ;
}
else
{
oFont.className = fontStyle ;
oTextRange.pasteHTML( oFont.outerHTML ) ;
}
}// FCKFontStyleCommand.prototype.Execute
FCKFontStyleCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandValue('FontStyle');
}
And ready !!
Bye