Sha256: 8cd6ed1ae6b97e2b338076aa27bd5487312c8c82c92617459ebedcfba0c47719

Contents?: true

Size: 823 Bytes

Versions: 4

Compression:

Stored size: 823 Bytes

Contents

if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
	RedactorPlugins.fontfamily = function()
	{
		return {
			init: function ()
			{
				var fonts = [ 'Arial', 'Helvetica', 'Georgia', 'Times New Roman', 'Monospace' ];
				var that = this;
				var dropdown = {};

				$.each(fonts, function(i, s)
				{
					dropdown['s' + i] = { title: s, func: function() { that.fontfamily.set(s); }};
				});

				dropdown.remove = { title: 'Remove Font Family', func: that.fontfamily.reset };

				var button = this.button.add('fontfamily', 'Change Font Family');
				this.button.addDropdown(button, dropdown);

			},
			set: function (value)
			{
				this.inline.format('span', 'style', 'font-family:' + value + ';');
			},
			reset: function()
			{
				this.inline.removeStyleRule('font-family');
			}
		};
	};
})(jQuery);

Version data entries

4 entries across 4 versions & 4 rubygems

Version Path
redactor-rails-fixes-0.5.0.1 vendor/assets/javascripts/redactor-rails/plugins/fontfamily.js
rdrails5-0.5.1 vendor/assets/javascripts/redactor-rails/plugins/fontfamily.js
redactor-rails4-0.5.0 vendor/assets/javascripts/redactor-rails/plugins/fontfamily.js
redactor-rails-0.5.0 vendor/assets/javascripts/redactor-rails/plugins/fontfamily.js