1 /*
  2 Copyright (c) 2003-2012, 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 		requires: [ 'dialog' ],
 19 		
 20 		// List of available localizations.
 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 },
 22 		
 23 		init : function( editor )
 24 		{
 25 			var plugin = this;
 26 			editor.addCommand( commandName,
 27 				{
 28 					exec : function()
 29 					{
 30 						var langCode = editor.langCode;
 31 						langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
 32 
 33 						CKEDITOR.scriptLoader.load(
 34 								CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),
 35 								function()
 36 								{
 37 									CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ langCode ] );
 38 									editor.openDialog( commandName );
 39 								});
 40 					},
 41 					modes : { wysiwyg:1, source:1 },
 42 					readOnly : 1,
 43 					canUndo : false
 44 				});
 45 
 46 			CKEDITOR.dialog.add( commandName, this.path + 'dialogs/a11yhelp.js' );
 47 		}
 48 	});
 49 })();
 50