X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ffind%2Fdialogs%2Ffind.js;h=b6b2d450358f610b0b0581b23e6489b7284e4818;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=6711fe58740d6907dc6c99dd1abea9df4ee4ea5c;hpb=f0610347140239143439a511ee2bd48cb784f470;p=ckeditor.git diff --git a/_source/plugins/find/dialogs/find.js b/_source/plugins/find/dialogs/find.js index 6711fe5..b6b2d45 100644 --- a/_source/plugins/find/dialogs/find.js +++ b/_source/plugins/find/dialogs/find.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -71,8 +71,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Style object for highlights: (#5018) // 1. Defined as full match style to avoid compromising ordinary text color styles. // 2. Must be apply onto inner-most text to avoid conflicting with ordinary text color styles visually. - var highlightStyle = new CKEDITOR.style( CKEDITOR.tools.extend( { fullMatch : true, childRule : function(){ return 0; } }, - editor.config.find_highlight ) ); + var highlightStyle = new CKEDITOR.style( + CKEDITOR.tools.extend( { attributes : { 'data-cke-highlight': 1 }, fullMatch : 1, ignoreReadonly : 1, childRule : function(){ return 0; } }, + editor.config.find_highlight, true ) ); /** * Iterator which walk through the specified range char by char. By @@ -154,7 +155,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( this._.matchWord && !currentTextNode || this._.walker._.end ) break; - } + } // Found a fresh text node. this.textNode = currentTextNode; if ( currentTextNode ) @@ -494,8 +495,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license tail = cursors[ cursors.length - 1 ], head = cursors[ 0 ]; - var headWalker = new characterWalker( getRangeBeforeCursor( head ), true ), - tailWalker = new characterWalker( getRangeAfterCursor( tail ), true ); + var rangeBefore = getRangeBeforeCursor( head ), + rangeAfter = getRangeAfterCursor( tail ); + + // The word boundary checks requires to trim the text nodes. (#9036) + rangeBefore.trim(); + rangeAfter.trim(); + + var headWalker = new characterWalker( rangeBefore, true ), + tailWalker = new characterWalker( rangeAfter, true ); if ( ! ( isWordSeparator( headWalker.back().character ) && isWordSeparator( tailWalker.next().character ) ) ) @@ -646,29 +654,36 @@ For licensing, see LICENSE.html or http://ckeditor.com/license ] }, { - type : 'vbox', - padding : 0, + type : 'fieldset', + label : CKEDITOR.tools.htmlEncode( lang.findOptions ), + style : 'margin-top:29px', children : [ { - type : 'checkbox', - id : 'txtFindCaseChk', - isChanged : false, - style : 'margin-top:28px', - label : lang.matchCase - }, - { - type : 'checkbox', - id : 'txtFindWordChk', - isChanged : false, - label : lang.matchWord - }, - { - type : 'checkbox', - id : 'txtFindCyclic', - isChanged : false, - 'default' : true, - label : lang.matchCyclic + type : 'vbox', + padding : 0, + children : + [ + { + type : 'checkbox', + id : 'txtFindCaseChk', + isChanged : false, + label : lang.matchCase + }, + { + type : 'checkbox', + id : 'txtFindWordChk', + isChanged : false, + label : lang.matchWord + }, + { + type : 'checkbox', + id : 'txtFindCyclic', + isChanged : false, + 'default' : true, + label : lang.matchCyclic + } + ] } ] } @@ -768,31 +783,35 @@ For licensing, see LICENSE.html or http://ckeditor.com/license ] }, { - type : 'vbox', - padding : 0, + type : 'fieldset', + label : CKEDITOR.tools.htmlEncode( lang.findOptions ), children : [ { - type : 'checkbox', - id : 'txtReplaceCaseChk', - isChanged : false, - label : lang - .matchCase - }, - { - type : 'checkbox', - id : 'txtReplaceWordChk', - isChanged : false, - label : lang - .matchWord - }, - { - type : 'checkbox', - id : 'txtReplaceCyclic', - isChanged : false, - 'default' : true, - label : lang - .matchCyclic + type : 'vbox', + padding : 0, + children : + [ + { + type : 'checkbox', + id : 'txtReplaceCaseChk', + isChanged : false, + label : lang.matchCase + }, + { + type : 'checkbox', + id : 'txtReplaceWordChk', + isChanged : false, + label : lang.matchWord + }, + { + type : 'checkbox', + id : 'txtReplaceCyclic', + isChanged : false, + 'default' : true, + label : lang.matchCyclic + } + ] } ] }