1 /* 2 Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 */ 5 6 CKEDITOR.plugins.add( 'find', 7 { 8 requires : [ 'dialog' ], 9 init : function( editor ) 10 { 11 var forms = CKEDITOR.plugins.find; 12 editor.ui.addButton( 'Find', 13 { 14 label : editor.lang.findAndReplace.find, 15 command : 'find' 16 }); 17 var findCommand = editor.addCommand( 'find', new CKEDITOR.dialogCommand( 'find' ) ); 18 findCommand.canUndo = false; 19 findCommand.readOnly = 1; 20 21 editor.ui.addButton( 'Replace', 22 { 23 label : editor.lang.findAndReplace.replace, 24 command : 'replace' 25 }); 26 var replaceCommand = editor.addCommand( 'replace', new CKEDITOR.dialogCommand( 'replace' ) ); 27 replaceCommand.canUndo = false; 28 29 CKEDITOR.dialog.add( 'find', this.path + 'dialogs/find.js' ); 30 CKEDITOR.dialog.add( 'replace', this.path + 'dialogs/find.js' ); 31 }, 32 33 requires : [ 'styles' ] 34 } ); 35 36 /** 37 * Defines the style to be used to highlight results with the find dialog. 38 * @type Object 39 * @default { element : 'span', styles : { 'background-color' : '#004', 'color' : '#fff' } } 40 * @example 41 * // Highlight search results with blue on yellow. 42 * config.find_highlight = 43 * { 44 * element : 'span', 45 * styles : { 'background-color' : '#ff0', 'color' : '#00f' } 46 * }; 47 */ 48 CKEDITOR.config.find_highlight = { element : 'span', styles : { 'background-color' : '#004', 'color' : '#fff' } }; 49