2
* FCKeditor - The text editor for internet
3
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
5
* Licensed under the terms of the GNU Lesser General Public License:
6
* http://www.opensource.org/licenses/lgpl-license.php
8
* For further information visit:
9
* http://www.fckeditor.net/
11
* "Support Open Source software. What about a donation today?"
13
* File Name: fckcontextmenugroup.js
14
* FCKContextMenuGroup Class: represents a group of items in the context
15
* menu. Generaly a group of items is directly dependent of the same rules.
18
* Frederico Caldeira Knabben (fredck@fckeditor.net)
21
var FCKContextMenuGroup = function( addSeparator, contextMenu, firstItemCommand, firstItemLabel, hasIcon )
23
this.IsVisible = true ;
25
// Array with all available context menu items of this group.
26
this.Items = new Array() ;
29
this.Add( new FCKContextMenuSeparator() ) ;
31
if ( contextMenu && firstItemCommand && firstItemLabel )
32
this.Add( new FCKContextMenuItem( contextMenu, firstItemCommand, firstItemLabel, hasIcon ) ) ;
34
// This OPTIONAL function checks if the group must be shown.
35
this.ValidationFunction = null ;
38
// Adds an item to the group's items collecion.
39
FCKContextMenuGroup.prototype.Add = function( contextMenuItem )
41
this.Items[ this.Items.length ] = contextMenuItem ;
44
// Creates the <TR> elements that represent the item in a table (usually the rendered context menu).
45
FCKContextMenuGroup.prototype.CreateTableRows = function( table )
47
for ( var i = 0 ; i < this.Items.length ; i++ )
49
this.Items[i].CreateTableRow( table ) ;
53
FCKContextMenuGroup.prototype.SetVisible = function( isVisible )
55
for ( var i = 0 ; i < this.Items.length ; i++ )
57
this.Items[i].SetVisible( isVisible ) ;
60
this.IsVisible = isVisible ;
63
FCKContextMenuGroup.prototype.RefreshState = function()
65
if ( ! this.IsVisible ) return ;
67
for ( var i = 0 ; i < this.Items.length ; i++ )
69
this.Items[i].RefreshState() ;
b'\\ No newline at end of file'