2
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
7
* Licensed under the terms of any of the following licenses at your
10
* - GNU General Public License Version 2 or later (the "GPL")
11
* http://www.gnu.org/licenses/gpl.html
13
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
* http://www.gnu.org/licenses/lgpl.html
16
* - Mozilla Public License Version 1.1 or later (the "MPL")
17
* http://www.mozilla.org/MPL/MPL-1.1.html
21
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
24
var FCKToolbarFontFormatCombo = function( tooltip, style )
26
this.CommandName = 'FontFormat' ;
27
this.Label = this.GetLabel() ;
28
this.Tooltip = tooltip ? tooltip : this.Label ;
29
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
31
this.NormalLabel = 'Normal' ;
33
this.PanelWidth = 190 ;
36
// Inherit from FCKToolbarSpecialCombo.
37
FCKToolbarFontFormatCombo.prototype = new FCKToolbarSpecialCombo ;
40
FCKToolbarFontFormatCombo.prototype.GetLabel = function()
42
return FCKLang.FontFormat ;
45
FCKToolbarFontFormatCombo.prototype.CreateItems = function( targetSpecialCombo )
47
var oTargetDoc = targetSpecialCombo._Panel.Document ;
49
// Add the Editor Area CSS to the panel to create a realistic preview.
50
FCKTools.AppendStyleSheet( oTargetDoc, FCKConfig.ToolbarComboPreviewCSS ) ;
52
// Add ID and Class to the body
53
if ( FCKConfig.BodyId && FCKConfig.BodyId.length > 0 )
54
oTargetDoc.body.id = FCKConfig.BodyId ;
55
if ( FCKConfig.BodyClass && FCKConfig.BodyClass.length > 0 )
56
oTargetDoc.body.className += ' ' + FCKConfig.BodyClass ;
58
// Get the format names from the language file.
59
var aNames = FCKLang['FontFormats'].split(';') ;
73
// Get the available formats from the configuration file.
74
var aTags = FCKConfig.FontFormats.split(';') ;
76
for ( var i = 0 ; i < aTags.length ; i++ )
78
// Support for DIV in Firefox has been reintroduced on version 2.2.
79
// if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko )
83
var sLabel = oNames[sTag] ;
86
this.NormalLabel = sLabel ;
88
this._Combo.AddItem( sTag, '<div class="BaseFont"><' + sTag + '>' + sLabel + '</' + sTag + '></div>', sLabel ) ;
92
if ( FCKBrowserInfo.IsIE )
94
FCKToolbarFontFormatCombo.prototype.RefreshActiveItems = function( combo, value )
96
// FCKDebug.Output( 'FCKToolbarFontFormatCombo Value: ' + value ) ;
98
// IE returns normal for DIV and P, so to avoid confusion, we will not show it if normal.
99
if ( value == this.NormalLabel )
101
if ( combo.Label != ' ' )
102
combo.DeselectAll(true) ;
106
if ( this._LastValue == value )
109
combo.SelectItemByLabel( value, true ) ;
112
this._LastValue = value ;
b'\\ No newline at end of file'