I would like to insert link in a texte with FCKeditor but i also want that the link open a new window on click. Now, the code generated by the link function is <a href="...."> and i would like to have <a href="..." target="_blank">, is it possible to change it in the .js files ?
Fri, 05/02/2003 - 20:20
#1
RE: Open URL links in another window
The next version will probably bring this feature.
Thanks,
FredCK
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
RE: Open URL links in another window
ok i've done it manually and it works.
Thanks.
(you've forgotten a "</table>" at the end of fck_selcolor.html and it made some problems with my browser. )
RE: Open URL links in another window
Thanks for the "table" bug reporting... I'll fix it for the next version
FredCK
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
RE: Open URL links in another window
I am not sure if when you say "manual" way to pop open links in a new browser window, you mean users need to edit the html source or whether you mean modifying the fckeditor javascript code.
I ended up modifying a method in fck_actions.js such that links unconditionally are configured to pop up a new browser window. It may be useful to you; it took me a while to get it work.
Here is the code -
function decCommand(cmdId, cmdExecOpt)
{
var status = objContent.QueryStatus(cmdId) ;
if ( status != DECMDF_DISABLED && status != DECMDF_NOTSUPPORTED )
{
if (cmdExecOpt == null) cmdExecOpt = OLECMDEXECOPT_DODEFAULT ;
if (cmdId == DECMD_HYPERLINK) {
var sText = objContent.DOM.selection.createRange();
if (sText.text != null && sText.text != "")
sText.execCommand("CreateLink");
var newLinkId = sText.parentElement().sourceIndex;
objContent.DOM.all(newLinkId).setAttribute("target","_blank");
} else {
objContent.ExecCommand(cmdId, cmdExecOpt);
}
}
objContent.focus() ;
}