Ticket #593: 593_Proposal.patch

File 593_Proposal.patch, 2.2 KB (added by Frederico Caldeira Knabben, 16 years ago)

First patch proposal. Not intended to be the final solution.

  • editor/_source/internals/fck.js

     
    114114                this.EditingArea = new FCKEditingArea( document.getElementById( 'xEditingArea' ) ) ;
    115115                this.EditingArea.FFSpellChecker = FCKConfig.FirefoxSpellChecker ;
    116116
     117                FCK.EditMode = FCKConfig.StartupMode ;
     118
    117119                // Set the editor's startup contents.
    118120                this.SetData( this.GetLinkedFieldValue(), true ) ;
    119121
     
    322324
    323325        OnAfterSetHTML : function()
    324326        {
    325                 FCKDocumentProcessor.Process( FCK.EditorDocument ) ;
    326                 FCKUndo.SaveUndoStep() ;
     327                if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
     328                {
     329                        FCKDocumentProcessor.Process( FCK.EditorDocument ) ;
     330                        FCKUndo.SaveUndoStep() ;
     331                }
    327332
     333                // Check if it is not a startup call, otherwise complete the startup.
     334                if ( FCK.Status != FCK_STATUS_NOTLOADED )
     335                        FCK.SetStatus( FCK_STATUS_ACTIVE ) ;
     336
    328337                FCK.Events.FireEvent( 'OnSelectionChange' ) ;
    329338                FCK.Events.FireEvent( 'OnAfterSetHTML' ) ;
    330339        },
     
    478487
    479488                        this.EditingArea.Textarea.focus() ;
    480489
    481                         FCK.Events.FireEvent( 'OnAfterSetHTML' ) ;
     490                        FCK.OnAfterSetHTML() ;
    482491                }
    483492
    484493                if ( FCKBrowserInfo.IsGecko )
     
    960969
    961970        // Restore show blocks status.
    962971        FCKCommands.GetCommand( 'ShowBlocks' ).RestoreState() ;
    963 
    964         // Check if it is not a startup call, otherwise complete the startup.
    965         if ( FCK.Status != FCK_STATUS_NOTLOADED )
    966                 return ;
    967 
    968         FCK.SetStatus( FCK_STATUS_ACTIVE ) ;
    969972}
    970973
    971974function _FCK_GetEditorAreaStyleTags()
  • fckconfig.js

     
    7373FCKConfig.FormatOutput          = true ;
    7474FCKConfig.FormatIndentator      = '    ' ;
    7575
    76 FCKConfig.StartupFocus  = false ;
     76FCKConfig.StartupMode = FCK_EDITMODE_WYSIWYG ;  // FCK_EDITMODE_WYSIWYG = 0 || FCK_EDITMODE_SOURCE = 1
     77FCKConfig.StartupFocus = false ;
    7778FCKConfig.ForcePasteAsPlainText = false ;
    7879FCKConfig.AutoDetectPasteFromWord = true ;      // IE only.
    7980FCKConfig.ShowDropDialog = true ;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy