21
21
var FCKContextMenu = new Object() ;
23
FCKContextMenu._Panel = new FCKPanel( FCKBrowserInfo.IsIE ? window : window.parent ) ;
24
FCKContextMenu._Panel.PanelDiv.className = 'CM_ContextMenu' ;
25
FCKContextMenu._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
26
FCKContextMenu._Panel.IsContextMenu = true ;
28
FCKContextMenu._Document = FCKContextMenu._Panel.Document ;
23
30
// This property is internally used to indicate that the context menu has been created.
24
31
FCKContextMenu._IsLoaded = false ;
33
FCKContextMenu.Show = function( x, y )
35
if ( !this._IsLoaded )
40
// If not IE, x and y are relative to the editing area, so we must "fix" it.
41
if ( !FCKBrowserInfo.IsIE )
43
var oCoordsA = FCKTools.GetElementPosition( FCK.EditorWindow.frameElement, this._Panel._Window ) ;
48
this._Panel.Show( x, y ) ;
51
FCKContextMenu.Hide = function()
26
56
// This method creates the context menu inside a DIV tag. Take a look at the end of this file for a sample output.
27
57
FCKContextMenu.Reload = function()
29
59
// Create the Main DIV that holds the Context Menu.
30
this._Div = this._Document.createElement( 'DIV' ) ;
31
this._Div.className = 'CM_ContextMenu' ;
32
this._Div.style.position = 'absolute' ;
33
this._Div.style.visibility = 'hidden' ;
34
this._Document.body.appendChild( this._Div );
60
// this._Div = this._Document.createElement( 'DIV' ) ;
61
// this._Div.className = 'CM_ContextMenu' ;
62
// this._Div.style.position = 'absolute' ;
63
// this._Div.style.visibility = 'hidden' ;
64
// this._Document.body.appendChild( this._Div );
36
66
// Create the main table for the menu items.
37
67
var oTable = this._Document.createElement( 'TABLE' ) ;
38
68
oTable.cellSpacing = 0 ;
39
69
oTable.cellPadding = 0 ;
41
this._Div.appendChild( oTable ) ;
70
this._Panel.PanelDiv.appendChild( oTable ) ;
71
// this._Div.appendChild( oTable ) ;
43
73
// Load all configured groups.
44
74
this.Groups = new Object() ;
93
125
oGroup.Add( new FCKContextMenuItem( this, 'TableMergeCells' , FCKLang.MergeCells, true ) ) ;
94
126
oGroup.Add( new FCKContextMenuItem( this, 'TableSplitCell' , FCKLang.SplitCell, true ) ) ;
95
127
oGroup.Add( new FCKContextMenuSeparator() ) ;
128
oGroup.Add( new FCKContextMenuItem( this, 'TableDelete' , FCKLang.TableDelete, false ) ) ;
129
oGroup.Add( new FCKContextMenuSeparator() ) ;
96
130
oGroup.Add( new FCKContextMenuItem( this, 'TableCellProp' , FCKLang.CellProperties, true ) ) ;
97
131
oGroup.Add( new FCKContextMenuItem( this, 'TableProp' , FCKLang.TableProperties, true ) ) ;
102
return new FCKContextMenuGroup( true, this, 'Table', FCKLang.TableProperties, true ) ;
136
oGroup = new FCKContextMenuGroup() ;
138
oGroup.Add( new FCKContextMenuSeparator() ) ;
139
oGroup.Add( new FCKContextMenuItem( this, 'TableDelete' , FCKLang.TableDelete, false ) ) ;
140
oGroup.Add( new FCKContextMenuSeparator() ) ;
141
oGroup.Add( new FCKContextMenuItem( this, 'Table' , FCKLang.TableProperties, true ) ) ;
105
146
return new FCKContextMenuGroup( true, this, 'Image', FCKLang.ImageProperties, true ) ;
166
207
if ( this.Groups['TableCell'] ) this.Groups['TableCell'].SetVisible( sTagName != 'TABLE' && FCKSelection.HasAncestorNode('TABLE') ) ;
167
208
if ( this.Groups['Table'] ) this.Groups['Table'].SetVisible( sTagName == 'TABLE' ) ;
169
if ( this.Groups['Image'] ) this.Groups['Image'].SetVisible( sTagName == 'IMG' && !oTag.getAttribute('_fckflash') && !oTag.getAttribute('_fckanchor') ) ;
210
if ( this.Groups['Image'] ) this.Groups['Image'].SetVisible( sTagName == 'IMG' && !oTag.getAttribute('_fckfakelement') ) ;
170
211
if ( this.Groups['Flash'] ) this.Groups['Flash'].SetVisible( sTagName == 'IMG' && oTag.getAttribute('_fckflash') ) ;
171
212
if ( this.Groups['Anchor'] ) this.Groups['Anchor'].SetVisible( sTagName == 'IMG' && oTag.getAttribute('_fckanchor') ) ;
196
237
<div class="CM_ContextMenu">
197
238
<table cellSpacing="0" cellPadding="0" border="0">
198
239
<tr class="CM_Disabled">
199
<td class="CM_Icon"><img alt="" src="icons/cut.gif" width="21" height="20" unselectable="on"></td>
200
<td class="CM_Label" unselectable="on">Cut</td>
240
<td class="CM_Icon"><img alt="" src="icons/cut.gif" width="21" height="20"></td>
241
<td class="CM_Label">Cut</td>
202
243
<tr class="CM_Disabled">
203
244
<td class="CM_Icon"><img height="20" alt="" src="icons/copy.gif" width="21"></td>