JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
695349f6f78a73c73e68b206242c09d32de500ef
[ckeditor.git] / _source / plugins / a11yhelp / plugin.js
1 /*\r
2 Copyright (c) 2003-2011, 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                 // List of available localizations.\r
19                 availableLangs : { en:1, he:1 },\r
20 \r
21                 init : function( editor )\r
22                 {\r
23                         var plugin = this;\r
24                         editor.addCommand( commandName,\r
25                                 {\r
26                                         exec : function()\r
27                                         {\r
28                                                 var langCode = editor.langCode;\r
29                                                 langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';\r
30 \r
31                                                 CKEDITOR.scriptLoader.load(\r
32                                                                 CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),\r
33                                                                 function()\r
34                                                                 {\r
35                                                                         CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ langCode ] );\r
36                                                                         editor.openDialog( commandName );\r
37                                                                 });\r
38                                         },\r
39                                         modes : { wysiwyg:1, source:1 },\r
40                                         canUndo : false\r
41                                 });\r
42 \r
43                         CKEDITOR.dialog.add( commandName, this.path + 'dialogs/a11yhelp.js' );\r
44                 }\r
45         });\r
46 })();\r