new_ckeditor 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +149 -0
- data/Rakefile +32 -0
- data/app/assets/config/new_ckeditor_manifest.js +6 -0
- data/app/assets/javascripts/new_ckeditor/balloon/ckeditor.js +6 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/af.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ar.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ast.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/az.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/bg.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ca.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/cs.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/da.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/de-ch.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/de.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/el.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/en-au.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/en-gb.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/eo.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/es.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/et.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/eu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/fa.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/fi.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/fr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/gl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/gu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/he.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/hr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/hu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/id.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/it.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ja.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/km.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/kn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ko.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ku.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/lt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/lv.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ms.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/nb.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ne.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/nl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/no.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/oc.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/pl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/pt-br.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/pt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ro.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ru.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/si.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/sk.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/sl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/sq.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/sr-latn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/sr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/sv.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/tr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/tt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/ug.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/uk.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/vi.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/zh-cn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/balloon/translations/zh.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/ckeditor.js +6 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/af.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ar.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ast.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/az.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/bg.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ca.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/cs.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/da.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/de-ch.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/de.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/el.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/en-au.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/en-gb.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/eo.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/es.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/et.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/eu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/fa.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/fi.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/fr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/gl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/gu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/he.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/hr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/hu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/id.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/it.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ja.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/km.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/kn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ko.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ku.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/lt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/lv.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ms.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/nb.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ne.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/nl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/no.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/oc.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/pl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/pt-br.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/pt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ro.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ru.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/si.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/sk.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/sl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/sq.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/sr-latn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/sr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/sv.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/tr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/tt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/ug.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/uk.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/vi.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/zh-cn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/classic/translations/zh.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/ckeditor.js +6 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/af.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ar.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ast.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/az.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/bg.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ca.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/cs.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/da.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/de-ch.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/de.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/el.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/en-au.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/en-gb.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/eo.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/es.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/et.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/eu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/fa.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/fi.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/fr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/gl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/gu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/he.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/hr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/hu.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/id.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/it.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ja.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/km.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/kn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ko.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ku.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/lt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/lv.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ms.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/nb.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ne.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/nl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/no.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/oc.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/pl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/pt-br.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/pt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ro.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ru.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/si.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/sk.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/sl.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/sq.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/sr-latn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/sr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/sv.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/tr.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/tt.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/ug.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/uk.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/vi.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/zh-cn.js +1 -0
- data/app/assets/javascripts/new_ckeditor/inline/translations/zh.js +1 -0
- data/app/assets/stylesheets/new_ckeditor/ckeditor.css +300 -0
- data/app/views/new_ckeditor/shared/_balloon.html.erb +79 -0
- data/app/views/new_ckeditor/shared/_classic.html.erb +58 -0
- data/app/views/new_ckeditor/shared/_inline.html.erb +65 -0
- data/config/routes.rb +2 -0
- data/lib/generators/new_ckeditor_generator.rb +10 -0
- data/lib/new_ckeditor/addons/simple_form.rb +16 -0
- data/lib/new_ckeditor/editor.rb +65 -0
- data/lib/new_ckeditor/engine.rb +24 -0
- data/lib/new_ckeditor/rails_ext/form_builder.rb +11 -0
- data/lib/new_ckeditor/rails_ext/form_helper.rb +11 -0
- data/lib/new_ckeditor/rails_ext/view_helper.rb +12 -0
- data/lib/new_ckeditor/version.rb +3 -0
- data/lib/new_ckeditor.rb +15 -0
- data/lib/tasks/new_ckeditor_tasks.rake +4 -0
- metadata +326 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0eefeeb12aad3cb29959f2cefb57379afd52a6928bff017b806386868e565a84
|
4
|
+
data.tar.gz: 3cd4044f33ebe962f8dedd6a9397ccfefbdff42fe2b657763658bfc5979e9eb1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 38a80c133ec4f995a44b200240f5411cf6acae391defba6dbafaff4afbb16100a685471f135ec769b42bf636c9de847107ec84b30b0577ff832c617ae5366c1e
|
7
|
+
data.tar.gz: 686028c8fe5e689e9146fd5d1a7ca2612fc9bbff04232bd2d222b791013248be0bb426fef5fc9a64baaca353caaca4ae3cf9df99f1f8e2bf052b8efa9a12aa0c
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2020 Igor Kasyanchuk
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
# Rails + CKEditor 5
|
2
|
+
|
3
|
+
Short description and motivation.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
How to use my plugin.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile and run `bundle`:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'new_ckeditor'
|
15
|
+
```
|
16
|
+
|
17
|
+
## Configuration
|
18
|
+
|
19
|
+
## File Upload with CKEditor 5
|
20
|
+
|
21
|
+
Gem doesn't have any strict dependency on any library. It's implemented this way on purpose to let developer use gem which he wants. Maybe in the future we can improve it.
|
22
|
+
|
23
|
+
But you can get a base skeleton where you can put your own logic.
|
24
|
+
|
25
|
+
Below I'll put an example of code which works with CKEditor.
|
26
|
+
|
27
|
+
1. Let's start with new controller `rails g controller file_uploads upload`
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
class FileUploadsController < ApplicationController
|
31
|
+
# note
|
32
|
+
# that method must return json with URL to an uploaded image
|
33
|
+
# or error message
|
34
|
+
def upload
|
35
|
+
image = CkEditorImage.new(file: params["upload"])
|
36
|
+
if image.save
|
37
|
+
render json: {
|
38
|
+
url: image.file.url
|
39
|
+
}
|
40
|
+
else
|
41
|
+
render json: {
|
42
|
+
"error": {
|
43
|
+
"message": image.errors.full_messages.join(", ")
|
44
|
+
}
|
45
|
+
}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
2. Create a new model where images will be stored: `rails g model CkEditorImage file:string user_id:integer parent_id:integer parent_type:string`
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
class CkEditorImage < ApplicationRecord
|
55
|
+
mount_uploader :file, CkEditorImageUploader
|
56
|
+
belongs_to :user, optional: true
|
57
|
+
validates_presence_of :file
|
58
|
+
end
|
59
|
+
```
|
60
|
+
|
61
|
+
Code of migration may look like:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
class CreateCkEditorImages < ActiveRecord::Migration[6.0]
|
65
|
+
def change
|
66
|
+
create_table :ck_editor_images do |t|
|
67
|
+
t.string :file
|
68
|
+
t.integer :user_id, index: true
|
69
|
+
t.integer :parent_id
|
70
|
+
t.string :parent_type
|
71
|
+
|
72
|
+
t.datetime :created_at
|
73
|
+
t.datetime :updated_at
|
74
|
+
end
|
75
|
+
add_index :ck_editor_images, :user_id
|
76
|
+
add_index :ck_editor_images, [:parent_id, :parent_type]
|
77
|
+
end
|
78
|
+
end
|
79
|
+
```
|
80
|
+
|
81
|
+
Run this migration.
|
82
|
+
|
83
|
+
3. Create Carrierwave uploader `rails g uploader CkEditorImage`. Open and edit it if needed.
|
84
|
+
|
85
|
+
4. Open again controller, edit logic, check user, check params, etc. You have a full control how to implement logic of storing files.
|
86
|
+
|
87
|
+
## Output
|
88
|
+
|
89
|
+
### Output RAW HTML from CKEditor
|
90
|
+
|
91
|
+
To use same CSS as in editor, to keep consistent UI:
|
92
|
+
|
93
|
+
Require CSS file in `application.css`:
|
94
|
+
|
95
|
+
```css
|
96
|
+
*= require new_ckeditor/ckeditor.css
|
97
|
+
```
|
98
|
+
|
99
|
+
And in the view wrap output in `.ck-content` class:
|
100
|
+
|
101
|
+
```erb
|
102
|
+
<p>
|
103
|
+
<strong>About:</strong>
|
104
|
+
<div class="ck-content">
|
105
|
+
<%= raw @user.about %>
|
106
|
+
</div>
|
107
|
+
</p>
|
108
|
+
```
|
109
|
+
|
110
|
+
More documentation: https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/content-styles.html
|
111
|
+
|
112
|
+
## Styling
|
113
|
+
|
114
|
+
### CKEditor 5 set min-height, height, width
|
115
|
+
|
116
|
+
```css
|
117
|
+
.ck-editor__editable {
|
118
|
+
min-height: 500px;
|
119
|
+
}
|
120
|
+
```
|
121
|
+
|
122
|
+
You can editor in some parent div and set height explicitly for editor inside.
|
123
|
+
|
124
|
+
## TODO
|
125
|
+
|
126
|
+
- different types of ckeditors
|
127
|
+
- generator for toolbar
|
128
|
+
- configuration to specify toolbar
|
129
|
+
- generator for controller?
|
130
|
+
- store files using active storage
|
131
|
+
- store with user_id, and parent?
|
132
|
+
- readme, samples
|
133
|
+
- gif with demo
|
134
|
+
- sample with ajax? and with ballon?
|
135
|
+
- tests
|
136
|
+
- CSFR-Token
|
137
|
+
- support inline editor?
|
138
|
+
- remove title plugin
|
139
|
+
- check how it works with turbolinks
|
140
|
+
|
141
|
+
## Customization
|
142
|
+
|
143
|
+
https://ckeditor.com/ckeditor-5/online-builder/
|
144
|
+
|
145
|
+
## Contributing
|
146
|
+
Contribution directions go here.
|
147
|
+
|
148
|
+
## License
|
149
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'NewCkeditor'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
load 'rails/tasks/statistics.rake'
|
21
|
+
|
22
|
+
require 'bundler/gem_tasks'
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'test'
|
28
|
+
t.pattern = 'test/**/*_test.rb'
|
29
|
+
t.verbose = false
|
30
|
+
end
|
31
|
+
|
32
|
+
task default: :test
|