]>
git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blob - sources/plugins/selectall/plugin.js
8db372bde2716c2daa4660f00b777d8a60ab83f5
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
7 * @fileOverview The "selectall" plugin provides an editor command that
8 * allows selecting the entire content of editable area.
9 * This plugin also enables a toolbar button for the feature.
13 CKEDITOR
.plugins
.add( 'selectall', {
14 // jscs:disable maximumLineLength
15 lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,de-ch,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%
16 // jscs:enable maximumLineLength
17 icons: 'selectall', // %REMOVE_LINE_CORE%
18 hidpi: true, // %REMOVE_LINE_CORE%
19 init: function( editor
) {
20 editor
.addCommand( 'selectAll', { modes: { wysiwyg: 1, source: 1 },
21 exec: function( editor
) {
22 var editable
= editor
.editable();
24 if ( editable
.is( 'textarea' ) ) {
25 var textarea
= editable
.$;
27 if ( CKEDITOR
.env
.ie
)
28 textarea
.createTextRange().execCommand( 'SelectAll' );
30 textarea
.selectionStart
= 0;
31 textarea
.selectionEnd
= textarea
.value
.length
;
36 if ( editable
.is( 'body' ) )
37 editor
.document
.$.execCommand( 'SelectAll', false, null );
39 var range
= editor
.createRange();
40 range
.selectNodeContents( editable
);
44 // Force triggering selectionChange (#7008)
45 editor
.forceNextSelectionCheck();
46 editor
.selectionChange();
53 editor
.ui
.addButton
&& editor
.ui
.addButton( 'SelectAll', {
54 label: editor
.lang
.selectall
.toolbar
,
56 toolbar: 'selection,10'