aboutsummaryrefslogtreecommitdiff
path: root/sources/plugins/print/plugin.js
diff options
context:
space:
mode:
Diffstat (limited to 'sources/plugins/print/plugin.js')
-rw-r--r--sources/plugins/print/plugin.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/sources/plugins/print/plugin.js b/sources/plugins/print/plugin.js
new file mode 100644
index 00000000..faa567b6
--- /dev/null
+++ b/sources/plugins/print/plugin.js
@@ -0,0 +1,46 @@
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/**
7 * @fileOverview Print Plugin
8 */
9
10CKEDITOR.plugins.add( 'print', {
11 // jscs:disable maximumLineLength
12 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%
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
35CKEDITOR.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};