[ Index ] |
|
Code source de FCKeditor 2.4 |
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: fcktablehandler_gecko.js 22 * Manage table operations (IE specific). 23 * 24 * File Authors: 25 * Frederico Caldeira Knabben (www.fckeditor.net) 26 */ 27 28 FCKTableHandler.GetSelectedCells = function() 29 { 30 var aCells = new Array() ; 31 32 var oSelection = FCK.EditorWindow.getSelection() ; 33 34 // If the selection is a text. 35 if ( oSelection.rangeCount == 1 && oSelection.anchorNode.nodeType == 3 ) 36 { 37 var oParent = FCKTools.GetElementAscensor( oSelection.anchorNode, 'TD,TH' ) ; 38 39 if ( oParent ) 40 { 41 aCells[0] = oParent ; 42 return aCells ; 43 } 44 } 45 46 for ( var i = 0 ; i < oSelection.rangeCount ; i++ ) 47 { 48 var oRange = oSelection.getRangeAt(i) ; 49 var oCell ; 50 51 if ( oRange.startContainer.tagName.Equals( 'TD', 'TH' ) ) 52 oCell = oRange.startContainer ; 53 else 54 oCell = oRange.startContainer.childNodes[ oRange.startOffset ] ; 55 56 if ( oCell.tagName.Equals( 'TD', 'TH' ) ) 57 aCells[aCells.length] = oCell ; 58 } 59 60 return aCells ; 61 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 15:28:05 2007 | par Balluche grâce à PHPXref 0.7 |