Ticket #4772: 4772.patch

File 4772.patch, 2.9 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/styles/plugin.js

     
    375375                                }
    376376
    377377                                // Check if the current node can be a child of the style element.
    378                                 if ( !nodeName || ( dtd[ nodeName ] && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) ) )
     378                                if ( !nodeName || ( dtd[ nodeName ]
     379                                                          && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
     380                                                          && ( !def.childRule || def.childRule( currentNode ) ) ) )
    379381                                {
    380382                                        var currentParent = currentNode.getParent();
    381383
    382384                                        // Check if the style element can be a child of the current
    383385                                        // node parent or if the element is not defined in the DTD.
    384                                         if ( currentParent && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement ) )
     386                                        if ( currentParent
     387                                                        && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement )
     388                                                        && ( !def.parentRule || def.parentRule( currentParent ) ) )
    385389                                        {
    386390                                                // This node will be part of our range, so if it has not
    387391                                                // been started, place its start right before the node.
     
    406410                                                        // to the range.
    407411                                                        while ( !includedNode.$.nextSibling
    408412                                                                && ( parentNode = includedNode.getParent(), dtd[ parentNode.getName() ] )
    409                                                                 && ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) )
     413                                                                && ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
     414                                                                && ( !def.childRule || def.childRule( parentNode ) ) )
    410415                                                        {
    411416                                                                includedNode = parentNode;
    412417                                                        }
  • _source/plugins/colorbutton/plugin.js

     
    194194        {
    195195                element         : 'span',
    196196                styles          : { 'color' : '#(color)' },
    197                 overrides       : [ { element : 'font', attributes : { 'color' : null } } ]
     197                overrides       : [ { element : 'font', attributes : { 'color' : null } } ],
     198                childRule : function( element )
     199                {
     200                        return element.getName() != 'a';
     201                }
    198202        };
    199203
    200204/**
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy