~ubuntu-branches/ubuntu/oneiric/moin/oneiric-security

« back to all changes in this revision

Viewing changes to MoinMoin/web/static/htdocs/applets/FCKeditor/editor/_source/classes/fcktoolbarfontsizecombo.js

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-03-30 12:55:34 UTC
  • mfrom: (0.1.17 sid)
  • Revision ID: james.westby@ubuntu.com-20100330125534-4c2ufc1rok24447l
Tags: 1.9.2-2ubuntu1
* Merge from Debian testing (LP: #521834). Based on work by Stefan Ebner.
  Remaining changes:
 - Remove python-xml from Suggests field, the package isn't anymore in
   sys.path.
 - Demote fckeditor from Recommends to Suggests; the code was previously
   embedded in moin, but it was also disabled, so there's no reason for us
   to pull this in by default currently. Note: This isn't necessary anymore
   but needs a MIR for fckeditor, so postpone dropping this change until
   lucid+1
* debian/rules:
  - Replace hardcoded python2.5 with python* and hardcore python2.6 for ln
* debian/control.in: drop versioned depends on cdbs

Show diffs side-by-side

added added

removed removed

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