Changeset 1603

Show
Ignore:
Timestamp:
2008-02-24 16:56:16 (6 months ago)
Author:
alfonsoml
Message:

Remove extra attributes when the RemoveFormat is executed #1502

Location:
FCKeditor/trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fckconfig.js

    r1598 r1603  
    136136        if ( !sComboPreviewCSS || sComboPreviewCSS.length == 0 ) 
    137137                oConfig.ToolbarComboPreviewCSS = oConfig.EditorAreaCSS ; 
     138 
     139        // Turn the attributes that will be removed in the RemoveFormat from a string to an array 
     140        oConfig.RemoveAttributesArray = (oConfig.RemoveAttributes || '').split( ',' ); 
    138141} 
    139142 
  • FCKeditor/trunk/editor/_source/internals/fckdomtools.js

    r1565 r1603  
    517517                return element.removeAttribute( attributeName, 0 ) ; 
    518518        }, 
     519 
     520        /** 
     521         * Removes an array of attributes from an element 
     522         */ 
     523        RemoveAttributes : function (element, aAttributes ) 
     524        { 
     525                for ( var i = 0 ; i < aAttributes.length ; i++ ) 
     526                        this.RemoveAttribute( element, aAttributes[i] ); 
     527        },  
    519528 
    520529        GetAttributeValue : function( element, att ) 
  • FCKeditor/trunk/editor/_source/internals/fckstyles.js

    r1565 r1603  
    211211                        if ( tagsRegex.test( currentNode.nodeName ) ) 
    212212                                FCKDomTools.RemoveNode( currentNode, true ) ; 
     213                        else 
     214                                FCKDomTools.RemoveAttributes( currentNode, FCKConfig.RemoveAttributesArray ); 
    213215 
    214216                        currentNode = nextNode ; 
  • FCKeditor/trunk/fckconfig.js

    r1598 r1603  
    193193FCKConfig.RemoveFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' ; 
    194194 
     195// Attributes that will be removed  
     196FCKConfig.RemoveAttributes = 'class,style,lang,width,height,align,hspace,valign' ; 
     197 
    195198FCKConfig.CustomStyles = 
    196199{ 
  • FCKeditor/trunk/_whatsnew.html

    r1602 r1603  
    142142                        additional fifth parameter "customData" that will be send to the Execute method of the command for that  
    143143                        menu item, allowing a single command to be used for different menu items..</li> 
     144                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1502">#1502</a>] The RemoveFormat command now 
     145                        also removes the attributes from the cleaned text. The list of attributes is configurable with  
     146                        FCKConfig.RemoveAttributes.</li> 
    144147        </ul> 
    145148        <p>