]> git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blob - sources/plugins/newpage/plugin.js
Upgrade to 4.5.7 and add some plugin
[perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git] / sources / plugins / newpage / plugin.js
1 /**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */
5
6 /**
7 * @fileOverview Horizontal Page Break.
8 */
9
10 // Register a plugin named "newpage".
11 CKEDITOR.plugins.add( 'newpage', {
12 // jscs:disable maximumLineLength
13 lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
14 // jscs:enable maximumLineLength
15 icons: 'newpage,newpage-rtl', // %REMOVE_LINE_CORE%
16 hidpi: true, // %REMOVE_LINE_CORE%
17 init: function( editor ) {
18 editor.addCommand( 'newpage', { modes: { wysiwyg: 1, source: 1 },
19
20 exec: function( editor ) {
21 var command = this;
22 editor.setData( editor.config.newpage_html || '', function() {
23 editor.focus();
24 // Save the undo snapshot after all document changes are affected. (#4889)
25 setTimeout( function() {
26 editor.fire( 'afterCommandExec', {
27 name: 'newpage',
28 command: command
29 } );
30 editor.selectionChange();
31
32 }, 200 );
33 } );
34 },
35 async: true
36 } );
37
38 editor.ui.addButton && editor.ui.addButton( 'NewPage', {
39 label: editor.lang.newpage.toolbar,
40 command: 'newpage',
41 toolbar: 'document,20'
42 } );
43 }
44 } );
45
46 /**
47 * The HTML to load in the editor when the "new page" command is executed.
48 *
49 * config.newpage_html = '<p>Type your text here.</p>';
50 *
51 * @cfg {String} [newpage_html='']
52 * @member CKEDITOR.config
53 */