Ticket #670: 670_2.patch

File 670_2.patch, 7.9 KB (added by Martin Kou, 16 years ago)

Updated patch for fixing #670, fixed the About dialog status issue.

  • _source/internals/fckcommands.js

     
    5555                case 'AnchorDelete'     : oCommand = new FCKAnchorDeleteCommand() ; break ;
    5656                case 'BulletedList'     : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp             , 'dialog/fck_listprop.html?UL' , 370, 170 ) ; break ;
    5757                case 'NumberedList'     : oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp             , 'dialog/fck_listprop.html?OL' , 370, 170 ) ; break ;
    58                 case 'About'            : oCommand = new FCKDialogCommand( 'About'              , FCKLang.About                                 , 'dialog/fck_about.html'               , 400, 330 ) ; break ;
     58                case 'About'            : oCommand = new FCKDialogCommand( 'About'              , FCKLang.About                                 , 'dialog/fck_about.html'               , 400, 330, function(){ return FCK_TRISTATE_OFF ; } ) ; break ;
    5959
    6060                case 'Find'                     : oCommand = new FCKDialogCommand( 'Find'               , FCKLang.DlgFindAndReplaceTitle                        , 'dialog/fck_replace.html'             , 340, 250 ) ; break ;
    6161                case 'Replace'          : oCommand = new FCKDialogCommand( 'Replace'    , FCKLang.DlgFindAndReplaceTitle                , 'dialog/fck_replace.html'             , 340, 250 ) ; break ;
  • _source/commandclasses/fcktextcolorcommand.js

     
    7575
    7676FCKTextColorCommand.prototype.GetState = function()
    7777{
     78        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     79                return FCK_TRISTATE_DISABLED ;
    7880        return FCK_TRISTATE_OFF ;
    7981}
    8082
  • _source/commandclasses/fcknamedcommand.js

     
    3333
    3434FCKNamedCommand.prototype.GetState = function()
    3535{
     36        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     37                return FCK_TRISTATE_DISABLED ;
    3638        return FCK.GetNamedCommandState( this.Name ) ;
    3739}
  • _source/commandclasses/fckspellcheckcommand_gecko.js

     
    3535
    3636FCKSpellCheckCommand.prototype.GetState = function()
    3737{
     38        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     39                return FCK_TRISTATE_DISABLED ;
    3840        return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
    39 }
    40  No newline at end of file
     41}
  • _source/commandclasses/fckspellcheckcommand_ie.js

     
    6363
    6464FCKSpellCheckCommand.prototype.GetState = function()
    6565{
     66        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     67                return FCK_TRISTATE_DISABLED ;
    6668        return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
    67 }
    68  No newline at end of file
     69}
  • _source/commandclasses/fckstylecommand.js

     
    4545
    4646        GetState : function()
    4747        {
    48                 if ( !FCK.EditorDocument )
     48                if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || !FCK.EditorDocument )
    4949                        return FCK_TRISTATE_DISABLED ;
    5050
    5151                if ( FCKSelection.GetType() == 'Control' )
  • _source/commandclasses/fck_othercommands.js

     
    4747        if ( this.GetStateFunction )
    4848                return this.GetStateFunction( this.GetStateParam ) ;
    4949        else
    50                 return FCK_TRISTATE_OFF ;
     50                return FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
    5151}
    5252
    5353// Generic Undefined command (usually used when a command is under development).
     
    7979       
    8080        GetState : function()
    8181        {
    82                 return FCK.EditorDocument ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
     82                return FCK.EditorDocument ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
    8383        }
    8484};
    8585
     
    209209
    210210FCKUndoCommand.prototype.GetState = function()
    211211{
     212        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     213                return FCK_TRISTATE_DISABLED ;
    212214        return ( FCKUndo.CheckUndoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
    213215}
    214216
     
    225227
    226228FCKRedoCommand.prototype.GetState = function()
    227229{
     230        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     231                return FCK_TRISTATE_DISABLED ;
    228232        return ( FCKUndo.CheckRedoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
    229233}
    230234
     
    262266
    263267FCKPageBreakCommand.prototype.GetState = function()
    264268{
     269        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     270                return FCK_TRISTATE_DISABLED ;
    265271        return 0 ; // FCK_TRISTATE_OFF
    266272}
    267273
     
    291297
    292298FCKUnlinkCommand.prototype.GetState = function()
    293299{
     300        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     301                return FCK_TRISTATE_DISABLED ;
    294302        var state = FCK.GetNamedCommandState( this.Name ) ;
    295303
    296304        // Check that it isn't an anchor
     
    336344
    337345FCKSelectAllCommand.prototype.GetState = function()
    338346{
     347        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     348                return FCK_TRISTATE_DISABLED ;
    339349        return FCK_TRISTATE_OFF ;
    340350}
    341351
     
    357367
    358368        GetState : function()
    359369        {
     370                if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     371                        return FCK_TRISTATE_DISABLED ;
    360372                return FCK.GetNamedCommandState( 'Paste' ) ;
    361373        }
    362374} ;
     
    377389
    378390        GetState : function()
    379391        {
     392                if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     393                        return FCK_TRISTATE_DISABLED ;
    380394                return FCK.GetNamedCommandState( 'InsertHorizontalRule' ) ;
    381395        }
    382396} ;
     
    396410
    397411        GetState : function()
    398412        {
     413                if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     414                        return FCK_TRISTATE_DISABLED ;
    399415                // Strangely, the cut command happens to have the correct states for both Copy and Cut in all browsers.
    400416                return FCK.GetNamedCommandState( 'Cut' ) ;
    401417        }
     
    465481
    466482        GetState : function()
    467483        {
     484                if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     485                        return FCK_TRISTATE_DISABLED ;
    468486                return FCK.GetNamedCommandState( 'Unlink') ;
    469487        }
    470488};
  • _source/commandclasses/fckpasteplaintextcommand.js

     
    3434
    3535FCKPastePlainTextCommand.prototype.GetState = function()
    3636{
     37        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     38                return FCK_TRISTATE_DISABLED ;
    3739        return FCK.GetNamedCommandState( 'Paste' ) ;
    3840}
  • _source/commandclasses/fckpastewordcommand.js

     
    3333
    3434FCKPasteWordCommand.prototype.GetState = function()
    3535{
    36         if ( FCKConfig.ForcePasteAsPlainText )
     36        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || FCKConfig.ForcePasteAsPlainText )
    3737                return FCK_TRISTATE_DISABLED ;
    3838        else
    3939                return FCK.GetNamedCommandState( 'Paste' ) ;
  • _source/commandclasses/fckcorestylecommand.js

     
    4444                        FCKStyles.ApplyStyle( this.StyleName ) ;
    4545
    4646                FCK.Focus() ;
    47                 FCK.Events.FireEvent( 'OnSelectionChange' ) ;
     47                FCK.Events.FireEvent( 'OnSelectionChange' ) ;
    4848        },
    4949
    5050        GetState : function()
    5151        {
     52                if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
     53                        return FCK_TRISTATE_DISABLED ;
    5254                return this.IsActive ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
    5355        },
    5456
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy