X-Git-Url: https://scm.cri.ensmp.fr/git/ckeditor.git/blobdiff_plain/256592bf803e851aa7fc953e08a6e9e58d970f8c..871bad8291b6dbc29d489d95d185458caab25158:/skins/ckeditor/_source/plugins/print/plugin.js?ds=sidebyside diff --git a/skins/ckeditor/_source/plugins/print/plugin.js b/skins/ckeditor/_source/plugins/print/plugin.js new file mode 100644 index 0000000..cc26932 --- /dev/null +++ b/skins/ckeditor/_source/plugins/print/plugin.js @@ -0,0 +1,42 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @file Print Plugin + */ + +CKEDITOR.plugins.add( 'print', +{ + init : function( editor ) + { + var pluginName = 'print'; + + // Register the command. + var command = editor.addCommand( pluginName, CKEDITOR.plugins.print ); + + // Register the toolbar button. + editor.ui.addButton( 'Print', + { + label : editor.lang.print, + command : pluginName + }); + } +} ); + +CKEDITOR.plugins.print = +{ + exec : function( editor ) + { + if ( CKEDITOR.env.opera ) + return; + else if ( CKEDITOR.env.gecko ) + editor.window.$.print(); + else + editor.document.$.execCommand( "Print" ); + }, + canUndo : false, + readOnly : 1, + modes : { wysiwyg : !( CKEDITOR.env.opera ) } // It is imposible to print the inner document in Opera. +};