Ticket #5599: 5599_2.patch

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

     
    213213                }
    214214        });
    215215
     216        function mergeChars( chars, extraChars )
     217        {
     218                if ( CKEDITOR.tools.isArray( extraChars ) )
     219                        for ( var i = 0; i < extraChars.length; i++ )
     220                                chars[ chars.length ] = extraChars[ i ];
     221                return chars;
     222        }
     223
    216224        return {
    217225                title : lang.title,
    218226                minWidth : 430,
    219227                minHeight : 280,
    220228                buttons : [ CKEDITOR.dialog.cancelButton ],
    221229                charColumns : 17,
    222                 chars :
    223                         [
    224                                 '!','&quot;','#','$','%','&amp;',"'",'(',')','*','+','-','.','/',
    225                                 '0','1','2','3','4','5','6','7','8','9',':',';',
    226                                 '&lt;','=','&gt;','?','@',
    227                                 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
    228                                 'P','Q','R','S','T','U','V','W','X','Y','Z',
    229                                 '[',']','^','_','`',
    230                                 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
    231                                 'q','r','s','t','u','v','w','x','y','z',
    232                                 '{','|','}','~','&euro;(EURO SIGN)','&lsquo;(LEFT SINGLE QUOTATION MARK)','&rsquo;(RIGHT SINGLE QUOTATION MARK)','&ldquo;(LEFT DOUBLE QUOTATION MARK)',
    233                                 '&rdquo;(RIGHT DOUBLE QUOTATION MARK)','&ndash;(EN DASH)','&mdash;(EM DASH)','&iexcl;(INVERTED EXCLAMATION MARK)','&cent;(CENT SIGN)','&pound;(POUND SIGN)',
    234                                 '&curren;(CURRENCY SIGN)','&yen;(YEN SIGN)','&brvbar;(BROKEN BAR)','&sect;(SECTION SIGN)','&uml;(DIAERESIS)','&copy;(COPYRIGHT SIGN)','&ordf;(FEMININE ORDINAL INDICATOR)',
    235                                 '&laquo;(LEFT-POINTING DOUBLE ANGLE QUOTATION MARK)','&not;(NOT SIGN)','&reg;(REGISTERED SIGN)','&macr;(MACRON)','&deg;(DEGREE SIGN)','&plusmn;(PLUS-MINUS SIGN)','&sup2;(SUPERSCRIPT TWO)',
    236                                 '&sup3;(SUPERSCRIPT THREE)','&acute;(ACUTE ACCENT)','&micro;(MICRO SIGN)','&para;(PILCROW SIGN)','&middot;(MIDDLE DOT)','&cedil;(CEDILLA)',
    237                                 '&sup1;(SUPERSCRIPT ONE)','&ordm;(MASCULINE ORDINAL INDICATOR)','&raquo;(RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK)','&frac14;(VULGAR FRACTION ONE QUARTER)','&frac12;(VULGAR FRACTION ONE HALF)','&frac34;(VULGAR FRACTION THREE QUARTERS)',
    238                                 '&iquest;(INVERTED QUESTION MARK)','&Agrave;(LATIN CAPITAL LETTER A WITH GRAVE)','&Aacute;(LATIN CAPITAL LETTER A WITH ACUTE)','&Acirc;(LATIN CAPITAL LETTER A WITH CIRCUMFLEX)','&Atilde;(LATIN CAPITAL LETTER A WITH TILDE)','&Auml;(LATIN CAPITAL LETTER A WITH DIAERESIS)',
    239                                 '&Aring;(LATIN CAPITAL LETTER A WITH RING ABOVE)','&AElig;(LATIN CAPITAL LETTER AE)','&Ccedil;(LATIN CAPITAL LETTER C WITH CEDILLA)','&Egrave;(LATIN CAPITAL LETTER E WITH GRAVE)','&Eacute;(LATIN CAPITAL LETTER E WITH ACUTE)','&Ecirc;(LATIN CAPITAL LETTER E WITH CIRCUMFLEX)',
    240                                 '&Euml;(LATIN CAPITAL LETTER E WITH DIAERESIS)','&Igrave;(LATIN CAPITAL LETTER I WITH GRAVE)','&Iacute;(LATIN CAPITAL LETTER I WITH ACUTE)','&Icirc;(LATIN CAPITAL LETTER I WITH CIRCUMFLEX)','&Iuml;(LATIN CAPITAL LETTER I WITH DIAERESIS)','&ETH;(LATIN CAPITAL LETTER ETH)',
    241                                 '&Ntilde;(LATIN CAPITAL LETTER N WITH TILDE)','&Ograve;(LATIN CAPITAL LETTER O WITH GRAVE)','&Oacute;(LATIN CAPITAL LETTER O WITH ACUTE)','&Ocirc;(LATIN CAPITAL LETTER O WITH CIRCUMFLEX)','&Otilde;(LATIN CAPITAL LETTER O WITH TILDE)','&Ouml;(LATIN CAPITAL LETTER O WITH DIAERESIS)',
    242                                 '&times;(MULTIPLICATION SIGN)','&Oslash;(LATIN CAPITAL LETTER O WITH STROKE)','&Ugrave;(LATIN CAPITAL LETTER U WITH GRAVE)','&Uacute;(LATIN CAPITAL LETTER U WITH ACUTE)','&Ucirc;(LATIN CAPITAL LETTER U WITH CIRCUMFLEX)','&Uuml;(LATIN CAPITAL LETTER U WITH DIAERESIS)',
    243                                 '&Yacute;(LATIN CAPITAL LETTER Y WITH ACUTE)','&THORN;(LATIN CAPITAL LETTER THORN)','&szlig;(LATIN SMALL LETTER SHARP S)','&agrave;(LATIN SMALL LETTER A WITH GRAVE)','&aacute;(LATIN SMALL LETTER A WITH ACUTE)','&acirc;(LATIN SMALL LETTER A WITH CIRCUMFLEX)',
    244                                 '&atilde;(LATIN SMALL LETTER A WITH TILDE)','&auml;(LATIN SMALL LETTER A WITH DIAERESIS)','&aring;(LATIN SMALL LETTER A WITH RING ABOVE)','&aelig;(LATIN SMALL LETTER AE)','&ccedil;(LATIN SMALL LETTER C WITH CEDILLA)','&egrave;(LATIN SMALL LETTER E WITH GRAVE)',
    245                                 '&eacute;(LATIN SMALL LETTER E WITH ACUTE)','&ecirc;(LATIN SMALL LETTER E WITH CIRCUMFLEX)','&euml;(LATIN SMALL LETTER E WITH DIAERESIS)','&igrave;(LATIN SMALL LETTER I WITH GRAVE)','&iacute;(LATIN SMALL LETTER I WITH ACUTE)','&icirc;(LATIN SMALL LETTER I WITH CIRCUMFLEX)',
    246                                 '&iuml;(LATIN SMALL LETTER I WITH DIAERESIS)','&eth;(LATIN SMALL LETTER ETH)','&ntilde;(LATIN SMALL LETTER N WITH TILDE)','&ograve;(LATIN SMALL LETTER O WITH GRAVE)','&oacute;(LATIN SMALL LETTER O WITH ACUTE)','&ocirc;(LATIN SMALL LETTER O WITH CIRCUMFLEX)',
    247                                 '&otilde;(LATIN SMALL LETTER O WITH TILDE)','&ouml;(LATIN SMALL LETTER O WITH DIAERESIS)',
    248                                 '&divide;(DIVISION SIGN)','&oslash;(LATIN SMALL LETTER O WITH STROKE)',
    249                                 '&ugrave;(LATIN SMALL LETTER U WITH GRAVE)','&uacute;(LATIN SMALL LETTER U WITH ACUTE)',
    250                                 '&ucirc;(LATIN SMALL LETTER U WITH CIRCUMFLEX)','&uuml;(LATIN SMALL LETTER U WITH DIAERESIS)',
    251                                 '&uuml;(LATIN SMALL LETTER U WITH DIAERESIS)','&yacute;(LATIN SMALL LETTER Y WITH ACUTE)','&thorn;(LATIN SMALL LETTER THORN)','&yuml;(LATIN SMALL LETTER Y WITH DIAERESIS)',
    252                                 '&OElig;(LATIN CAPITAL LIGATURE OE)',
    253                                 '&oelig;(LATIN SMALL LIGATURE OE)','&#372;(LATIN CAPITAL LETTER W WITH CIRCUMFLEX)',
    254                                 '&#374(LATIN CAPITAL LETTER Y WITH CIRCUMFLEX)','&#373(LATIN SMALL LETTER W WITH CIRCUMFLEX)',
    255                                 '&#375;(LATIN SMALL LETTER Y WITH CIRCUMFLEX)','&sbquo;(SINGLE LOW-9 QUOTATION MARK)',
    256                                 '&#8219;(SINGLE HIGH-REVERSED-9 QUOTATION MARK)','&bdquo;(DOUBLE LOW-9 QUOTATION MARK)','&hellip;(HORIZONTAL ELLIPSIS)',
    257                                 '&trade;(TRADE MARK SIGN)','&#9658;(BLACK RIGHT-POINTING POINTER)','&bull;(BULLET)',
    258                                 '&rarr;(RIGHTWARDS ARROW)','&rArr;(RIGHTWARDS DOUBLE ARROW)','&hArr;(LEFT RIGHT DOUBLE ARROW)','&diams;(BLACK DIAMOND SUIT)','&asymp;(ALMOST EQUAL TO)'
    259                         ],
    260230                onLoad :  function()
    261231                {
    262232                        var columns = this.definition.charColumns,
    263                                 chars = this.definition.chars;
     233                                chars = mergeChars( editor.config.specialChars, editor.config.extraSpecialChars );
    264234
    265235                        var charsTableLabel =  'specialchar_table_label' + CKEDITOR.tools.getNextNumber();
    266236                        var html = [ '<table role="listbox" aria-labelledby="' + charsTableLabel + '"' +
     
    281251                                        if ( ( character = chars[ i ] ) )
    282252                                        {
    283253                                                charDesc = '';
    284                                                 character = character.replace( /\((.*?)\)/, function( match, desc )
    285                                                         {
    286                                                                 charDesc = desc;
    287                                                                 return '';
    288                                                         } );
     254                                               
     255                                                if ( character instanceof Array )
     256                                                {
     257                                                        charDesc = character[ 1 ];
     258                                                        character = character[ 0 ];
     259                                                }
     260                                                else
     261                                                {
     262                                                        var _tmpName = character.replace( '&', '' ).replace( ';', '' ).replace( '#', '' );
     263                                                        if ( parseInt( _tmpName, 10 ) == _tmpName )
     264                                                                _tmpName = 'sign_' + _tmpName;
    289265
    290                                                 // Use character in case description unavailable.
    291                                                 charDesc = charDesc || character;
     266                                                        // Use character in case description unavailable.
     267                                                        charDesc = lang[ _tmpName ] || CKEDITOR.tools.htmlEncode( character );
     268                                                }
    292269
     270                                                console.log( character, charDesc );
     271
    293272                                                var charLabelId =  'cke_specialchar_label_' + i + '_' + CKEDITOR.tools.getNextNumber();
    294273
    295274                                                html.push(
  • _source/lang/en.js

     
    115115                options : 'Context Menu Options'
    116116        },
    117117
    118         // Special char dialog.
    119         specialChar             :
    120         {
    121                 toolbar         : 'Insert Special Character',
    122                 title           : 'Select Special Character',
    123                 options : 'Special Character Options'
    124         },
    125 
    126118        // Link dialog.
    127119        link :
    128120        {
     
    744736        },
    745737
    746738        toolbarCollapse : 'Collapse Toolbar',
    747         toolbarExpand   : 'Expand Toolbar'
     739        toolbarExpand   : 'Expand Toolbar',
     740       
     741        // Special char dialog.
     742        specialChar             :
     743        {
     744                toolbar         : 'Insert Special Character',
     745                title           : 'Select Special Character',
     746                options : 'Special Character Options',
     747                euro:"EURO SIGN", lsquo:"LEFT SINGLE QUOTATION MARK", rsquo:"RIGHT SINGLE QUOTATION MARK", ldquo:"LEFT DOUBLE QUOTATION MARK", rdquo:"RIGHT DOUBLE QUOTATION MARK", ndash:"EN DASH", mdash:"EM DASH", iexcl:"INVERTED EXCLAMATION MARK", cent:"CENT SIGN", pound:"POUND SIGN", curren:"CURRENCY SIGN", yen:"YEN SIGN", brvbar:"BROKEN BAR", sect:"SECTION SIGN", uml:"DIAERESIS", copy:"COPYRIGHT SIGN", ordf:"FEMININE ORDINAL INDICATOR", laquo:"LEFT-POINTING DOUBLE ANGLE QUOTATION MARK", not:"NOT SIGN", reg:"REGISTERED SIGN", macr:"MACRON", deg:"DEGREE SIGN", '':"s", sup2:"SUPERSCRIPT TWO", sup3:"SUPERSCRIPT THREE", acute:"ACUTE ACCENT", micro:"MICRO SIGN", para:"PILCROW SIGN", middot:"MIDDLE DOT", cedil:"CEDILLA", sup1:"SUPERSCRIPT ONE", ordm:"MASCULINE ORDINAL INDICATOR", frac14:"VULGAR FRACTION ONE QUARTER", frac12:"VULGAR FRACTION ONE HALF", frac34:"VULGAR FRACTION THREE QUARTERS", iquest:"INVERTED QUESTION MARK", agrave:"LATIN SMALL LETTER A WITH GRAVE", aacute:"LATIN SMALL LETTER A WITH ACUTE", acirc:"LATIN SMALL LETTER A WITH CIRCUMFLEX", atilde:"LATIN SMALL LETTER A WITH TILDE", auml:"LATIN SMALL LETTER A WITH DIAERESIS", aring:"LATIN SMALL LETTER A WITH RING ABOVE", aelig:"LATIN SMALL LETTER AE", ccedil:"LATIN SMALL LETTER C WITH CEDILLA", egrave:"LATIN SMALL LETTER E WITH GRAVE", eacute:"LATIN SMALL LETTER E WITH ACUTE", ecirc:"LATIN SMALL LETTER E WITH CIRCUMFLEX", euml:"LATIN SMALL LETTER E WITH DIAERESIS", igrave:"LATIN SMALL LETTER I WITH GRAVE", iacute:"LATIN SMALL LETTER I WITH ACUTE", icirc:"LATIN SMALL LETTER I WITH CIRCUMFLEX", iuml:"LATIN SMALL LETTER I WITH DIAERESIS", eth:"LATIN SMALL LETTER ETH", ntilde:"LATIN SMALL LETTER N WITH TILDE", ograve:"LATIN SMALL LETTER O WITH GRAVE", oacute:"LATIN SMALL LETTER O WITH ACUTE", ocirc:"LATIN SMALL LETTER O WITH CIRCUMFLEX", otilde:"LATIN SMALL LETTER O WITH TILDE", ouml:"LATIN SMALL LETTER O WITH DIAERESIS", times:"MULTIPLICATION SIGN", oslash:"LATIN SMALL LETTER O WITH STROKE", ugrave:"LATIN SMALL LETTER U WITH GRAVE", uacute:"LATIN SMALL LETTER U WITH ACUTE", ucirc:"LATIN SMALL LETTER U WITH CIRCUMFLEX", uuml:"LATIN SMALL LETTER U WITH DIAERESIS", yacute:"LATIN SMALL LETTER Y WITH ACUTE", thorn:"LATIN SMALL LETTER THORN", szlig:"LATIN SMALL LETTER SHARP S", divide:"DIVISION SIGN", yuml:"LATIN SMALL LETTER Y WITH DIAERESIS", oelig:"LATIN SMALL LIGATURE OE", sign_372:"LATIN CAPITAL LETTER W WITH CIRCUMFLEX", sign_374:"LATIN CAPITAL LETTER Y WITH CIRCUMFLEX", sign_373:"LATIN SMALL LETTER W WITH CIRCUMFLEX", sign_375:"LATIN SMALL LETTER Y WITH CIRCUMFLEX", sign_8219:"SINGLE HIGH-REVERSED-9 QUOTATION MARK", bdquo:"DOUBLE LOW-9 QUOTATION MARK", hellip:"HORIZONTAL ELLIPSIS", trade:"TRADE MARK SIGN", sign_9658:"BLACK RIGHT-POINTING POINTER", bull:"BULLET", rarr:"RIGHTWARDS DOUBLE ARROW", harr:"LEFT RIGHT DOUBLE ARROW", diams:"BLACK DIAMOND SUIT", asymp:"ALMOST EQUAL TO"
     748        }
    748749};
  • _source/core/config.js

     
    327327         * @example
    328328         * config.baseFloatZIndex = 2000
    329329         */
    330         baseFloatZIndex : 10000
     330        baseFloatZIndex : 10000,
     331
     332        /**
     333         * The list of special characters visible in Special Character dialog.
     334         * @type Array
     335         * @example
     336         * config.specialChars = [ '&quot;', '&rsquo;', [ '&custom;', 'Custom label' ] ];
     337         */
     338        specialChars :
     339                [
     340                        '!','&quot;','#','$','%','&amp;',"'",'(',')','*','+','-','.','/',
     341                        '0','1','2','3','4','5','6','7','8','9',':',';',
     342                        '&lt;','=','&gt;','?','@',
     343                        'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
     344                        'P','Q','R','S','T','U','V','W','X','Y','Z',
     345                        '[',']','^','_','`',
     346                        'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
     347                        'q','r','s','t','u','v','w','x','y','z',
     348                        '{','|','}','~',
     349                        "&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;", "&", "&#8219;", "&bdquo;", "&hellip;", "&trade;", "&#9658;", "&bull;", "&rarr;", "&rArr;", "&hArr;", "&diams;", "&asymp;"
     350                ],
     351
     352//      extraSpecialChars : null
     353        /**
     354         * List of additional special characters. This is a tool setting which
     355         * makes it easier to add new characters, whithout having to touch and
     356         * possibly breaking the {@link CKEDITOR.config.specialChars} array.
     357         * @type Array
     358         * @example
     359         * config.extraSpecialChars = [ '&quot;', '&rsquo;', [ '&custom;', 'Custom label' ] ];
     360         */
     361        extraSpecialChars : null
    331362};
    332363
    333364// PACKAGER_RENAME( CKEDITOR.config )
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy