Skip to content
This repository was archived by the owner on May 18, 2025. It is now read-only.

Commit 149d10f

Browse files
committed
v0.2.8
1 parent 5573f88 commit 149d10f

3 files changed

Lines changed: 28 additions & 26 deletions

File tree

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017 Mattia Roccoberton
1+
Copyright (c) 2017-2020 Mattia Roccoberton
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

README.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
1-
# ActiveAdmin Medium Editor [![Gem Version](https://badge.fury.io/rb/activeadmin_medium_editor.svg)](https://badge.fury.io/rb/activeadmin_medium_editor) [![CircleCI](https://circleci.com/gh/blocknotes/activeadmin_medium_editor.svg?style=svg)](https://circleci.com/gh/blocknotes/activeadmin_medium_editor)
1+
# Active Admin Medium Editor [![Gem Version](https://badge.fury.io/rb/activeadmin_medium_editor.svg)](https://badge.fury.io/rb/activeadmin_medium_editor) [![CircleCI](https://circleci.com/gh/blocknotes/activeadmin_medium_editor.svg?style=svg)](https://circleci.com/gh/blocknotes/activeadmin_medium_editor)
22

33
An Active Admin plugin to use [medium-editor](https://github.com/yabwe/medium-editor), a compact and clean WYSIWYG editor.
44

55
![screenshot](screenshot.png)
66

7-
*Usage*: select some text in the input, a pop-up menu is shown with the available buttons
7+
## Usage
8+
- After the installation, select some text in the editor
9+
- A pop-up menu is shown with the available buttons
10+
- Click on a button and the effect will be applied to the selected text
811

912
## Install
10-
11-
- Add to your Gemfile:
12-
`gem 'activeadmin_medium_editor'`
13-
- Execute bundle
14-
- Add at the end of your ActiveAdmin styles (_app/assets/stylesheets/active_admin.scss_):
15-
```css
13+
- After installing Active Admin, add to your Gemfile: `gem 'activeadmin_medium_editor'` (and execute *bundle*)
14+
- Add at the end of your Active Admin styles (_app/assets/stylesheets/active_admin.scss_):
15+
```scss
16+
@import 'activeadmin/medium_editor/medium_editor';
1617
@import 'activeadmin/medium_editor_input';
17-
@import 'activeadmin/medium_editor/themes/default.css'; // or another theme
18+
@import 'activeadmin/medium_editor/themes/default'; // or another theme
1819
```
19-
- Add at the end of your ActiveAdmin javascripts (_app/assets/javascripts/active_admin.js_):
20+
- Add at the end of your Active Admin javascripts (_app/assets/javascripts/active_admin.js_):
2021
```js
2122
//= require activeadmin/medium_editor/medium_editor
2223
//= require activeadmin/medium_editor_input
2324
```
2425
- Use the input with `as: :medium_editor` in Active Admin model conf
2526

26-
Why 2 separated scripts? In this way you can include a different version of *medium-editor* if you like.
27+
Why 2 separated scripts/styles? In this way you can include a different version of *medium-editor* if you like.
2728

28-
## Options
29+
> **UPDATE FROM VERSION < 2.8**: please change your _app/assets/stylesheets/active_admin.scss_ using the new import lines above
2930
31+
## Options
3032
**data-options**: permits to set *medium-editor* options directly - see [options list](https://github.com/yabwe/medium-editor#mediumeditor-options)
3133

3234
## Examples
3335

36+
### Basic usage
37+
3438
```ruby
35-
# ActiveAdmin article form conf:
39+
# Active Admin article form conf:
3640
form do |f|
3741
f.inputs 'Article' do
3842
f.input :title
@@ -43,26 +47,24 @@ Why 2 separated scripts? In this way you can include a different version of *med
4347
end
4448
```
4549

46-
Some more buttons:
50+
### Buttons configuration
4751

48-
`f.input :description, as: :medium_editor, input_html: { data: { options: '{"spellcheck":false,"toolbar":{"buttons":["bold","italic","underline","anchor","orderedlist","unorderedlist","strikethrough","subscript","superscript","pre","h1","h2","h3","h4","h5","h6","html"]}}' } }`
52+
```ruby
53+
f.input :description, as: :medium_editor, input_html: { data: { options: '{"spellcheck":false,"toolbar":{"buttons":["bold","italic","underline","anchor","orderedlist","unorderedlist","strikethrough","subscript","superscript","pre","h1","h2","h3","h4","h5","h6","html"]}}' } }
54+
```
4955

5056
## Notes
51-
52-
With the current version of Medium Editor some default buttons seem to not work properly, from my test they are: "indent", "outdent", "quote", "justifyLeft", "justifyCenter", "justifyRight", "justifyFull"
53-
54-
If some of this feature are needed I could suggest to override the button behavior or to use custom style classes. See the Medium Editor documentation for details.
57+
- With the current version of Medium Editor some default buttons seem to not work properly, from my test they are: "indent", "outdent", "quote", "justifyLeft", "justifyCenter", "justifyRight", "justifyFull"
58+
- If some of this feature are needed I could suggest to override the button behavior or to use custom style classes. See the Medium Editor documentation for details.
5559

5660
## Do you like it? Star it!
57-
5861
If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
5962

60-
Take a look at [other ActiveAdmin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source) that I made if you are curious.
63+
Take a look at [other Active Admin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source) that I made if you are curious.
6164

6265
## Contributors
63-
6466
- [Mattia Roccoberton](http://blocknot.es): author
67+
- The good guys that opened issues and pull requests from time to time
6568

6669
## License
67-
68-
[MIT](LICENSE.txt)
70+
- The gem is available as open-source under the terms of the [MIT](LICENSE.txt)

lib/activeadmin/medium_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 MediumEditor
5-
VERSION = '0.2.4'
5+
VERSION = '0.2.8'
66
end
77
end

0 commit comments

Comments
 (0)