First of all, the correct way to mark it up now is by using <strong> instead of <b>. Bold is a visual tag and only makes sense for a visual representation of a word, strong (whilst looking the same as <b> when viewing in a browser) is more accessible for people browsing your site using other methods (i.e. a screen reader). Similarly you should use <em> rather than <i> (you cannot say something bold, you can say it strong, you cannot say something italic, you can say something emphasised).
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?
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 }
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