Bugfix : prendre le innerHTML du body du document n'est pas une bonne idée, dans...
[ckeditor.git] / skins / ckeditor / _source / plugins / print / plugin.js
1 /*
2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
4 */
5
6 /**
7 * @file Print Plugin
8 */
9
10 CKEDITOR.plugins.add( 'print',
11 {
12 init : function( editor )
13 {
14 var pluginName = 'print';
15
16 // Register the command.
17 var command = editor.addCommand( pluginName, CKEDITOR.plugins.print );
18
19 // Register the toolbar button.
20 editor.ui.addButton( 'Print',
21 {
22 label : editor.lang.print,
23 command : pluginName
24 });
25 }
26 } );
27
28 CKEDITOR.plugins.print =
29 {
30 exec : function( editor )
31 {
32 if ( CKEDITOR.env.opera )
33 return;
34 else if ( CKEDITOR.env.gecko )
35 editor.window.$.print();
36 else
37 editor.document.$.execCommand( "Print" );
38 },
39 canUndo : false,
40 readOnly : 1,
41 modes : { wysiwyg : !( CKEDITOR.env.opera ) } // It is imposible to print the inner document in Opera.
42 };