Skip to content

Commit c2c8d48

Browse files
committed
Webpacker support
1 parent 72062c1 commit c2c8d48

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ An Active Admin plugin to use [Quill Rich Text Editor](https://github.com/quillj
55
![screenshot](screenshot.png)
66

77
## Install
8-
- After installing Active Admin, add to your Gemfile: `gem 'activeadmin_quill_editor'` (and execute *bundle*)
8+
After installing Active Admin, add to your Gemfile: `gem 'activeadmin_quill_editor'` (and execute *bundle*)
9+
10+
If you installed Active Admin without Webpacker support (default for now):
11+
912
- Add at the end of your Active Admin styles (_app/assets/stylesheets/active_admin.scss_):
1013
```scss
1114
@import 'activeadmin/quill_editor/quill.snow';
@@ -16,13 +19,23 @@ An Active Admin plugin to use [Quill Rich Text Editor](https://github.com/quillj
1619
//= require activeadmin/quill_editor/quill
1720
//= require activeadmin/quill_editor_input
1821
```
19-
- Use the input with `as: :quill_editor` in Active Admin model conf
20-
21-
Why 2 separated scripts/styles? In this way you can include a different version of *quill editor* if you like.
2222

2323
> **UPDATE FROM VERSION <= 2.0**: please add to your _app/assets/stylesheets/active_admin.scss_ the line `@import 'activeadmin/quill_editor/quill.snow';`
2424
25-
## Options
25+
If you installed Active Admin with Webpacker support:
26+
27+
- Execute in your project root:
28+
```sh
29+
yarn add blocknotes/activeadmin_quill_editor
30+
```
31+
- Add to your *app/javascript/packs/active_admin.js*:
32+
```js
33+
require('activeadmin_quill_editor')
34+
```
35+
36+
## Usage
37+
In your Active Admin models, form configuration, set the text inputs with `as: :quill_editor` where needed.
38+
2639
**data-options**: permits to set *quill editor* options directly - see [options list](https://quilljs.com/docs/configuration/)
2740

2841
## Examples

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Styles
2+
import 'activeadmin_quill_editor/app/assets/stylesheets/activeadmin/quill_editor/quill.snow'
3+
import 'activeadmin_quill_editor/app/assets/stylesheets/activeadmin/_quill_editor_input'
4+
5+
// JS
6+
window.Quill = require('activeadmin_quill_editor/app/assets/javascripts/activeadmin/quill_editor/quill')
7+
require('activeadmin_quill_editor/app/assets/javascripts/activeadmin/quill_editor_input')

lib/activeadmin/quill_editor/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module ActiveAdmin
44
module QuillEditor
5-
VERSION = '0.2.14'
5+
VERSION = '0.3.0'
66
end
77
end

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "activeadmin_quill_editor",
3+
"version": "0.3.0",
4+
"description": "Quill Editor for ActiveAdmin",
5+
"author": "Mattia Roccoberton <[email protected]>",
6+
"license": "MIT",
7+
"homepage": "https://github.com/blocknotes/activeadmin_quill_editor",
8+
"main": "index.js"
9+
}

0 commit comments

Comments
 (0)