first pass RT4 merge, RT#13852
[freeside.git] / rt / share / html / NoAuth / RichText / FCKeditor / editor / _source / classes / fcktoolbarfontsizecombo.js
1 /*\r
2  * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
3  * Copyright (C) 2003-2009 Frederico Caldeira Knabben\r
4  *\r
5  * == BEGIN LICENSE ==\r
6  *\r
7  * Licensed under the terms of any of the following licenses at your\r
8  * choice:\r
9  *\r
10  *  - GNU General Public License Version 2 or later (the "GPL")\r
11  *    http://www.gnu.org/licenses/gpl.html\r
12  *\r
13  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
14  *    http://www.gnu.org/licenses/lgpl.html\r
15  *\r
16  *  - Mozilla Public License Version 1.1 or later (the "MPL")\r
17  *    http://www.mozilla.org/MPL/MPL-1.1.html\r
18  *\r
19  * == END LICENSE ==\r
20  *\r
21  * FCKToolbarPanelButton Class: Handles the Fonts combo selector.\r
22  */\r
23 \r
24 var FCKToolbarFontSizeCombo = function( tooltip, style )\r
25 {\r
26         this.CommandName        = 'FontSize' ;\r
27         this.Label              = this.GetLabel() ;\r
28         this.Tooltip    = tooltip ? tooltip : this.Label ;\r
29         this.Style              = style ? style : FCK_TOOLBARITEM_ICONTEXT ;\r
30 \r
31         this.DefaultLabel = FCKConfig.DefaultFontSizeLabel || '' ;\r
32 \r
33         this.FieldWidth = 70 ;\r
34 }\r
35 \r
36 // Inherit from FCKToolbarSpecialCombo.\r
37 FCKToolbarFontSizeCombo.prototype = new FCKToolbarFontFormatCombo( false ) ;\r
38 \r
39 FCKToolbarFontSizeCombo.prototype.GetLabel = function()\r
40 {\r
41         return FCKLang.FontSize ;\r
42 }\r
43 \r
44 FCKToolbarFontSizeCombo.prototype.GetStyles = function()\r
45 {\r
46         var baseStyle = FCKStyles.GetStyle( '_FCK_Size' ) ;\r
47 \r
48         if ( !baseStyle )\r
49         {\r
50                 alert( "The FCKConfig.CoreStyles['FontFace'] setting was not found. Please check the fckconfig.js file" ) ;\r
51                 return {} ;\r
52         }\r
53 \r
54         var styles = {} ;\r
55 \r
56         var fonts = FCKConfig.FontSizes.split(';') ;\r
57 \r
58         for ( var i = 0 ; i < fonts.length ; i++ )\r
59         {\r
60                 var fontParts = fonts[i].split('/') ;\r
61                 var font = fontParts[0] ;\r
62                 var caption = fontParts[1] || font ;\r
63 \r
64                 var style = FCKTools.CloneObject( baseStyle ) ;\r
65                 style.SetVariable( 'Size', font ) ;\r
66                 style.Label = caption ;\r
67 \r
68                 styles[ caption ] = style ;\r
69         }\r
70 \r
71         return styles ;\r
72 }\r
73 \r
74 FCKToolbarFontSizeCombo.prototype.RefreshActiveItems = FCKToolbarStyleCombo.prototype.RefreshActiveItems ;\r
75 \r
76 FCKToolbarFontSizeCombo.prototype.StyleCombo_OnBeforeClick = FCKToolbarFontsCombo.prototype.StyleCombo_OnBeforeClick ;\r