[ Index ]
 

Code source de FCKeditor 2.4

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

title

Body

[fermer]

/editor/_source/classes/ -> fckelementpath.js (source)

   1  /*
   2   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
   3   * Copyright (C) 2003-2007 Frederico Caldeira Knabben
   4   * 
   5   * == BEGIN LICENSE ==
   6   * 
   7   * Licensed under the terms of any of the following licenses at your
   8   * choice:
   9   * 
  10   *  - GNU General Public License Version 2 or later (the "GPL")
  11   *    http://www.gnu.org/licenses/gpl.html
  12   * 
  13   *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  14   *    http://www.gnu.org/licenses/lgpl.html
  15   * 
  16   *  - Mozilla Public License Version 1.1 or later (the "MPL")
  17   *    http://www.mozilla.org/MPL/MPL-1.1.html
  18   * 
  19   * == END LICENSE ==
  20   * 
  21   * File Name: fckelementpath.js
  22   *     Manages the DOM anscensors element list of a specific DOM node
  23   *     (limited to body, inclusive).
  24   * 
  25   * File Authors:
  26   *         Frederico Caldeira Knabben (www.fckeditor.net)
  27   */
  28  
  29  // TODO: Implement IE cleanup.
  30  
  31  var FCKElementPath = function( lastNode )
  32  {
  33      var eBlock = null ;
  34      var eBlockLimit = null ;
  35      
  36      var aElements = new Array() ;
  37      
  38      var e = lastNode ;
  39      while ( e ) 
  40      {
  41          if ( e.nodeType == 1 )
  42          {
  43              if ( !this.LastElement )
  44                  this.LastElement = e ;
  45  
  46              var sElementName = e.nodeName.toLowerCase() ;
  47              
  48              if ( !eBlockLimit && !eBlock && FCKListsLib.PathBlockElements[ sElementName ] != null )
  49                  eBlock = e ;
  50                  
  51              // TODO: Review the Regex and move it to the RegexLib.
  52              if ( !eBlockLimit && (/^(?:body|td|th|caption|form)$/).test( sElementName ) )
  53                  eBlockLimit = e ;
  54  
  55              aElements.push( e ) ;
  56              
  57              if ( sElementName == 'BODY' )
  58                  break ; 
  59          }
  60          e = e.parentNode ;
  61      }
  62      
  63      this.Block = eBlock ;
  64      this.BlockLimit = eBlockLimit ;
  65      this.Elements = aElements ;
  66  }
  67  


Généré le : Sun Feb 25 15:28:05 2007 par Balluche grâce à PHPXref 0.7