]>
Commit | Line | Data |
---|---|---|
1 | /**\r | |
2 | * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.\r | |
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license\r | |
4 | */\r | |
5 | \r | |
6 | /**\r | |
7 | * @fileOverview Plugin definition for the a11yhelp, which provides a dialog\r | |
8 | * with accessibility related help.\r | |
9 | */\r | |
10 | \r | |
11 | ( function() {\r | |
12 | var pluginName = 'a11yhelp',\r | |
13 | commandName = 'a11yHelp';\r | |
14 | \r | |
15 | CKEDITOR.plugins.add( pluginName, {\r | |
16 | requires: 'dialog',\r | |
17 | \r | |
18 | // List of available localizations.\r | |
19 | // jscs:disable\r | |
20 | availableLangs: { af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,'de-ch':1,el:1,en:1,'en-gb':1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,fr:1,'fr-ca':1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,nb:1,nl:1,no:1,pl:1,pt:1,'pt-br':1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,'sr-latn':1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,'zh-cn':1 },\r | |
21 | // jscs:enable\r | |
22 | \r | |
23 | init: function( editor ) {\r | |
24 | var plugin = this;\r | |
25 | editor.addCommand( commandName, {\r | |
26 | exec: function() {\r | |
27 | var langCode = editor.langCode;\r | |
28 | langCode =\r | |
29 | plugin.availableLangs[ langCode ] ? langCode :\r | |
30 | plugin.availableLangs[ langCode.replace( /-.*/, '' ) ] ? langCode.replace( /-.*/, '' ) :\r | |
31 | 'en';\r | |
32 | \r | |
33 | CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( plugin.path + 'dialogs/lang/' + langCode + '.js' ), function() {\r | |
34 | editor.lang.a11yhelp = plugin.langEntries[ langCode ];\r | |
35 | editor.openDialog( commandName );\r | |
36 | } );\r | |
37 | },\r | |
38 | modes: { wysiwyg: 1, source: 1 },\r | |
39 | readOnly: 1,\r | |
40 | canUndo: false\r | |
41 | } );\r | |
42 | \r | |
43 | editor.setKeystroke( CKEDITOR.ALT + 48 /*0*/, 'a11yHelp' );\r | |
44 | CKEDITOR.dialog.add( commandName, this.path + 'dialogs/a11yhelp.js' );\r | |
45 | \r | |
46 | editor.on( 'ariaEditorHelpLabel', function( evt ) {\r | |
47 | evt.data.label = editor.lang.common.editorHelp;\r | |
48 | } );\r | |
49 | }\r | |
50 | } );\r | |
51 | } )();\r |