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  * @file Special Character plugin
  8  */
  9 
 10 CKEDITOR.plugins.add( 'specialchar',
 11 {
 12 	requires : [ 'dialog' ],
 13 
 14 	// List of available localizations.
 15 	availableLangs : { cs:1, cy:1, de:1, el:1, en:1, eo:1, et:1, fa:1, fi:1, fr:1, he:1, hr:1, it:1, nb:1, nl:1, no:1, 'pt-br':1, tr:1, ug:1, 'zh-cn':1 },
 16 
 17 	init : function( editor )
 18 	{
 19 		var pluginName = 'specialchar',
 20 			plugin = this;
 21 
 22 		// Register the dialog.
 23 		CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );
 24 
 25 		editor.addCommand( pluginName,
 26 			{
 27 				exec : function()
 28 				{
 29 					var langCode = editor.langCode;
 30 					langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
 31 
 32 					CKEDITOR.scriptLoader.load(
 33 							CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),
 34 							function()
 35 							{
 36 								CKEDITOR.tools.extend( editor.lang.specialChar, plugin.langEntries[ langCode ] );
 37 								editor.openDialog( pluginName );
 38 							});
 39 				},
 40 				modes : { wysiwyg:1 },
 41 				canUndo : false
 42 			});
 43 
 44 		// Register the toolbar button.
 45 		editor.ui.addButton( 'SpecialChar',
 46 			{
 47 				label : editor.lang.specialChar.toolbar,
 48 				command : pluginName
 49 			});
 50 	}
 51 } );
 52 
 53 /**
 54   * The list of special characters visible in the Special Character dialog window.
 55   * @type Array
 56   * @example
 57   * config.specialChars = [ '"', '’', [ '&custom;', 'Custom label' ] ];
 58   * config.specialChars = config.specialChars.concat( [ '"', [ '’', 'Custom label' ] ] );
 59   */
 60 CKEDITOR.config.specialChars =
 61 	[
 62 		'!','"','#','$','%','&',"'",'(',')','*','+','-','.','/',
 63 		'0','1','2','3','4','5','6','7','8','9',':',';',
 64 		'<','=','>','?','@',
 65 		'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
 66 		'P','Q','R','S','T','U','V','W','X','Y','Z',
 67 		'[',']','^','_','`',
 68 		'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
 69 		'q','r','s','t','u','v','w','x','y','z',
 70 		'{','|','}','~',
 71 		"€", "‘", "’", "“", "”", "–", "—", "¡", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "®", "¯", "°", "²", "³", "´", "µ", "¶", "·", "¸", "¹", "º", "»", "¼", "½", "¾", "¿", "À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ", "Œ", "œ", "Ŵ", "Ŷ", "ŵ", "ŷ", "‚", "‛", "„", "…", "™", "►", "•", "→", "⇒", "⇔", "♦", "≈"
 72 	];
 73