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.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96623 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Mateusz Uzdowski 2010-01-11 20:07:51 +00:00 committed by Sam Minnee
parent 57e8693dc9
commit d5a04edf02

View File

@ -242,20 +242,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);