I downloaded FCKeditor 2.0 RC3 at http://www.fckeditor.net/download/default.html,
and installed it at wwwroot folder of my coldfusion server.
If you open http://220.89.242.20/FCKeditor/_samples ... mple01.cfm,
you can see the demo sentence
saying "This is some sample text. You are using FCKEditor" there.
(1) Let's select the phrase 'sample text,' and click the button "B" standing for "Bold."
Then, the phrase 'sample text' will be bolded.
(2) If you click the button 'Source,' it will say "This is some <strong>sample text</strong>.
you are using <a href="http://fckeditor.net/" target"_blank">FCKEditor</a>.
I like to change like the below.
(1) Let's select the phrase 'sample text,' and click the button "B" standing for "Bold."
Then, the phrase 'sample text' will be bolded.
(2) If you click the button 'Source,' it will say "This is some <b>sample text</b>.
you are using <a href="http://fckeditor.net/" target"_blank">FCKEditor</a>.
In order to change <strong>blah</strong> into <b>blah</b>,
How should I do?
Tue, 04/26/2005 - 11:33
#1
RE: changing <strong></strong> into <b></b&
If you still really need <b> for some reason (i.e. you need to support nutscrape or ie 3) then can you do a regexp/string replace on the server side?
i.e., in php
Whoops...
/<([\/]*)strong>/
RE: changing <strong></strong> into <b></b&
(Q1) Is changing <strong></stong> into <b></b> so difficult one?
(Q2) Is it possible?
RE: changing <strong></strong> into <b></b&
2. Possible;)
Bolding text is done via browsers' internal commands. All you need is to make your own bolding object with methods (below example from me) and either append it to your editor 'the plugin way' or put it into fck_othercommands.js and add the following lines:
case 'Bold' : oCommand = new FCKBoldCommand() ; break ;
case 'Italic' : oCommand = new FCKItalicCommand() ; break ;
to CKCommands.GetCommand (into the switch statement starting some line 3.
// NOTE: unification of bold & italic text tag
var FCKBoldCommand = function()
{
this.Name = 'Bold';
}
FCKBoldCommand.prototype.Execute = function()
{
b = new FCKStyleDef("Bold","b");
if(FCKSelection.GetType() == "Text")
{
b.ApplyToSelection();
}
return true;
}
FCKBoldCommand.prototype.GetState = function()
{
; //didn't figure how to make the button behave the proper way yet
}
Cheers
7ac