source: trunk/phpgwapi/js/ckeditor/_source/plugins/newpage/plugin.js @ 2862

Revision 2862, 1.2 KB checked in by rodsouza, 14 years ago (diff)

Ticket #663 - Atualizando e centralizando o CKEditor (v. 3.2.1)

Line 
1/*
2Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
3For licensing, see LICENSE.html or http://ckeditor.com/license
4*/
5
6/**
7 * @file Horizontal Page Break
8 */
9
10// Register a plugin named "newpage".
11CKEDITOR.plugins.add( 'newpage',
12{
13        init : function( editor )
14        {
15                editor.addCommand( 'newpage',
16                        {
17                                modes : { wysiwyg:1, source:1 },
18
19                                exec : function( editor )
20                                {
21                                        var command = this;
22                                        editor.setData( editor.config.newpage_html, function()
23                                        {
24                                                // Save the undo snapshot after all document changes are affected. (#4889)
25                                                setTimeout( function ()
26                                                {
27                                                        editor.fire( 'afterCommandExec',
28                                                        {
29                                                                name: command.name,
30                                                                command: command
31                                                        } );
32
33                                                }, 200 );
34                                        } );
35                                        editor.focus();
36                                },
37                                async : true
38                        });
39
40                editor.ui.addButton( 'NewPage',
41                        {
42                                label : editor.lang.newPage,
43                                command : 'newpage'
44                        });
45        }
46});
47/**
48 * The HTML to load in the editor when the "new page" command is executed.
49 * @type String
50 * @default ''
51 * @example
52 * config.newpage_html = '<p>Type your text here.</p>';
53 */
54CKEDITOR.config.newpage_html = '';
Note: See TracBrowser for help on using the repository browser.