We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    Oops, forgot to ask, how do we do it currently? I have searched the source and the FCKeditor help stuff but can’t find it.
      • 32963
      • 1,732 Posts
      Hmmm,

      I’ll have to check with FCK
        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 18397
        • 3,250 Posts
        Quote from: xwisdom at Sep 16, 2005, 09:32 PM

        Hmmm,

        I’ll have to check with FCK

        I know it must be a modification or additional script you (or someone else) wrote because in the same version of FCKeditor (stock install) it does not do this, but when I load the example file (stock version) from within the MODx version it does minimize before closing.
          • 18397
          • 3,250 Posts
          Raymond?
            • 32963
            • 1,732 Posts
            Quote from: Mark at Oct 14, 2005, 12:50 AM

            Raymond?

            Hi Mark,

            This is truely long overdue smiley

            Here’s the updated code:
            global $replace_richtexteditor;
            $replace_richtexteditor[] = "introtext";
            
            $html = '<script>'.
            'document.mutate.introtext.style.height="100px";'.
            'setTimeout("adJustIntrotextSize()",800);'.
            'function adJustIntrotextSize(){'.
            '   var o = document.getElementById("introtext___Frame");'.
            '   if(o) {o.style.height="130px";o.style.width="300px"}'.
            '   if(o) {'.
            '	var oEditor = FCKeditorAPI.GetInstance("introtext");'.
            '	if(oEditor) oEditor.ToolbarSet.Collapse();'.
            '    }'.
            '}'.
            '</script>';
            $modx->event->output($html);


              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 18397
              • 3,250 Posts
              Raymond, the collapse toolbar bit doesn’t seem to work at all.
                • 32963
                • 1,732 Posts
                Hmmm,

                Try increasing the time from 800 to the following:

                setTimeout("adJustIntrotextSize()",1200);

                  xWisdom
                  www.xwisdomhtml.com
                  The fear of the Lord is the beginning of wisdom:
                  MODx Co-Founder - Create and do more with less.
                  • 18397
                  • 3,250 Posts
                  Thanks! That did it!
                    • 18397
                    • 3,250 Posts
                    Raymond:

                    Found this on the FCKeditor Javascript API Wiki:


                    Once the editor loading is complete and it is ready to use (and interact with JavaScript), a standard function is called in the page that contains the editor, if the function is defined. This function must be named "FCKeditor_OnComplete" and receives the related editor instance as the parameter. Using it, you can execute any initial code that makes the initial interaction with the editor. This is a declaration example:

                    function FCKeditor_OnComplete( editorInstance )
                    {
                        alert( editorInstance.Name ) ;
                    }
                    

                      • 32963
                      • 1,732 Posts
                      You’re correct Mark but we can’t use that feature as the Plugin is already making use of that function.

                      Here’s a quick work around


                      global $replace_richtexteditor;
                      $replace_richtexteditor[] = "introtext";
                      
                      $html = '<script>'.
                      'var tick=0;'.
                      'document.mutate.introtext.style.height="100px";'.
                      'setTimeout("adJustIntrotextSize()",800);'.
                      'function adJustIntrotextSize(){'.
                      '   if(!self.FCKeditorAPI) {tick++;setTimeout("adJustIntrotextSize()",800);return;}'.
                      '   else if(tick>5) return;'.
                      '   var o = document.getElementById("introtext___Frame");'.
                      '   if(o) {o.style.height="130px";o.style.width="300px"}'.
                      '   if(o) {'.
                      '	var oEditor = FCKeditorAPI.GetInstance("introtext");'.
                      '	if(oEditor) oEditor.ToolbarSet.Collapse();'.
                      '    }'.
                      '}'.
                      '</script>';
                      $modx->event->output($html);

                        xWisdom
                        www.xwisdomhtml.com
                        The fear of the Lord is the beginning of wisdom:
                        MODx Co-Founder - Create and do more with less.