BUGFIX: anchor, target, and title are not set on a link that's inserted without selection. Also when using createElement in that way firefox encodes the spaces within href parameter breaking the shortcodes. Switched to using the 'mctmp' placeholder now. (from r96623)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102328 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 01:36:12 +00:00
parent 21a6cf52cc
commit 58782bcf2a

View File

@ -240,20 +240,24 @@ LinkForm.prototype = {
else ed.dom.setAttrib(e, k, v);
});
};
function replace() {
tinymce.each(ed.dom.select('a'), function(e) {
if (e.href == 'javascript:mctmp(0);') set(e);
});
}
if(attributes.innerHTML && !ed.selection.getContent()) {
if(tinymce.isIE) var rng = ed.selection.getRng();
e = ed.getDoc().createElement('a');
e.innerHTML = attributes.innerHTML;
e.href = attributes.href;
e.href = 'javascript:mctmp(0);';
s.setNode(e);
if(tinymce.isIE) tinyMCE.activeEditor.selection.setRng(rng);
replace();
}
if (!e) {
ed.execCommand('CreateLink', false, 'javascript:mctmp(0);');
tinymce.each(ed.dom.select('a'), function(e) {
if (e.href == 'javascript:mctmp(0);') set(e);
});
replace();
} else {
if (attributes.href)
set(e);