Hello Dibrom, JohnV or any IPB admin,
At this point, only IE users are able to mark text and apply formatting when creating or editing a post. If you would like to implement Mozilla support, too, replace the "doInsert" function of "/html/ibfcode.js" with this one (make a backup in case you screw it):
function doInsert(ibTag, ibClsTag, isSingle)
{
var isClose = false;
var obj_ta = document.REPLIER.Post;
if ( (myVersion >= 4) && is_ie && is_win) // Ensure it works for IE4up / Win only
{
if(obj_ta.isTextEdit){ // this doesn't work for NS, but it works for IE 4+ and compatible browsers
obj_ta.focus();
var sel = document.selection;
var rng = sel.createRange();
rng.colapse;
if((sel.type == "Text" || sel.type == "None") && rng != null){
if(ibClsTag != "" && rng.text.length > 0)
ibTag += rng.text + ibClsTag;
else if(isSingle)
isClose = true;
rng.text = ibTag;
}
}
else{
if(isSingle)
isClose = true;
obj_ta.value += ibTag;
}
}
else if ( obj_ta.selectionEnd )
{
var ss = obj_ta.selectionStart;
var es = obj_ta.selectionEnd;
if (es <= 2)
{
es = obj_ta.textLength;
}
var start = (obj_ta.value).substring(0, ss);
var middle = (obj_ta.value).substring(ss, es);
var end = (obj_ta.value).substring(es, obj_ta.textLength);
//-----------------------------------
// text range?
//-----------------------------------
if (obj_ta.selectionEnd - obj_ta.selectionStart > 0)
{
middle = ibTag + middle + ibClsTag;
}
else
{
middle = ibTag + middle;
if (isSingle)
{
isClose = true;
}
}
obj_ta.value = start + middle + end;
}
else
{
if(isSingle)
isClose = true;
obj_ta.value += ibTag;
}
obj_ta.focus();
return isClose;
}
Regards,
Sebastian Mares
PS: Credits for the above function go to Matt Mecham.