diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-02-19 23:38:52 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-02-19 23:38:52 +0100 |
commit | 3332bebe4da6dfa0fe3e4b2abddc84b1cc62f8f5 (patch) | |
tree | a4f77655fe55b79606e7d3416504686a1ab8b058 /sources/plugins/horizontalrule/plugin.js | |
download | piedsjaloux-ckeditor-component-3332bebe4da6dfa0fe3e4b2abddc84b1cc62f8f5.tar.gz piedsjaloux-ckeditor-component-3332bebe4da6dfa0fe3e4b2abddc84b1cc62f8f5.tar.zst piedsjaloux-ckeditor-component-3332bebe4da6dfa0fe3e4b2abddc84b1cc62f8f5.zip |
Initial commit4.5.7
Diffstat (limited to 'sources/plugins/horizontalrule/plugin.js')
-rw-r--r-- | sources/plugins/horizontalrule/plugin.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sources/plugins/horizontalrule/plugin.js b/sources/plugins/horizontalrule/plugin.js new file mode 100644 index 0000000..c7faa89 --- /dev/null +++ b/sources/plugins/horizontalrule/plugin.js | |||
@@ -0,0 +1,43 @@ | |||
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 Rule plugin. | ||
8 | */ | ||
9 | |||
10 | ( function() { | ||
11 | var horizontalruleCmd = { | ||
12 | canUndo: false, // The undo snapshot will be handled by 'insertElement'. | ||
13 | exec: function( editor ) { | ||
14 | var hr = editor.document.createElement( 'hr' ); | ||
15 | editor.insertElement( hr ); | ||
16 | }, | ||
17 | |||
18 | allowedContent: 'hr', | ||
19 | requiredContent: 'hr' | ||
20 | }; | ||
21 | |||
22 | var pluginName = 'horizontalrule'; | ||
23 | |||
24 | // Register a plugin named "horizontalrule". | ||
25 | CKEDITOR.plugins.add( pluginName, { | ||
26 | // jscs:disable maximumLineLength | ||
27 | 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% | ||
28 | // jscs:enable maximumLineLength | ||
29 | icons: 'horizontalrule', // %REMOVE_LINE_CORE% | ||
30 | hidpi: true, // %REMOVE_LINE_CORE% | ||
31 | init: function( editor ) { | ||
32 | if ( editor.blockless ) | ||
33 | return; | ||
34 | |||
35 | editor.addCommand( pluginName, horizontalruleCmd ); | ||
36 | editor.ui.addButton && editor.ui.addButton( 'HorizontalRule', { | ||
37 | label: editor.lang.horizontalrule.toolbar, | ||
38 | command: pluginName, | ||
39 | toolbar: 'insert,40' | ||
40 | } ); | ||
41 | } | ||
42 | } ); | ||
43 | } )(); | ||