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: fcktoolbarfontformatcombo.js
14
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
17
* Frederico Caldeira Knabben (fredck@fckeditor.net)
20
var FCKToolbarFontFormatCombo = function( tooltip, style )
22
this.Command = FCKCommands.GetCommand( 'FontFormat' ) ;
23
this.Label = this.GetLabel() ;
24
this.Tooltip = tooltip ? tooltip : this.Label ;
25
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
27
this.NormalLabel = 'Normal' ;
29
this.PanelWidth = 190 ;
32
// Inherit from FCKToolbarSpecialCombo.
33
FCKToolbarFontFormatCombo.prototype = new FCKToolbarSpecialCombo ;
35
FCKToolbarFontFormatCombo.prototype.GetLabel = function()
37
return FCKLang.FontFormat ;
40
FCKToolbarFontFormatCombo.prototype.CreateItems = function( targetSpecialCombo )
42
// Get the format names from the language file.
43
var aNames = FCKLang['FontFormats'].split(';') ;
57
// Get the available formats from the configuration file.
58
var aTags = FCKConfig.FontFormats.split(';') ;
60
for ( var i = 0 ; i < aTags.length ; i++ )
62
// Support for DIV in Firefox has been reintroduced on version 2.2.
63
// if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko )
67
var sLabel = oNames[sTag] ;
70
this.NormalLabel = sLabel ;
72
this._Combo.AddItem( sTag, '<div class="BaseFont"><' + sTag + '>' + sLabel + '</' + sTag + '></div>', sLabel ) ;
76
if ( FCKBrowserInfo.IsIE )
78
FCKToolbarFontFormatCombo.prototype.RefreshActiveItems = function( combo, value )
80
// FCKDebug.Output( 'FCKToolbarFontFormatCombo Value: ' + value ) ;
82
// IE returns normal for DIV and P, so to avoid confusion, we will not show it if normal.
83
if ( value == this.NormalLabel )
85
if ( combo.Label != ' ' )
86
combo.DeselectAll(true) ;
90
if ( this._LastValue == value )
93
combo.SelectItemByLabel( value, true ) ;
96
this._LastValue = value ;
b'\\ No newline at end of file'