Ticket #2836: 2836_3.patch

File 2836_3.patch, 15.8 KB (added by Artur Formella, 16 years ago)
  • _source/plugins/blockquote/plugin.js

     
    277277
    278278                        selection.selectBookmarks( bookmarks );
    279279                        editor.focus();
    280                 }
     280                },
     281                activeInModes : [ 'wysiwyg' ]
    281282        };
    282283
    283284        CKEDITOR.plugins.add( 'blockquote',
  • _source/plugins/clipboard/plugin.js

     
    7272                                alert( editor.lang.clipboard[ this.type + 'Error' ] );          // Show cutError or copyError.
    7373
    7474                        return success;
    75                 }
     75                },
     76                activeInModes : [ 'wysiwyg' ]
    7677        };
    7778
    7879        // Paste command.
     
    8990                                        {
    9091                                                        editor.openDialog( 'paste' );
    9192                                        }
    92                                 }
     93                                },
     94                                activeInModes : [ 'wysiwyg' ]
    9395                        }
    9496                :
    9597                        {
     
    108110                                                // Open the paste dialog.
    109111                                                editor.openDialog( 'paste' );
    110112                                        }
    111                                 }
     113                                },
     114                                activeInModes : [ 'wysiwyg' ]
    112115                        };
    113116
    114117        // Listens for some clipboard related keystrokes, so they get customized.
  • _source/plugins/dialog/plugin.js

     
    22202220         * // Register the "link" command, which opens the "link" dialog.
    22212221         * editor.addCommand( 'link', <b>new CKEDITOR.dialogCommand( 'link' )</b> );
    22222222         */
    2223         CKEDITOR.dialogCommand = function( dialogName )
     2223        CKEDITOR.dialogCommand = function( dialogName, commandDefinition )
    22242224        {
    22252225                this.dialogName = dialogName;
     2226                CKEDITOR.tools.extend( this, commandDefinition );
    22262227        };
    22272228
    22282229        CKEDITOR.dialogCommand.prototype =
  • _source/plugins/editingblock/plugin.js

     
    168168                                });
    169169                }
    170170
     171                // Enable and disable commands.
     172                for ( item in this._.commands )
     173                {
     174                        var command = this._.commands[ item ];
     175
     176                        if ( command.activeInModes )
     177                        {
     178                                var index = CKEDITOR.tools.indexOf( command.activeInModes, mode ),
     179                                        state = ( index == -1 ) ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF;
     180
     181                                if ( command.state != state )
     182                                {
     183                                        command.state = state;
     184                                        command.fire( 'state' );
     185                                }
     186                        }
     187                }
     188
    171189                modeEditor.load( holderElement, ( typeof data ) != 'string'  ? this.getData() : data);
    172190        };
    173191
  • _source/plugins/find/plugin.js

     
    77{
    88        init : function( editor )
    99        {
     10                var commandDefinition =
     11                {
     12                        activeInModes : [ 'wysiwyg' ]
     13                }
    1014                var forms = CKEDITOR.plugins.find;
    1115                editor.ui.addButton( 'Find',
    1216                        {
    1317                                label : editor.lang.findAndReplace.find,
    1418                                command : 'find'
    1519                        });
    16                 editor.addCommand( 'find', new CKEDITOR.dialogCommand( 'find' ) );
     20                editor.addCommand( 'find', new CKEDITOR.dialogCommand( 'find', commandDefinition ) );
    1721
    1822                editor.ui.addButton( 'Replace',
    1923                        {
    2024                                label : editor.lang.findAndReplace.replace,
    2125                                command : 'replace'
    2226                        });
    23                 editor.addCommand( 'replace', new CKEDITOR.dialogCommand( 'replace' ) );
     27                editor.addCommand( 'replace', new CKEDITOR.dialogCommand( 'replace', commandDefinition ) );
    2428
    2529                CKEDITOR.dialog.add( 'find',    this.path + 'dialogs/find.js' );
    2630                CKEDITOR.dialog.add( 'replace', this.path + 'dialogs/find.js' );
  • _source/plugins/flash/plugin.js

     
    1818                        return length;
    1919                }
    2020
    21                 editor.addCommand( 'flash', new CKEDITOR.dialogCommand( 'flash' ) );
     21                var commandDefinition =
     22                {
     23                        activeInModes : [ 'wysiwyg' ]
     24                }
     25
     26                editor.addCommand( 'flash', new CKEDITOR.dialogCommand( 'flash', commandDefinition ) );
    2227                editor.ui.addButton( 'Flash',
    2328                        {
    2429                                label : editor.lang.common.flash,
  • _source/plugins/forms/plugin.js

     
    1717                                'border: 1px dotted #FF0000;' +
    1818                                'padding: 2px;' +
    1919                        '}' );
     20
     21                var commandDefinition =
     22                {
     23                        activeInModes : [ 'wysiwyg' ]
     24                }
     25
    2026                // All buttons use the same code to register. So, to avoid
    2127                // duplications, let's use this tool function.
    2228                var addButtonCommand = function( buttonName, commandName, dialogFile )
    2329                {
    24                         editor.addCommand( commandName, new CKEDITOR.dialogCommand( commandName ) );
    2530
     31                        editor.addCommand( commandName, new CKEDITOR.dialogCommand( commandName, commandDefinition ) );
    2632                        editor.ui.addButton( buttonName,
    2733                                {
    2834                                        label : editor.lang.common[ buttonName.charAt(0).toLowerCase() + buttonName.slice(1) ],
  • _source/plugins/horizontalrule/plugin.js

     
    1414                exec : function( editor )
    1515                {
    1616                        editor.insertElement( editor.document.createElement( 'hr' ) );
    17                 }
     17                },
     18                activeInModes : [ 'wysiwyg' ]
    1819        };
    1920
    2021        var pluginName = 'horizontalrule';
  • _source/plugins/image/plugin.js

     
    1717                CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/image.js' );
    1818
    1919                // Register the command.
    20                 editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) );
     20                var commandDefinition =
     21                {
     22                        activeInModes : [ 'wysiwyg' ]
     23                }
     24                editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName, commandDefinition ) );
    2125
    2226                // Register the toolbar button.
    2327                editor.ui.addButton( 'Image',
  • _source/plugins/indent/plugin.js

     
    251251                        editor.focus();
    252252                        editor.forceNextSelectionCheck();
    253253                        selection.selectBookmarks( bookmarks );
    254                 }
     254                },
     255                activeInModes : [ 'wysiwyg' ]
    255256        };
    256257
    257258        CKEDITOR.plugins.add( 'indent',
  • _source/plugins/justify/plugin.js

     
    105105                        editor.focus();
    106106                        editor.forceNextSelectionCheck();
    107107                        selection.selectBookmarks( bookmarks );
    108                 }
     108                },
     109                activeInModes : [ 'wysiwyg' ]
    109110        };
    110111
    111112        CKEDITOR.plugins.add( 'justify',
  • _source/plugins/link/plugin.js

     
    77{
    88        init : function( editor, pluginPath )
    99        {
     10                var commandDefinition =
     11                {
     12                        activeInModes : [ 'wysiwyg' ]
     13                }
    1014                // Add the link and unlink buttons.
    11                 editor.addCommand( 'link', new CKEDITOR.dialogCommand( 'link' ) );
    12                 editor.addCommand( 'anchor', new CKEDITOR.dialogCommand( 'anchor' ) );
     15                editor.addCommand( 'link', new CKEDITOR.dialogCommand( 'link', commandDefinition ) );
     16                editor.addCommand( 'anchor', new CKEDITOR.dialogCommand( 'anchor', commandDefinition ) );
    1317                editor.addCommand( 'unlink', new CKEDITOR.unlinkCommand() );
    1418                editor.ui.addButton( 'Link',
    1519                        {
     
    117121                selection.selectRanges( ranges );
    118122                editor.document.$.execCommand( 'unlink', false, null );
    119123                selection.selectBookmarks( bookmarks );
    120         }
     124        },
     125        activeInModes : [ 'wysiwyg' ]
    121126};
    122127
    123128CKEDITOR.tools.extend( CKEDITOR.config,
  • _source/plugins/list/plugin.js

     
    503503                        CKEDITOR.dom.element.clearAllMarkers( database );
    504504                        selection.selectBookmarks( bookmarks );
    505505                        editor.focus();
    506                 }
     506                },
     507                activeInModes : [ 'wysiwyg' ]
    507508        };
    508509
    509510        CKEDITOR.plugins.add( 'list',
  • _source/plugins/pagebreak/plugin.js

     
    7979                        range.splitBlock( 'p' );
    8080                        range.insertNode( breakObject );
    8181                }
    82         }
     82        },
     83        activeInModes : [ 'wysiwyg' ]
    8384};
  • _source/plugins/pastefromword/plugin.js

     
    77{
    88        init : function( editor )
    99        {
     10                var commandDefinition =
     11                {
     12                        activeInModes : [ 'wysiwyg' ]
     13                }
    1014                // Register the command.
    11                 editor.addCommand( 'pastefromword', new CKEDITOR.dialogCommand( 'pastefromword' ) );
     15                editor.addCommand( 'pastefromword', new CKEDITOR.dialogCommand( 'pastefromword', commandDefinition ) );
    1216
    1317                // Register the toolbar button.
    1418                editor.ui.addButton( 'PasteFromWord',
  • _source/plugins/pastetext/plugin.js

     
    2525                        text = clipboardData.getData( 'Text' );
    2626
    2727                        editor.insertText( text );
    28                 }
     28                },
     29                activeInModes : [ 'wysiwyg' ]
    2930        };
    3031
    3132        // Register the plugin.
  • _source/plugins/print/plugin.js

     
    3939                        editor.window.$.print();
    4040                else
    4141                        editor.document.$.execCommand( "Print" );
    42         }
     42        },
     43        activeInModes : [ 'wysiwyg' ]
    4344};
  • _source/plugins/removeformat/plugin.js

     
    108108                                }
    109109
    110110                                editor.getSelection().selectRanges( ranges );
    111                         }
     111                        },
     112                        activeInModes : [ 'wysiwyg' ]
    112113                }
    113114        }
    114115};
  • _source/plugins/selection/plugin.js

     
    7474                                        editor.document.$.execCommand( 'SelectAll', false, null );
    7575                                        break;
    7676                                case 'source' :
    77                                         // TODO
     77                                        // TODOz
    7878                        }
    7979                }
    8080        };
  • _source/plugins/showblocks/plugin.js

     
    9696
    9797                        this.toggleState();
    9898                        editor._.showBlocks = !isOn;
    99                 }
     99                },
     100                activeInModes : [ 'wysiwyg' ]
    100101        };
    101102
    102103        CKEDITOR.plugins.add( 'showblocks',
  • _source/plugins/smiley/plugin.js

     
    99
    1010        init : function( editor, pluginPath )
    1111        {
    12                 editor.addCommand( 'smiley', new CKEDITOR.dialogCommand( 'smiley' ) );
     12                var commandDefinition =
     13                {
     14                        activeInModes : [ 'wysiwyg' ]
     15                }
     16                editor.addCommand( 'smiley', new CKEDITOR.dialogCommand( 'smiley', commandDefinition ) );
    1317                editor.ui.addButton( 'Smiley',
    1418                        {
    1519                                label : editor.lang.smiley.toolbar,
  • _source/plugins/specialchar/plugin.js

     
    1717                CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );
    1818
    1919                // Register the command.
    20                 editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) );
     20                var commandDefinition =
     21                {
     22                        activeInModes : 'wysiwyg'
     23                }
     24                editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName, commandDefinition ) );
    2125
    2226                // Register the toolbar button.
    2327                editor.ui.addButton( 'SpecialChar',
  • _source/plugins/styles/plugin.js

     
    848848CKEDITOR.styleCommand = function( style )
    849849{
    850850        this.style = style;
     851        this.activeInModes = [ 'wysiwyg' ];
    851852};
    852853
    853854CKEDITOR.styleCommand.prototype.exec = function( editor )
  • _source/plugins/table/plugin.js

     
    88        init : function( editor )
    99        {
    1010                var table = CKEDITOR.plugins.table;
    11 
    12                 editor.addCommand( 'table', new CKEDITOR.dialogCommand( 'table' ) );
     11                var commandDefinition =
     12                {
     13                        activeInModes : [ 'wysiwyg' ]
     14                }
     15                editor.addCommand( 'table', new CKEDITOR.dialogCommand( 'table', commandDefinition ) );
    1316                editor.addCommand( 'tableProperties', new CKEDITOR.dialogCommand( 'tableProperties' ) );
    1417                editor.ui.addButton( 'Table',
    1518                        {
  • _source/plugins/templates/plugin.js

     
    1212                        init : function( editor )
    1313                        {
    1414                                CKEDITOR.dialog.add( 'templates', CKEDITOR.getUrl( this.path + 'dialogs/templates.js' ) );
     15                               
     16                                var commandDefinition =
     17                                {
     18                                        activeInModes : [ 'wysiwyg' ]
     19                                }
     20                                editor.addCommand( 'templates', new CKEDITOR.dialogCommand( 'templates', commandDefinition ) );
    1521
    16                                 editor.addCommand( 'templates', new CKEDITOR.dialogCommand( 'templates' ) );
    17 
    1822                                editor.ui.addButton( 'Templates',
    1923                                        {
    2024                                                label : editor.lang.templates.button,
  • _source/plugins/undo/plugin.js

     
    8181                                                if ( undoManager.index == -1 )
    8282                                                        undoManager.save();
    8383                                        }
     84                                        else if ( undoManager.enabled && editor.mode == 'source' )
     85                                                undoManager.enabled = false;
    8486
    8587                                        undoManager.onChange();
    8688                                });
  • _source/plugins/wsc/plugin.js

     
    1313        init : function( editor, pluginPath )
    1414        {
    1515                var commandName = 'checkspell';
     16                var commandDefinition =
     17                {
     18                        activeInModes : [ 'wysiwyg' ]
     19                }
    1620
    17                 var command = editor.addCommand( commandName, new CKEDITOR.dialogCommand( commandName ) );
     21                var command = editor.addCommand( commandName, new CKEDITOR.dialogCommand( commandName, commandDefinition ) );
    1822
    1923                // SpellChecker doesn't work in Opera.
    2024                if ( CKEDITOR.env.opera )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy