[2000] | 1 | /*
|
---|
| 2 | Copyright (c) 2003-2009, 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 | init : function( editor )
|
---|
| 9 | {
|
---|
| 10 | var forms = CKEDITOR.plugins.find;
|
---|
| 11 | editor.ui.addButton( 'Find',
|
---|
| 12 | {
|
---|
| 13 | label : editor.lang.findAndReplace.find,
|
---|
| 14 | command : 'find'
|
---|
| 15 | });
|
---|
| 16 | var findCommand = editor.addCommand( 'find', new CKEDITOR.dialogCommand( 'find' ) );
|
---|
| 17 | findCommand.canUndo = false;
|
---|
| 18 |
|
---|
| 19 | editor.ui.addButton( 'Replace',
|
---|
| 20 | {
|
---|
| 21 | label : editor.lang.findAndReplace.replace,
|
---|
| 22 | command : 'replace'
|
---|
| 23 | });
|
---|
| 24 | var replaceCommand = editor.addCommand( 'replace', new CKEDITOR.dialogCommand( 'replace' ) );
|
---|
| 25 | replaceCommand.canUndo = false;
|
---|
| 26 |
|
---|
| 27 | CKEDITOR.dialog.add( 'find', this.path + 'dialogs/find.js' );
|
---|
| 28 | CKEDITOR.dialog.add( 'replace', this.path + 'dialogs/find.js' );
|
---|
| 29 | },
|
---|
| 30 |
|
---|
| 31 | requires : [ 'styles' ]
|
---|
| 32 | } );
|
---|
| 33 |
|
---|
| 34 | /**
|
---|
| 35 | * Defines the style to be used to highlight results with the find dialog.
|
---|
| 36 | * @type Object
|
---|
| 37 | * @default { element : 'span', styles : { 'background-color' : '#004', 'color' : '#fff' } }
|
---|
| 38 | * @example
|
---|
| 39 | * // Highlight search results with blue on yellow.
|
---|
| 40 | * config.find_highlight =
|
---|
| 41 | * {
|
---|
| 42 | * element : 'span',
|
---|
| 43 | * styles : { 'background-color' : '#ff0', 'color' : '#00f' }
|
---|
| 44 | * };
|
---|
| 45 | */
|
---|
| 46 | CKEDITOR.config.find_highlight = { element : 'span', styles : { 'background-color' : '#004', 'color' : '#fff' } };
|
---|