[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/include/fckeditor/editor/_source/internals/ -> fckxhtml_gecko.js (source)

   1  /*
   2   * FCKeditor - The text editor for internet
   3   * Copyright (C) 2003-2005 Frederico Caldeira Knabben
   4   * 
   5   * Licensed under the terms of the GNU Lesser General Public License:
   6   *         http://www.opensource.org/licenses/lgpl-license.php
   7   * 
   8   * For further information visit:
   9   *         http://www.fckeditor.net/
  10   * 
  11   * "Support Open Source software. What about a donation today?"
  12   * 
  13   * File Name: fckxhtml_gecko.js
  14   *     Defines the FCKXHtml object, responsible for the XHTML operations.
  15   *     Gecko specific.
  16   * 
  17   * File Authors:
  18   *         Frederico Caldeira Knabben (fredck@fckeditor.net)
  19   */
  20  
  21  FCKXHtml._GetMainXmlString = function()
  22  {
  23      // Create the XMLSerializer.
  24      var oSerializer = new XMLSerializer() ;
  25  
  26      // Return the serialized XML as a string.
  27      // Due to a BUG on Gecko, the special chars sequence "#?-:" must be replaced with "&"
  28      // for the XHTML entities.
  29      return oSerializer.serializeToString( this.MainNode ).replace( FCKRegexLib.GeckoEntitiesMarker, '&' ) ;
  30  }
  31  
  32  // There is a BUG on Gecko... createEntityReference returns null.
  33  // So we use a trick to append entities on it.
  34  FCKXHtml._AppendEntity = function( xmlNode, entity )
  35  {
  36      xmlNode.appendChild( this.XML.createTextNode( '#?-:' + entity + ';' ) ) ;
  37  }
  38  
  39  FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node )
  40  {
  41      var aAttributes = htmlNode.attributes ;
  42      
  43      for ( var n = 0 ; n < aAttributes.length ; n++ )
  44      {
  45          var oAttribute = aAttributes[n] ;
  46          
  47          if ( oAttribute.specified )
  48          {
  49              var sAttName = oAttribute.nodeName.toLowerCase() ;
  50              var sAttValue ;
  51  
  52              // Ignore any attribute starting with "_fck".
  53              if ( sAttName.startsWith( '_fck' ) )
  54                  continue ;
  55              // There is a bug in Mozilla that returns '_moz_xxx' attributes as specified.
  56              else if ( sAttName.indexOf( '_moz' ) == 0 )
  57                  continue ;
  58              // There are one cases (on Gecko) when the oAttribute.nodeValue must be used:
  59              //        - for the "class" attribute
  60              else if ( sAttName == 'class' )
  61                  sAttValue = oAttribute.nodeValue ;
  62              // XHTML doens't support attribute minimization like "CHECKED". It must be trasformed to cheched="checked".
  63              else if ( oAttribute.nodeValue === true )
  64                  sAttValue = sAttName ;
  65              else
  66                  sAttValue = htmlNode.getAttribute( sAttName, 2 ) ;    // We must use getAttribute to get it exactly as it is defined.
  67  
  68              if ( FCKConfig.ForceSimpleAmpersand && sAttValue.replace )
  69                  sAttValue = sAttValue.replace( /&/g, '___FCKAmp___' ) ;
  70              
  71              this._AppendAttribute( node, sAttName, sAttValue ) ;
  72          }
  73      }
  74  }


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7