Ticket #2763: 2763_5.patch

File 2763_5.patch, 7.1 KB (added by Frederico Caldeira Knabben, 15 years ago)
  • _source/core/command.js

     
    99
    1010        this.exec = function()
    1111        {
    12                 commandDefinition.exec.call( this, editor );
     12                if ( this.state == CKEDITOR.TRISTATE_DISABLED )
     13                        return false;
     14
     15                return ( commandDefinition.exec.call( this, editor ) !== false );
    1316        };
    1417
    1518        CKEDITOR.tools.extend( this, commandDefinition );
  • _source/core/commanddefinition.js

     
    2424 * @function
    2525 * @param {CKEDITOR.editor} editor The editor within which run the command.
    2626 * @param {Object} [data] Additional data to be used to execute the command.
     27 * @returns {Boolean} Whether the command has been successfully executed.
     28 *              Defaults to "true", if nothing is returned.
    2729 * @example
    2830 * editorInstance.addCommand( 'sample',
    2931 * {
     
    3335 *     }
    3436 * });
    3537 */
     38
     39/**
     40 * Whether the command need to be hooked into the redo/undo system.
     41 * @name  CKEDITOR.commandDefinition.canUndo
     42 * @type {Boolean} If not defined or 'true' both hook into undo system, set it
     43 *              to 'false' explicitly  keep it out.
     44 * @field
     45 * @example
     46 * editorInstance.addCommand( 'alertName',
     47 * {
     48 *     exec : function( editor )
     49 *     {
     50 *         alert( editor.name );
     51 *     },
     52 *     canUndo : false    // No support for undo/redo
     53 * });
     54 */
  • _source/core/config.js

     
    146146         * @example
    147147         * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
    148148         */
     149        plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,preview,removeformat,smiley,indent,link,list,sourcearea,table,specialchar,tab,toolbar,undo,wysiwygarea',
    149150
    150         plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,preview,removeformat,smiley,indent,link,list,sourcearea,table,specialchar,tab,toolbar,wysiwygarea',
    151 
    152151        /**
    153152         * The theme to be used to build the UI.
    154153         * @type String
  • _source/core/editor.js

     
    346346                 */
    347347                addCommand : function( commandName, commandDefinition )
    348348                {
    349                         this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition );
     349                        return this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition );
    350350                },
    351351
    352352                addCss : function( css )
     
    386386                execCommand : function( commandName, data )
    387387                {
    388388                        var command = this.getCommand( commandName );
     389
     390                        var eventData =
     391                        {
     392                                name: commandName,
     393                                commandData: data,
     394                                command: command
     395                        };
     396
    389397                        if ( command && command.state != CKEDITOR.TRISTATE_DISABLED )
    390                                 return command.exec( this, data );
     398                        {
     399                                if ( this.fire( 'beforeCommandExec', eventData ) !== false )
     400                                {
     401                                        eventData.returnValue = command.exec( this, eventData.commandData );
    391402
     403                                        if ( this.fire( 'afterCommandExec', eventData ) !== false )
     404                                                return eventData.returnValue;
     405                                }
     406                        }
     407
    392408                        // throw 'Unknown command name "' + commandName + '"';
    393409                        return false;
    394410                },
     
    454470                        return data;
    455471                },
    456472
     473                loadSnapshot : function( snapshot )
     474                {
     475                        this.fire( 'loadSnapshot', snapshot );
     476                },
     477
    457478                /**
    458479                 * Sets the editor data. The data must be provided in raw format.
    459480                 * @param {String} data HTML code to replace the curent content in the editor.
  • _source/core/tools.js

     
    1515 */
    1616CKEDITOR.tools =
    1717{
     18        arrayCompare : function( arrayA, arrayB )
     19        {
     20                if ( !arrayA && !arrayB )
     21                        return true;
     22
     23                if ( !arrayA || !arrayB || arrayA.length != arrayB.length )
     24                        return false;
     25
     26                for ( var i = 0 ; i < arrayA.length ; i++ )
     27                {
     28                        if ( arrayA[ i ] != arrayB[ i ] )
     29                                return false;
     30                }
     31
     32                return true;
     33        },
     34
    1835        /**
    1936         * Copy the properties from one object to another. By default, properties
    2037         * already present in the target object <strong>are not</strong> overwritten.
  • _source/lang/en.js

     
    4343        horizontalrule  : 'Insert Horizontal Line',
    4444        pagebreak               : 'Insert Page Break',
    4545        unlink                  : 'Unlink',
     46        undo                    : 'Undo',
     47        redo                    : 'Redo',
    4648
    4749        // Common messages and labels.
    4850        common :
  • _source/plugins/editingblock/plugin.js

     
    7070                                        if ( editor.mode )
    7171                                                event.data = getMode( editor ).getSnapshotData();
    7272                                });
     73
     74                        editor.on( 'loadSnapshot', function( event )
     75                                {
     76                                        if ( editor.mode )
     77                                                getMode( editor ).loadSnapshotData( event.data );
     78                                });
    7379                }
    7480        });
    7581
  • _source/plugins/selection/plugin.js

     
    633633                        return retval;
    634634                },
    635635
     636                createBookmarks2 : function()
     637                {
     638                        var bookmarks = [],
     639                                ranges = this.getRanges();
     640
     641                        for ( var i = 0 ; i < ranges.length ; i++ )
     642                                bookmarks.push( ranges[i].createBookmark2() );
     643                       
     644                        return bookmarks;
     645                },
     646
    636647                selectBookmarks : function( bookmarks )
    637648                {
    638649                        var ranges = [];
  • _source/plugins/toolbar/plugin.js

     
    212212                'NumberedList', 'BulletedList', '-',
    213213                'Outdent', 'Indent', '-',
    214214                'Subscript', 'Superscript', '-',
     215                'Undo', 'Redo', '-',
    215216                'SelectAll', 'RemoveFormat', '-',
    216217                'Link', 'Unlink', 'Anchor', '-',
    217218                'Table', 'Smiley', 'HorizontalRule', 'SpecialChar', 'PageBreak'
  • _source/skins/default/toolbar.css

     
    310310{
    311311        background-position: 0 -880px;
    312312}
    313 
     313.cke_skin_default a.cke_button_undo .cke_icon
     314{
     315        background-position: 0 -208px;
     316}
     317.cke_skin_default a.cke_button_redo .cke_icon
     318{
     319        background-position: 0 -224px;
     320}
    314321.cke_skin_default a.cke_button_numberedlist .cke_icon
    315322{
    316323        background-position: 0 -400px;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy