Changeset 4452


Ignore:
Timestamp:
11/11/09 05:43:16 (6 years ago)
Author:
garry.yao
Message:

Fixing #4546 : UIColor plugin doesn't work when editor id contains CSS selector preserved keywords.

Location:
CKEditor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CKEditor/tests/dt/core/tools.html

    r4341 r4452  
    157157                },
    158158
     159                test_escapeCssSelector : function ()
     160                {
     161                        assert.areSame( '\\.\\,\\*\\=\\~\\$\\^\\(\\)\\ \\:\\#\\+\\>', CKEDITOR.tools.escapeCssSelector( '.,*=~$^() :#+>' ) );
     162                },
    159163                name : document.title
    160164        };
  • CKEditor/trunk/CHANGES.html

    r4448 r4452  
    5353                <li><a href="http://dev.fckeditor.net/ticket/4573">#4573</a> : Fixed 'IgnoreEmptyPargraph' config doesn't work with config 'entites' set to 'false'.</li>
    5454                <li><a href="http://dev.fckeditor.net/ticket/4614">#4614</a> : Fixed attribute protection fails because of line-break.</li>
     55                <li><a href="http://dev.fckeditor.net/ticket/4546">#4546</a> : Fixed UIColor plugin doesn't work when editor id contains CSS selector preserved keywords.</li>
    5556        </ul>
    5657        <h3>
  • CKEditor/trunk/_source/core/tools.js

    r4440 r4452  
    277277
    278278                /**
     279                 * Replace characters can't be represented through CSS Selectors string
     280                 * by CSS Escape Notation where the character escape sequence consists
     281                 * of a backslash character (\) followed by the orginal characters.
     282                 * Ref: http://www.w3.org/TR/css3-selectors/#grammar
     283                 * @param cssSelectText
     284                 * @return the escaped selector text.
     285                 */
     286                escapeCssSelector : function( cssSelectText )
     287                {
     288                        return cssSelectText.replace( /[\s#:.,$*^\[\]()~=+>]/g, '\\$&' );
     289                },
     290
     291                /**
    279292                 * Gets a unique number for this CKEDITOR execution session. It returns
    280293                 * progressive numbers starting at 1.
  • CKEditor/trunk/_source/skins/kama/skin.js

    r4373 r4452  
    148148                                        var cssContent,
    149149                                                uiStyle = addStylesheet( CKEDITOR.document ),
    150                                                 cssId = '#cke_' + editor.name.replace('.', '\\.');
     150                                                cssId = '#cke_' + CKEDITOR.tools.escapeCssSelector( editor.name );
    151151
    152152                                        var cssSelectors =
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2015 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy