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: fcktoolbarpanelbutton.js
14
* FCKToolbarPanelButton Class: represents a special button in the toolbar
15
* that shows a panel when pressed.
18
* Frederico Caldeira Knabben (fredck@fckeditor.net)
21
var FCKToolbarPanelButton = function( commandName, label, tooltip, style )
23
this.Command = FCKCommands.GetCommand( commandName ) ;
24
this.Label = label ? label : commandName ;
25
this.Tooltip = tooltip ? tooltip : ( label ? label : commandName) ;
26
this.Style = style ? style : FCK_TOOLBARITEM_ONLYICON ;
27
this.State = FCK_UNKNOWN ;
28
this.IconPath = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ;
31
FCKToolbarPanelButton.prototype.Click = function(e)
33
// For Mozilla we must stop the event propagation to avoid it hiding
34
// the panel because of a click outside of it.
37
// e.stopPropagation() ;
38
// FCKPanelEventHandlers.OnDocumentClick( e ) ;
41
if ( this.State != FCK_TRISTATE_DISABLED )
43
this.Command.Execute(0, this.DOMDiv.offsetHeight, this.DOMDiv) ;
44
// this.FCKToolbarButton.HandleOnClick( this, e ) ;
50
FCKToolbarPanelButton.prototype.CreateInstance = function( parentToolbar )
52
this.DOMDiv = document.createElement( 'div' ) ;
53
this.DOMDiv.className = 'TB_Button_Off' ;
55
this.DOMDiv.FCKToolbarButton = this ;
58
'<table title="' + this.Tooltip + '" cellspacing="0" cellpadding="0" border="0">' +
61
if ( this.Style != FCK_TOOLBARITEM_ONLYTEXT )
62
sHtml += '<td class="TB_Icon"><img src="' + this.IconPath + '" width="21" height="21"></td>' ;
64
if ( this.Style != FCK_TOOLBARITEM_ONLYICON )
65
sHtml += '<td class="TB_Text" nowrap>' + this.Label + '</td>' ;
68
'<td class="TB_ButtonArrow"><img src="' + FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif" width="5" height="3"></td>' +
72
this.DOMDiv.innerHTML = sHtml ;
74
var oCell = parentToolbar.DOMRow.insertCell(-1) ;
75
oCell.appendChild( this.DOMDiv ) ;
80
// The Panel Button works like a normal button so the refresh state functions
81
// defined for the normal button can be reused here.
82
FCKToolbarPanelButton.prototype.RefreshState = FCKToolbarButton.prototype.RefreshState ;
83
FCKToolbarPanelButton.prototype.Enable = FCKToolbarButton.prototype.Enable ;
84
FCKToolbarPanelButton.prototype.Disable = FCKToolbarButton.prototype.Disable ;
b'\\ No newline at end of file'