]> git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blob - sources/plugins/print/plugin.js
Upgrade to 4.5.7 and add some plugin
[perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git] / sources / plugins / print / plugin.js
1 /**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */
5
6 /**
7 * @fileOverview Print Plugin
8 */
9
10 CKEDITOR.plugins.add( 'print', {
11 // jscs:disable maximumLineLength
12 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%
13 // jscs:enable maximumLineLength
14 icons: 'print,', // %REMOVE_LINE_CORE%
15 hidpi: true, // %REMOVE_LINE_CORE%
16 init: function( editor ) {
17 // Print plugin isn't available in inline mode yet.
18 if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE )
19 return;
20
21 var pluginName = 'print';
22
23 // Register the command.
24 editor.addCommand( pluginName, CKEDITOR.plugins.print );
25
26 // Register the toolbar button.
27 editor.ui.addButton && editor.ui.addButton( 'Print', {
28 label: editor.lang.print.toolbar,
29 command: pluginName,
30 toolbar: 'document,50'
31 } );
32 }
33 } );
34
35 CKEDITOR.plugins.print = {
36 exec: function( editor ) {
37 if ( CKEDITOR.env.gecko ) {
38 editor.window.$.print();
39 } else {
40 editor.document.$.execCommand( 'Print' );
41 }
42 },
43 canUndo: false,
44 readOnly: 1,
45 modes: { wysiwyg: 1 }
46 };