]> git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blob - sources/plugins/find/plugin.js
Initial commit
[perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git] / sources / plugins / find / plugin.js
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' } };