зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-09-03 10:16:18 +03:00
Сравнить коммиты
4 Коммитов
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
dc97316303 | ||
|
|
e9b8abc88e | ||
|
|
582667dc59 | ||
|
|
76c06f5346 |
10
README.md
10
README.md
@@ -1,6 +1,6 @@
|
|||||||
# ActiveAdmin Quill Editor [](https://badge.fury.io/rb/activeadmin_quill_editor) [](https://circleci.com/gh/blocknotes/activeadmin_quill_editor)
|
# ActiveAdmin Quill Editor [](https://badge.fury.io/rb/activeadmin_quill_editor) [](https://circleci.com/gh/blocknotes/activeadmin_quill_editor)
|
||||||
|
|
||||||
An Active Admin plugin to use [Quill Rich Text Editor](https://github.com/quilljs/quill)
|
An Active Admin plugin to use [Quill Rich Text Editor](https://github.com/quilljs/quill) in form fields.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ An Active Admin plugin to use [Quill Rich Text Editor](https://github.com/quillj
|
|||||||
```
|
```
|
||||||
- Use the input with `as: :quill_editor` in Active Admin model conf
|
- Use the input with `as: :quill_editor` in Active Admin model conf
|
||||||
|
|
||||||
Why 2 separated scripts? In this way you can include a different version of *quill editor* if you like.
|
Why 2 separated scripts/styles? In this way you can include a different version of *quill editor* if you like.
|
||||||
|
|
||||||
> **UPDATE FROM VERSION <= 2.0**: please add to your _app/assets/stylesheets/active_admin.scss_ the line `@import 'activeadmin/quill_editor/quill.snow';`
|
> **UPDATE FROM VERSION <= 2.0**: please add to your _app/assets/stylesheets/active_admin.scss_ the line `@import 'activeadmin/quill_editor/quill.snow';`
|
||||||
|
|
||||||
@@ -44,11 +44,11 @@ Why 2 separated scripts? In this way you can include a different version of *qui
|
|||||||
### Toolbar buttons configuration
|
### Toolbar buttons configuration
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
f.input :description, as: :quill_editor, input_html: {data: {options: {modules: {toolbar: [['bold', 'italic', 'underline'], ['link']]}, placeholder: 'Type something...', theme: 'snow'}}}
|
f.input :description, as: :quill_editor, input_html: { data: { options: { modules: { toolbar: [['bold', 'italic', 'underline'], ['link']] }, placeholder: 'Type something...', theme: 'snow' } } }
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
- Upload functions (Images, Documents, Files, etc.) are not implemented yet
|
- Upload features (images/documents/files): not tested yet.
|
||||||
|
|
||||||
## Do you like it? Star it!
|
## Do you like it? Star it!
|
||||||
If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
|
If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
|
||||||
@@ -60,4 +60,4 @@ Take a look at [other Active Admin components](https://github.com/blocknotes?utf
|
|||||||
- The good guys that opened issues and pull requests from time to time
|
- The good guys that opened issues and pull requests from time to time
|
||||||
|
|
||||||
## License
|
## License
|
||||||
- The gem is available as open-source under the terms of the [MIT](LICENSE.txt)
|
The gem is available as open-source under the terms of the [MIT](LICENSE.txt).
|
||||||
|
|||||||
@@ -30,7 +30,11 @@ function initQuillEditors() {
|
|||||||
formtastic.onsubmit = function() {
|
formtastic.onsubmit = function() {
|
||||||
for(var i = 0; i < editors.length; i++) {
|
for(var i = 0; i < editors.length; i++) {
|
||||||
var input = editors[i].querySelector('input[type="hidden"]');
|
var input = editors[i].querySelector('input[type="hidden"]');
|
||||||
input.value = editors[i]['_quill-editor'].root.innerHTML;
|
if (editors[i]['_quill-editor'].editor.isBlank()) {
|
||||||
|
input.value = '';
|
||||||
|
} else {
|
||||||
|
input.value = editors[i]['_quill-editor'].root.innerHTML;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
// reset internal elements
|
||||||
|
.ql-editor * {
|
||||||
|
margin: initial;
|
||||||
|
padding: initial;
|
||||||
|
text-align: initial;
|
||||||
|
}
|
||||||
|
|
||||||
body.active_admin .quill-editor {
|
body.active_admin .quill-editor {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: calc(80% - 2px);
|
width: calc(80% - 2px);
|
||||||
@@ -23,13 +30,6 @@ body.active_admin .quill-editor {
|
|||||||
min-height: 150px;
|
min-height: 150px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|
||||||
// reset internal elements
|
|
||||||
* {
|
|
||||||
margin: initial;
|
|
||||||
padding: initial;
|
|
||||||
text-align: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol {
|
ol {
|
||||||
list-style-type: decimal;
|
list-style-type: decimal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
module ActiveAdmin
|
module ActiveAdmin
|
||||||
module QuillEditor
|
module QuillEditor
|
||||||
VERSION = '0.2.8'
|
VERSION = '0.2.9'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user