When applying a style to a piece of text changes any relative paths in links and images to absolute paths. This appears to be due to the use of pasteHTML. Not sure what the best workaround is but here is what I did.
fck_action.js
In the doStyle function replace:
oFont.className = command.value ;
oTextRange.pasteHTML( oFont.outerHTML ) ;
with:
objContent.DOM.execCommand('FontName',0,'CLASSPLACEHOLDERREPLACE');
var parSel;
var psFonts = objContent.DOM.all.tags("FONT");
if (psFonts != null) {
for (var i = psFonts.length - 1; i >= 0; i--) {
if (psFonts[i].face == 'CLASSPLACEHOLDERREPLACE') { parSel = psFonts[i];
parSel.className = command.value;
parSel.removeAttribute('face');
}
}
}
This will insert a font tag with a bogus face name of 'CLASSPLACEHOLDERREPLACE'. It then searches for the tag with the bogus face name, sets the class, and deletes the face attribute. Seems to work well and keeps your paths relative.
fck_action.js
In the doStyle function replace:
oFont.className = command.value ;
oTextRange.pasteHTML( oFont.outerHTML ) ;
with:
objContent.DOM.execCommand('FontName',0,'CLASSPLACEHOLDERREPLACE');
var parSel;
var psFonts = objContent.DOM.all.tags("FONT");
if (psFonts != null) {
for (var i = psFonts.length - 1; i >= 0; i--) {
if (psFonts[i].face == 'CLASSPLACEHOLDERREPLACE') { parSel = psFonts[i];
parSel.className = command.value;
parSel.removeAttribute('face');
}
}
}
This will insert a font tag with a bogus face name of 'CLASSPLACEHOLDERREPLACE'. It then searches for the tag with the bogus face name, sets the class, and deletes the face attribute. Seems to work well and keeps your paths relative.