Ticket #5345: 5345.patch

File 5345.patch, 6.6 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/core/editor.js

     
    505505                        if ( this._.filebrowserFn )
    506506                                CKEDITOR.tools.removeFunction( this._.filebrowserFn );
    507507
    508                         items = editor.config.elementsPath_filters;
    509                         if ( items )
    510                         {
    511                                 for ( index= 0 ; index < items.length ; index++ )
    512                                         items[ index ] = null;
    513                         }
    514 
    515508                        this.fire( 'destroy' );
    516509                        CKEDITOR.remove( this );
    517510                        CKEDITOR.fire( 'instanceDestroyed', null, this );
  • _source/plugins/elementspath/plugin.js

     
    4444
    4545                        var idBase = 'cke_elementspath_' + CKEDITOR.tools.getNextNumber() + '_';
    4646
    47                         editor._.elementsPath = { idBase : idBase };
     47                        editor._.elementsPath = { idBase : idBase, filters : [] };
    4848
    4949                        editor.on( 'themeSpace', function( event )
    5050                                {
     
    5656                                        }
    5757                                });
    5858
    59                         var filters = editor.config.elementsPath_filters;
    60 
    6159                        editor.on( 'selectionChange', function( ev )
    6260                                {
    63                                         var env = CKEDITOR.env;
    64 
    65                                         var selection = ev.data.selection;
    66 
    67                                         var element = selection.getStartElement(),
     61                                        var env = CKEDITOR.env,
     62                                                selection = ev.data.selection,
     63                                                element = selection.getStartElement(),
    6864                                                html = [],
    69                                                 elementsList = this._.elementsPath.list = [];
     65                                                editor = ev.editor,
     66                                                elementsList = editor._.elementsPath.list = [],
     67                                                filters = editor._.elementsPath.filters;
    7068
    7169                                        while ( element )
    7270                                        {
     
    114112                                                                        ( ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) ?
    115113                                                                        ' onfocus="event.preventBubble();"' : '' ) +
    116114                                                                        ' hidefocus="true" ' +
    117                                                                         ' onkeydown="return CKEDITOR._.elementsPath.keydown(\'', this.name, '\',', index, ', event);"' +
     115                                                                        ' onkeydown="return CKEDITOR._.elementsPath.keydown(\'', editor.name, '\',', index, ', event);"' +
    118116                                                                        extra ,
    119                                                                         ' onclick="return CKEDITOR._.elementsPath.click(\'', this.name, '\',', index, ');"',
     117                                                                        ' onclick="return CKEDITOR._.elementsPath.click(\'', editor.name, '\',', index, ');"',
    120118                                                                        ' role="button" aria-labelledby="' + idBase + index + '_label">',
    121119                                                                                name,
    122120                                                                                '<span id="', idBase, index, '_label" class="cke_label">' + label + '</span>',
     
    204202        }
    205203};
    206204
    207 /**
    208  * A list of filter functions to determinate whether an element should display in elements path bar.
    209  * @type Array Array of functions that optionaly return 'false' to prevent the element from displaying.
    210  * @default  []
    211  * @example
    212  *      // Prevent elements with attribute 'myAttribute' to appear in elements path.
    213  *      editor.config.elementsPath_filters.push( function( element )
    214  *      {
    215  *              if( element.hasAttribute( 'myAttribute') )
    216  *                      return false;
    217  *      });
    218  */
    219 CKEDITOR.config.elementsPath_filters = [];
  • _source/plugins/scayt/plugin.js

     
    4646                        oParams.customDictionaryIds = editor.config.scayt_customDictionaryIds || '';
    4747                        oParams.userDictionaryName = editor.config.scayt_userDictionaryName || '';
    4848                        oParams.sLang = editor.config.scayt_sLang || "en_US";
    49                        
    5049
    5150                        var scayt_custom_params = window.scayt_custom_params;
    5251                        if ( typeof scayt_custom_params == 'object')
     
    5655                                        oParams[ k ] = scayt_custom_params[ k ];
    5756                                }
    5857                        }
    59                        
     58
    6059                        if ( scayt_control_id )
    6160                                oParams.id = scayt_control_id;
    62                        
     61
    6362                        var scayt_control = new window.scayt( oParams );
    6463
    6564                        // Copy config.
     
    124123                        });
    125124
    126125
    127                 editor.on( 'destroy', function()
     126                editor.on( 'destroy', function( ev )
    128127                        {
     128                                var editor = ev.editor,
     129                                        scayt_instanse = plugin.getScayt( editor );
     130
    129131                                scayt_control_id = scayt_instanse.id;
    130132                                plugin.getScayt( editor ).destroy( true );
    131133                        });
     
    133135                editor.on( 'afterSetData', function()
    134136                        {
    135137                                if ( plugin.isScaytEnabled( editor ) ) {
    136                                         window.setTimeout( function(){ plugin.getScayt( editor ).refresh() }, 10 );
     138                                        window.setTimeout( function(){ plugin.getScayt( editor ).refresh(); }, 10 );
    137139                                }
    138140                        });
    139141
     
    149151                                                editor.getSelection().unlock( true );
    150152
    151153                                        // Swallow any SCAYT engine errors.
    152                                         window.setTimeout( function(){ scayt_instance.refresh() }, 10 );
     154                                        window.setTimeout( function(){ scayt_instance.refresh(); }, 10 );
    153155                                }
    154156                        }, this, null, 50 );
    155157
     
    165167                                                editor.getSelection().unlock( true );
    166168
    167169                                        // Swallow any SCAYT engine errors.
    168                                        
    169                                         window.setTimeout( function(){ scayt_instance.refresh() },10 );
    170                                        
     170
     171                                        window.setTimeout( function(){ scayt_instance.refresh(); },10 );
     172
    171173                                }
    172174                        }, this, null, 50 );
    173175
     
    239241                                },
    240242                                this,
    241243                                null,
    242                                 0 
     244                                0
    243245                        );      // First to run.
    244246
    245247                        this.engineLoaded = -1; // Loading in progress.
     
    475477
    476478                                                var scayt_control = plugin.getScayt( editor ),
    477479                                                        node = scayt_control.getScaytNode();
    478                                                
     480
    479481                                                if ( !node )
    480482                                                        return null;
    481483
     
    609611                                editor.on( 'showScaytState', showInitialState );
    610612                                plugin.loadEngine( editor );
    611613                        }
     614                },
    612615
     616                afterInit : function( editor )
     617                {
    613618                        // Prevent word marker line from displaying in elements path. (#3570)
    614619                        var elementsPathFilters;
    615                         if ( elementsPathFilters = editor.config.elementsPath_filters )
     620                        if ( editor._.elementsPath && ( elementsPathFilters = editor._.elementsPath.filters ) )
    616621                        {
    617622                                elementsPathFilters.push( function( element )
    618623                                {
     
    620625                                                return false;
    621626                                } );
    622627                        }
     628                }
    623629
    624                 }
    625630        });
    626631})();
    627632
     
    656661 */
    657662
    658663/**
    659  * Sets the customer ID for SCAYT. Required for migration from free version 
     664 * Sets the customer ID for SCAYT. Required for migration from free version
    660665 * with banner to paid version.
    661666 * @name CKEDITOR.config.scayt_customerid
    662667 * @type String
     
    732737
    733738/**
    734739 * Links SCAYT to custom dictionaries. It's a string containing dictionary ids
    735  * separared by commas (","). Available only for licensed version. 
     740 * separared by commas (","). Available only for licensed version.
    736741 * Further details at http://wiki.spellchecker.net/doku.php?id=custom_dictionary_support .
    737742 * @name CKEDITOR.config.scayt_customDictionaryIds
    738743 * @type String
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy