Ticket #3789: 3789_2.patch

File 3789_2.patch, 2.1 KB (added by Artur Formella, 15 years ago)
  • _source/plugins/htmldataprocessor/plugin.js

     
    9191        for ( i in blockLikeTags )
    9292                defaultDataBlockFilterRules.elements[ i ] = extendBlockForDisplay;
    9393
    94         /**
    95          * IE sucks with dynamic 'name' attribute after element is created, '_cke_saved_name' is used instead for this attribute.
    96          */
    97         var removeName = function( element )
    98         {
    99                 var attribs = element.attributes;
    100 
    101                 if ( attribs._cke_saved_name )
    102                         delete attribs.name;
    103         };
    104 
    10594        var defaultHtmlFilterRules =
    10695                {
    10796                        elementNames :
     
    124113
    125114                        elements :
    126115                        {
     116                                $ : function( element )
     117                                {
     118                                        // Remove duplicated attributes - #3789.
     119                                        var attribs = element.attributes;
     120
     121                                        if ( attribs )
     122                                        {
     123                                                // IE sucks with dynamic 'name' attribute after element is created, '_cke_saved_name' is used instead for this attribute.
     124                                                if ( attribs._cke_saved_name )
     125                                                        delete attribs.name;
     126                                                if ( attribs._cke_saved_href )
     127                                                        delete attribs.href;
     128                                                if ( attribs._cke_saved_src )
     129                                                        delete attribs.src;
     130                                        }
     131                                },
     132
    127133                                embed : function( element )
    128134                                {
    129135                                        var parent = element.parent;
     
    135141                                                element.attributes.width = parent.attributes.width;
    136142                                                element.attributes.height = parent.attributes.height;
    137143                                        }
    138                                 },
    139 
    140                                 img : function( element )
    141                                 {
    142                                         var attribs = element.attributes;
    143 
    144                                         if ( attribs._cke_saved_name )
    145                                                 delete attribs.name;
    146                                         if ( attribs._cke_saved_src )
    147                                                 delete attribs.src;
    148                                 },
    149 
    150                                 a : function( element )
    151                                 {
    152                                         var attribs = element.attributes;
    153 
    154                                         if ( attribs._cke_saved_name )
    155                                                 delete attribs.name;
    156                                         if ( attribs._cke_saved_href )
    157                                                 delete attribs.href;
    158                                 },
    159 
    160                                 input : removeName,
    161                                 textarea : removeName,
    162                                 select : removeName,
    163                                 form : removeName
     144                                }
    164145                        },
    165146
    166147                        attributes :
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy