JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
e825f8680a02da84c2b8da4b3ea6d38abb35702c
[ckeditor.git] / _source / plugins / a11yhelp / plugin.js
1 /*\r
2 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
3 For licensing, see LICENSE.html 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 {\r
13         var pluginName = 'a11yhelp',\r
14                 commandName = 'a11yHelp';\r
15 \r
16         CKEDITOR.plugins.add( pluginName,\r
17         {\r
18                 requires: [ 'dialog' ],\r
19 \r
20                 // List of available localizations.\r
21                 availableLangs : { cs:1, cy:1, da:1, de:1, el:1, en:1, eo:1, fa:1, fi:1, fr:1, gu:1, he:1, it:1, ku:1, mk:1, nb:1, nl:1, no:1, 'pt-br':1, ro:1, tr:1, ug:1, vi:1, 'zh-cn':1 },\r
22 \r
23                 init : function( editor )\r
24                 {\r
25                         var plugin = this;\r
26                         editor.addCommand( commandName,\r
27                                 {\r
28                                         exec : function()\r
29                                         {\r
30                                                 var langCode = editor.langCode;\r
31                                                 langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';\r
32 \r
33                                                 CKEDITOR.scriptLoader.load(\r
34                                                                 CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),\r
35                                                                 function()\r
36                                                                 {\r
37                                                                         CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ langCode ] );\r
38                                                                         editor.openDialog( commandName );\r
39                                                                 });\r
40                                         },\r
41                                         modes : { wysiwyg:1, source:1 },\r
42                                         readOnly : 1,\r
43                                         canUndo : false\r
44                                 });\r
45 \r
46                         CKEDITOR.dialog.add( commandName, this.path + 'dialogs/a11yhelp.js' );\r
47                 }\r
48         });\r
49 })();\r