mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
21a6cf52cc
commit
58782bcf2a
14
javascript/tiny_mce_improvements.js
vendored
14
javascript/tiny_mce_improvements.js
vendored
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user