]> git.immae.eu Git - perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git/blob - sources/plugins/horizontalrule/plugin.js
Add oembed
[perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git] / sources / plugins / horizontalrule / plugin.js
1 /**
2 * @license Copyright (c) 2003-2017, 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,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,es-mx,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,oc,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 } )();