Fixed bug #17180: t3editor claims more then 100% width
authorTobias Liebig <mail@etobi.de>
Thu, 20 Jan 2011 23:20:14 +0000 (23:20 +0000)
committerTobias Liebig <mail@etobi.de>
Thu, 20 Jan 2011 23:20:14 +0000 (23:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10179 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/t3editor/res/css/t3editor.css
typo3/sysext/t3editor/res/jslib/t3editor.js

index e9125f5..0020616 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-01-21  Tobias Liebig  <mail_typo3@etobi.de>
+
+       * Fixed bug #17180: t3editor claims more then 100% width
+
 2011-01-21  Christian Kuhn  <lolli@schwarzbu.ch>
 
        * Fixed bug #17149: Remove sys_refindex_* tables and unused code
index c0b2042..790a579 100644 (file)
@@ -1,6 +1,5 @@
 .CodeMirror-wrapping {
        position: relative;
-       margin-left: 21px;
 }
 .CodeMirror-wrapping div {
        line-height: 13px !important;
@@ -132,10 +131,11 @@ div.CodeMirror-line-numbers {
        position: absolute;
        top: 0;
        left: 0;
+       z-index:999;
 }
 
 .t3e_iframe_wrap {
-       margin: 0 0 0 5px;
+       margin: 0 0 0 3px;
 }
 
 .t3e_iframe {
index a7e39b9..8ad0ccc 100644 (file)
@@ -65,14 +65,14 @@ function T3editor(textarea) {
        this.statusbar_wrap = this.outerdiv.down('.t3e_statusbar_wrap');
        this.statusbar_title = this.outerdiv.down('.t3e_statusbar_title');
        this.statusbar_status = this.outerdiv.down('.t3e_statusbar_status');
-       
+
        this.statusbar_title.update( this.textarea.readAttribute('alt') );
        this.statusbar_status.update( '' );
 
                // setting options
        var options = {
                height: ( textareaDim.height ) + 'px',
-               width: ( textareaDim.width - 40 ) + 'px',
+               width: ( textareaDim.width + this.adjustWidth ) + 'px',
                content: $(this.textarea).value,
                parserfile: T3editor.parserfile,
                stylesheet: T3editor.stylesheet,
@@ -94,22 +94,23 @@ T3editor.prototype = {
                saveFunctionEvent: null,
                saveButtons: null,
                updateTextareaEvent: null,
-       
+               adjustWidth: -30,
+
                init: function() {
                        var textareaDim = $(this.textarea).getDimensions();
                        // hide the textarea
                        this.textarea.hide();
 
                        this.attachEvents();
-                       this.resize(textareaDim.width, textareaDim.height );
-                       
+                       this.resize(textareaDim.width + this.adjustWidth, textareaDim.height );
+
                        this.modalOverlay.hide();
                        $(this.outerdiv).fire('t3editor:initFinished', {t3editor: this});
                },
 
                attachEvents: function() {
                        var that = this;
-                       
+
                        // get the form object
                        var form = $(this.textarea.form);
                        this.saveButtons = form.getInputs('image', 'submit');
@@ -121,7 +122,7 @@ T3editor.prototype = {
                        }.bind(this));
 
                        this.updateTextareaEvent = this.updateTextarea.bind(this);
-                       
+
                        Event.observe($(this.textarea.form), 'submit', this.updateTextareaEvent);
 
                        Event.observe(this.mirror.win.document, 'keyup', function(event) {
@@ -129,7 +130,7 @@ T3editor.prototype = {
                        });
                        Event.observe(this.mirror.win.document, 'keydown', function(event) {
                                $(that.outerdiv).fire('t3editor:keydown', {t3editor: that, actualEvent: event});
-                               
+
                                if ((event.ctrlKey || event.metaKey) && event.keyCode == 122) {
                                        that.toggleFullscreen();
                                        event.stop();
@@ -139,17 +140,17 @@ T3editor.prototype = {
                                $(that.outerdiv).fire('t3editor:click', {t3editor: that, actualEvent: event});
                        });
                },
-       
+
                // indicates is content is modified and not safed yet
                textModified: false,
-               
+
                // check if code in editor has been modified since last saving
                checkTextModified: function() {
                        if (!this.textModified) {
                                this.textModified = true;
                        }
                },
-               
+
                updateTextarea: function(event) {
                        this.textarea.value = this.mirror.getCode();
                },
@@ -159,18 +160,18 @@ T3editor.prototype = {
                        this.checkTextModified();
                        $(that.outerdiv).fire('t3editor:change', {t3editor: that});
                },
-               
+
                saveFunction: function(event) {
                        this.modalOverlay.show();
                        this.updateTextarea(event);
-                       
+
                        if (event) {
                                Event.stop(event);
                        }
 
                        var params = $(this.textarea.form).serialize(true);
                        params = Object.extend( {t3editor_disableEditor: 'false'}, params);
-                       
+
                        $(this.outerdiv).fire('t3editor:save', {parameters: params, t3editor: this});
 
                },
@@ -184,7 +185,7 @@ T3editor.prototype = {
                        }
                        this.modalOverlay.hide();
                },
-                               
+
                // toggle between the textarea and t3editor
                toggleView: function(disable) {
                        $(this.outerdiv).fire('t3editor:toggleView', {t3editor: this, disable: disable});
@@ -196,7 +197,7 @@ T3editor.prototype = {
                                        Event.stopObserving(button,'click',this.saveFunctionEvent);
                                }.bind(this));
                                Event.stopObserving($(this.textarea.form), 'submit', this.updateTextareaEvent);
-                               
+
                        } else {
                                this.mirror.editor.importCode(this.textarea.value);
                                this.textarea.hide();
@@ -208,14 +209,13 @@ T3editor.prototype = {
                                Event.observe($(this.textarea.form), 'submit', this.updateTextareaEvent);
                        }
                },
-               
-               
+
                resize: function(width, height) {
                        if (this.outerdiv) {
                                newheight = (height - 1);
                                newwidth = (width + 11);
                                if (Prototype.Browser.IE) newwidth = newwidth + 8;
-                               
+
                                $(this.outerdiv).setStyle({
                                        height: newheight + 'px',
                                        width: newwidth + 'px'
@@ -231,7 +231,7 @@ T3editor.prototype = {
                        }
 
                },
-               
+
                // toggle between normal view and fullscreen mode
                toggleFullscreen: function() {
                        if (this.outerdiv.hasClassName('t3e_fullscreen')) {
@@ -276,7 +276,7 @@ T3editor.prototype = {
 T3editor.toggleEditor = function(checkbox, index) {
        if (!Prototype.Browser.MobileSafari
                && !Prototype.Browser.WebKit) {
-               
+
                if (index == undefined) {
                        $$('textarea.t3editor').each(
                                function(textarea, i) {
@@ -298,7 +298,7 @@ T3editor.toggleEditor = function(checkbox, index) {
 // ------------------------------------------------------------------------
 
 if (!Prototype.Browser.MobileSafari) {
-       // everything ready: turn textarea's into fancy editors 
+       // everything ready: turn textarea's into fancy editors
        Event.observe(window, 'load',
                function() {
                        $$('textarea.t3editor').each(
@@ -310,7 +310,7 @@ if (!Prototype.Browser.MobileSafari) {
                                        }
                                }
                        );
-                       
+
                        if (T3editor.ajaxSavetype != "") {
                                Event.observe(document, 't3editor:save',
                                        function(event) {