diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-01-25 17:45:33 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-01-25 18:00:33 +0100 |
commit | 7adcb81e4f83f98c468889aaa5a85558ba88c770 (patch) | |
tree | 0d6ede733777b29060b48df4afaa2c64bfbae276 /sources/plugins/find/plugin.js | |
download | connexionswing-ckeditor-component-7adcb81e4f83f98c468889aaa5a85558ba88c770.tar.gz connexionswing-ckeditor-component-7adcb81e4f83f98c468889aaa5a85558ba88c770.tar.zst connexionswing-ckeditor-component-7adcb81e4f83f98c468889aaa5a85558ba88c770.zip |
Initial commit4.5.6
Diffstat (limited to 'sources/plugins/find/plugin.js')
-rw-r--r-- | sources/plugins/find/plugin.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/sources/plugins/find/plugin.js b/sources/plugins/find/plugin.js new file mode 100644 index 00000000..bf8a3529 --- /dev/null +++ b/sources/plugins/find/plugin.js | |||
@@ -0,0 +1,52 @@ | |||
1 | /** | ||
2 | * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license | ||
4 | */ | ||
5 | |||
6 | CKEDITOR.plugins.add( 'find', { | ||
7 | requires: 'dialog', | ||
8 | // jscs:disable maximumLineLength | ||
9 | lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% | ||
10 | // jscs:enable maximumLineLength | ||
11 | icons: 'find,find-rtl,replace', // %REMOVE_LINE_CORE% | ||
12 | hidpi: true, // %REMOVE_LINE_CORE% | ||
13 | init: function( editor ) { | ||
14 | var findCommand = editor.addCommand( 'find', new CKEDITOR.dialogCommand( 'find' ) ); | ||
15 | findCommand.canUndo = false; | ||
16 | findCommand.readOnly = 1; | ||
17 | |||
18 | var replaceCommand = editor.addCommand( 'replace', new CKEDITOR.dialogCommand( 'replace' ) ); | ||
19 | replaceCommand.canUndo = false; | ||
20 | |||
21 | if ( editor.ui.addButton ) { | ||
22 | editor.ui.addButton( 'Find', { | ||
23 | label: editor.lang.find.find, | ||
24 | command: 'find', | ||
25 | toolbar: 'find,10' | ||
26 | } ); | ||
27 | |||
28 | editor.ui.addButton( 'Replace', { | ||
29 | label: editor.lang.find.replace, | ||
30 | command: 'replace', | ||
31 | toolbar: 'find,20' | ||
32 | } ); | ||
33 | } | ||
34 | |||
35 | CKEDITOR.dialog.add( 'find', this.path + 'dialogs/find.js' ); | ||
36 | CKEDITOR.dialog.add( 'replace', this.path + 'dialogs/find.js' ); | ||
37 | } | ||
38 | } ); | ||
39 | |||
40 | /** | ||
41 | * Defines the style to be used to highlight results with the find dialog. | ||
42 | * | ||
43 | * // Highlight search results with blue on yellow. | ||
44 | * config.find_highlight = { | ||
45 | * element: 'span', | ||
46 | * styles: { 'background-color': '#ff0', color: '#00f' } | ||
47 | * }; | ||
48 | * | ||
49 | * @cfg | ||
50 | * @member CKEDITOR.config | ||
51 | */ | ||
52 | CKEDITOR.config.find_highlight = { element: 'span', styles: { 'background-color': '#004', color: '#fff' } }; | ||