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