Ticket #8527: 8527.patch

File 8527.patch, 2.8 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/link/plugin.js

     
    3838                        'border:1px dotted #00f;';
    3939
    4040                editor.addCss(
    41                         'a.cke_anchor,a.cke_anchor_empty' +
     41                        'a.cke_anchor' +
    4242                        // IE6 breaks with the following selectors.
    4343                        ( ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) ? '' :
    4444                                ',a[name],a[data-cke-saved-name]' ) +
     
    4848                                // Show the arrow cursor for the anchor image (FF at least).
    4949                                'cursor:auto;' +
    5050                        '}' +
    51                         ( CKEDITOR.env.ie ? (
    52                                 'a.cke_anchor_empty' +
    53                                 '{' +
    54                                         // Make empty anchor selectable on IE.
    55                                         'display:inline-block;' +
    56                                 '}'
    57                                 ) : '' ) +
    5851                        'img.cke_anchor' +
    5952                        '{' +
    6053                                basicCss +
     
    188181
    189182                                                        var isEmpty = !element.children.length;
    190183
    191                                                         if ( CKEDITOR.plugins.link.synAnchorSelector )
    192                                                         {
    193                                                                 // IE needs a specific class name to be applied
    194                                                                 // to the anchors, for appropriate styling.
    195                                                                 var ieClass = isEmpty ? 'cke_anchor_empty' : 'cke_anchor';
    196                                                                 var cls = attributes[ 'class' ];
    197                                                                 if ( attributes.name && ( !cls || cls.indexOf( ieClass ) < 0 ) )
    198                                                                         attributes[ 'class' ] = ( cls || '' ) + ' ' + ieClass;
    199 
    200                                                                 if ( isEmpty && CKEDITOR.plugins.link.emptyAnchorFix )
    201                                                                 {
    202                                                                         attributes.contenteditable = 'false';
    203                                                                         attributes[ 'data-cke-editable' ] = 1;
    204                                                                 }
    205                                                         }
    206                                                         else if ( CKEDITOR.plugins.link.fakeAnchor && isEmpty )
     184                                                        if ( CKEDITOR.plugins.link.fakeAnchor && isEmpty )
    207185                                                                return editor.createFakeParserElement( element, 'cke_anchor', 'anchor' );
    208186
    209187                                                        return null;
     
    212190                                });
    213191                }
    214192
    215                 if ( CKEDITOR.plugins.link.emptyAnchorFix && htmlFilter )
    216                 {
    217                         htmlFilter.addRules(
    218                                 {
    219                                         elements :
    220                                         {
    221                                                 a : function( element )
    222                                                 {
    223                                                         delete element.attributes.contenteditable;
    224                                                 }
    225                                         }
    226                                 });
    227                 }
    228 
    229193                if ( pathFilters )
    230194                {
    231195                        pathFilters.push( function( element, name )
     
    284248
    285249        // Opera and WebKit don't make it possible to select empty anchors. Fake
    286250        // elements must be used for them.
    287         fakeAnchor : CKEDITOR.env.opera || CKEDITOR.env.webkit,
     251        fakeAnchor : !CKEDITOR.env.gecko,
    288252
    289         // For browsers that don't support CSS3 a[name]:empty(), note IE9 is included because of #7783.
    290         synAnchorSelector : CKEDITOR.env.ie,
    291 
    292         // For browsers that have editing issue with empty anchor.
    293         emptyAnchorFix : CKEDITOR.env.ie && CKEDITOR.env.version < 8,
    294 
    295253        tryRestoreFakeAnchor : function( editor, element )
    296254        {
    297255                if ( element && element.data( 'cke-real-element-type' ) && element.data( 'cke-real-element-type' ) == 'anchor' )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy