activeadmin_froala_editor 0.2.1 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +21 -22
- data/Rakefile +2 -2
- data/app/assets/javascripts/activeadmin/froala_editor_input.js +5 -2
- data/app/assets/stylesheets/activeadmin/_froala_editor_input.scss +14 -3
- data/lib/activeadmin/froala_editor.rb +2 -0
- data/lib/activeadmin/froala_editor/engine.rb +2 -0
- data/lib/activeadmin/froala_editor/version.rb +3 -1
- data/lib/activeadmin_froala_editor.rb +2 -1
- data/lib/formtastic/inputs/froala_editor_input.rb +2 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9749605f9f60196e6c2a7c5c4896dd542d0090d413efc70114005efa50756e8f
|
4
|
+
data.tar.gz: 31dd928db47987a934d114c200f6956a182191a009c8ba8e270f197f8294ea13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '084f552b2767fd5266427a42ee7b480ff57ae7ab6115bea21603936e9d636e31f2557b6ea3e6cda1976803f88043822abbd7136290362676ab7555198cc07779'
|
7
|
+
data.tar.gz: 0740ba637e5b9cf2bf7403423775243db8132afd8f9e148196c8f3454c5081bc1f36100e7d557349e3644ea08bbd2cfd4cd63fecdd3c6d13b0237b457eaf0aae
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,36 +1,35 @@
|
|
1
1
|
# ActiveAdmin Froala Editor [![Gem Version](https://badge.fury.io/rb/activeadmin_froala_editor.svg)](https://badge.fury.io/rb/activeadmin_froala_editor) [![CircleCI](https://circleci.com/gh/blocknotes/activeadmin_froala_editor.svg?style=svg)](https://circleci.com/gh/blocknotes/activeadmin_froala_editor)
|
2
2
|
|
3
|
-
An Active Admin plugin to use [Froala WYSIWYG editor](https://github.com/froala/wysiwyg-editor) (jQuery required, font-awesome required & included)
|
3
|
+
An Active Admin plugin to use [Froala WYSIWYG editor](https://github.com/froala/wysiwyg-editor) (jQuery required, font-awesome required & included). For Froala license / pricing see Froala website.
|
4
4
|
|
5
|
-
|
5
|
+
Features:
|
6
|
+
- permits to include an easy to use rich editor in Active Admin;
|
7
|
+
- customizable options via data attributes in the form input;
|
8
|
+
- plugins included, like images upload.
|
6
9
|
|
7
|
-
|
10
|
+
![screenshot](screenshot.png)
|
8
11
|
|
9
12
|
## Install
|
10
|
-
|
11
|
-
-
|
12
|
-
- Add at the end of your ActiveAdmin styles (_app/assets/stylesheets/active_admin.scss_):
|
13
|
+
- After installing Active Admin, add to your Gemfile: `gem 'activeadmin_froala_editor'` (and execute *bundle*)
|
14
|
+
- Add at the end of your Active Admin styles (_app/assets/stylesheets/active_admin.scss_):
|
13
15
|
```css
|
14
16
|
@import 'font-awesome/font-awesome';
|
15
17
|
@import 'activeadmin/froala_editor_input';
|
16
18
|
```
|
17
|
-
- Add at the end of your
|
19
|
+
- Add at the end of your Active Admin javascripts (_app/assets/javascripts/active_admin.js_):
|
18
20
|
```js
|
19
21
|
//= require activeadmin/froala_editor/froala_editor.pkgd.min
|
20
22
|
//= require activeadmin/froala_editor_input
|
21
23
|
```
|
22
24
|
- Use the input with `as: :froala_editor` in Active Admin model conf
|
23
25
|
|
24
|
-
Why 2 separated scripts? In this way you can include a different version of *froala editor* if you like. The same for FontAwesome.
|
25
|
-
|
26
26
|
## Options
|
27
|
-
|
28
27
|
**data-options**: permits to set *froala editor* options directly - see [options list](https://www.froala.com/wysiwyg-editor/docs/options)
|
29
28
|
|
30
29
|
## Examples
|
31
30
|
|
32
31
|
```ruby
|
33
|
-
#
|
32
|
+
# Active Admin article form conf:
|
34
33
|
form do |f|
|
35
34
|
f.inputs 'Article' do
|
36
35
|
f.input :title
|
@@ -47,24 +46,24 @@ Toolbar buttons configuration:
|
|
47
46
|
f.input :description, as: :froala_editor, input_html: { data: { options: { toolbarButtons: ['undo', 'redo', '|', 'bold', 'italic'] } } }
|
48
47
|
```
|
49
48
|
|
50
|
-
|
49
|
+
Froala upload plugin: for the relevant files of an upload example see [here](examples/upload_plugin_using_activestorage/).
|
50
|
+
Consider that this is just a basic example: images are uploaded as soon as they are attached to the
|
51
|
+
editor (regardless of the form submit), it shows the editor only for an existing record (because of
|
52
|
+
the *upload_admin_post_path*) and it doesn't provide a way to remove images (just deleting them from
|
53
|
+
the editor will not destroy them, you'll need to implement a purge logic for that).
|
51
54
|
|
52
|
-
|
53
|
-
-
|
54
|
-
- To use this plugins with ActiveAdmin 1.x please use the version 0.1.3
|
55
|
+
## Notes
|
56
|
+
- To use this plugins with Active Admin 1.x please use the version [0.1.3](https://github.com/blocknotes/activeadmin_froala_editor/releases/tag/v0.1.3)
|
55
57
|
|
56
58
|
## Do you like it? Star it!
|
57
|
-
|
58
59
|
If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
|
59
60
|
|
60
|
-
Take a look at [other
|
61
|
+
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.
|
61
62
|
|
62
63
|
## Contributors
|
63
|
-
|
64
64
|
- [Mattia Roccoberton](http://blocknot.es): author
|
65
|
+
- The good guys that opened issues and pull requests from time to time
|
65
66
|
|
66
67
|
## License
|
67
|
-
|
68
|
-
Froala License: see Froala website
|
69
|
-
|
70
|
-
Plugin License: [MIT](LICENSE.txt)
|
68
|
+
- The gem is available as open-source under the terms of the [MIT](LICENSE.txt)
|
69
|
+
- For Froala editor License: see [Froala website](https://froala.com/wysiwyg-editor/)
|
data/Rakefile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require 'bundler/gem_tasks'
|
@@ -4,6 +4,10 @@ function initFroalaEditors() {
|
|
4
4
|
var name = $(this).attr('name');
|
5
5
|
if(name) {
|
6
6
|
var options = {
|
7
|
+
quickInsertButtons: ['table', 'ol', 'ul', 'hr'],
|
8
|
+
requestHeaders: {
|
9
|
+
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
|
10
|
+
},
|
7
11
|
toolbarButtons: {
|
8
12
|
moreText: {
|
9
13
|
buttons: ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting'],
|
@@ -25,8 +29,7 @@ function initFroalaEditors() {
|
|
25
29
|
align: 'right',
|
26
30
|
buttonsVisible: 3
|
27
31
|
}
|
28
|
-
}
|
29
|
-
quickInsertButtons: ['table', 'ol', 'ul', 'hr']
|
32
|
+
}
|
30
33
|
};
|
31
34
|
options = $.extend({}, options, $(this).data('options'));
|
32
35
|
new FroalaEditor('.froala-editor[name="' + name + '"]', options);
|
@@ -1,36 +1,43 @@
|
|
1
1
|
@import 'activeadmin/froala_editor/froala_editor.pkgd';
|
2
2
|
@import 'activeadmin/froala_editor/froala_style';
|
3
3
|
|
4
|
-
body.active_admin
|
4
|
+
body.active_admin .froala_editor {
|
5
5
|
button {
|
6
6
|
box-shadow: none;
|
7
7
|
}
|
8
|
+
|
8
9
|
ol {
|
9
10
|
list-style-type: decimal;
|
10
11
|
}
|
12
|
+
|
11
13
|
ul {
|
12
14
|
list-style-type: disc;
|
13
15
|
}
|
16
|
+
|
14
17
|
.fr-action-buttons > button {
|
15
18
|
font-weight: normal;
|
16
19
|
text-shadow: none;
|
17
20
|
}
|
21
|
+
|
18
22
|
.fr-box {
|
19
23
|
display: inline-block;
|
20
|
-
width: calc(80% -
|
24
|
+
width: calc(80% - 2px);
|
21
25
|
}
|
26
|
+
|
22
27
|
.fr-checkbox-line {
|
23
28
|
>label {
|
24
29
|
display: inline-block;
|
25
30
|
float: none;
|
26
31
|
width: auto;
|
27
32
|
}
|
33
|
+
|
28
34
|
>span {
|
29
35
|
height: auto;
|
30
36
|
padding: 0;
|
31
37
|
width: auto;
|
32
38
|
}
|
33
39
|
}
|
40
|
+
|
34
41
|
.fr-element {
|
35
42
|
ul, ol {
|
36
43
|
margin: 0 10px 15px 0;
|
@@ -40,17 +47,21 @@ body.active_admin form .froala_editor {
|
|
40
47
|
padding: 0;
|
41
48
|
}
|
42
49
|
}
|
50
|
+
|
43
51
|
.fr-input-line >label {
|
44
52
|
font-weight: normal;
|
45
53
|
}
|
54
|
+
|
46
55
|
.fr-top {
|
47
|
-
border-radius:
|
56
|
+
border-radius: 3px 3px 0 0;
|
48
57
|
}
|
58
|
+
|
49
59
|
.fr-wrapper {
|
50
60
|
min-height: 150px;
|
51
61
|
max-height: 300px;
|
52
62
|
overflow-y: scroll;
|
53
63
|
}
|
64
|
+
|
54
65
|
.second-toolbar {
|
55
66
|
border-radius: 0 0 4px 4px;
|
56
67
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin_froala_editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattia Roccoberton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|
@@ -109,33 +109,33 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 4.0.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rubocop
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 0.90.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 0.90.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: selenium-webdriver
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 3.142.7
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 3.142.7
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: sqlite3
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|