Modificare il file:
\FckEditor\plugins\SpanControl\fckplugin.js
var FCKAddSpanRight = function(name) { this.Name = name; } FCKAddSpanRight.prototype.Execute = function() { var aCells = FCKTableHandler.GetSelectedCells() ; // Check that just one cell is selected, otherwise return. if ( aCells.length != 1 ) return ; var CurrentCell = aCells[0] ; var iCellIndex= CurrentCell.cellIndex ; var aRows= CurrentCell.parentNode ; var NextCell= aRows.cells[iCellIndex+1] ; if ( !NextCell ) return ; var iCurrentColSpan = isNaN( CurrentCell.colSpan ) ? 1 : CurrentCell.colSpan ; var iNextColSpan = isNaN( NextCell.colSpan ) ? 1 : NextCell.colSpan ; CurrentCell.innerHTML += NextCell.innerHTML ; CurrentCell.colSpan = iCurrentColSpan + iNextColSpan ; // The two cells are merged, we have to delete the empty one FCKTableHandler.DeleteCell( NextCell ) ; } // manage the plugins" button behavior FCKAddSpanRight.prototype.GetState = function() { return FCK_TRISTATE_OFF; } var FCKRemoveSpanRight = function(name) { this.Name = name; } FCKRemoveSpanRight.prototype.Execute = function() { var aCells = FCKTableHandler.GetSelectedCells() ; // Check that just one cell is selected, otherwise return. if ( aCells.length != 1 ) return ; var CurrentCell = aCells[0] ; if (CurrentCell.colSpan == 1) return ; CurrentCell.colSpan -= 1 ; var iCurrentRowSpan = isNaN( CurrentCell.rowSpan ) ? 1 : CurrentCell.rowSpan ; var NewCell= CurrentCell.parentNode.insertCell(CurrentCell.cellIndex+1, 1) ; NewCell.innerHTML= " " ; NewCell.rowSpan= iCurrentRowSpan ; } // manage the plugins" button behavior FCKRemoveSpanRight.prototype.GetState = function() { return FCK_TRISTATE_OFF; } var FCKAddSpanDown = function(name) { this.Name = name; } FCKAddSpanDown.prototype.Execute = function() { var aCells = FCKTableHandler.GetSelectedCells() ; // Check that just one cell is selected, otherwise return. if ( aCells.length != 1 ) return ; var CurrentCell = aCells[0] ; var aMap = FCKTableHandler._CreateTableMap( CurrentCell.parentNode.parentNode ) ; var iRowIndex = CurrentCell.parentNode.rowIndex ; var iColIndex = FCKTableHandler._GetCellIndexSpan( aMap, CurrentCell.parentNode.rowIndex , CurrentCell ) ; var aCollCells = FCKTableHandler._GetCollumnCells( aMap, iColIndex ) ; var NextCell = aCollCells[iRowIndex+1] ; // Calculate the new rowSpan for the cell. var iCurrentRowSpan = isNaN( CurrentCell.rowSpan ) ? 1 : CurrentCell.rowSpan ; var iNextRowSpan = isNaN( NextCell.rowSpan ) ? 1 : NextCell.rowSpan ; CurrentCell.innerHTML += NextCell.innerHTML ; CurrentCell.rowSpan = iCurrentRowSpan + iNextRowSpan ; // The two cells are merged, we have to delete the empty one FCKTableHandler.DeleteCell( NextCell ) ; } // manage the plugins" button behavior FCKAddSpanDown.prototype.GetState = function() { return FCK_TRISTATE_OFF; } var FCKRemoveSpanDown = function(name) { this.Name = name; } FCKRemoveSpanDown.prototype.Execute = function() { ///////////////////////////////////////////////////////////////////// var aCells = FCKTableHandler.GetSelectedCells() ; // Check that just one cell is selected, otherwise return. if ( aCells.length != 1 ) return ; var CurrentCell = aCells[0] ; if (CurrentCell.rowSpan == 1) return ; var iCurrentRowSpan = isNaN( CurrentCell.rowSpan ) ? 1 : CurrentCell.rowSpan ; var iCurrentColSpan = isNaN( CurrentCell.colSpan ) ? 1 : CurrentCell.colSpan ; var CurrentRow = CurrentCell.parentNode ; var CurrentTable = CurrentRow.parentNode ; var iCurrentRowIndex = CurrentRow.rowIndex ; var iNextRowIndex = iCurrentRowIndex + iCurrentRowSpan - 1; CurrentCell.rowSpan -= 1 ; var aMap = FCKTableHandler._CreateTableMap( CurrentTable ) ; var iCurrentColIndex = FCKTableHandler._GetCellIndexSpan( aMap, iCurrentRowIndex , CurrentCell ) ; // var aCollCells = FCKTableHandler._GetCollumnCells( aMap, iCurrentColIndex ) ; var NextCell = CurrentTable.rows[iNextRowIndex] ; var NewCell= NextCell.insertCell(iCurrentColIndex, 1) ; NewCell.innerHTML= " " ; NewCell.colSpan= iCurrentColSpan ; } // manage the plugins" button behavior FCKRemoveSpanDown.prototype.GetState = function() { return FCK_TRISTATE_OFF; } FCKCommands.RegisterCommand( "AddSpanRight", new FCKAddSpanRight("AddSpanRight")) ; FCKCommands.RegisterCommand( "RemoveSpanRight", new FCKRemoveSpanRight("RemoveSpanRight")) ; FCKCommands.RegisterCommand( "AddSpanDown", new FCKAddSpanDown("AddSpanDown")) ; FCKCommands.RegisterCommand( "RemoveSpanDown", new FCKRemoveSpanDown("RemoveSpanDown")) ; // Create the toolbar buttons. var oAddSpanRightItem = new FCKToolbarButton( "AddSpanRight", FCKLang["AddSpanRight"], null, null, false, true ) ; oAddSpanRightItem.IconPath = FCKConfig.PluginsPath + "SpanControl/AddSpanRight.gif" ; FCKToolbarItems.RegisterItem( "AddSpanRight", oAddSpanRightItem ) ; var oRemoveSpanRightItem = new FCKToolbarButton( "RemoveSpanRight", FCKLang["RemoveSpanRight"], null, null, false, true ) ; oRemoveSpanRightItem.IconPath = FCKConfig.PluginsPath + "SpanControl/RemoveSpanRight.gif" ; FCKToolbarItems.RegisterItem( "RemoveSpanRight", oRemoveSpanRightItem ) ; var oAddSpanDownItem = new FCKToolbarButton( "AddSpanDown", FCKLang["AddSpanDown"], null, null, false, true ) ; oAddSpanDownItem.IconPath = FCKConfig.PluginsPath + "SpanControl/AddSpanDown.gif" ; FCKToolbarItems.RegisterItem( "AddSpanDown", oAddSpanDownItem ) ; var oRemoveSpanDownItem = new FCKToolbarButton( "RemoveSpanDown", FCKLang["RemoveSpanDown"], null, null, false, true ) ; oRemoveSpanDownItem.IconPath = FCKConfig.PluginsPath + "SpanControl/RemoveSpanDown.gif" ; FCKToolbarItems.RegisterItem( "RemoveSpanDown", oRemoveSpanDownItem ) ;
[
Íàçàä
]