Imported CKEDITOR 3.0

Monotone-Parent: 5f9c08dd6b5b34d815ddb2108abbf4055e846934
Monotone-Revision: b2cf7eda0ef8f15fb6e78f8c38a7406a47bcdd2f

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-08-26T14:03:12
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2009-08-26 14:03:12 +00:00
parent 4d1a003124
commit 0ce87017d6
329 changed files with 5266 additions and 3451 deletions
@@ -314,17 +314,15 @@ CKEDITOR.dialog.add( 'cellProperties', function( editor )
],
onShow : function()
{
// Get the selected table cell.
var startElement = editor.getSelection().getStartElement();
this.cell = startElement.getAscendant( 'td', true ) || startElement.getAscendant( 'th', true );
// Call setupContent().
this.setupContent( this.cell );
this.cells = CKEDITOR.plugins.tabletools.getSelectedCells(
this._.editor.getSelection() );
this.setupContent( this.cells[ 0 ] );
},
onOk : function()
{
// Call commitContent().
this.commitContent( this.cell );
var cells = this.cells;
for ( var i = 0 ; i < cells.length ; i++ )
this.commitContent( cells[ i ] );
}
};
} );
@@ -416,7 +416,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
}
}
CKEDITOR.plugins.add( 'tabletools',
// Context menu on table caption incorrect (#3834)
var contextMenuTags = { thead : 1, tbody : 1, tfoot : 1, td : 1, tr : 1, th : 1 };
CKEDITOR.plugins.tabletools =
{
init : function( editor )
{
@@ -544,12 +547,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
getItems : function()
{
var cells = getSelectedCells( editor.getSelection() );
return {
tablecell_insertBefore : CKEDITOR.TRISTATE_OFF,
tablecell_insertAfter : CKEDITOR.TRISTATE_OFF,
tablecell_delete : CKEDITOR.TRISTATE_OFF,
tablecell_properties : cells.length == 1 ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
tablecell_properties : cells.length > 0 ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
};
}
},
@@ -674,9 +676,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
if ( !element )
return null;
var isCell = !element.is( 'table' ) && element.hasAscendant( 'table' ) ;
if ( isCell )
while ( element )
{
if ( element.getName() in contextMenuTags )
{
return {
tablecell : CKEDITOR.TRISTATE_OFF,
@@ -684,10 +686,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
tablecolumn : CKEDITOR.TRISTATE_OFF
};
}
element = element.getParent();
}
return null;
return null;
} );
}
}
} );
},
getSelectedCells : getSelectedCells
};
CKEDITOR.plugins.add( 'tabletools', CKEDITOR.plugins.tabletools );
})();