Ticket #5599: 5599_7.patch

File 5599_7.patch, 13.6 KB (added by Tobiasz Cudnik, 9 years ago)
  • _source/plugins/specialchar/dialogs/specialchar.js

     
    222222                minHeight : 280,
    223223                buttons : [ CKEDITOR.dialog.cancelButton ],
    224224                charColumns : 17,
    225                 chars :
    226                         [
    227                                 '!','"','#','$','%','&',"'",'(',')','*','+','-','.','/',
    228                                 '0','1','2','3','4','5','6','7','8','9',':',';',
    229                                 '<','=','>','?','@',
    230                                 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
    231                                 'P','Q','R','S','T','U','V','W','X','Y','Z',
    232                                 '[',']','^','_','`',
    233                                 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
    234                                 'q','r','s','t','u','v','w','x','y','z',
    235                                 '{','|','}','~','€(EURO SIGN)','‘(LEFT SINGLE QUOTATION MARK)','’(RIGHT SINGLE QUOTATION MARK)','“(LEFT DOUBLE QUOTATION MARK)',
    236                                 '”(RIGHT DOUBLE QUOTATION MARK)','–(EN DASH)','—(EM DASH)','¡(INVERTED EXCLAMATION MARK)','¢(CENT SIGN)','£(POUND SIGN)',
    237                                 '¤(CURRENCY SIGN)','¥(YEN SIGN)','¦(BROKEN BAR)','§(SECTION SIGN)','¨(DIAERESIS)','©(COPYRIGHT SIGN)','ª(FEMININE ORDINAL INDICATOR)',
    238                                 '«(LEFT-POINTING DOUBLE ANGLE QUOTATION MARK)','¬(NOT SIGN)','®(REGISTERED SIGN)','¯(MACRON)','°(DEGREE SIGN)','±(PLUS-MINUS SIGN)','²(SUPERSCRIPT TWO)',
    239                                 '³(SUPERSCRIPT THREE)','´(ACUTE ACCENT)','µ(MICRO SIGN)','¶(PILCROW SIGN)','·(MIDDLE DOT)','¸(CEDILLA)',
    240                                 '¹(SUPERSCRIPT ONE)','º(MASCULINE ORDINAL INDICATOR)','»(RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK)','¼(VULGAR FRACTION ONE QUARTER)','½(VULGAR FRACTION ONE HALF)','¾(VULGAR FRACTION THREE QUARTERS)',
    241                                 '¿(INVERTED QUESTION MARK)','À(LATIN CAPITAL LETTER A WITH GRAVE)','Á(LATIN CAPITAL LETTER A WITH ACUTE)','Â(LATIN CAPITAL LETTER A WITH CIRCUMFLEX)','Ã(LATIN CAPITAL LETTER A WITH TILDE)','Ä(LATIN CAPITAL LETTER A WITH DIAERESIS)',
    242                                 'Å(LATIN CAPITAL LETTER A WITH RING ABOVE)','Æ(LATIN CAPITAL LETTER AE)','Ç(LATIN CAPITAL LETTER C WITH CEDILLA)','È(LATIN CAPITAL LETTER E WITH GRAVE)','É(LATIN CAPITAL LETTER E WITH ACUTE)','Ê(LATIN CAPITAL LETTER E WITH CIRCUMFLEX)',
    243                                 'Ë(LATIN CAPITAL LETTER E WITH DIAERESIS)','Ì(LATIN CAPITAL LETTER I WITH GRAVE)','Í(LATIN CAPITAL LETTER I WITH ACUTE)','Î(LATIN CAPITAL LETTER I WITH CIRCUMFLEX)','Ï(LATIN CAPITAL LETTER I WITH DIAERESIS)','Ð(LATIN CAPITAL LETTER ETH)',
    244                                 'Ñ(LATIN CAPITAL LETTER N WITH TILDE)','Ò(LATIN CAPITAL LETTER O WITH GRAVE)','Ó(LATIN CAPITAL LETTER O WITH ACUTE)','Ô(LATIN CAPITAL LETTER O WITH CIRCUMFLEX)','Õ(LATIN CAPITAL LETTER O WITH TILDE)','Ö(LATIN CAPITAL LETTER O WITH DIAERESIS)',
    245                                 '×(MULTIPLICATION SIGN)','Ø(LATIN CAPITAL LETTER O WITH STROKE)','Ù(LATIN CAPITAL LETTER U WITH GRAVE)','Ú(LATIN CAPITAL LETTER U WITH ACUTE)','Û(LATIN CAPITAL LETTER U WITH CIRCUMFLEX)','Ü(LATIN CAPITAL LETTER U WITH DIAERESIS)',
    246                                 'Ý(LATIN CAPITAL LETTER Y WITH ACUTE)','Þ(LATIN CAPITAL LETTER THORN)','ß(LATIN SMALL LETTER SHARP S)','à(LATIN SMALL LETTER A WITH GRAVE)','á(LATIN SMALL LETTER A WITH ACUTE)','â(LATIN SMALL LETTER A WITH CIRCUMFLEX)',
    247                                 'ã(LATIN SMALL LETTER A WITH TILDE)','ä(LATIN SMALL LETTER A WITH DIAERESIS)','å(LATIN SMALL LETTER A WITH RING ABOVE)','æ(LATIN SMALL LETTER AE)','ç(LATIN SMALL LETTER C WITH CEDILLA)','è(LATIN SMALL LETTER E WITH GRAVE)',
    248                                 'é(LATIN SMALL LETTER E WITH ACUTE)','ê(LATIN SMALL LETTER E WITH CIRCUMFLEX)','ë(LATIN SMALL LETTER E WITH DIAERESIS)','ì(LATIN SMALL LETTER I WITH GRAVE)','í(LATIN SMALL LETTER I WITH ACUTE)','î(LATIN SMALL LETTER I WITH CIRCUMFLEX)',
    249                                 'ï(LATIN SMALL LETTER I WITH DIAERESIS)','ð(LATIN SMALL LETTER ETH)','ñ(LATIN SMALL LETTER N WITH TILDE)','ò(LATIN SMALL LETTER O WITH GRAVE)','ó(LATIN SMALL LETTER O WITH ACUTE)','ô(LATIN SMALL LETTER O WITH CIRCUMFLEX)',
    250                                 'õ(LATIN SMALL LETTER O WITH TILDE)','ö(LATIN SMALL LETTER O WITH DIAERESIS)',
    251                                 '÷(DIVISION SIGN)','ø(LATIN SMALL LETTER O WITH STROKE)',
    252                                 'ù(LATIN SMALL LETTER U WITH GRAVE)','ú(LATIN SMALL LETTER U WITH ACUTE)',
    253                                 'û(LATIN SMALL LETTER U WITH CIRCUMFLEX)','ü(LATIN SMALL LETTER U WITH DIAERESIS)',
    254                                 'ü(LATIN SMALL LETTER U WITH DIAERESIS)','ý(LATIN SMALL LETTER Y WITH ACUTE)','þ(LATIN SMALL LETTER THORN)','ÿ(LATIN SMALL LETTER Y WITH DIAERESIS)',
    255                                 'Œ(LATIN CAPITAL LIGATURE OE)',
    256                                 'œ(LATIN SMALL LIGATURE OE)','Ŵ(LATIN CAPITAL LETTER W WITH CIRCUMFLEX)',
    257                                 '&#374(LATIN CAPITAL LETTER Y WITH CIRCUMFLEX)','&#373(LATIN SMALL LETTER W WITH CIRCUMFLEX)',
    258                                 'ŷ(LATIN SMALL LETTER Y WITH CIRCUMFLEX)','‚(SINGLE LOW-9 QUOTATION MARK)',
    259                                 '‛(SINGLE HIGH-REVERSED-9 QUOTATION MARK)','„(DOUBLE LOW-9 QUOTATION MARK)','…(HORIZONTAL ELLIPSIS)',
    260                                 '™(TRADE MARK SIGN)','►(BLACK RIGHT-POINTING POINTER)','•(BULLET)',
    261                                 '→(RIGHTWARDS ARROW)','⇒(RIGHTWARDS DOUBLE ARROW)','⇔(LEFT RIGHT DOUBLE ARROW)','♦(BLACK DIAMOND SUIT)','≈(ALMOST EQUAL TO)'
    262                         ],
    263225                onLoad :  function()
    264226                {
    265227                        var columns = this.definition.charColumns,
    266                                 chars = this.definition.chars;
     228                                extraChars = editor.config.extraSpecialChars,
     229                                chars = editor.config.specialChars;
    267230
    268231                        var charsTableLabel =  CKEDITOR.tools.getNextId() + '_specialchar_table_label';
    269232                        var html = [ '<table role="listbox" aria-labelledby="' + charsTableLabel + '"' +
     
    284247                                        if ( ( character = chars[ i ] ) )
    285248                                        {
    286249                                                charDesc = '';
    287                                                 character = character.replace( /\((.*?)\)/, function( match, desc )
    288                                                         {
    289                                                                 charDesc = desc;
    290                                                                 return '';
    291                                                         } );
     250                                               
     251                                                if ( character instanceof Array )
     252                                                {
     253                                                        charDesc = character[ 1 ];
     254                                                        character = character[ 0 ];
     255                                                }
     256                                                else
     257                                                {
     258                                                        var _tmpName = character.toLowerCase().replace( '&', '' ).replace( ';', '' ).replace( '#', '' );
    292259
    293                                                 // Use character in case description unavailable.
    294                                                 charDesc = charDesc || character;
     260                                                        // Use character in case description unavailable.
     261                                                        charDesc = lang[ _tmpName ] || character;
     262                                                }
    295263
    296264                                                var charLabelId =  'cke_specialchar_label_' + i + '_' + CKEDITOR.tools.getNextNumber();
    297265
  • _source/plugins/specialchar/lang/en.js

     
     1
     2CKEDITOR.plugins.setLang( 'specialchar', 'en',
     3{
     4        euro: "EURO SIGN",
     5        lsquo: "LEFT SINGLE QUOTATION MARK",
     6        rsquo: "RIGHT SINGLE QUOTATION MARK",
     7        ldquo: "LEFT DOUBLE QUOTATION MARK",
     8        rdquo: "RIGHT DOUBLE QUOTATION MARK",
     9        ndash: "EN DASH",
     10        mdash: "EM DASH",
     11        iexcl: "INVERTED EXCLAMATION MARK",
     12        cent: "CENT SIGN",
     13        pound: "POUND SIGN",
     14        curren: "CURRENCY SIGN",
     15        yen: "YEN SIGN",
     16        brvbar: "BROKEN BAR",
     17        sect: "SECTION SIGN",
     18        uml: "DIAERESIS",
     19        copy: "COPYRIGHT SIGN",
     20        ordf: "FEMININE ORDINAL INDICATOR",
     21        laquo: "LEFT-POINTING DOUBLE ANGLE QUOTATION MARK",
     22        not: "NOT SIGN",
     23        reg: "REGISTERED SIGN",
     24        macr: "MACRON",
     25        deg: "DEGREE SIGN",
     26        sup2: "SUPERSCRIPT TWO",
     27        sup3: "SUPERSCRIPT THREE",
     28        acute: "ACUTE ACCENT",
     29        micro: "MICRO SIGN",
     30        para: "PILCROW SIGN",
     31        middot: "MIDDLE DOT",
     32        cedil: "CEDILLA",
     33        sup1: "SUPERSCRIPT ONE",
     34        ordm: "MASCULINE ORDINAL INDICATOR",
     35        frac14: "VULGAR FRACTION ONE QUARTER",
     36        frac12: "VULGAR FRACTION ONE HALF",
     37        frac34: "VULGAR FRACTION THREE QUARTERS",
     38        iquest: "INVERTED QUESTION MARK",
     39        agrave: "LATIN SMALL LETTER A WITH GRAVE",
     40        aacute: "LATIN SMALL LETTER A WITH ACUTE",
     41        acirc: "LATIN SMALL LETTER A WITH CIRCUMFLEX",
     42        atilde: "LATIN SMALL LETTER A WITH TILDE",
     43        auml: "LATIN SMALL LETTER A WITH DIAERESIS",
     44        aring: "LATIN SMALL LETTER A WITH RING ABOVE",
     45        aelig: "LATIN SMALL LETTER AE",
     46        ccedil: "LATIN SMALL LETTER C WITH CEDILLA",
     47        egrave: "LATIN SMALL LETTER E WITH GRAVE",
     48        eacute: "LATIN SMALL LETTER E WITH ACUTE",
     49        ecirc: "LATIN SMALL LETTER E WITH CIRCUMFLEX",
     50        euml: "LATIN SMALL LETTER E WITH DIAERESIS",
     51        igrave: "LATIN SMALL LETTER I WITH GRAVE",
     52        iacute: "LATIN SMALL LETTER I WITH ACUTE",
     53        icirc: "LATIN SMALL LETTER I WITH CIRCUMFLEX",
     54        iuml: "LATIN SMALL LETTER I WITH DIAERESIS",
     55        eth: "LATIN SMALL LETTER ETH",
     56        ntilde: "LATIN SMALL LETTER N WITH TILDE",
     57        ograve: "LATIN SMALL LETTER O WITH GRAVE",
     58        oacute: "LATIN SMALL LETTER O WITH ACUTE",
     59        ocirc: "LATIN SMALL LETTER O WITH CIRCUMFLEX",
     60        otilde: "LATIN SMALL LETTER O WITH TILDE",
     61        ouml: "LATIN SMALL LETTER O WITH DIAERESIS",
     62        times: "MULTIPLICATION SIGN",
     63        oslash: "LATIN SMALL LETTER O WITH STROKE",
     64        ugrave: "LATIN SMALL LETTER U WITH GRAVE",
     65        uacute: "LATIN SMALL LETTER U WITH ACUTE",
     66        ucirc: "LATIN SMALL LETTER U WITH CIRCUMFLEX",
     67        uuml: "LATIN SMALL LETTER U WITH DIAERESIS",
     68        yacute: "LATIN SMALL LETTER Y WITH ACUTE",
     69        thorn: "LATIN SMALL LETTER THORN",
     70        szlig: "LATIN SMALL LETTER SHARP S",
     71        divide: "DIVISION SIGN",
     72        yuml: "LATIN SMALL LETTER Y WITH DIAERESIS",
     73        oelig: "LATIN SMALL LIGATURE OE",
     74        '372': "LATIN CAPITAL LETTER W WITH CIRCUMFLEX",
     75        '374': "LATIN CAPITAL LETTER Y WITH CIRCUMFLEX",
     76        '373': "LATIN SMALL LETTER W WITH CIRCUMFLEX",
     77        '375': "LATIN SMALL LETTER Y WITH CIRCUMFLEX",
     78        8219: "SINGLE HIGH-REVERSED-9 QUOTATION MARK",
     79        bdquo: "DOUBLE LOW-9 QUOTATION MARK",
     80        hellip: "HORIZONTAL ELLIPSIS",
     81        trade: "TRADE MARK SIGN",
     82        '9658': "BLACK RIGHT-POINTING POINTER",
     83        bull: "BULLET",
     84        rarr: "RIGHTWARDS DOUBLE ARROW",
     85        harr: "LEFT RIGHT DOUBLE ARROW",
     86        diams: "BLACK DIAMOND SUIT",
     87        asymp: "ALMOST EQUAL TO",
     88        sbquo: 'SINGLE LOW-9 QUOTATION MARK'
     89});
     90 No newline at end of file
  • _source/plugins/specialchar/plugin.js

     
    99
    1010CKEDITOR.plugins.add( 'specialchar',
    1111{
     12        // List of available localizations.
     13        availableLangs : { en:1 },
     14       
    1215        init : function( editor )
    1316        {
    14                 var pluginName = 'specialchar';
     17                var pluginName = 'specialchar',
     18                        plugin = this;
    1519
    1620                // Register the dialog.
    1721                CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );
    1822
    19                 // Register the command.
    20                 editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) );
     23                editor.addCommand( pluginName,
     24                        {
     25                                exec : function()
     26                                {
     27                                        var langCode = editor.langCode;
     28                                        langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
    2129
     30                                        CKEDITOR.scriptLoader.load(
     31                                                        CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),
     32                                                        function()
     33                                                        {
     34                                                                CKEDITOR.tools.extend( editor.lang.specialChar, plugin.lang[ langCode ] );
     35                                                                editor.openDialog( pluginName );
     36                                                        });
     37                                },
     38                                modes : { wysiwyg:1 },
     39                                canUndo : false
     40                        });
     41
    2242                // Register the toolbar button.
    2343                editor.ui.addButton( 'SpecialChar',
    2444                        {
  • _source/core/config.js

     
    408408         * @example
    409409         * config.baseFloatZIndex = 2000
    410410         */
    411         baseFloatZIndex : 10000
     411        baseFloatZIndex : 10000,
     412
     413        /**
     414         * The list of special characters visible in Special Character dialog.
     415         * @type Array
     416         * @example
     417         * config.specialChars = [ '&quot;', '&rsquo;', [ '&custom;', 'Custom label' ] ];
     418         * config.specialChars = config.specialChars.concat( [ '&quot;', [ '&rsquo;', 'Custom label' ] ] );
     419         */
     420        specialChars :
     421                [
     422                        '!','&quot;','#','$','%','&amp;',"'",'(',')','*','+','-','.','/',
     423                        '0','1','2','3','4','5','6','7','8','9',':',';',
     424                        '&lt;','=','&gt;','?','@',
     425                        'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
     426                        'P','Q','R','S','T','U','V','W','X','Y','Z',
     427                        '[',']','^','_','`',
     428                        'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
     429                        'q','r','s','t','u','v','w','x','y','z',
     430                        '{','|','}','~',
     431                        "&euro;", "&lsquo;", "&rsquo;", "&ldquo;", "&rdquo;", "&ndash;", "&mdash;", "&iexcl;", "&cent;", "&pound;", "&curren;", "&yen;", "&brvbar;", "&sect;", "&uml;", "&copy;", "&ordf;", "&laquo;", "&not;", "&reg;", "&macr;", "&deg;", "&", "&sup2;", "&sup3;", "&acute;", "&micro;", "&para;", "&middot;", "&cedil;", "&sup1;", "&ordm;", "&", "&frac14;", "&frac12;", "&frac34;", "&iquest;", "&Agrave;", "&Aacute;", "&Acirc;", "&Atilde;", "&Auml;", "&Aring;", "&AElig;", "&Ccedil;", "&Egrave;", "&Eacute;", "&Ecirc;", "&Euml;", "&Igrave;", "&Iacute;", "&Icirc;", "&Iuml;", "&ETH;", "&Ntilde;", "&Ograve;", "&Oacute;", "&Ocirc;", "&Otilde;", "&Ouml;", "&times;", "&Oslash;", "&Ugrave;", "&Uacute;", "&Ucirc;", "&Uuml;", "&Yacute;", "&THORN;", "&szlig;", "&agrave;", "&aacute;", "&acirc;", "&atilde;", "&auml;", "&aring;", "&aelig;", "&ccedil;", "&egrave;", "&eacute;", "&ecirc;", "&euml;", "&igrave;", "&iacute;", "&icirc;", "&iuml;", "&eth;", "&ntilde;", "&ograve;", "&oacute;", "&ocirc;", "&otilde;", "&ouml;", "&divide;", "&oslash;", "&ugrave;", "&uacute;", "&ucirc;", "&uuml;", "&uuml;", "&yacute;", "&thorn;", "&yuml;", "&OElig;", "&oelig;", "&#372;", "&#374", "&#373", "&#375;", "&sbquo;", "&#8219;", "&bdquo;", "&hellip;", "&trade;", "&#9658;", "&bull;", "&rarr;", "&rArr;", "&hArr;", "&diams;", "&asymp;"
     432                ]
    412433};
    413434
    414435/**
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy