Ticket #171: 171_pre.patch

File 171_pre.patch, 3.7 KB (added by Martin Kou, 16 years ago)
  • editor/_source/internals/fckxhtml.js

     
    3030        FCKDomTools.CheckAndRemovePaddingNode( FCKTools.GetElementDocument( node ), FCKConfig.EnterMode ) ;
    3131        FCKXHtmlEntities.Initialize() ;
    3232
     33        // Random ID for protected attributes.
     34        this._ProtectID = Math.random() ;
     35
    3336        // Set the correct entity to use for empty blocks.
    3437        this._NbspEntity = ( FCKConfig.ProcessHTMLEntities? 'nbsp' : '#160' ) ;
    3538
     
    5962        // Get the resulting XHTML as a string.
    6063        var sXHTML = this._GetMainXmlString() ;
    6164
     65        // Release protected attributes that could not be directly set in DOM operations previously.
     66        sXHTML = sXHTML.replace( new RegExp( '_protected_' + this._ProtectID, 'g' ), '' ) ;
     67
    6268//      alert( 'Time: ' + ( ( ( new Date() ) - dTimer ) ) + ' ms' ) ;
    6369
    6470        this.XML = null ;
     
    513519} ;
    514520
    515521FCKXHtml.TagProcessors.ul = FCKXHtml.TagProcessors.ol ;
     522
     523FCKXHtml.AttributeProcessors =
     524{
     525        fck_alt_size : function( node, htmlNode, value )
     526        {
     527                node.attributes.removeNamedItem( 'size' ) ;
     528                node.attributes.removeNamedItem( 'fck_alt_size' ) ;
     529                htmlNode.removeAttribute( 'size' ) ;
     530                htmlNode.removeAttribute( 'fck_alt_size' ) ;
     531
     532                FCKXHtml._AppendAttribute( node, 'size_protected_' + FCKXHtml._ProtectID, value ) ;
     533        }
     534} ;
  • editor/_source/internals/fckxhtml_gecko.js

     
    6060                        else
    6161                                sAttValue = htmlNode.getAttribute( sAttName, 2 ) ;      // We must use getAttribute to get it exactly as it is defined.
    6262
    63                         this._AppendAttribute( node, sAttName, sAttValue ) ;
     63                        if ( this.AttributeProcessors[sAttName] )
     64                                this.AttributeProcessors[sAttName]( node, htmlNode, sAttValue ) ;
     65                        else
     66                                this._AppendAttribute( node, sAttName, sAttValue ) ;
    6467                }
    6568        }
    6669}
  • editor/_source/internals/fckxhtml_ie.js

     
    7777                                }
    7878                                catch (e) {}
    7979                        }
    80                         this._AppendAttribute( node, sAttName, sAttValue || oAttribute.nodeValue ) ;
     80                        if ( this.AttributeProcessors[sAttName] )
     81                                this.AttributeProcessors[sAttName]( node, htmlNode, sAttValue ) ;
     82                        else
     83                                this._AppendAttribute( node, sAttName, sAttValue ) ;
    8184                }
    8285        }
    8386}
     
    200203        node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
    201204
    202205        return node ;
    203 }
    204  No newline at end of file
     206}
  • editor/dialog/fck_textfield.html

     
    4646        {
    4747                GetE('txtName').value   = oActiveEl.name ;
    4848                GetE('txtValue').value  = oActiveEl.value ;
    49                 GetE('txtSize').value   = GetAttribute( oActiveEl, 'size' ) ;
     49                GetE('txtSize').value   = GetAttribute( oActiveEl, 'size' ) || GetAttribute( oActiveEl, 'fck_alt_size' ) ;
    5050                GetE('txtMax').value    = GetAttribute( oActiveEl, 'maxLength' ) ;
    5151                GetE('txtType').value   = oActiveEl.type ;
    5252
     
    8686        oActiveEl.name = GetE('txtName').value ;
    8787        SetAttribute( oActiveEl, 'value'        , GetE('txtValue').value ) ;
    8888        SetAttribute( oActiveEl, 'size'         , GetE('txtSize').value ) ;
     89        SetAttribute( oActiveEl, 'fck_alt_size', GetE('txtSize').value ) ;
    8990        SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;
    9091
    9192        return true ;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy