We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Hi Jeff,

    I’ve noticed something strange about FCK today. It does not autosize the IFrame to match the width and height of the textbox that it’s replacing. Maybe we need to add a feature to the FCKeditor.prototype.ReplaceTextarea function that allows it to auto size the IFrames?

      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 4018
      • 1,131 Posts
      Hmm...guess I’ll need to look into that now, won’t I. wink
        Jeff Whitfield

        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
        • 4018
        • 1,131 Posts
        Is there an example of this? Where in MODx are you using FCK in an IFrame? Just curious...
          Jeff Whitfield

          "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
          • 32963
          • 1,732 Posts
          I mean the IFrame that FCK uses to replace the textarea.

          See fckeditor.js ReplaceTextArea() function

          We might need something like ReplaceTextArea(autosize) where autosize can be true/false

            xWisdom
            www.xwisdomhtml.com
            The fear of the Lord is the beginning of wisdom:
            MODx Co-Founder - Create and do more with less.
            • 4018
            • 1,131 Posts
            Hmm...well...

            Here’s the problem...textareas themselves aren’t measured by width and height but rather by the number of characters in width and lines by height. The only way to set the width and height of a textarea with pixels is with CSS. Now, with this being said, there are some limitations of all the main editors, FCKeditor included.

            By default FCKeditor is set to 100% width, which means that it’ll expand out to the width of the are where the textarea is. Hacking up the code to get FCK to detect the width of the original textarea will be quite a task...one that I would recommend for the original programmers since they have more insight into the code. If we do it ourselves then...well...we’ll have to do this to every editor we plugin to MODx.

            I’ve played around with some of the other editors, TinyMCE and Xinha specifically. They both exhibit similar behavior to some degree. TinyMCE seems to pick up on the character width and line height of the textarea...but only to a point. If the width goes below the width of the toolbar, then it’ll retain the width of the toolbar and show just the width of the textarea. TinyMCE just doesn’t do anything to collapse the toolbar the same way FCK does. Xinha is another story...it’s somewhat tempermental though a width can be set manually.

            Both TinyMCE and FCK can be forced to a specific width rather simply (though TinyMCE will still have the toolbar issue). Basically, if you wrap the textarea with a DIV and give the DIV a specific width, then the editor will conform with the width of the DIV. Pretty simple. However, Xinha may prove to be a little more problematic. Still need to work with it to discover all it’s little quirks.

            That’s where we stand for now. I’ll be playing with them some more and will hopefully have a better answer sometime soon. smiley
              Jeff Whitfield

              "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."