activeadmin_medium_editor 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18830bfe275573dcd15abaa21c76b6e4266ec56d
|
4
|
+
data.tar.gz: b4c18640d247fe3dc72bf08bea8deded67557c6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93a66cf75bb58cd4b0d1bedea4ee9b625d589dbab2ec400041519235c5001c34d2e07e13c7d93d4ea2f2a26bb712a9f81add83a1c72a5cd2d106c423a506f5cb
|
7
|
+
data.tar.gz: a629a66783f6598990a1bcae5c00c1fd8309ff9c6bed6eda6de84a86f40d4f5ef59eb0a89a69686b1b69cc60372ac229ba2da58bd16f85e8316807a4664f98e9
|
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# ActiveAdmin Medium Editor [![Gem Version](https://badge.fury.io/rb/activeadmin_medium_editor.svg)](https://badge.fury.io/rb/activeadmin_medium_editor)
|
2
2
|
|
3
|
-
An Active Admin plugin to use [medium-editor](https://github.com/yabwe/medium-editor).
|
3
|
+
An Active Admin plugin to use [medium-editor](https://github.com/yabwe/medium-editor), a compact and clean WYSIWYG editor.
|
4
|
+
|
5
|
+
![screenshot](screenshot.jpg)
|
6
|
+
|
7
|
+
After some text of the input is selected a pop-up menu is shown.
|
4
8
|
|
5
9
|
## Install
|
6
10
|
|
@@ -23,22 +27,32 @@ Why 2 separated scripts? In this way you can include a different version of *med
|
|
23
27
|
|
24
28
|
## Notes
|
25
29
|
|
26
|
-
**data-options
|
30
|
+
**data-options**: permits to set *medium-editor* options directly - see [options list](https://github.com/yabwe/medium-editor#mediumeditor-options)
|
27
31
|
|
28
|
-
##
|
32
|
+
## Examples
|
29
33
|
|
30
34
|
```ruby
|
31
35
|
# ActiveAdmin article form conf:
|
32
36
|
form do |f|
|
33
37
|
f.inputs 'Article' do
|
34
38
|
f.input :title
|
35
|
-
f.input :description, as: :medium_editor, input_html: {
|
39
|
+
f.input :description, as: :medium_editor, input_html: { data: { options: '{"spellcheck":false,"toolbar":{"buttons":["bold","italic","underline","anchor"]}}' } }
|
36
40
|
f.input :published
|
37
41
|
end
|
38
42
|
f.actions
|
39
43
|
end
|
40
44
|
```
|
41
45
|
|
46
|
+
Some more buttons:
|
47
|
+
|
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"]}}' } }`
|
49
|
+
|
50
|
+
## 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.
|
55
|
+
|
42
56
|
## Contributors
|
43
57
|
|
44
58
|
- [Mattia Roccoberton](http://blocknot.es) - creator, maintainer
|
@@ -2,7 +2,6 @@ $(document).ready( function() {
|
|
2
2
|
$('.medium-editor').each(function () {
|
3
3
|
var options = {};
|
4
4
|
options = $.extend({}, options, $(this).data('options'));
|
5
|
-
// var options = $(this).data('options') ? $(this).data('options') : {};
|
6
5
|
new MediumEditor( $(this), options );
|
7
6
|
});
|
8
7
|
});
|
@@ -1,17 +1,31 @@
|
|
1
1
|
@import './medium_editor/medium_editor'
|
2
2
|
|
3
3
|
body.active_admin form
|
4
|
-
|
4
|
+
textarea.medium-editor-hidden
|
5
|
+
display: none
|
6
|
+
.medium-editor-element
|
5
7
|
background-color: #fff
|
6
8
|
border-radius: 5px
|
7
9
|
border: 1px solid #96a8b2
|
8
10
|
display: inline-block
|
11
|
+
max-height: 200px
|
12
|
+
overflow-y: scroll
|
9
13
|
padding: 4px 6px 6px 6px
|
10
14
|
width: 450px
|
11
|
-
|
15
|
+
// reset internal elements
|
16
|
+
*
|
17
|
+
margin: initial
|
18
|
+
padding: initial
|
19
|
+
text-align: initial
|
20
|
+
ol
|
21
|
+
list-style-type: decimal
|
22
|
+
ul
|
23
|
+
list-style-type: disc
|
24
|
+
ul, ol
|
25
|
+
margin: 0 1.5em 1.5em 0
|
26
|
+
padding-left: 1.5em
|
27
|
+
.medium-editor-element:focus
|
12
28
|
border-color: transparent
|
13
|
-
textarea.medium-editor-hidden
|
14
|
-
display: none
|
15
29
|
.medium_editor > label
|
16
30
|
display: inline-block
|
17
31
|
float: none
|
@@ -19,11 +33,3 @@ body.active_admin form
|
|
19
33
|
|
20
34
|
button.medium-editor-action
|
21
35
|
border-radius: 0
|
22
|
-
|
23
|
-
// .selectize-control
|
24
|
-
// .selectize-input
|
25
|
-
// width: calc(80% - 22px)
|
26
|
-
// &.multi .selectize-input, .selectize-input
|
27
|
-
// padding: 0 5px
|
28
|
-
// &.has-items
|
29
|
-
// padding: 0 5px
|
data/screenshot.jpg
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin_medium_editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattia Roccoberton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- lib/activeadmin/medium_editor/version.rb
|
62
62
|
- lib/activeadmin_medium_editor.rb
|
63
63
|
- lib/formtastic/inputs/medium_editor_input.rb
|
64
|
+
- screenshot.jpg
|
64
65
|
homepage: https://github.com/blocknotes/activeadmin_medium_editor
|
65
66
|
licenses:
|
66
67
|
- MIT
|
@@ -81,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
82
|
version: '0'
|
82
83
|
requirements: []
|
83
84
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.6.13
|
85
86
|
signing_key:
|
86
87
|
specification_version: 4
|
87
88
|
summary: medium-editor for ActiveAdmin
|