[FEATURE] RTE: Always use standards-based methods in IE9 native-mode
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 5 Jul 2012 02:06:39 +0000 (22:06 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 5 Jul 2012 02:17:29 +0000 (04:17 +0200)
Description: When IE9 is used in native IE9 mode, the RTE should
always use the standards-based methods supported by IE9.

Change-Id: I1a4b94706600c559e8468684441e6034089c16ba
Releases: 6.0
Resolves: #38656
Reviewed-on: http://review.typo3.org/12616
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
19 files changed:
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/CharacterMap/character-map.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultImage/default-image.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/default-link.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefinitionList/definition-list.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineElements/inline-elements.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/insert-smiley.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Language/language.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/MicrodataSchema/microdata-schema.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/PlainText/plain-text.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SelectFont/select-font.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Color/typo3color.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/UndoRedo/undo-redo.js
typo3/sysext/rtehtmlarea/mod6/parse_html.php

index 992653d..3a8ef48 100644 (file)
@@ -1696,7 +1696,7 @@ HTMLArea.StatusBar = Ext.extend(Ext.Container, {
        selectElement: function (element) {
                var editor = this.getEditor();
                element.blur();
        selectElement: function (element) {
                var editor = this.getEditor();
                element.blur();
-               if (!Ext.isIE) {
+               if (!HTMLArea.isIEBeforeIE9) {
                        if (/^(img|table)$/i.test(element.ancestor.nodeName)) {
                                editor.getSelection().selectNode(element.ancestor);
                        } else {
                        if (/^(img|table)$/i.test(element.ancestor.nodeName)) {
                                editor.getSelection().selectNode(element.ancestor);
                        } else {
@@ -3021,7 +3021,7 @@ HTMLArea.DOM = function () {
                                } else {
                                        if (!Ext.isOpera) {
                                                node.removeAttribute('class');
                                } else {
                                        if (!Ext.isOpera) {
                                                node.removeAttribute('class');
-                                               if (Ext.isIE) {
+                                               if (HTMLArea.isIEBeforeIE9) {
                                                        node.removeAttribute('className');
                                                }
                                        } else {
                                                        node.removeAttribute('className');
                                                }
                                        } else {
@@ -3398,9 +3398,11 @@ HTMLArea.DOM.Walker = Ext.extend(HTMLArea.DOM.Walker, {
                                continue;
                        }
                        if (Ext.isIE) {
                                continue;
                        }
                        if (Ext.isIE) {
-                                       // IE fails to put style in attributes list.
+                                       // IE before I9 fails to put style in attributes list.
                                if (attributeName === 'style') {
                                if (attributeName === 'style') {
-                                       attributeValue = node.style.cssText;
+                                       if (HTMLArea.isIEBeforeIE9) {
+                                               attributeValue = node.style.cssText;
+                                       }
                                        // May need to strip the base url
                                } else if (attributeName === 'href' || attributeName === 'src') {
                                        attributeValue = this.stripBaseURL(attributeValue);
                                        // May need to strip the base url
                                } else if (attributeName === 'href' || attributeName === 'src') {
                                        attributeValue = this.stripBaseURL(attributeValue);
index b89fcc1..3d12034 100644 (file)
@@ -62,7 +62,7 @@ HTMLArea.BlockElements = Ext.extend(HTMLArea.Plugin, {
                        }
                }
                this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
                        }
                }
                this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
-               if (Ext.isIE) {
+               if (HTMLArea.isIEBeforeIE9) {
                        this.addAllowedAttribute('className');
                }
                this.indentedList = null;
                        this.addAllowedAttribute('className');
                }
                this.indentedList = null;
@@ -314,7 +314,7 @@ HTMLArea.BlockElements = Ext.extend(HTMLArea.Plugin, {
                                }
                        }
                }
                                }
                        }
                }
-               var fullNodeTextSelected = (!Ext.isIE && parentElement.textContent === range.toString()) || (Ext.isIE && parentElement.innerText === range.text);
+               var fullNodeTextSelected = (!HTMLArea.isIEBeforeIE9 && parentElement.textContent === range.toString()) || (HTMLArea.isIEBeforeIE9 && parentElement.innerText === range.text);
                switch (buttonId) {
                        case "Indent" :
                                if (/^(ol|ul)$/i.test(parentElement.nodeName) && !(fullNodeTextSelected && !/^(li)$/i.test(parentElement.parentNode.nodeName))) {
                switch (buttonId) {
                        case "Indent" :
                                if (/^(ol|ul)$/i.test(parentElement.nodeName) && !(fullNodeTextSelected && !/^(li)$/i.test(parentElement.parentNode.nodeName))) {
@@ -866,11 +866,11 @@ HTMLArea.BlockElements = Ext.extend(HTMLArea.Plugin, {
                }
                if (endElement) {
                        var parent = endElement.parentNode;
                }
                if (endElement) {
                        var parent = endElement.parentNode;
-                       var paragraph = this.editor.document.createElement("p");
-                       if (Ext.isIE) {
-                               paragraph.innerHTML = "&nbsp";
+                       var paragraph = this.editor.document.createElement('p');
+                       if (HTMLArea.isIEBeforeIE9) {
+                               paragraph.innerHTML = '&nbsp';
                        } else {
                        } else {
-                               paragraph.appendChild(this.editor.document.createElement("br"));
+                               paragraph.appendChild(this.editor.document.createElement('br'));
                        }
                        if (after && !endElement.nextSibling) {
                                parent.appendChild(paragraph);
                        }
                        if (after && !endElement.nextSibling) {
                                parent.appendChild(paragraph);
index 6d6473b..8fe452f 100644 (file)
@@ -465,9 +465,7 @@ HTMLArea.CharacterMap = Ext.extend(HTMLArea.Plugin, {
                this.restoreSelection();
                var entity = Ext.get(target).dom.innerHTML;
                this.insertEntity(entity);
                this.restoreSelection();
                var entity = Ext.get(target).dom.innerHTML;
                this.insertEntity(entity);
-               if (Ext.isIE) {
-                       this.saveSelection();
-               }
+               this.saveSelection();
                return false;
        },
        /*
                return false;
        },
        /*
@@ -478,11 +476,11 @@ HTMLArea.CharacterMap = Ext.extend(HTMLArea.Plugin, {
         * @return      void
         */
        insertEntity: function (entity) {
         * @return      void
         */
        insertEntity: function (entity) {
-               if (Ext.isIE) {
+               if (HTMLArea.isIEBeforeIE9) {
                        this.editor.getSelection().insertHtml(entity);
                } else {
                        this.editor.getSelection().insertHtml(entity);
                } else {
-                               // Firefox and WebKit convert '&nbsp;' to '&amp;nbsp;'
-                       var node = this.editor.document.createTextNode(((Ext.isGecko || Ext.isWebKit) && entity == '&nbsp;') ? '\xA0' : entity);
+                               // Firefox, WebKit and IE convert '&nbsp;' to '&amp;nbsp;'
+                       var node = this.editor.document.createTextNode(((Ext.isGecko || Ext.isWebKit || Ext.isIE) && entity == '&nbsp;') ? '\xA0' : entity);
                        this.editor.getSelection().insertNode(node);
                        this.editor.getSelection().selectNode(node, false);
                }
                        this.editor.getSelection().insertNode(node);
                        this.editor.getSelection().selectNode(node, false);
                }
index 177ab35..171b486 100644 (file)
@@ -216,7 +216,7 @@ HTMLArea.CopyPaste = Ext.extend(HTMLArea.Plugin, {
                if (/^(a)$/i.test(parent.nodeName)) {
                        parent.normalize();
                        if (!parent.innerHTML || (parent.childNodes.length == 1 && /^(br)$/i.test(parent.firstChild.nodeName))) {
                if (/^(a)$/i.test(parent.nodeName)) {
                        parent.normalize();
                        if (!parent.innerHTML || (parent.childNodes.length == 1 && /^(br)$/i.test(parent.firstChild.nodeName))) {
-                               if (!Ext.isIE) {
+                               if (!HTMLArea.isIEBeforeIE9) {
                                        var container = parent.parentNode;
                                        this.editor.getDomNode().removeMarkup(parent);
                                                // Opera does not render empty list items
                                        var container = parent.parentNode;
                                        this.editor.getDomNode().removeMarkup(parent);
                                                // Opera does not render empty list items
index 1b1e9fe..e6bffda 100644 (file)
@@ -94,7 +94,7 @@ HTMLArea.DefaultClean = Ext.extend(HTMLArea.Plugin, {
                                if (!/\S/.test(node.className)) {
                                        if (!Ext.isOpera) {
                                                node.removeAttribute('class');
                                if (!/\S/.test(node.className)) {
                                        if (!Ext.isOpera) {
                                                node.removeAttribute('class');
-                                               if (Ext.isIE) {
+                                               if (HTMLArea.isIEBeforeIE9) {
                                                        node.removeAttribute('className');
                                                }
                                        } else {
                                                        node.removeAttribute('className');
                                                }
                                        } else {
@@ -104,7 +104,7 @@ HTMLArea.DefaultClean = Ext.extend(HTMLArea.Plugin, {
                        }
                }
                function clearStyle(node) {
                        }
                }
                function clearStyle(node) {
-                       var style = Ext.isIE ? node.style.cssText : node.getAttribute('style');
+                       var style = HTMLArea.isIEBeforeIE9 ? node.style.cssText : node.getAttribute('style');
                        if (style) {
                                var declarations = style.split(/\s*;\s*/);
                                for (var i = declarations.length; --i >= 0;) {
                        if (style) {
                                var declarations = style.split(/\s*;\s*/);
                                for (var i = declarations.length; --i >= 0;) {
@@ -116,7 +116,7 @@ HTMLArea.DefaultClean = Ext.extend(HTMLArea.Plugin, {
                        }
                }
                function stripTag(el) {
                        }
                }
                function stripTag(el) {
-                       if (Ext.isIE) {
+                       if (HTMLArea.isIEBeforeIE9) {
                                el.outerHTML = HTMLArea.util.htmlEncode(el.innerText);
                        } else {
                                var txt = document.createTextNode(HTMLArea.DOM.getInnerText(el));
                                el.outerHTML = HTMLArea.util.htmlEncode(el.innerText);
                        } else {
                                var txt = document.createTextNode(HTMLArea.DOM.getInnerText(el));
@@ -141,7 +141,7 @@ HTMLArea.DefaultClean = Ext.extend(HTMLArea.Plugin, {
                                case HTMLArea.DOM.TEXT_NODE:
                                case HTMLArea.DOM.DOCUMENT_NODE:
                                case HTMLArea.DOM.DOCUMENT_FRAGMENT_NODE:
                                case HTMLArea.DOM.TEXT_NODE:
                                case HTMLArea.DOM.DOCUMENT_NODE:
                                case HTMLArea.DOM.DOCUMENT_FRAGMENT_NODE:
-                                       if ((Ext.isIE && root.scopeName != 'HTML') || (!Ext.isIE && /:/.test(tag)) || /o:p/.test(tag)) {
+                                       if ((HTMLArea.isIEBeforeIE9 && root.scopeName != 'HTML') || (!HTMLArea.isIEBeforeIE9 && /:/.test(tag)) || /o:p/.test(tag)) {
                                                stripTag(root);
                                                return false;
                                        } else {
                                                stripTag(root);
                                                return false;
                                        } else {
index 3a65dc2..785c6f6 100644 (file)
@@ -131,7 +131,7 @@ HTMLArea.DefaultImage = Ext.extend(HTMLArea.Plugin, {
                                paddingRight:   isNaN(parseInt(this.image.style.paddingRight)) ? '' : parseInt(this.image.style.paddingRight),
                                paddingBottom:  isNaN(parseInt(this.image.style.paddingBottom)) ? '' : parseInt(this.image.style.paddingBottom),
                                paddingLeft:    isNaN(parseInt(this.image.style.paddingLeft)) ? '' : parseInt(this.image.style.paddingLeft),
                                paddingRight:   isNaN(parseInt(this.image.style.paddingRight)) ? '' : parseInt(this.image.style.paddingRight),
                                paddingBottom:  isNaN(parseInt(this.image.style.paddingBottom)) ? '' : parseInt(this.image.style.paddingBottom),
                                paddingLeft:    isNaN(parseInt(this.image.style.paddingLeft)) ? '' : parseInt(this.image.style.paddingLeft),
-                               cssFloat:       Ext.isIE ? this.image.style.styleFloat : this.image.style.cssFloat
+                               cssFloat:       HTMLArea.isIEBeforeIE9 ? this.image.style.styleFloat : this.image.style.cssFloat
                        };
                } else {
                        this.parameters = {
                        };
                } else {
                        this.parameters = {
@@ -450,7 +450,7 @@ HTMLArea.DefaultImage = Ext.extend(HTMLArea.Plugin, {
                        if (Ext.isWebKit) {
                                this.editor.getDomNode().cleanAppleStyleSpans(this.editor.document.body);
                        }
                        if (Ext.isWebKit) {
                                this.editor.getDomNode().cleanAppleStyleSpans(this.editor.document.body);
                        }
-                       if (Ext.isIE) {
+                       if (HTMLArea.isIEBeforeIE9) {
                                image = range.parentElement();
                                if (!/^img$/i.test(image.nodeName)) {
                                        image = image.previousSibling;
                                image = range.parentElement();
                                if (!/^img$/i.test(image.nodeName)) {
                                        image = image.previousSibling;
@@ -496,7 +496,7 @@ HTMLArea.DefaultImage = Ext.extend(HTMLArea.Plugin, {
                                                }
                                                break;
                                        case 'cssFloat':
                                                }
                                                break;
                                        case 'cssFloat':
-                                               if (Ext.isIE) {
+                                               if (HTMLArea.isIEBeforeIE9) {
                                                        image.style.styleFloat = value;
                                                } else {
                                                        image.style.cssFloat = value;
                                                        image.style.styleFloat = value;
                                                } else {
                                                        image.style.cssFloat = value;
index a5a702a..e697fe4 100644 (file)
@@ -320,7 +320,7 @@ HTMLArea.DefaultLink = Ext.extend(HTMLArea.Plugin, {
                        this.restoreSelection();
                        this.editor.getSelection().execCommand('CreateLink', false, href);
                        a = this.editor.getSelection().getParentElement();
                        this.restoreSelection();
                        this.editor.getSelection().execCommand('CreateLink', false, href);
                        a = this.editor.getSelection().getParentElement();
-                       if (!Ext.isIE && !/^a$/i.test(a.nodeName)) {
+                       if (!HTMLArea.isIEBeforeIE9 && !/^a$/i.test(a.nodeName)) {
                                var range = this.editor.getSelection().createRange();
                                if (range.startContainer.nodeType !== HTMLArea.DOM.TEXT_NODE) {
                                        a = range.startContainer.childNodes[range.startOffset];
                                var range = this.editor.getSelection().createRange();
                                if (range.startContainer.nodeType !== HTMLArea.DOM.TEXT_NODE) {
                                        a = range.startContainer.childNodes[range.startOffset];
index dc2efd3..bb7dfab 100644 (file)
@@ -157,7 +157,7 @@ HTMLArea.DefinitionList = Ext.extend(HTMLArea.BlockElements, {
                        if (attributeValue) newNode.setAttribute(attributeName, attributeValue);
                }
                        // In IE, the above fails to update the classname and style attributes.
                        if (attributeValue) newNode.setAttribute(attributeName, attributeValue);
                }
                        // In IE, the above fails to update the classname and style attributes.
-               if (Ext.isIE) {
+               if (HTMLArea.isIEBeforeIE9) {
                        if (node.style.cssText) {
                                newNode.style.cssText = node.style.cssText;
                        }
                        if (node.style.cssText) {
                                newNode.style.cssText = node.style.cssText;
                        }
@@ -226,7 +226,7 @@ HTMLArea.DefinitionList = Ext.extend(HTMLArea.BlockElements, {
                if (this.editor.getSelection().isEmpty() && /^dd$/i.test(parentElement.nodeName)) {
                        var list = parentElement.appendChild(this.editor.document.createElement('dl'));
                        var term = list.appendChild(this.editor.document.createElement('dt'));
                if (this.editor.getSelection().isEmpty() && /^dd$/i.test(parentElement.nodeName)) {
                        var list = parentElement.appendChild(this.editor.document.createElement('dl'));
                        var term = list.appendChild(this.editor.document.createElement('dt'));
-                       if (!Ext.isIE) {
+                       if (!HTMLArea.isIEBeforeIE9) {
                                if (Ext.isWebKit) {
                                        term.innerHTML = '<br />';
                                } else {
                                if (Ext.isWebKit) {
                                        term.innerHTML = '<br />';
                                } else {
index 61a5bee..b7bd759 100644 (file)
@@ -40,7 +40,7 @@ HTMLArea.InlineElements = Ext.extend(HTMLArea.Plugin, {
                        this.allowedAttributes = this.getPluginInstance('TextStyle').allowedAttributes;
                } else {
                        this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
                        this.allowedAttributes = this.getPluginInstance('TextStyle').allowedAttributes;
                } else {
                        this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
-                       if (Ext.isIE) {
+                       if (HTMLArea.isIEBeforeIE9) {
                                this.addAllowedAttribute('className');
                        }
                }
                                this.addAllowedAttribute('className');
                        }
                }
@@ -213,7 +213,7 @@ HTMLArea.InlineElements = Ext.extend(HTMLArea.Plugin, {
                var ancestors = editor.getSelection().getAllAncestors();
                var elementIsAncestor = false;
                var fullNodeSelected = false;
                var ancestors = editor.getSelection().getAllAncestors();
                var elementIsAncestor = false;
                var fullNodeSelected = false;
-               if (Ext.isIE) {
+               if (HTMLArea.isIEBeforeIE9) {
                        var bookmark = editor.getBookMark().get(range);
                }
                        // Check if the chosen element is among the ancestors
                        var bookmark = editor.getBookMark().get(range);
                }
                        // Check if the chosen element is among the ancestors
@@ -237,7 +237,7 @@ HTMLArea.InlineElements = Ext.extend(HTMLArea.Plugin, {
                                if (element === "bdo") {
                                        newElement.setAttribute("dir", "rtl");
                                }
                                if (element === "bdo") {
                                        newElement.setAttribute("dir", "rtl");
                                }
-                               if (!Ext.isIE) {
+                               if (!HTMLArea.isIEBeforeIE9) {
                                        if (fullNodeSelected && statusBarSelection) {
                                                if (Ext.isWebKit) {
                                                        newElement = parent.parentNode.insertBefore(newElement, statusBarSelection);
                                        if (fullNodeSelected && statusBarSelection) {
                                                if (Ext.isWebKit) {
                                                        newElement = parent.parentNode.insertBefore(newElement, statusBarSelection);
@@ -315,8 +315,8 @@ HTMLArea.InlineElements = Ext.extend(HTMLArea.Plugin, {
                                newElement.setAttribute(this.allowedAttributes[i], attributeValue);
                        }
                }
                                newElement.setAttribute(this.allowedAttributes[i], attributeValue);
                        }
                }
-                       // In IE, the above fails to update the class and style attributes.
-               if (Ext.isIE) {
+                       // In IE before IE9, the above fails to update the class and style attributes.
+               if (HTMLArea.isIEBeforeIE9) {
                        if (element.style.cssText) {
                                newElement.style.cssText = element.style.cssText;
                        }
                        if (element.style.cssText) {
                                newElement.style.cssText = element.style.cssText;
                        }
index f046e0d..1d1024d 100644 (file)
@@ -154,7 +154,7 @@ HTMLArea.InsertSmiley = Ext.extend(HTMLArea.Plugin, {
                imgTag.setAttribute('alt', target.getAttribute('ext:qtitle'));
                imgTag.setAttribute('title', target.getAttribute('ext:qtip'));
                this.editor.getSelection().insertNode(imgTag);
                imgTag.setAttribute('alt', target.getAttribute('ext:qtitle'));
                imgTag.setAttribute('title', target.getAttribute('ext:qtip'));
                this.editor.getSelection().insertNode(imgTag);
-               if (!Ext.isIE) {
+               if (!HTMLArea.isIEBeforeIE9) {
                        this.editor.getSelection().selectNode(imgTag, false);
                }
                this.close();
                        this.editor.getSelection().selectNode(imgTag, false);
                }
                this.close();
index 5300a1e..792a858 100644 (file)
@@ -55,7 +55,7 @@ HTMLArea.Language = Ext.extend(HTMLArea.Plugin, {
                }
                if (!this.allowedAttributes) {
                        this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class');
                }
                if (!this.allowedAttributes) {
                        this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class');
-                       if (Ext.isIE) {
+                       if (HTMLArea.isIEBeforeIE9) {
                                this.allowedAttributes.push('className');
                        }
                }
                                this.allowedAttributes.push('className');
                        }
                }
@@ -154,7 +154,7 @@ HTMLArea.Language = Ext.extend(HTMLArea.Plugin, {
                                var selector = 'body.htmlarea-show-language-marks *[' + 'lang="' + option.get('value') + '"]:before';
                                var style = 'content: "' + option.get('value') + ': ";';
                                var rule = selector + ' { ' + style + ' }';
                                var selector = 'body.htmlarea-show-language-marks *[' + 'lang="' + option.get('value') + '"]:before';
                                var style = 'content: "' + option.get('value') + ': ";';
                                var rule = selector + ' { ' + style + ' }';
-                               if (!Ext.isIE) {
+                               if (!HTMLArea.isIEBeforeIE9) {
                                        try {
                                                styleSheet.insertRule(rule, styleSheet.cssRules.length);
                                        } catch (e) {
                                        try {
                                                styleSheet.insertRule(rule, styleSheet.cssRules.length);
                                        } catch (e) {
@@ -247,8 +247,8 @@ HTMLArea.Language = Ext.extend(HTMLArea.Plugin, {
                        if (endPointsInSameBlock) {
                                var ancestors = this.editor.getSelection().getAllAncestors();
                                for (var i = 0; i < ancestors.length; ++i) {
                        if (endPointsInSameBlock) {
                                var ancestors = this.editor.getSelection().getAllAncestors();
                                for (var i = 0; i < ancestors.length; ++i) {
-                                       fullNodeSelected = (statusBarSelection === ancestors[i])
-                                               && ((!Ext.isIE && ancestors[i].textContent === range.toString()) || (Ext.isIE && ((this.editor.getSelection().getType() !== 'Control' && ancestors[i].innerText === range.text) || (this.editor.getSelection().getType() === 'Control' && ancestors[i].innerText === range.item(0).text))));
+                                       fullNodeSelected =  (!HTMLArea.isIEBeforeIE9 && ((statusBarSelection === ancestors[i] && ancestors[i].textContent === range.toString()) || (!statusBarSelection && ancestors[i].textContent === range.toString())))
+                                               || (HTMLArea.isIEBeforeIE9 && statusBarSelection === ancestors[i] && ((this.editor.getSelection().getType() !== 'Control' && ancestors[i].innerText === range.text) || (this.editor.getSelection().getType() === 'Control' && ancestors[i].innerText === range.item(0).text)));
                                        if (fullNodeSelected) {
                                                parent = ancestors[i];
                                                break;
                                        if (fullNodeSelected) {
                                                parent = ancestors[i];
                                                break;
@@ -274,7 +274,7 @@ HTMLArea.Language = Ext.extend(HTMLArea.Plugin, {
                                var newElement = this.editor.document.createElement('span');
                                this.setLanguageAttributes(newElement, language);
                                this.editor.getDomNode().wrapWithInlineElement(newElement, range);
                                var newElement = this.editor.document.createElement('span');
                                this.setLanguageAttributes(newElement, language);
                                this.editor.getDomNode().wrapWithInlineElement(newElement, range);
-                               if (!Ext.isIE) {
+                               if (!HTMLArea.isIEBeforeIE9) {
                                        range.detach();
                                }
                        }
                                        range.detach();
                                }
                        }
@@ -415,8 +415,8 @@ HTMLArea.Language = Ext.extend(HTMLArea.Plugin, {
                                        if (!selectionEmpty) {
                                                if (endPointsInSameBlock) {
                                                        for (var i = 0; i < ancestors.length; ++i) {
                                        if (!selectionEmpty) {
                                                if (endPointsInSameBlock) {
                                                        for (var i = 0; i < ancestors.length; ++i) {
-                                                               fullNodeSelected = (statusBarSelection === ancestors[i])
-                                                                       && ((!Ext.isIE && ancestors[i].textContent === range.toString()) || (Ext.isIE && ((this.editor.getSelection().getType() !== 'Control' && ancestors[i].innerText === range.text) || (this.editor.getSelection().getType() === 'Control' && ancestors[i].innerText === range.item(0).text))));
+                                                               fullNodeSelected =  (!HTMLArea.isIEBeforeIE9 && ((statusBarSelection === ancestors[i] && ancestors[i].textContent === range.toString()) || (!statusBarSelection && ancestors[i].textContent === range.toString())))
+                                                                       || (HTMLArea.isIEBeforeIE9 && statusBarSelection === ancestors[i] && ((this.editor.getSelection().getType() !== 'Control' && ancestors[i].innerText === range.text) || (this.editor.getSelection().getType() === 'Control' && ancestors[i].innerText === range.item(0).text)));
                                                                if (fullNodeSelected) {
                                                                        parent = ancestors[i];
                                                                        break;
                                                                if (fullNodeSelected) {
                                                                        parent = ancestors[i];
                                                                        break;
index 7f7eae8..a3ddef7 100644 (file)
@@ -139,7 +139,7 @@ HTMLArea.MicrodataSchema = Ext.extend(HTMLArea.Plugin, {
                        var selector = 'body.htmlarea-show-microdata *[' + store.storeId + '="' + option.get('name') + '"]:before';
                        var style = 'content: "' + option.get('label') + ': "; font-variant: small-caps;';
                        var rule = selector + ' { ' + style + ' }';
                        var selector = 'body.htmlarea-show-microdata *[' + store.storeId + '="' + option.get('name') + '"]:before';
                        var style = 'content: "' + option.get('label') + ': "; font-variant: small-caps;';
                        var rule = selector + ' { ' + style + ' }';
-                       if (!Ext.isIE) {
+                       if (!HTMLArea.isIEBeforeIE9) {
                                try {
                                        styleSheet.insertRule(rule, styleSheet.cssRules.length);
                                } catch (e) {
                                try {
                                        styleSheet.insertRule(rule, styleSheet.cssRules.length);
                                } catch (e) {
index bec8a32..bee14f2 100644 (file)
@@ -182,8 +182,6 @@ HTMLArea.PlainText = Ext.extend(HTMLArea.Plugin, {
                        border: false,
                        width: dimensions.width,
                        height: 'auto',
                        border: false,
                        width: dimensions.width,
                        height: 'auto',
-                               // As of ExtJS 3.1, JS error with IE when the window is resizable
-                       resizable: !Ext.isIE,
                        iconCls: this.getButton(buttonId).iconCls,
                        listeners: {
                                close: {
                        iconCls: this.getButton(buttonId).iconCls,
                        listeners: {
                                close: {
index 666cb37..27ba1ba 100644 (file)
@@ -50,7 +50,7 @@ HTMLArea.SelectFont = Ext.extend(HTMLArea.Plugin, {
                }
                if (!this.allowedAttributes) {
                        this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'style');
                }
                if (!this.allowedAttributes) {
                        this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'style');
-                       if (Ext.isIE) {
+                       if (HTMLArea.isIEBeforeIE9) {
                                this.allowedAttributes.push('className');
                        }
                }
                                this.allowedAttributes.push('className');
                        }
                }
@@ -176,7 +176,7 @@ HTMLArea.SelectFont = Ext.extend(HTMLArea.Plugin, {
                        this.setStyle(element, combo.itemId, param);
                                // Wrap the selection with span tag with the style attribute
                        editor.getDomNode().wrapWithInlineElement(element, range);
                        this.setStyle(element, combo.itemId, param);
                                // Wrap the selection with span tag with the style attribute
                        editor.getDomNode().wrapWithInlineElement(element, range);
-                       if (!Ext.isIE) {
+                       if (!HTMLArea.isIEBeforeIE9) {
                                range.detach();
                        }
                }
                                range.detach();
                        }
                }
@@ -218,7 +218,7 @@ HTMLArea.SelectFont = Ext.extend(HTMLArea.Plugin, {
                        var parentElement = statusBarSelection ? statusBarSelection : editor.getSelection().getParentElement();
                        var value = parentElement.style[this.styleProperty[select.itemId]];
                        if (!value) {
                        var parentElement = statusBarSelection ? statusBarSelection : editor.getSelection().getParentElement();
                        var value = parentElement.style[this.styleProperty[select.itemId]];
                        if (!value) {
-                               if (!Ext.isIE) {
+                               if (!HTMLArea.isIEBeforeIE9) {
                                        if (editor.document.defaultView && editor.document.defaultView.getComputedStyle(parentElement, null)) {
                                                value = editor.document.defaultView.getComputedStyle(parentElement, null).getPropertyValue(this.cssProperty[select.itemId]);
                                        }
                                        if (editor.document.defaultView && editor.document.defaultView.getComputedStyle(parentElement, null)) {
                                                value = editor.document.defaultView.getComputedStyle(parentElement, null).getPropertyValue(this.cssProperty[select.itemId]);
                                        }
index a16018c..a16e8d9 100644 (file)
@@ -51,7 +51,7 @@ HTMLArea.TYPO3Color = Ext.extend(HTMLArea.Plugin, {
                }
                if (!this.allowedAttributes) {
                        this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'style');
                }
                if (!this.allowedAttributes) {
                        this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'style');
-                       if (Ext.isIE) {
+                       if (HTMLArea.isIEBeforeIE9) {
                                this.allowedAttributes.push('className');
                        }
                }
                                this.allowedAttributes.push('className');
                        }
                }
index 37935e7..ac190bb 100644 (file)
@@ -432,7 +432,9 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                tbody.appendChild(tr);
                                for (var j = params.f_cols; --j >= 0;) {
                                        var td = doc.createElement('td');
                                tbody.appendChild(tr);
                                for (var j = params.f_cols; --j >= 0;) {
                                        var td = doc.createElement('td');
-                                       if (!Ext.isIE) td.innerHTML = '<br />';
+                                       if (!HTMLArea.isIEBeforeIE9) {
+                                               td.innerHTML = '<br />';
+                                       }
                                        tr.appendChild(td);
                                }
                        }
                                        tr.appendChild(td);
                                }
                        }
@@ -534,7 +536,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        }
                }, this);
                if (this.dialog.arguments.buttonId === "InsertTable") {
                        }
                }, this);
                if (this.dialog.arguments.buttonId === "InsertTable") {
-                       if (!Ext.isIE) {
+                       if (!HTMLArea.isIEBeforeIE9) {
                                this.editor.getSelection().insertNode(table);
                        } else {
                                table.id = "htmlarea_table_insert";
                                this.editor.getSelection().insertNode(table);
                        } else {
                                table.id = "htmlarea_table_insert";
@@ -680,7 +682,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                var buttonId = this.translateHotKey(id);
                buttonId = buttonId ? buttonId : id;
 
                var buttonId = this.translateHotKey(id);
                buttonId = buttonId ? buttonId : id;
 
-               var mozbr = !Ext.isIE ? "<br />" : "";
+               var mozbr = !HTMLArea.isIEBeforeIE9 ? "<br />" : "";
                var tableParts = ["tfoot", "thead", "tbody"];
                var tablePartsIndex = { tfoot : 0, thead : 1, tbody : 2 };
 
                var tableParts = ["tfoot", "thead", "tbody"];
                var tablePartsIndex = { tfoot : 0, thead : 1, tbody : 2 };
 
@@ -1563,8 +1565,8 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                }
                        }
                }
                                }
                        }
                }
-                       // In IE, the above fails to update the classname and style attributes.
-               if (Ext.isIE) {
+                       // In IE before IE9, the above fails to update the classname and style attributes.
+               if (HTMLArea.isIEBeforeIE9) {
                        if (element.style.cssText) {
                                newCell.style.cssText = element.style.cssText;
                        }
                        if (element.style.cssText) {
                                newCell.style.cssText = element.style.cssText;
                        }
@@ -1624,7 +1626,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
         */
        processStyle: function (element, params) {
                var style = element.style;
         */
        processStyle: function (element, params) {
                var style = element.style;
-               if (Ext.isIE) {
+               if (HTMLArea.isIEBeforeIE9) {
                        style.styleFloat = "";
                } else {
                        style.cssFloat = "";
                        style.styleFloat = "";
                } else {
                        style.cssFloat = "";
@@ -2606,7 +2608,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        parentElement = parentElement.parentNode;
                }
                if (/^(td|th)$/i.test(parentElement.nodeName)) {
                        parentElement = parentElement.parentNode;
                }
                if (/^(td|th)$/i.test(parentElement.nodeName)) {
-                       if (Ext.isIE) {
+                       if (HTMLArea.isIEBeforeIE9) {
                                range.pasteHTML('<br />');
                                range.select();
                        } else {
                                range.pasteHTML('<br />');
                                range.select();
                        } else {
index 08e0c42..656ffca 100644 (file)
@@ -63,7 +63,7 @@ HTMLArea.TextStyle = Ext.extend(HTMLArea.Plugin, {
                
                        // Allowed attributes on inline elements
                this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
                
                        // Allowed attributes on inline elements
                this.allowedAttributes = new Array('id', 'title', 'lang', 'xml:lang', 'dir', 'class', 'itemscope', 'itemtype', 'itemprop');
-               if (Ext.isIE) {
+               if (HTMLArea.isIEBeforeIE9) {
                        this.addAllowedAttribute('className');
                }
                /*
                        this.addAllowedAttribute('className');
                }
                /*
@@ -139,8 +139,8 @@ HTMLArea.TextStyle = Ext.extend(HTMLArea.Plugin, {
                if (!selectionEmpty) {
                                // The selection is not empty
                        for (var i = 0; i < ancestors.length; ++i) {
                if (!selectionEmpty) {
                                // The selection is not empty
                        for (var i = 0; i < ancestors.length; ++i) {
-                               fullNodeSelected = (Ext.isIE && ((statusBarSelection === ancestors[i] && ancestors[i].innerText === range.text) || (!statusBarSelection && ancestors[i].innerText === range.text)))
-                                                       || (!Ext.isIE && ((statusBarSelection === ancestors[i] && ancestors[i].textContent === range.toString()) || (!statusBarSelection && ancestors[i].textContent === range.toString())));
+                               fullNodeSelected = (HTMLArea.isIEBeforeIE9 && ((statusBarSelection === ancestors[i] && ancestors[i].innerText === range.text) || (!statusBarSelection && ancestors[i].innerText === range.text)))
+                                                       || (!HTMLArea.isIEBeforeIE9 && ((statusBarSelection === ancestors[i] && ancestors[i].textContent === range.toString()) || (!statusBarSelection && ancestors[i].textContent === range.toString())));
                                if (fullNodeSelected) {
                                        if (this.isInlineElement(ancestors[i])) {
                                                parent = ancestors[i];
                                if (fullNodeSelected) {
                                        if (this.isInlineElement(ancestors[i])) {
                                                parent = ancestors[i];
@@ -161,7 +161,7 @@ HTMLArea.TextStyle = Ext.extend(HTMLArea.Plugin, {
                                var newElement = editor.document.createElement('span');
                                HTMLArea.DOM.addClass(newElement, className);
                                editor.getDomNode().wrapWithInlineElement(newElement, range);
                                var newElement = editor.document.createElement('span');
                                HTMLArea.DOM.addClass(newElement, className);
                                editor.getDomNode().wrapWithInlineElement(newElement, range);
-                               if (!Ext.isIE) {
+                               if (!HTMLArea.isIEBeforeIE9) {
                                        range.detach();
                                }
                        }
                                        range.detach();
                                }
                        }
@@ -266,7 +266,7 @@ HTMLArea.TextStyle = Ext.extend(HTMLArea.Plugin, {
                        if (!selectionEmpty) {
                                for (var i = 0; i < ancestors.length; ++i) {
                                        fullNodeSelected = (statusBarSelection === ancestors[i])
                        if (!selectionEmpty) {
                                for (var i = 0; i < ancestors.length; ++i) {
                                        fullNodeSelected = (statusBarSelection === ancestors[i])
-                                               && ((!Ext.isIE && ancestors[i].textContent === range.toString()) || (Ext.isIE && ancestors[i].innerText === range.text));
+                                               && ((!HTMLArea.isIEBeforeIE9 && ancestors[i].textContent === range.toString()) || (HTMLArea.isIEBeforeIE9 && ancestors[i].innerText === range.text));
                                        if (fullNodeSelected) {
                                                if (!HTMLArea.DOM.isBlockElement(ancestors[i])) {
                                                        tagName = ancestors[i].nodeName.toLowerCase();
                                        if (fullNodeSelected) {
                                                if (!HTMLArea.DOM.isBlockElement(ancestors[i])) {
                                                        tagName = ancestors[i].nodeName.toLowerCase();
index f277c84..d40ab28 100644 (file)
@@ -162,7 +162,7 @@ HTMLArea.UndoRedo = Ext.extend(HTMLArea.Plugin, {
                var bookmark = null, bookmarkedText = null;
                        // Insert a bookmark
                if (this.getEditorMode() === 'wysiwyg' && this.editor.isEditable()) {
                var bookmark = null, bookmarkedText = null;
                        // Insert a bookmark
                if (this.getEditorMode() === 'wysiwyg' && this.editor.isEditable()) {
-                       if ((!Ext.isIE && !(Ext.isOpera && navigator.userAgent.toLowerCase().indexOf('presto/2.1') != -1)) || (Ext.isIE && this.editor.getSelection().getType() !== 'Control')) {
+                       if ((!HTMLArea.isIEBeforeIE9 && !(Ext.isOpera && navigator.userAgent.toLowerCase().indexOf('presto/2.1') != -1)) || (HTMLArea.isIEBeforeIE9 && this.editor.getSelection().getType() !== 'Control')) {
                                        // Catch error in FF when the selection contains no usable range
                                try {
                                        bookmark = this.editor.getBookMark().get(this.editor.getSelection().createRange());
                                        // Catch error in FF when the selection contains no usable range
                                try {
                                        bookmark = this.editor.getBookMark().get(this.editor.getSelection().createRange());
index 1b5ffcc..2402d73 100644 (file)
@@ -34,8 +34,6 @@ error_reporting(E_ALL & ~(E_STRICT | E_NOTICE));
 unset($MCONF);
 require ('conf.php');
 require ($BACK_PATH.'init.php');
 unset($MCONF);
 require ('conf.php');
 require ($BACK_PATH.'init.php');
-require ($BACK_PATH.'template.php');
-
 
 // Make instance:
 $SOBE = t3lib_div::makeInstance('tx_rtehtmlarea_parse_html');
 
 // Make instance:
 $SOBE = t3lib_div::makeInstance('tx_rtehtmlarea_parse_html');