Ticket #2962: 2962_2.patch

File 2962_2.patch, 2.5 KB (added by Martin Kou, 14 years ago)
  • _source/plugins/link/dialogs/link.js

     
    128128                        // IE BUG: target attribute is an empty string instead of null in IE if it's not set.
    129129                        if ( !target )
    130130                        {
    131                                 var onclick = element.getAttribute( '_cke_saved_onclick' ) || element.getAttribute( 'onclick' ),
     131                                var onclick = element.getAttribute( '_cke_pa_onclick' ) || element.getAttribute( 'onclick' ),
    132132                                        onclickMatch = onclick && onclick.match( popupRegex );
    133133                                if ( onclickMatch )
    134134                                {
     
    10571057                                        addFeature( 'top' );
    10581058
    10591059                                        onclickList.push( featureList.join( ',' ), '\'); return false;' );
    1060                                         attributes._cke_saved_onclick = onclickList.join( '' );
     1060                                        attributes[ CKEDITOR.env.ie || CKEDITOR.env.webkit ? '_cke_pa_onclick' : 'onclick' ] = onclickList.join( '' );
    10611061                                }
    10621062                                else
    10631063                                {
    10641064                                        if ( data.target.type != 'notSet' && data.target.name )
    10651065                                                attributes.target = data.target.name;
    1066                                         removeAttributes.push( '_cke_saved_onclick', 'onclick' );
     1066                                        removeAttributes.push( '_cke_pa_onclick', 'onclick' );
    10671067                                }
    10681068                        }
    10691069
  • _source/core/htmlparser/element.js

     
    6767        };
    6868
    6969        var ckeAttrRegex = /^_cke/,
    70                 ckeClassRegex = /(^|\s+)cke_[^\s]*/g;
     70                ckeClassRegex = /(^|\s+)cke_[^\s]*/g,
     71                ckePrivateAttrRegex = /^_cke_pa_/;
    7172
    7273        CKEDITOR.htmlParser.element.prototype =
    7374        {
     
    132133                        var attribsArray = [];
    133134                        for ( var a in attributes )
    134135                        {
     136                                var value = attributes[ a ];
     137
     138                                // If the attribute name is _cke_pa_*, strip away the _cke_pa part.
     139                                a = a.replace( ckePrivateAttrRegex, '' );
     140
    135141                                // Ignore all attributes starting with "_cke".
    136142                                if ( ckeAttrRegex.test( a ) )
    137143                                        continue;
     
    139145                                // Ignore all cke_* CSS classes.
    140146                                if ( a.toLowerCase() == 'class' )
    141147                                {
    142                                         this.attributes[ a ] = CKEDITOR.tools.ltrim( this.attributes[ a ].replace( ckeClassRegex, '' ) );
    143                                         if ( this.attributes[ a ] == '' )
     148                                        value = CKEDITOR.tools.ltrim( value.replace( ckeClassRegex, '' ) );
     149                                        if ( value == '' )
    144150                                                continue;
    145151                                }
    146152
    147                                 attribsArray.push( [ a, this.attributes[ a ] ] );
     153                                attribsArray.push( [ a, value ] );
    148154                        }
    149155
    150156                        // Sort the attributes by name.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy