]> git.immae.eu Git - perso/Immae/Projets/packagist/ludivine-ckeditor-component.git/blame - sources/plugins/liststyle/plugin.js
Validation initiale
[perso/Immae/Projets/packagist/ludivine-ckeditor-component.git] / sources / plugins / liststyle / plugin.js
CommitLineData
c63493c8
IB
1/**\r
2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\r
3 * For licensing, see LICENSE.md or http://ckeditor.com/license\r
4 */\r
5\r
6( function() {\r
7 CKEDITOR.plugins.liststyle = {\r
8 requires: 'dialog,contextmenu',\r
9 // jscs:disable maximumLineLength\r
10 lang: 'af,ar,az,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,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%\r
11 // jscs:enable maximumLineLength\r
12 init: function( editor ) {\r
13 if ( editor.blockless )\r
14 return;\r
15\r
16 var def, cmd;\r
17\r
18 def = new CKEDITOR.dialogCommand( 'numberedListStyle', {\r
19 requiredContent: 'ol',\r
20 allowedContent: 'ol{list-style-type}[start]; li{list-style-type}[value]',\r
21 contentTransformations: [\r
22 [ 'ol: listTypeToStyle' ]\r
23 ]\r
24 } );\r
25 cmd = editor.addCommand( 'numberedListStyle', def );\r
26 editor.addFeature( cmd );\r
27 CKEDITOR.dialog.add( 'numberedListStyle', this.path + 'dialogs/liststyle.js' );\r
28\r
29 def = new CKEDITOR.dialogCommand( 'bulletedListStyle', {\r
30 requiredContent: 'ul',\r
31 allowedContent: 'ul{list-style-type}',\r
32 contentTransformations: [\r
33 [ 'ul: listTypeToStyle' ]\r
34 ]\r
35 } );\r
36 cmd = editor.addCommand( 'bulletedListStyle', def );\r
37 editor.addFeature( cmd );\r
38 CKEDITOR.dialog.add( 'bulletedListStyle', this.path + 'dialogs/liststyle.js' );\r
39\r
40 //Register map group;\r
41 editor.addMenuGroup( 'list', 108 );\r
42\r
43 editor.addMenuItems( {\r
44 numberedlist: {\r
45 label: editor.lang.liststyle.numberedTitle,\r
46 group: 'list',\r
47 command: 'numberedListStyle'\r
48 },\r
49 bulletedlist: {\r
50 label: editor.lang.liststyle.bulletedTitle,\r
51 group: 'list',\r
52 command: 'bulletedListStyle'\r
53 }\r
54 } );\r
55\r
56 editor.contextMenu.addListener( function( element ) {\r
57 if ( !element || element.isReadOnly() )\r
58 return null;\r
59\r
60 while ( element ) {\r
61 var name = element.getName();\r
62 if ( name == 'ol' )\r
63 return { numberedlist: CKEDITOR.TRISTATE_OFF };\r
64 else if ( name == 'ul' )\r
65 return { bulletedlist: CKEDITOR.TRISTATE_OFF };\r
66\r
67 element = element.getParent();\r
68 }\r
69 return null;\r
70 } );\r
71 }\r
72 };\r
73\r
74 CKEDITOR.plugins.add( 'liststyle', CKEDITOR.plugins.liststyle );\r
75} )();\r