JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
6dc20be7086923239f7f126e3eb314d76b815d7e
[ckeditor.git] / _source / plugins / newpage / 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 Horizontal Page Break\r
8  */\r
9 \r
10 // Register a plugin named "newpage".\r
11 CKEDITOR.plugins.add( 'newpage',\r
12 {\r
13         init : function( editor )\r
14         {\r
15                 editor.addCommand( 'newpage',\r
16                         {\r
17                                 modes : { wysiwyg:1, source:1 },\r
18 \r
19                                 exec : function( editor )\r
20                                 {\r
21                                         var command = this;\r
22                                         editor.setData( editor.config.newpage_html, function()\r
23                                         {\r
24                                                 editor.fire( 'afterCommandExec',\r
25                                                 {\r
26                                                         name: command.name,\r
27                                                         command: command\r
28                                                 } );\r
29                                         } );\r
30                                         editor.focus();\r
31                                 },\r
32                                 async : true\r
33                         });\r
34 \r
35                 editor.ui.addButton( 'NewPage',\r
36                         {\r
37                                 label : editor.lang.newPage,\r
38                                 command : 'newpage'\r
39                         });\r
40         }\r
41 });\r
42 /**\r
43  * The HTML to load in the editor when the "new page" command is executed.\r
44  * @type String\r
45  * @default ''\r
46  * @example\r
47  * config.newpage_html = '<p>Type your text here.</p>';\r
48  */\r
49 CKEDITOR.config.newpage_html = '';\r