项目作者: WaKeMaTTa

项目描述 :
Gemify summernote-image-attributes for Rails >= 3.1
高级语言: Ruby
项目地址: git://github.com/WaKeMaTTa/summernote-ext-image-attributes-rails.git
创建时间: 2018-05-09T11:52:33Z
项目社区:https://github.com/WaKeMaTTa/summernote-ext-image-attributes-rails

开源协议:MIT License

下载


summernote-ext-image-attributes-rails

The gemification of the summernote extension summernote-image-attributes
for Rails >= 3.1.



Demo

Also, we have a live demo (press the image inside of the editor).

Installation

Add the following gems to your application’s Gemfile:

  1. gem 'bootstrap-sass' # required
  2. gem 'summernote-rails' # required
  3. gem 'summernote-ext-image-attributes-rails', '~> 0.8.10'

And then execute on the terminal:

  1. bundle install

Usage

JavaScript

In app/assets/javascripts/application.js, you should add in this order:

  1. //= require bootstrap
  2. //= require summernote
  3. //= require summernote-ext-image-attributes

CoffeeScript

In app/assets/javascripts/application.coffee, you should add in this order:

  1. #= require bootstrap
  2. #= require summernote
  3. #= require summernote-ext-image-attributes

Customization

  1. $('[data-provider="summernote"]').summernote({
  2. popover: {
  3. image: [
  4. ['custom', ['imageAttributes']],
  5. ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
  6. ['float', ['floatLeft', 'floatRight', 'floatNone']],
  7. ['remove', ['removeMedia']]
  8. ],
  9. },
  10. lang: 'en-US', // Change to your chosen language
  11. imageAttributes: {
  12. icon: '<i class="note-icon-pencil"></i>',
  13. removeEmpty: false, // true = remove attributes | false = leave empty if present
  14. disableUpload: false // true = don't display Upload Options | Display Upload Options
  15. }
  16. });

More information here.

Versioning

Major Minor Patch Current
is the major of summernote is the minor of summernote is the patch of summernote is the vesion of this extension

Example:

The compatible versions of this gem with summernote v0.8.10 are:

  • summernote-ext-image-attributes-rails v0.8.10.X

License

MIT