Added feature #14059: htmlArea RTE: Cleanup use of editor focus method
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 10 Apr 2010 23:54:05 +0000 (23:54 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 10 Apr 2010 23:54:05 +0000 (23:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7281 709f56b5-9817-0410-a4d7-c38de5d9e867

12 files changed:
ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultInline/default-inline.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefinitionList/definition-list.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js

index c93204e..1b231b9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
        * Added feature #14051: htmlArea RTE: Streamline the RTE loading process
        * Added feature #14057: htmlArea RTE: Extjize the RTE ajax requests.
        * Added feature #14058: htmlArea RTE: update some WebKit dom methods.
+       * Added feature #14059: htmlArea RTE: Cleanup use of editor focus method
 
 2010-04-09  Michael Stucki  <michael@typo3.org>
 
index ecd28ce..d10c887 100644 (file)
@@ -3,6 +3,7 @@
        * Added feature #14051: htmlArea RTE: Streamline the RTE loading process
        * Added feature #14057: htmlArea RTE: Extjize the RTE ajax requests.
        * Added feature #14058: htmlArea RTE: update some WebKit dom methods.
+       * Added feature #14059: htmlArea RTE: Cleanup use of editor focus method
 
 2010-04-08  Stanislas Rolland  <typo3@sjbr.ca>
 
index 8ac4522..41e0037 100644 (file)
@@ -62,8 +62,8 @@ HTMLArea.Editor.prototype.emptySelection = function(selection) {
        } else {
                selection.removeAllRanges();
        }
-       if (HTMLArea.is_opera) {
-               this._iframe.focus();
+       if (Ext.isOpera) {
+               this.focus();
        }
 };
 
@@ -118,7 +118,7 @@ HTMLArea.Editor.prototype._createRange = function(sel) {
  * Select a node AND the contents inside the node
  */
 HTMLArea.Editor.prototype.selectNode = function(node, endPoint) {
-       this.focusEditor();
+       this.focus();
        var selection = this._getSelection();
        var range = this._doc.createRange();
        if (node.nodeType == 1 && node.nodeName.toLowerCase() == "body") {
@@ -141,7 +141,7 @@ HTMLArea.Editor.prototype.selectNode = function(node, endPoint) {
  * Select ONLY the contents inside the given node
  */
 HTMLArea.Editor.prototype.selectNodeContents = function(node, endPoint) {
-       this.focusEditor();
+       this.focus();
        var selection = this._getSelection();
        var range = this._doc.createRange();
        if (Ext.isWebKit) {
@@ -160,7 +160,6 @@ HTMLArea.Editor.prototype.selectNodeContents = function(node, endPoint) {
        this.emptySelection(selection);
        this.addRangeToSelection(selection, range);
 };
-
 HTMLArea.Editor.prototype.rangeIntersectsNode = function(range, node) {
        var nodeRange = this._doc.createRange();
        try {
@@ -181,7 +180,6 @@ HTMLArea.Editor.prototype.rangeIntersectsNode = function(range, node) {
        return (range.compareBoundaryPoints(range.END_TO_START, nodeRange) == -1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == 1) ||
                (range.compareBoundaryPoints(range.END_TO_START, nodeRange) == 1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == -1);
 };
-
 /*
  * Get the selection type
  */
@@ -413,7 +411,7 @@ HTMLArea.Editor.prototype.selectRange = function (range) {
  * Split the text node, if needed.
  */
 HTMLArea.Editor.prototype.insertNodeAtSelection = function(toBeInserted) {
-       this.focusEditor();
+       this.focus();
        var range = this._createRange(this._getSelection());
        range.deleteContents();
        var toBeSelected = (toBeInserted.nodeType === 11) ? toBeInserted.lastChild : toBeInserted;
@@ -426,7 +424,7 @@ HTMLArea.Editor.prototype.insertNodeAtSelection = function(toBeInserted) {
  * Delete the current selection, if any.
  */
 HTMLArea.Editor.prototype.insertHTML = function(html) {
-       this.focusEditor();
+       this.focus();
        var fragment = this._doc.createDocumentFragment();
        var div = this._doc.createElement("div");
        div.innerHTML = html;
@@ -539,7 +537,7 @@ HTMLArea.Editor.prototype._checkBackspace = function() {
  */
 HTMLArea.Editor.prototype._checkInsertP = function() {
        var editor = this;
-       this.focusEditor();
+       this.focus();
        var i, left, right, rangeClone,
                sel     = this._getSelection(),
                range   = this._createRange(sel),
index c307970..7d6e898 100644 (file)
@@ -57,7 +57,7 @@ HTMLArea.Editor.prototype._createRange = function(sel) {
                var sel = this._getSelection();
        }
        if (sel.type.toLowerCase() == "none") {
-               this.focusEditor();
+               this.focus();
        }
        return sel.createRange();
 };
@@ -66,7 +66,7 @@ HTMLArea.Editor.prototype._createRange = function(sel) {
  * Select a node AND the contents inside the node
  */
 HTMLArea.Editor.prototype.selectNode = function(node) {
-       this.focusEditor();
+       this.focus();
        this.forceRedraw();
        var range = this._doc.body.createTextRange();
        range.moveToElementText(node);
@@ -77,7 +77,7 @@ HTMLArea.Editor.prototype.selectNode = function(node) {
  * Select ONLY the contents inside the given node
  */
 HTMLArea.Editor.prototype.selectNodeContents = function(node, endPoint) {
-       this.focusEditor();
+       this.focus();
        this.forceRedraw();
        var range = this._doc.body.createTextRange();
        range.moveToElementText(node);
@@ -91,7 +91,7 @@ HTMLArea.Editor.prototype.selectNodeContents = function(node, endPoint) {
  * Determine whether the node intersects the range
  */
 HTMLArea.Editor.prototype.rangeIntersectsNode = function(range, node) {
-       this.focusEditor();
+       this.focus();
        var nodeRange = this._doc.body.createTextRange();
        nodeRange.moveToElementText(node);
        return (range.compareEndPoints("EndToStart", nodeRange) == -1 && range.compareEndPoints("StartToEnd", nodeRange) == 1) ||
index ec8f94f..5326f55 100644 (file)
@@ -2778,6 +2778,9 @@ HTMLArea.Editor.prototype.forceRedraw = function() {
 
 /*
  * Focus the editor iframe window or the textarea.
+ ***********************************************
+ * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.4 *
+ ***********************************************
  */
 HTMLArea.Editor.prototype.focusEditor = function() {
        this.focus();
@@ -2786,6 +2789,9 @@ HTMLArea.Editor.prototype.focusEditor = function() {
 
 /*
  * Check if any plugin has an opened window
+ ***********************************************
+ * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.4 *
+ ***********************************************
  */
 HTMLArea.Editor.prototype.hasOpenedWindow = function () {
        for (var plugin in this.plugins) {
index 685a7c4..b8fe590 100644 (file)
@@ -266,7 +266,7 @@ BlockElements = HTMLArea.Plugin.extend({
                                        if (HTMLArea.is_ie) {
                                                element = "<" + element + ">";
                                        }
-                                       this.editor.focusEditor();
+                                       this.editor.focus();
                                        if (HTMLArea.is_safari && !this.editor._doc.body.hasChildNodes()) {
                                                this.editor._doc.body.appendChild((this.editor._doc.createElement("br")));
                                        }
@@ -294,7 +294,7 @@ BlockElements = HTMLArea.Plugin.extend({
                        // Could be a button or its hotkey
                var buttonId = this.translateHotKey(id);
                buttonId = buttonId ? buttonId : id;
-               this.editor.focusEditor();
+               this.editor.focus();
                var selection = editor._getSelection();
                var range = editor._createRange(selection);
                var statusBarSelection = this.editor.statusBar ? this.editor.statusBar.getSelection() : null;
index d79d847..191b8fe 100644 (file)
@@ -145,7 +145,7 @@ BlockStyle = HTMLArea.Plugin.extend({
         */
        onChange : function (editor, combo, record, index) {
                var className = combo.getValue();
-               this.editor.focusEditor();
+               this.editor.focus();
                var blocks = this.getSelectedBlocks();
                for (var k = 0; k < blocks.length; ++k) {
                        var parent = blocks[k];
index 08c0dc9..23c61cc 100644 (file)
@@ -106,7 +106,7 @@ CopyPaste = HTMLArea.Plugin.extend({
                        // Could be a button or its hotkey
                var buttonId = this.translateHotKey(id);
                buttonId = buttonId ? buttonId : id;
-               this.editor.focusEditor();
+               this.editor.focus();
                if (!this.applyToTable(buttonId, target)) {
                                // If we are not handling table cells
                        switch (buttonId) {
index f1c273d..6f41e98 100644 (file)
@@ -90,7 +90,7 @@ DefaultInline = HTMLArea.Plugin.extend({
                        // Could be a button or its hotkey
                var buttonId = this.translateHotKey(id);
                buttonId = buttonId ? buttonId : id;
-               editor.focusEditor();
+               editor.focus();
                try {
                        editor._doc.execCommand(buttonId, false, null);
                }
index 182aee8..718a72e 100644 (file)
@@ -113,7 +113,7 @@ DefinitionList = BlockElements.extend({
                        // Could be a button or its hotkey
                var buttonId = this.translateHotKey(id);
                buttonId = buttonId ? buttonId : id;
-               this.editor.focusEditor();
+               this.editor.focus();
                var selection = editor._getSelection();
                var range = editor._createRange(selection);
                var statusBarSelection = this.editor.statusBar ? this.editor.statusBar.getSelection() : null;
index eb42465..db999ca 100644 (file)
@@ -192,7 +192,7 @@ TYPO3Link = HTMLArea.Plugin.extend({
         */
        createLink : function(theLink,cur_target,cur_class,cur_title,additionalValues) {
                var selection, range, anchorClass, imageNode = null, addIconAfterLink;
-               this.editor.focusEditor();
+               this.editor.focus();
                this.restoreSelection();
                var node = this.editor.getParentElement();
                var el = HTMLArea.getElementObject(node, "a");
@@ -251,7 +251,7 @@ TYPO3Link = HTMLArea.Plugin.extend({
        * This function is called from the TYPO3 link popup and from the context menu.
        */
        unLink : function() {
-               this.editor.focusEditor();
+               this.editor.focus();
                this.restoreSelection();
                var node = this.editor.getParentElement();
                var el = HTMLArea.getElementObject(node, "a");
index 82e6edd..5e67935 100644 (file)
@@ -162,7 +162,7 @@ TextStyle = HTMLArea.Plugin.extend({
                var classNames = null;
                var fullNodeSelected = false;
                
-               this.editor.focusEditor();
+               this.editor.focus();
                var selection = this.editor._getSelection();
                var statusBarSelection = this.editor.statusBar ? this.editor.statusBar.getSelection() : null;
                var range = this.editor._createRange(selection);