80e556c08258d73472d3a809c3cf1c50f8efe373
[ckeditor.git] / _source / plugins / a11yhelp / plugin.js
1 /*
2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
4 */
5
6 /**
7 * @fileOverview Plugin definition for the a11yhelp, which provides a dialog
8 * with accessibility related help.
9 */
10
11 (function()
12 {
13 var pluginName = 'a11yhelp',
14 commandName = 'a11yHelp';
15
16 CKEDITOR.plugins.add( pluginName,
17 {
18 // List of available localizations.
19 availableLangs : { en:1, he:1 },
20
21 init : function( editor )
22 {
23 var plugin = this;
24 editor.addCommand( commandName,
25 {
26 exec : function()
27 {
28 var langCode = editor.langCode;
29 langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
30
31 CKEDITOR.scriptLoader.load(
32 CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),
33 function()
34 {
35 CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ langCode ] );
36 editor.openDialog( commandName );
37 });
38 },
39 modes : { wysiwyg:1, source:1 },
40 readOnly : 1,
41 canUndo : false
42 });
43
44 CKEDITOR.dialog.add( commandName, this.path + 'dialogs/a11yhelp.js' );
45 }
46 });
47 })();