2
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
7
* Licensed under the terms of any of the following licenses at your
10
* - GNU General Public License Version 2 or later (the "GPL")
11
* http://www.gnu.org/licenses/gpl.html
13
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
* http://www.gnu.org/licenses/lgpl.html
16
* - Mozilla Public License Version 1.1 or later (the "MPL")
17
* http://www.mozilla.org/MPL/MPL-1.1.html
21
* Manage table operations (IE specific).
24
FCKTableHandler.GetSelectedCells = function()
26
var aCells = new Array() ;
28
var oRange = FCK.EditorDocument.selection.createRange() ;
29
// var oParent = oRange.parentElement() ;
30
var oParent = FCKSelection.GetParentElement() ;
32
if ( oParent && oParent.tagName.Equals( 'TD', 'TH' ) )
36
oParent = FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
40
// Loops throw all cells checking if the cell is, or part of it, is inside the selection
41
// and then add it to the selected cells collection.
42
for ( var i = 0 ; i < oParent.cells.length ; i++ )
44
var oCellRange = FCK.EditorDocument.selection.createRange() ;
45
oCellRange.moveToElementText( oParent.cells[i] ) ;
47
if ( oRange.inRange( oCellRange )
48
|| ( oRange.compareEndPoints('StartToStart',oCellRange) >= 0 && oRange.compareEndPoints('StartToEnd',oCellRange) <= 0 )
49
|| ( oRange.compareEndPoints('EndToStart',oCellRange) >= 0 && oRange.compareEndPoints('EndToEnd',oCellRange) <= 0 ) )
51
aCells[aCells.length] = oParent.cells[i] ;