Ticket #5292: 5292.patch

File 5292.patch, 1.2 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/plugins/font/plugin.js

     
    5050                                {
    5151                                        this.startGroup( lang.panelTitle );
    5252
     53                                        // Create the html for this element based on its definition
     54                                        var startTag = '<' + styleDefinition.element + ' ',
     55                                                style = '',
     56                                                valueRegExp = new RegExp( '(#\\(' + styleType + '\\))' ),
     57                                                endTag = '</' + styleDefinition.element + '>';
     58
     59                                        for ( var styleName in styleDefinition.styles)
     60                                                style += styleName + ':' + styleDefinition.styles[ styleName ];
     61
     62                                        if ( style != '')
     63                                                startTag += ' style="' + style + '"';
     64
     65                                        for ( var attribute in styleDefinition.attributes)
     66                                                startTag += attribute + '="' + styleDefinition.attributes[ attribute ] + '"';
     67
    5368                                        for ( var i = 0 ; i < names.length ; i++ )
    5469                                        {
    5570                                                var name = names[ i ];
    5671
    5772                                                // Add the tag entry to the panel list.
    58                                                 this.add( name, '<span style="font-' + styleType + ':' + values[ i ] + '">' + name + '</span>', name );
     73                                                this.add( name, startTag.replace( valueRegExp, values[ i ]) + '>' + name + endTag, name );
    5974                                        }
    6075                                },
    6176
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy