2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
7 * @file Horizontal Page Break
\r
10 // Register a plugin named "newpage".
\r
11 CKEDITOR.plugins.add( 'newpage',
\r
13 init : function( editor )
\r
15 editor.addCommand( 'newpage',
\r
17 modes : { wysiwyg:1, source:1 },
\r
19 exec : function( editor )
\r
22 function afterCommand()
\r
24 // Defer to happen after 'selectionChange'.
\r
25 setTimeout( function()
\r
27 editor.fire( 'afterCommandExec',
\r
34 if ( editor.mode == 'wysiwyg')
\r
35 editor.on( 'contentDom', function( evt ){
\r
37 evt.removeListener();
\r
41 editor.setData( editor.config.newpage_html );
\r
44 if( editor.mode == 'source' )
\r
51 editor.ui.addButton( 'NewPage',
\r
53 label : editor.lang.newPage,
\r
59 * The HTML to load in the editor when the "new page" command is executed.
\r
63 * config.newpage_html = '<p>Type your text here.</p>';
\r
65 CKEDITOR.config.newpage_html = '';
\r