~ubuntu-branches/ubuntu/intrepid/moin/intrepid-updates

« back to all changes in this revision

Viewing changes to wiki/htdocs/applets/FCKeditor/editor/_source/internals/fckcontextmenu.js

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-02-14 16:09:24 UTC
  • mfrom: (0.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20060214160924-fyrx3gvknzqvt4vj
Tags: 1.5.2-1ubuntu1
Drop python2.3 package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
var FCKContextMenu = new Object() ;
22
22
 
 
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 ;
 
27
 
 
28
FCKContextMenu._Document = FCKContextMenu._Panel.Document ;
 
29
 
23
30
// This property is internally used to indicate that the context menu has been created.
24
31
FCKContextMenu._IsLoaded = false ;
25
32
 
 
33
FCKContextMenu.Show = function( x, y )
 
34
{
 
35
        if ( !this._IsLoaded )
 
36
                this.Reload() ;
 
37
        
 
38
        this.RefreshState() ;
 
39
 
 
40
        // If not IE, x and y are relative to the editing area, so we must "fix" it.
 
41
        if ( !FCKBrowserInfo.IsIE )
 
42
        {
 
43
                var oCoordsA = FCKTools.GetElementPosition( FCK.EditorWindow.frameElement, this._Panel._Window ) ;
 
44
                x += oCoordsA.X ;
 
45
                y += oCoordsA.Y ;
 
46
        }
 
47
 
 
48
        this._Panel.Show( x, y ) ;
 
49
}
 
50
 
 
51
FCKContextMenu.Hide = function()
 
52
{
 
53
        this._Panel.Hide() ;
 
54
}
 
55
 
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()
28
58
{
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 );
35
65
 
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 ;
40
 
        oTable.border = 0 ;
41
 
        this._Div.appendChild( oTable ) ;
 
70
        this._Panel.PanelDiv.appendChild( oTable ) ;
 
71
//      this._Div.appendChild( oTable ) ;
42
72
 
43
73
        // Load all configured groups.
44
74
        this.Groups = new Object() ;
50
80
                this.Groups[ sGroup ].CreateTableRows( oTable ) ;
51
81
        }
52
82
 
 
83
        FCKTools.DisableSelection( this._Panel.Document.body ) ;
 
84
 
53
85
        this._IsLoaded = true ;
54
86
}
55
87
 
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 ) ) ;
98
132
 
99
133
                        break ;
100
134
 
101
135
                case 'Table' :
102
 
                        return new FCKContextMenuGroup( true, this, 'Table', FCKLang.TableProperties, true ) ;
 
136
                        oGroup = new FCKContextMenuGroup() ;
 
137
                        
 
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 ) ) ;
 
142
                        
 
143
                        break ;
103
144
 
104
145
                case 'Image' :
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' ) ;
168
209
        
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') ) ;
172
213
 
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>
201
242
                </tr>
202
243
                <tr class="CM_Disabled">
203
244
                        <td class="CM_Icon"><img height="20" alt="" src="icons/copy.gif" width="21"></td>