[BUGFIX] RTE link insertion issues with IE9
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 28 Jun 2012 18:28:09 +0000 (14:28 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 28 Jun 2012 18:45:02 +0000 (20:45 +0200)
Problem: inRange method not supported by standard range object used
with IE9.
Solution: Use standards-based method with IE9

Note: Thanks to Johannes Pfeiffer

Change-Id: Iccf230e6103e72953e49eb1a4dde967f3e65a5b7
Releases: 4.7, 6.0
Resolve: #38300
Reviewed-on: http://review.typo3.org/12422
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js

index 8055323..e88edc9 100644 (file)
@@ -285,7 +285,7 @@ HTMLArea.TYPO3Link = Ext.extend(HTMLArea.Plugin, {
                }
                if (HTMLArea.classesAnchorSetup) {
                        var range = this.editor.getSelection().createRange();
-                       if (!Ext.isIE) {
+                       if (!(Ext.isIE6 || Ext.isIE7 || Ext.isIE8)) {
                                this.cleanAllLinks(node, range, false);
                        } else {
                                this.cleanAllLinks(node, range, true);
@@ -316,7 +316,7 @@ HTMLArea.TYPO3Link = Ext.extend(HTMLArea.Plugin, {
        setLinkAttributes: function(node, range, cur_target, cur_class, cur_title, imageNode, addIconAfterLink, additionalValues) {
                if (/^a$/i.test(node.nodeName)) {
                        var nodeInRange = false;
-                       if (!Ext.isIE) {
+                       if (!(Ext.isIE6 || Ext.isIE7 || Ext.isIE8)) {
                                this.editor.focus();
                                nodeInRange = HTMLArea.DOM.rangeIntersectsNode(range, node);
                        } else {
@@ -347,7 +347,7 @@ HTMLArea.TYPO3Link = Ext.extend(HTMLArea.Plugin, {
                                } else {
                                        if (!Ext.isOpera) {
                                                node.removeAttribute('class');
-                                               if (Ext.isIE) {
+                                               if (Ext.isIE6 || Ext.isIE7 || Ext.isIE8) {
                                                        node.removeAttribute('className');
                                                }
                                        } else {
@@ -411,7 +411,7 @@ HTMLArea.TYPO3Link = Ext.extend(HTMLArea.Plugin, {
        cleanAllLinks: function(node, range, keepLinks) {
                if (/^a$/i.test(node.nodeName)) {
                        var intersection = false;
-                       if (!Ext.isIE) {
+                       if (!(Ext.isIE6 || Ext.isIE7 || Ext.isIE8)) {
                                this.editor.focus();
                                intersection = HTMLArea.DOM.rangeIntersectsNode(range, node);
                        } else {