Sha256: 93ad15767b7779970d0c5e5f27a44b084f37744f0168ad109d34ee4912496ab1

Contents?: true

Size: 869 Bytes

Versions: 4

Compression:

Stored size: 869 Bytes

Contents

if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
  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');
      }
    };
  };
})(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/fontsize.js
rdrails5-0.5.1 vendor/assets/javascripts/redactor-rails/plugins/fontsize.js
redactor-rails4-0.5.0 vendor/assets/javascripts/redactor-rails/plugins/fontsize.js
redactor-rails-0.5.0 vendor/assets/javascripts/redactor-rails/plugins/fontsize.js