1 if (!RedactorPlugins
) var RedactorPlugins
= {};
4 * Provides a font family picker, this is actually a heavily modified version of Imperavi's 'fontfamily' 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
.wfontfamily
= {
13 'Arial': "Arial, Helvetica, sans-serif",
14 'Comic Sans MS': "Comic Sans MS, cursive",
15 'Courier New': "Consolas, Courier New, Courier, monospace",
16 'Georgia': "Georgia, serif",
17 'Lucida Sans Unicode': "Lucida Sans Unicode, Lucida Grande, sans-serif",
18 'Tahoma': "Tahoma, Geneva, sans-serif",
19 'Times New Roman': "Times New Roman, Times, serif",
20 'Trebuchet MS': "Trebuchet MS, Helvetica, sans-serif",
21 'Verdana': "Verdana, Geneva, sans-serif"
27 $.each($fonts
, function(title
, value
) {
28 $dropdown
['fontFamily' + $i
] = {
30 className
: 'wfontfamily-' + $i
,
31 callback: function() {
32 self
.inlineSetStyle('font-family', value
);
38 $dropdown
['separator'] = { name
: 'separator' };
39 $dropdown
['remove'] = {
41 callback: function() {
42 this.inlineRemoveStyle('font-family');
46 this.buttonReplace('fontfamily', 'wfontfamily', 'Change font family', false, $dropdown
);
47 this.buttonGet('wfontfamily').addClass('re-fontfamily');
49 // modify dropdown to reflect each font family
50 $dropdown
= this.$toolbar
.find('.redactor_dropdown_box_wfontfamily');
52 $.each($fonts
, function(title
, value
) {
53 $dropdown
.children('.wfontfamily-' + $i
).removeClass('wfontfamily-' + $i
).css('font-family', value
);