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