1 if (!RedactorPlugins
) var RedactorPlugins
= {};
4 * Provides a font size picker, this is actually a heavily modified version of Imperavi's 'fontsize' plugin.
6 * @author Alexander Ebert
7 * @copyright 2001-2014 WoltLab GmbH
8 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
10 RedactorPlugins
.wfontsize
= {
12 var $fontSizes
= [ 8, 10, 12, 14, 18, 24, 36 ];
16 for (var $i
= 0, $length
= $fontSizes
.length
; $i
< $length
; $i
++) {
17 var $fontSize
= $fontSizes
[$i
];
19 $dropdown
['fontSize' + $i
] = {
21 className
: 'wfontsize-' + $fontSize
,
22 callback: function() {
23 self
.inlineSetStyle('font-size', $fontSize
+ 'pt');
28 $dropdown
['separator'] = { name
: 'separator' };
29 $dropdown
['remove'] = {
30 title
: 'remove font size',
31 callback: function() {
32 this.inlineRemoveStyle('font-size');
36 this.buttonReplace('fontsize', 'wfontsize', 'Change font size', false, $dropdown
);
37 this.buttonGet('wfontsize').addClass('re-fontsize');
39 // modify dropdown to reflect each font family
40 $dropdown
= this.$toolbar
.find('.redactor_dropdown_box_wfontsize');
41 for (var $i
= 0, $length
= $fontSizes
.length
; $i
< $length
; $i
++) {
42 var $fontSize
= $fontSizes
[$i
];
44 var $listItem
= $dropdown
.children('a.wfontsize-' + $fontSize
).removeClass('wfontsize-' + $fontSizes
).css('font-size', $fontSize
+ 'pt');
46 $listItem
.css('line-height', '1em');