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