Sha256: da4027d6d94213613ba40457754b059c75363cce5d947f7907875c63c21755c4

Contents?: true

Size: 732 Bytes

Versions: 11

Compression:

Stored size: 732 Bytes

Contents

if (!RedactorPlugins) var RedactorPlugins = {};

RedactorPlugins.fontsize = function()
{
	return {
		init: function()
		{
			var fonts = [10, 11, 12, 14, 16, 18, 20, 24, 28, 30];
			var that = this;
			var dropdown = {};

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

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

			var button = this.button.add('fontsize', 'Change Font Size');
			this.button.addDropdown(button, dropdown);
		},
		set: function(size)
		{
			this.inline.format('span', 'style', 'font-size: ' + size + 'px;');
		},
		reset: function()
		{
			this.inline.removeStyleRule('font-size');
		}
	};
};

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
annex-cms-0.4.0 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.3.8 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.3.7 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.3.6 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.3.5 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.3.4 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.3.2 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.3.1 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.3.0 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.2.1 app/assets/javascripts/annex/jquery.redactor.fontsize.js
annex-cms-0.2.0 app/assets/javascripts/annex/jquery.redactor.fontsize.js