fckxhtml_gecko.js
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. /*
  2.  * FCKeditor - The text editor for internet
  3.  * Copyright (C) 2003-2006 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. FCKXHtml._GetMainXmlString = function()
  21. {
  22. // Create the XMLSerializer.
  23. var oSerializer = new XMLSerializer() ;
  24. // Return the serialized XML as a string.
  25. return oSerializer.serializeToString( this.MainNode ) ;
  26. }
  27. FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node )
  28. {
  29. var aAttributes = htmlNode.attributes ;
  30. for ( var n = 0 ; n < aAttributes.length ; n++ )
  31. {
  32. var oAttribute = aAttributes[n] ;
  33. if ( oAttribute.specified )
  34. {
  35. var sAttName = oAttribute.nodeName.toLowerCase() ;
  36. var sAttValue ;
  37. // Ignore any attribute starting with "_fck".
  38. if ( sAttName.startsWith( '_fck' ) )
  39. continue ;
  40. // There is a bug in Mozilla that returns '_moz_xxx' attributes as specified.
  41. else if ( sAttName.indexOf( '_moz' ) == 0 )
  42. continue ;
  43. // There are one cases (on Gecko) when the oAttribute.nodeValue must be used:
  44. // - for the "class" attribute
  45. else if ( sAttName == 'class' )
  46. sAttValue = oAttribute.nodeValue ;
  47. // XHTML doens't support attribute minimization like "CHECKED". It must be trasformed to cheched="checked".
  48. else if ( oAttribute.nodeValue === true )
  49. sAttValue = sAttName ;
  50. else
  51. sAttValue = htmlNode.getAttribute( sAttName, 2 ) ; // We must use getAttribute to get it exactly as it is defined.
  52. this._AppendAttribute( node, sAttName, sAttValue ) ;
  53. }
  54. }
  55. }