Ticket #1376: 1376_2.patch

File 1376_2.patch, 6.4 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/justify/plugin.js

     
    5050        function onSelectionChange( evt )
    5151        {
    5252                var command = evt.editor.getCommand( this.name );
    53                 command.state = getState.call( this, evt.editor, evt.data.path );
    54                 command.fire( 'state' );
     53                command.setState( getState.call( this, evt.editor, evt.data.path ) );
    5554        }
    5655
    5756        function justifyCommand( editor, name, value )
  • _source/plugins/selection/plugin.js

     
    7272
    7373        var selectAllCmd =
    7474        {
    75                 modes : { wysiwyg : 1, source : 1 },
     75                modes : { wysiwyg : 1, source : 1, readonly : 1 },
    7676                exec : function( editor )
    7777                {
    7878                        switch ( editor.mode )
  • _source/plugins/save/plugin.js

     
    1111{
    1212        var saveCmd =
    1313        {
    14                 modes : { wysiwyg:1, source:1 },
     14                modes : { wysiwyg:1, source:1,readonly:1 },
    1515
    1616                exec : function( editor )
    1717                {
  • _source/plugins/clipboard/plugin.js

     
    6363                this.type = type;
    6464                this.canUndo = this.type == 'cut';              // We can't undo copy to clipboard.
    6565                this.startDisabled = true;
     66                this.modes = { 'wysiwyg':1 };
     67                type == 'copy' && ( this.modes.readonly = 1 );
    6668        };
    6769
    6870        cutCopyCmd.prototype =
  • _source/plugins/showborders/plugin.js

     
    5757        CKEDITOR.plugins.add( 'showborders',
    5858        {
    5959                requires : [ 'wysiwygarea' ],
    60                 modes : { 'wysiwyg' : 1 },
     60                modes : { 'wysiwyg' : 1, showblocks : 1 },
    6161
    6262                init : function( editor )
    6363                {
  • _source/plugins/readonly/plugin.js

     
     1/*
     2Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6( function()
     7{
     8        function cancelKeyListener( evt )
     9        {
     10                var keystroke = evt.data.keyCode;
     11                if ( keystroke != 9 && keystroke != CKEDITOR.SHIFT + 9 )
     12                        evt.cancel();
     13        }
     14
     15        CKEDITOR.plugins.add( 'readonly',
     16        {
     17                requires : [ 'editingblock' ],
     18                init : function( editor )
     19                {
     20                        var lastMode;
     21                        editor.on( 'editingBlockReady', function ()
     22                        {
     23                                editor._.modes[ 'readonly' ] = editor._.modes[ 'wysiwyg' ];
     24                        });
     25
     26                        editor.addCommand( 'readonly',
     27                        {
     28                                modes : { wysiwyg : 1, source : 1, readonly : 1 },
     29                                editorFocus : false,
     30                                canUndo : false,
     31                                exec : function ( editor )
     32                                {
     33                                        var readOnly = this.state == CKEDITOR.TRISTATE_OFF;
     34                                        readOnly && ( lastMode = editor.mode );
     35                                        editor.mode = readOnly ? 'readonly' : lastMode;
     36                                        editor.fire( 'mode' );
     37                                        // Prevent key handling.
     38                                        editor[ readOnly ? 'on' : 'removeListener' ]( 'key', cancelKeyListener, null, null, 0 );
     39                                        editor.forceNextSelectionCheck();
     40                                        editor.selectionChange();
     41                                        this.toggleState();
     42                                }
     43                        });
     44
     45                        editor.ui.addButton( 'ReadOnly',
     46                                {
     47                                        label : editor.lang.readOnly,
     48                                        command : 'readonly'
     49                                });
     50                }
     51        });
     52
     53} )();
  • _source/plugins/print/plugin.js

     
    3737                        editor.document.$.execCommand( "Print" );
    3838        },
    3939        canUndo : false,
    40         modes : { wysiwyg : !( CKEDITOR.env.opera ) }           // It is imposible to print the inner document in Opera.
     40        modes : { wysiwyg : !( CKEDITOR.env.opera ), readonly:1 }               // It is imposible to print the inner document in Opera.
    4141};
  • _source/plugins/maximize/plugin.js

     
    154154
    155155                        editor.addCommand( 'maximize',
    156156                                {
    157                                         modes : { wysiwyg : 1, source : 1 },
     157                                        modes : { wysiwyg : 1, source : 1, readonly : 1 },
    158158                                        editorFocus : false,
    159159                                        exec : function()
    160160                                        {
  • _source/plugins/preview/plugin.js

     
    1111{
    1212        var previewCmd =
    1313        {
    14                 modes : { wysiwyg:1, source:1 },
     14                modes : { wysiwyg:1, source:1, readonly:1 },
    1515                canUndo : false,
    1616                exec : function( editor )
    1717                {
  • _source/plugins/blockquote/plugin.js

     
    99
    1010(function()
    1111{
    12         function getState( editor, path )
     12        function getState( path )
    1313        {
    1414                var firstBlock = path.block || path.blockLimit;
    1515
     
    2727        {
    2828                var editor = evt.editor,
    2929                        command = editor.getCommand( 'blockquote' );
    30                 command.state = getState( editor, evt.data.path );
    31                 command.fire( 'state' );
     30                command.setState( getState( evt.data.path ) );
    3231        }
    3332
    3433        function noBlockLeft( bqBlock )
  • _source/plugins/about/plugin.js

     
    99        init : function( editor )
    1010        {
    1111                var command = editor.addCommand( 'about', new CKEDITOR.dialogCommand( 'about' ) );
    12                 command.modes = { wysiwyg:1, source:1 };
     12                command.modes = { wysiwyg:1, source:1, readonly:1 };
    1313                command.canUndo = false;
    1414
    1515                editor.ui.addButton( 'About',
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy