JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.0
[ckeditor.git] / _source / plugins / print / plugin.js
diff --git a/_source/plugins/print/plugin.js b/_source/plugins/print/plugin.js
new file mode 100644 (file)
index 0000000..d008785
--- /dev/null
@@ -0,0 +1,41 @@
+/*\r
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+For licensing, see LICENSE.html or http://ckeditor.com/license\r
+*/\r
+\r
+/**\r
+ * @file Print Plugin\r
+ */\r
+\r
+CKEDITOR.plugins.add( 'print',\r
+{\r
+       init : function( editor )\r
+       {\r
+               var pluginName = 'print';\r
+\r
+               // Register the command.\r
+               var command = editor.addCommand( pluginName, CKEDITOR.plugins.print );\r
+\r
+               // Register the toolbar button.\r
+               editor.ui.addButton( 'Print',\r
+                       {\r
+                               label : editor.lang.print,\r
+                               command : pluginName\r
+                       });\r
+       }\r
+} );\r
+\r
+CKEDITOR.plugins.print =\r
+{\r
+       exec : function( editor )\r
+       {\r
+               if ( CKEDITOR.env.opera )\r
+                       return;\r
+               else if ( CKEDITOR.env.gecko )\r
+                       editor.window.$.print();\r
+               else\r
+                       editor.document.$.execCommand( "Print" );\r
+       },\r
+       canUndo : false,\r
+       modes : { wysiwyg : !( CKEDITOR.env.opera ) }           // It is imposible to print the inner document in Opera.\r
+};\r