JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
d008785ebdd6de44b8c5c27fbc5aace561ca2352
[ckeditor.git] / _source / plugins / print / plugin.js
1 /*\r
2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license\r
4 */\r
5 \r
6 /**\r
7  * @file Print Plugin\r
8  */\r
9 \r
10 CKEDITOR.plugins.add( 'print',\r
11 {\r
12         init : function( editor )\r
13         {\r
14                 var pluginName = 'print';\r
15 \r
16                 // Register the command.\r
17                 var command = editor.addCommand( pluginName, CKEDITOR.plugins.print );\r
18 \r
19                 // Register the toolbar button.\r
20                 editor.ui.addButton( 'Print',\r
21                         {\r
22                                 label : editor.lang.print,\r
23                                 command : pluginName\r
24                         });\r
25         }\r
26 } );\r
27 \r
28 CKEDITOR.plugins.print =\r
29 {\r
30         exec : function( editor )\r
31         {\r
32                 if ( CKEDITOR.env.opera )\r
33                         return;\r
34                 else if ( CKEDITOR.env.gecko )\r
35                         editor.window.$.print();\r
36                 else\r
37                         editor.document.$.execCommand( "Print" );\r
38         },\r
39         canUndo : false,\r
40         modes : { wysiwyg : !( CKEDITOR.env.opera ) }           // It is imposible to print the inner document in Opera.\r
41 };\r