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