Ticket #1376: 1376_6.patch

File 1376_6.patch, 25.9 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/showblocks/plugin.js

     
    8989
    9090        var commandDefinition =
    9191        {
     92                readOnly : 1,
    9293                preserveState : true,
    9394                editorFocus : false,
    9495
  • _samples/readonly.html

     
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2<!--
     3Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
     4For licensing, see LICENSE.html or http://ckeditor.com/license
     5-->
     6<html xmlns="http://www.w3.org/1999/xhtml">
     7<head>
     8        <title>Read-only &mdash; CKEditor Sample</title>
     9        <meta content="text/html; charset=utf-8" http-equiv="content-type" />
     10        <!-- CKReleaser %REMOVE_LINE%
     11        <script type="text/javascript" src="../ckeditor.js"></script>
     12        CKReleaser %REMOVE_START% -->
     13        <script type="text/javascript" src="../ckeditor_source.js"></script>
     14        <!-- CKReleaser %REMOVE_END% -->
     15        <script src="sample.js" type="text/javascript"></script>
     16        <link href="sample.css" rel="stylesheet" type="text/css" />
     17        <script type="text/javascript">
     18        //<![CDATA[
     19
     20// The instanceReady event is fired, when an instance of CKEditor has finished
     21// its initialization.
     22CKEDITOR.on( 'instanceReady', function( ev )
     23{
     24        // Show the editor name and description in the browser status bar.
     25        document.getElementById( 'eMessage' ).innerHTML = '<p>Instance <code>' + ev.editor.name + '<\/code> loaded.<\/p>';
     26
     27        // Show this sample buttons.
     28         document.getElementById( 'eButtons' ).style.display = 'block';
     29});
     30
     31function toggleReadOnly( isReadOnly )
     32{
     33        // Get the editor instance that we want to interact with.
     34        var oEditor = CKEDITOR.instances.editor1;
     35
     36        // Change the read-only state of editor.
     37        // http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#setReadOnly
     38        oEditor.setReadOnly( isReadOnly );
     39}
     40
     41        //]]>
     42        </script>
     43
     44</head>
     45<body>
     46        <h1 class="samples">
     47                CKEditor Sample &mdash; Using CKEditor ReadOnly API
     48        </h1>
     49        <div class="description">
     50        <p>
     51                This sample shows how to use the
     52                <a class="samples" href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#setReadOnly">set read-only</a>
     53                API to put editor into an immutable state.
     54        </p>
     55        <p>
     56                For details on how to create this setup check the source code of this sample page.
     57        </p>
     58        </div>
     59
     60        <!-- This <div> holds alert messages to be display in the sample page. -->
     61        <div id="alerts">
     62                <noscript>
     63                        <p>
     64                                <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
     65                                support, like yours, you should still see the contents (HTML data) and you should
     66                                be able to edit it normally, without a rich editor interface.
     67                        </p>
     68                </noscript>
     69        </div>
     70        <form action="sample_posteddata.php" method="post">
     71                <textarea class="ckeditor" id="editor1" name="editor1" cols="100" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.some</p></textarea>
     72                <div id="eMessage">
     73                </div>
     74                <div id="eButtons" style="display: none">
     75                        <input onclick="toggleReadOnly( true );" type="button" value="Turn on read-only" />
     76                        <input onclick="toggleReadOnly();" type="button" value="Turn off read-only" />
     77                </div>
     78        </form>
     79        <div id="footer">
     80                <hr />
     81                <p>
     82                        CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
     83                </p>
     84                <p id="copy">
     85                        Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
     86                        Knabben. All rights reserved.
     87                </p>
     88        </div>
     89</body>
     90</html>
  • _source/plugins/about/plugin.js

     
    1111                var command = editor.addCommand( 'about', new CKEDITOR.dialogCommand( 'about' ) );
    1212                command.modes = { wysiwyg:1, source:1 };
    1313                command.canUndo = false;
     14                command.readOnly = 1;
    1415
    1516                editor.ui.addButton( 'About',
    1617                        {
  • _source/plugins/save/plugin.js

     
    1212        var saveCmd =
    1313        {
    1414                modes : { wysiwyg:1, source:1 },
     15                readOnly : 1,
    1516
    1617                exec : function( editor )
    1718                {
  • _source/plugins/showborders/plugin.js

     
    4040        {
    4141                preserveState : true,
    4242                editorFocus : false,
     43                readOnly: 1,
    4344
    4445                exec : function ( editor )
    4546                {
  • _source/plugins/basicstyles/plugin.js

     
    1717
    1818                        editor.attachStyleStateChange( style, function( state )
    1919                                {
    20                                         editor.getCommand( commandName ).setState( state );
     20                                        !editor.readOnly && editor.getCommand( commandName ).setState( state );
    2121                                });
    2222
    2323                        editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) );
  • _source/plugins/editingblock/plugin.js

     
    113113                                        }, 0 );
    114114                                });
    115115
     116                        // Force reload the mode to refresh all command states.
     117                        editor.on( 'readOnly', function() {
     118                                this.setMode( this.mode || this.config.startupMode, 1 );
     119                        });
     120
    116121                        editor.on( 'destroy', function ()
    117122                        {
    118123                                // ->           currentMode.unload( holderElement );
     
    151156         * // Switch to "source" view.
    152157         * CKEDITOR.instances.editor1.setMode( 'source' );
    153158         */
    154         CKEDITOR.editor.prototype.setMode = function( mode )
     159        CKEDITOR.editor.prototype.setMode = function( mode, forceReload )
    155160        {
    156161                this.fire( 'beforeSetMode', { newMode : mode } );
    157162
     
    162167                // Unload the previous mode.
    163168                if ( this.mode )
    164169                {
    165                         if ( mode == this.mode )
     170                        if ( !forceReload && mode == this.mode )
    166171                                return;
    167172
    168173                        this.fire( 'beforeModeUnload' );
  • _source/plugins/justify/plugin.js

     
    4949
    5050        function onSelectionChange( evt )
    5151        {
     52                if ( evt.editor.readOnly )
     53                        return;
     54
    5255                var command = evt.editor.getCommand( this.name );
    5356                command.state = getState.call( this, evt.editor, evt.data.path );
    5457                command.fire( 'state' );
  • _source/core/dom/range.js

     
    18701870                                                        return 0;
    18711871                                                }
    18721872                                                // Range enclosed entirely in an editable element.
    1873                                                 else if ( node.is( 'body' )
     1873                                                else if ( node.is( 'html' )
    18741874                                                        || node.getAttribute( 'contentEditable' ) == 'true'
    18751875                                                        && ( node.contains( anotherEnd ) || node.equals( anotherEnd ) ) )
    18761876                                                {
  • _source/plugins/selection/plugin.js

     
    9292        var selectAllCmd =
    9393        {
    9494                modes : { wysiwyg : 1, source : 1 },
     95                readOnly : CKEDITOR.env.ie || CKEDITOR.env.webkit,
    9596                exec : function( editor )
    9697                {
    9798                        switch ( editor.mode )
  • _source/plugins/find/plugin.js

     
    1515                        });
    1616                var findCommand = editor.addCommand( 'find', new CKEDITOR.dialogCommand( 'find' ) );
    1717                findCommand.canUndo = false;
     18                findCommand.readOnly = 1;
    1819
    1920                editor.ui.addButton( 'Replace',
    2021                        {
  • _source/plugins/find/dialogs/find.js

     
    854854                                finder.searchRange = getSearchRange();
    855855
    856856                                this.selectPage( startupPage );
     857
     858                                if ( startupPage == 'find' && this._.editor.readOnly )
     859                                        this.hidePage('replace' );
    857860                        },
    858861                        onHide : function()
    859862                        {
  • _source/plugins/menu/plugin.js

     
    9797                                                {
    9898                                                        var item = this.editor.getMenuItem( itemName );
    9999
    100                                                         if ( item )
     100                                                        if ( item && ( !item.command || this.editor.getCommand( item.command ).state ) )
    101101                                                        {
    102                                                                 item.state = listenerItems[ itemName ];
     102                                                                item.state =  listenerItems[ itemName ];
    103103                                                                this.add( item );
    104104                                                        }
    105105                                                }
  • _source/plugins/elementspath/plugin.js

     
    1515                toolbarFocus :
    1616                {
    1717                        editorFocus : false,
     18                        readOnly : 1,
    1819                        exec : function( editor )
    1920                        {
    2021                                var idBase = editor._.elementsPath.idBase;
  • _source/plugins/a11yhelp/plugin.js

     
    3737                                                                });
    3838                                        },
    3939                                        modes : { wysiwyg:1, source:1 },
     40                                        readOnly : 1,
    4041                                        canUndo : false
    4142                                });
    4243
  • _source/core/editor.js

     
    160160                 */
    161161                editor.tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0;
    162162
     163                /**
     164                 * Immutable field indicate the read-only state of this editor.
     165                 * @name CKEDITOR.editor.prototype.readOnly
     166                 * @see CKEDITOR.editor.prototype.setReadOnly
     167                 * @type Boolean
     168                 * @default CKEDITOR.config.readOnly
     169                 * @since 3.6
     170                 */
     171                editor.readOnly = !!( editor.config.readOnly || editor.element.getAttribute( 'disabled' ) );
     172
    163173                // Fire the "configLoaded" event.
    164174                editor.fireOnce( 'configLoaded' );
    165175
     
    394404                }
    395405        };
    396406
    397         function updateCommandsMode()
     407        function updateCommands()
    398408        {
    399409                var command,
    400410                        commands = this._.commands,
     
    403413                for ( var name in commands )
    404414                {
    405415                        command = commands[ name ];
    406                         command[ command.startDisabled ? 'disable' : command.modes[ mode ] ? 'enable' : 'disable' ]();
     416                        command[ command.startDisabled ? 'disable' :
     417                                         this.readOnly && !command.readOnly ? 'disable' : command.modes[ mode ] ? 'enable' : 'disable' ]();
    407418                }
    408419        }
    409420
     
    491502
    492503                        CKEDITOR.fire( 'instanceCreated', null, this );
    493504
    494                         this.on( 'mode', updateCommandsMode, null, null, 1 );
     505                        this.on( 'mode', updateCommands, null, null, 1 );
    495506
    496507                        initConfig( this, instanceConfig );
    497508                };
     
    714725                },
    715726
    716727                /**
     728                 * Turn editor into read-only mode or restore it from read-only mode.
     729                 * @param enable {Boolean}
     730                 * @since 3.6
     731                 * <strong>Note:</strong> current editing block will be reloaded.
     732                 */
     733                setReadOnly : function( enable )
     734                {
     735                        if ( this.readOnly != enable )
     736                        {
     737                                this.readOnly = !!enable;
     738                                // Reload current mode, then fire the event on editor.
     739                                this.fire( 'readOnly' );
     740                        }
     741                },
     742
     743                /**
    717744                 * Inserts HTML into the currently selected position in the editor.
    718745                 * @param {String} data HTML code to be inserted into the editor.
    719746                 * @example
     
    841868 */
    842869
    843870/**
     871 * Whether to start the editor in read-only mode, otherwise it depends on if "disabled" attribute is presented on the host &lt;textarea&gt;.
     872 * @name CKEDITOR.config.readOnly
     873 * @see CKEDITOR.editor.setReadOnly
     874 * @type Boolean
     875 * @default false
     876 * @since 3.6
     877 * @example
     878 * config.readOnly = true;
     879 */
     880
     881/**
    844882 * Fired when a CKEDITOR instance is created, but still before initializing it.
    845883 * To interact with a fully initialized instance, use the
    846884 * {@link CKEDITOR#instanceReady} event instead.
     
    9831021 * @param {CKEDITOR.editor} editor This editor instance.
    9841022 * @param {Object} element The element to insert.
    9851023 */
     1024
     1025/**
     1026 * Event fired once editor's {@link CKEDITOR.editor.prototype.readOnly} state has changed.
     1027 * @name CKEDITOR.editor#readOnly
     1028 * @event
     1029 * @param {CKEDITOR.editor} editor This editor instance.
     1030 */
  • _source/plugins/toolbar/plugin.js

     
    3636                toolbarFocus :
    3737                {
    3838                        modes : { wysiwyg : 1, source : 1 },
     39                        readOnly : 1,
    3940
    4041                        exec : function( editor )
    4142                        {
     
    294295
    295296                                                        editor.addCommand( 'toolbarCollapse',
    296297                                                                {
     298                                                                        readOnly : 1,
    297299                                                                        exec : function( editor )
    298300                                                                        {
    299301                                                                                var collapser = CKEDITOR.document.getById( collapserId ),
  • _source/plugins/print/plugin.js

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

     
    130130
    131131                        editor.on( 'mode', function()
    132132                                {
    133                                         this.setState( this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
     133                                        var state = this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
     134                                        this.setState( editor.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : state  );
    134135                                        this.setValue( '' );
    135136                                },
    136137                                this );
  • _source/plugins/button/plugin.js

     
    149149                        editor.on( 'mode', function()
    150150                                {
    151151                                        var mode = editor.mode;
     152
    152153                                        // Restore saved button state.
    153                                         this.setState( this.modes[ mode ] ?
    154                                                 modeStates[ mode ] != undefined ? modeStates[ mode ] :
    155                                                         CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
     154                                        var state = this.modes[ mode ] ? modeStates[ mode ] != undefined ? modeStates[ mode ] :
     155                                                        CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
     156
     157                                        this.setState( editor.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : state );
    156158                                }, this);
    157159                }
    158160                else if ( command )
  • _source/plugins/sourcearea/plugin.js

     
    4141                                                        textarea.addClass( 'cke_source' );
    4242                                                        textarea.addClass( 'cke_enable_context_menu' );
    4343
     44                                                        editor.readOnly && textarea.setAttribute( 'disabled', true );
     45
    4446                                                        var styles =
    4547                                                        {
    4648                                                                // IE7 has overflow the <textarea> from wrapping table cell.
     
    181183                {
    182184                        modes : { wysiwyg:1, source:1 },
    183185                        editorFocus : false,
    184 
     186                        readOnly : 1,
    185187                        exec : function( editor )
    186188                        {
    187189                                if ( editor.mode == 'wysiwyg' )
  • _source/plugins/clipboard/plugin.js

     
    293293                // keyboard paste or execCommand ) (#4874).
    294294                CKEDITOR.env.ie && ( depressBeforeEvent = 1 );
    295295
    296                 var retval = editor.document.$.queryCommandEnabled( command ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
     296                var retval = CKEDITOR.TRISTATE_OFF;
     297                try { retval = editor.document.$.queryCommandEnabled( command ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; }catch( er ){}
     298
    297299                depressBeforeEvent = 0;
    298300                return retval;
    299301        }
  • _source/plugins/undo/plugin.js

     
    9090                        // Make the undo manager available only in wysiwyg mode.
    9191                        editor.on( 'mode', function()
    9292                                {
    93                                         undoManager.enabled = editor.mode == 'wysiwyg';
     93                                        undoManager.enabled = editor.readOnly ? false : editor.mode == 'wysiwyg';
    9494                                        undoManager.onChange();
    9595                                });
    9696
  • _source/plugins/link/plugin.js

     
    5454                // Register selection change handler for the unlink button.
    5555                 editor.on( 'selectionChange', function( evt )
    5656                        {
     57                                if ( editor.readOnly )
     58                                        return;
     59
    5760                                /*
    5861                                 * Despite our initial hope, document.queryCommandEnabled() does not work
    5962                                 * for this in Firefox. So we must detect the state by element paths.
  • _source/plugins/enterkey/plugin.js

     
    1111
    1212                init : function( editor )
    1313                {
    14                         var specialKeys = editor.specialKeys;
    15                         specialKeys[ 13 ] = enter;
    16                         specialKeys[ CKEDITOR.SHIFT + 13 ] = shiftEnter;
     14                        editor.addCommand( 'enter', {
     15                                modes : { wysiwyg:1 },
     16                                editorFocus : false,
     17                                exec : enter
     18                        });
     19
     20                        editor.addCommand( 'shiftEnter', {
     21                                modes : { wysiwyg:1 },
     22                                editorFocus : false,
     23                                exec : shiftEnter
     24                        });
     25
     26                        var keystrokes = editor.keystrokeHandler.keystrokes;
     27                        keystrokes[ 13 ] = 'enter';
     28                        keystrokes[ CKEDITOR.SHIFT + 13 ] = 'shiftEnter';
    1729                }
    1830        });
    1931
  • _source/plugins/preview/plugin.js

     
    1313        {
    1414                modes : { wysiwyg:1, source:1 },
    1515                canUndo : false,
     16                readOnly : 1,
    1617                exec : function( editor )
    1718                {
    1819                        var sHTML,
  • _source/plugins/list/plugin.js

     
    218218
    219219        function onSelectionChange( evt )
    220220        {
     221                if ( evt.editor.readOnly )
     222                        return;
     223
    221224                var path = evt.data.path,
    222225                        blockLimit = path.blockLimit,
    223226                        elements = path.elements,
  • _source/plugins/blockquote/plugin.js

     
    2525
    2626        function onSelectionChange( evt )
    2727        {
    28                 var editor = evt.editor,
    29                         command = editor.getCommand( 'blockquote' );
     28                var editor = evt.editor;
     29                if ( editor.readOnly )
     30                        return;
     31
     32                var command = editor.getCommand( 'blockquote' );
    3033                command.state = getState( editor, evt.data.path );
    3134                command.fire( 'state' );
    3235        }
  • _source/plugins/wysiwygarea/plugin.js

     
    598598
    599599                                                body.spellcheck = !editor.config.disableNativeSpellChecker;
    600600
     601                                                var editable = !editor.readOnly;
     602
    601603                                                if ( CKEDITOR.env.ie )
    602604                                                {
    603605                                                        // Don't display the focus border.
     
    606608                                                        // Disable and re-enable the body to avoid IE from
    607609                                                        // taking the editing focus at startup. (#141 / #523)
    608610                                                        body.disabled = true;
    609                                                         body.contentEditable = true;
     611                                                        body.contentEditable = editable;
    610612                                                        body.removeAttribute( 'disabled' );
    611613                                                }
    612614                                                else
     
    618620                                                                // Prefer 'contentEditable' instead of 'designMode'. (#3593)
    619621                                                                if ( CKEDITOR.env.gecko && CKEDITOR.env.version >= 10900
    620622                                                                                || CKEDITOR.env.opera )
    621                                                                         domDocument.$.body.contentEditable = true;
     623                                                                        domDocument.$.body.contentEditable = editable;
    622624                                                                else if ( CKEDITOR.env.webkit )
    623                                                                         domDocument.$.body.parentNode.contentEditable = true;
     625                                                                        domDocument.$.body.parentNode.contentEditable = editable;
    624626                                                                else
    625                                                                         domDocument.$.designMode = 'on';
     627                                                                        domDocument.$.designMode = editable? 'off' : 'on';
    626628                                                        }, 0 );
    627629                                                }
    628630
    629                                                 CKEDITOR.env.gecko && CKEDITOR.tools.setTimeout( activateEditing, 0, null, editor );
     631                                                editable && CKEDITOR.env.gecko && CKEDITOR.tools.setTimeout( activateEditing, 0, null, editor );
    630632
    631633                                                domWindow       = editor.window = new CKEDITOR.dom.window( domWindow );
    632634                                                domDocument     = editor.document       = new CKEDITOR.dom.document( domDocument );
    633635
    634                                                 domDocument.on( 'dblclick', function( evt )
     636                                                editable && domDocument.on( 'dblclick', function( evt )
    635637                                                {
    636638                                                        var element = evt.data.getTarget(),
    637639                                                                data = { element : element, dialog : '' };
     
    712714
    713715                                                // IE standard compliant in editing frame doesn't focus the editor when
    714716                                                // clicking outside actual content, manually apply the focus. (#1659)
    715                                                 if ( CKEDITOR.env.ie
    716                                                         && domDocument.$.compatMode == 'CSS1Compat'
     717                                                if ( editable &&
     718                                                                CKEDITOR.env.ie && domDocument.$.compatMode == 'CSS1Compat'
    717719                                                                || CKEDITOR.env.gecko
    718720                                                                || CKEDITOR.env.opera )
    719721                                                {
     
    744746                                                        {
    745747                                                                var doc = editor.document;
    746748
    747                                                                 if ( CKEDITOR.env.gecko && CKEDITOR.env.version >= 10900 )
     749                                                                if ( editable && CKEDITOR.env.gecko && CKEDITOR.env.version >= 10900 )
    748750                                                                        blinkCursor();
    749751                                                                else if ( CKEDITOR.env.opera )
    750752                                                                        doc.getBody().focus();
     
    762764                                                        });
    763765
    764766                                                var keystrokeHandler = editor.keystrokeHandler;
    765                                                 if ( keystrokeHandler )
    766                                                         keystrokeHandler.attach( domDocument );
     767                                                // Prevent backspace from navigating off the page.
     768                                                !editable && ( keystrokeHandler.blockedKeystrokes[ 8 ] = 1 );
     769                                                keystrokeHandler.attach( domDocument );
    767770
    768771                                                if ( CKEDITOR.env.ie )
    769772                                                {
    770773                                                        domDocument.getDocumentElement().addClass( domDocument.$.compatMode );
    771774                                                        // Override keystrokes which should have deletion behavior
    772775                                                        //  on control types in IE . (#4047)
    773                                                         domDocument.on( 'keydown', function( evt )
     776                                                        editable && domDocument.on( 'keydown', function( evt )
    774777                                                        {
    775778                                                                var keyCode = evt.data.getKeystroke();
    776779
  • _source/plugins/bidi/plugin.js

     
    2222        {
    2323                var editor = evt.editor,
    2424                        path = evt.data.path;
     25
     26                if ( editor.readOnly )
     27                        return;
     28
    2529                var useComputedState = editor.config.useComputedState,
    2630                        selectedElement;
    2731
  • _samples/index.html

     
    7979                <li><a class="samples" href="output_for_flash.html">Output for Flash</a><br />
    8080                        Configuring CKEditor to produce HTML code that can be used with Adobe Flash.
    8181                </li>
     82                <li><a class="samples" href="readonly.html">ReadOnly mode</a><br />
     83                        Using the readOnly API to disallow making any change to the editor content.
     84                </li>
    8285                <li><a class="samples" href="placeholder.html">Placeholder plugin</a><br />
    8386                        Using the Placeholder plugin to create uneditable sections that can only be created and modified with a proper dialog window.
    8487                </li>
  • _source/plugins/maximize/plugin.js

     
    8585                for ( var i in all )
    8686                {
    8787                        var one = all[ i ];
    88                         if ( one.mode == 'wysiwyg' )
     88                        if ( one.mode == 'wysiwyg' && !one.readOnly )
    8989                        {
    9090                                var body = one.document.getBody();
    9191                                // Refresh 'contentEditable' otherwise
     
    155155                        editor.addCommand( 'maximize',
    156156                                {
    157157                                        modes : { wysiwyg : 1, source : 1 },
     158                                        readOnly : 1,
    158159                                        editorFocus : false,
    159160                                        exec : function()
    160161                                        {
  • _source/plugins/indent/plugin.js

     
    1515
    1616        function onSelectionChange( evt )
    1717        {
     18                if ( evt.editor.readOnly )
     19                        return;
     20
    1821                var editor = evt.editor,
    1922                        elementPath = evt.data.path,
    2023                        list = elementPath && elementPath.contains( listNodeNames ),
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy