Ticket #5319: 5319_2.patch

File 5319_2.patch, 1.6 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/find/dialogs/find.js

     
    1 /*
     1/*
    22Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
    55
    66(function()
    77{
    8         function guardDomWalkerNonEmptyTextNode( node )
     8        function nonEmptyText( node )
    99        {
    1010                return ( node.type == CKEDITOR.NODE_TEXT && node.getLength() > 0 );
    1111        }
     
    1313        /**
    1414         * Elements which break characters been considered as sequence.
    1515        */
    16         function checkCharactersBoundary ( node )
     16        function nonCharactersBoundary ( node )
    1717        {
    18                 var dtd = CKEDITOR.dtd;
    19                 return node.isBlockBoundary(
    20                         CKEDITOR.tools.extend( {}, dtd.$empty, dtd.$nonEditable ) );
     18                return !( node.type == CKEDITOR.NODE_ELEMENT && node.isBlockBoundary(
     19                        CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$empty, CKEDITOR.dtd.$nonEditable ) ) );
    2120        }
    2221
    2322        /**
     
    8483                {
    8584                        var walker =
    8685                                new CKEDITOR.dom.walker( range );
    87                         walker[ 'evaluator' ] = guardDomWalkerNonEmptyTextNode;
     86                        walker.guard = matchWord ? nonCharactersBoundary : null;
     87                        walker[ 'evaluator' ] = nonEmptyText;
    8888                        walker.breakOnFalse = true;
    8989
    9090                        this._ = {
     
    145145
    146146                                                // Marking as match character boundaries.
    147147                                                if ( !currentTextNode
    148                                                    && checkCharactersBoundary( this._.walker.current ) )
     148                                                   && !nonCharactersBoundary( this._.walker.current ) )
    149149                                                        this._.matchBoundary = true;
    150150
    151151                                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy