]> git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blame - 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
CommitLineData
7adcb81e 1/**\r
3b35bd27 2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.\r
7adcb81e
IB
3 * For licensing, see LICENSE.md or http://ckeditor.com/license\r
4 */\r
5\r
6/**\r
7 * @fileOverview Horizontal Page Break.\r
8 */\r
9\r
10// Register a plugin named "newpage".\r
11CKEDITOR.plugins.add( 'newpage', {\r
12 // jscs:disable maximumLineLength\r
3b35bd27 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%\r
7adcb81e
IB
14 // jscs:enable maximumLineLength\r
15 icons: 'newpage,newpage-rtl', // %REMOVE_LINE_CORE%\r
16 hidpi: true, // %REMOVE_LINE_CORE%\r
17 init: function( editor ) {\r
18 editor.addCommand( 'newpage', { modes: { wysiwyg: 1, source: 1 },\r
19\r
20 exec: function( editor ) {\r
21 var command = this;\r
22 editor.setData( editor.config.newpage_html || '', function() {\r
23 editor.focus();\r
24 // Save the undo snapshot after all document changes are affected. (#4889)\r
25 setTimeout( function() {\r
26 editor.fire( 'afterCommandExec', {\r
27 name: 'newpage',\r
28 command: command\r
29 } );\r
30 editor.selectionChange();\r
31\r
32 }, 200 );\r
33 } );\r
34 },\r
35 async: true\r
36 } );\r
37\r
38 editor.ui.addButton && editor.ui.addButton( 'NewPage', {\r
39 label: editor.lang.newpage.toolbar,\r
40 command: 'newpage',\r
41 toolbar: 'document,20'\r
42 } );\r
43 }\r
44} );\r
45\r
46/**\r
47 * The HTML to load in the editor when the "new page" command is executed.\r
48 *\r
49 * config.newpage_html = '<p>Type your text here.</p>';\r
50 *\r
51 * @cfg {String} [newpage_html='']\r
52 * @member CKEDITOR.config\r
53 */\r