Fixed several bugs with t3editor and IE #8157, #8049, #7509,#8146, credit Tobias...
authorIngo Renner <ingo.renner@typo3.org>
Tue, 22 Apr 2008 18:28:59 +0000 (18:28 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Tue, 22 Apr 2008 18:28:59 +0000 (18:28 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3612 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/t3editor/jslib/codemirror/editor.js
typo3/sysext/t3editor/jslib/t3editor.js

index bd45e82..1db4ac4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 2008-04-22  Ingo Renner  <ingo@typo3.org>
 
        * Fixed bug #8153: [left frame-width] left frame too small for german users, credits Steffen Kamper
+       * Fixed several bugs with t3editor and IE #8157, #8049, #7509,#8146, credit Tobias Liebig
 
 2008-04-22  Oliver Hader  <oliver@typo3.org>
 
index 0ed5901..1c9d599 100644 (file)
@@ -345,7 +345,7 @@ var Editor = (function(){
       addEventHandler(document.body, "paste", method(this, "markCursorDirty"));
          if (options.outerEditor && options.outerEditor.scroll) {
                addEventHandler(document, "scroll", method(options.outerEditor, "scroll"));
-               // addEventHandler(window, "scroll", method(options.outerEditor, "scroll"));
+               addEventHandler(window, "scroll", method(options.outerEditor, "scroll"));
          }
          if (options.outerEditor && options.outerEditor.click) {
                addEventHandler(document, "click", method(options.outerEditor, "click"));
index da366f2..f77c43c 100755 (executable)
@@ -143,12 +143,24 @@ function T3editor(textarea) {
 }
 
 T3editor.prototype = {
+               saveFunctionEvent: null,
+               saveButtons: null,
        
                init: function() {
                        var textareaDim = $(this.textarea).getDimensions();
                        // hide the textarea
                        this.textarea.hide();
                        
+                       // get the form object (needed for Ajax saving)
+                       var form = $(this.textarea.form)
+                       this.saveButtons = form.getInputs('image', 'submit');
+
+                       // initialize ajax saving events
+                       this.saveFunctionEvent = this.saveFunction.bind(this);
+                       this.saveButtons.each(function(button) {
+                               Event.observe(button,'click',this.saveFunctionEvent);
+                       }.bind(this));
+
                        this.resize(textareaDim.width, textareaDim.height );
                },
        
@@ -222,7 +234,10 @@ T3editor.prototype = {
                                (this.textModified ? ' <span alt="document has been modified">*</span> ': '') + bodyContentLineCount + ' lines');
                },
                
-               saveFunction: function() {
+               saveFunction: function(event) {
+                       if (event) {
+                               Event.stop(event);
+                       }
                        this.modalOverlay.show();
                        this.textarea.value = this.mirror.editor.getCode();
                        $('submitAjax').value = '1';
@@ -233,7 +248,6 @@ T3editor.prototype = {
 
                // callback if ajax saving was successful
                saveFunctionComplete: function(ajaxrequest) {
-
                        if (ajaxrequest.status == 200
                          && ajaxrequest.headerJSON.result == true) {
                                
@@ -244,7 +258,6 @@ T3editor.prototype = {
                        };
                        $('submitAjax').value = '0';
                        this.modalOverlay.hide();
-
                },
                
                // find matching bracket
@@ -263,6 +276,7 @@ T3editor.prototype = {
                                item.className = item.className.replace(' error-bracket', '');
                        });
 
+
                        if (!cursor.start || !cursor.start.node || !cursor.start.node.parentNode || !cursor.start.node.parentNode.className) {
                                return;
                        }