* Remove exception catching in htmlArea RTE when setting styleWithCSS
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 2 Nov 2007 18:18:55 +0000 (18:18 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 2 Nov 2007 18:18:55 +0000 (18:18 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2655 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index 7f3b0cf..e202045 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 2007-11-02  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Fixed feature #6579: Small correction to FE htmlArea RTE
+       * Remove exception catching in htmlArea RTE when setting styleWithCSS
 
 2007-11-01  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
index b2e26c5..16817cf 100644 (file)
@@ -1,6 +1,7 @@
 2007-11-02  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Fixed feature #6579: Small correction to FE htmlArea RTE
+       * Remove exception catching in htmlArea RTE when setting styleWithCSS
 
 2007-11-01  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
index f92710a..97c5891 100644 (file)
@@ -78,8 +78,9 @@ HTMLArea.prototype._initEditMode = function () {
                        HTMLArea._addEvent(nestedObj, 'DOMAttrModified', listenerFunction);
                }
        }
-       try { this._doc.execCommand("useCSS", false, !this.config.useCSS); } catch (e) {};
-       try { this._doc.execCommand("styleWithCSS", false, this.config.useCSS); } catch (e) {};
+       if (this._doc.queryCommandEnabled("insertbronreturn")) this._doc.execCommand("insertbronreturn", false, this.config.disableEnterParagraphs);
+       if (this._doc.queryCommandEnabled("styleWithCSS")) this._doc.execCommand("styleWithCSS", false, this.config.useCSS);
+               else if (this._doc.queryCommandEnabled("useCSS")) this._doc.execCommand("useCSS", false, !this.config.useCSS);
        return true;
 };
 
@@ -313,8 +314,9 @@ HTMLArea.NestedHandler = function(ev,editor,nestedObj,noOpenCloseAction) {
                                                if (editor.config.sizeIncludesToolbar && editor._initialToolbarOffsetHeight != editor._toolbar.offsetHeight) {
                                                        editor.sizeIframe(-2);
                                                }
-                                               try { editor._doc.execCommand("useCSS", false, !this.config.useCSS); } catch (e) {};
-                                               try { editor._doc.execCommand("styleWithCSS", false, this.config.useCSS); } catch (e) {};
+                                               if (editor._doc.queryCommandEnabled("insertbronreturn")) editor._doc.execCommand("insertbronreturn", false, editor.config.disableEnterParagraphs);
+                                               if (editor._doc.queryCommandEnabled("styleWithCSS")) editor._doc.execCommand("styleWithCSS", false, editor.config.useCSS);
+                                                       else if (editor._doc.queryCommandEnabled("useCSS")) editor._doc.execCommand("useCSS", false, !editor.config.useCSS);
                                        } catch(e) {
                                                        // If an event of a parent tab ("nested tabs") is triggered, the following lines should not be
                                                        // processed, because this causes some trouble on all event handlers...
index ffb46ae..2480ad3 100644 (file)
@@ -1260,8 +1260,9 @@ HTMLArea.prototype.setMode = function(mode) {
                        this._editMode = "wysiwyg";
                                        //set gecko options
                        if (HTMLArea.is_gecko) {
-                               try { this._doc.execCommand("useCSS", false, !this.config.useCSS); } catch (e) {};
-                               try { this._doc.execCommand("styleWithCSS", false, this.config.useCSS); } catch (e) {};
+                               if (this._doc.queryCommandEnabled("insertbronreturn")) this._doc.execCommand("insertbronreturn", false, this.config.disableEnterParagraphs);
+                               if (this._doc.queryCommandEnabled("styleWithCSS")) this._doc.execCommand("styleWithCSS", false, this.config.useCSS);
+                                       else if (this._doc.queryCommandEnabled("useCSS")) this._doc.execCommand("useCSS", false, !this.config.useCSS);
                        }
                        break;
                default: