fcktablehandler_gecko.js
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:1k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

ASP/ASPX

  1. /*
  2.  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  3.  * Copyright (C) 2003-2009 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.  * Manage table operations (non-IE).
  22.  */
  23. FCKTableHandler.GetSelectedCells = function()
  24. {
  25. var aCells = new Array() ;
  26. var oSelection = FCKSelection.GetSelection() ;
  27. // If the selection is a text.
  28. if ( oSelection.rangeCount == 1 && oSelection.anchorNode.nodeType == 3 )
  29. {
  30. var oParent = FCKTools.GetElementAscensor( oSelection.anchorNode, 'TD,TH' ) ;
  31. if ( oParent )
  32. aCells[0] = oParent ;
  33. return aCells ;
  34. }
  35. for ( var i = 0 ; i < oSelection.rangeCount ; i++ )
  36. {
  37. var oRange = oSelection.getRangeAt(i) ;
  38. var oCell ;
  39. if ( oRange.startContainer.tagName.Equals( 'TD', 'TH' ) )
  40. oCell = oRange.startContainer ;
  41. else
  42. oCell = oRange.startContainer.childNodes[ oRange.startOffset ] ;
  43. if ( oCell.nodeName.Equals( 'TD', 'TH' ) )
  44. aCells[aCells.length] = oCell ;
  45. }
  46. return aCells ;
  47. }