ckeditor5 1.15.0 → 1.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -24
- data/lib/ckeditor5/rails/plugins/simple_upload_adapter.rb +7 -0
- data/lib/ckeditor5/rails/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b26a617fa5ece35858dee8b02c715443a8bcbb53d68c3529e216d548341c02ee
|
4
|
+
data.tar.gz: 86c363e6f59edf4c09f903cdee2a5a27f1216bd8d41d6063bdd7795bd2c6f665
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdae106877e0d80c74af702ed133842ec3f4367f7f0f1f5e6d27ba1508f6e9bc0b006c87254110051790c7d2ea236cbb3a0650d8613b31eb728efef01769cf43
|
7
|
+
data.tar.gz: d82752dffffa42e16575c0b63594c66dd6f0123203d01caa44a885ae7410e0435c1329b4f9edff72bef2f852ea8ca1a190ecbfd30a845662b7b9a57a34176763
|
data/README.md
CHANGED
@@ -28,12 +28,13 @@ In your config (the default config is defined [here](https://github.com/Mati365/
|
|
28
28
|
# config/initializers/ckeditor5.rb
|
29
29
|
|
30
30
|
CKEditor5::Rails.configure do
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
# 🔖 Specify the version of editor you want.
|
32
|
+
# ⚙️ Default configuration includes:
|
33
|
+
# 📝 Classic editor build
|
34
|
+
# 🧩 Essential plugins (paragraphs, basic styles)
|
35
|
+
# 🎛️ Default toolbar layout
|
36
|
+
# 📜 GPL license
|
37
|
+
version '43.3.0'
|
37
38
|
end
|
38
39
|
```
|
39
40
|
|
@@ -63,8 +64,14 @@ In your view:
|
|
63
64
|
<%= ckeditor5_assets %>
|
64
65
|
<% end %>
|
65
66
|
|
66
|
-
<!-- 🖋️
|
67
|
+
<!-- 🖋️ CKEditor 5 might be placed using simple view helper ... -->
|
67
68
|
<%= ckeditor5_editor %>
|
69
|
+
|
70
|
+
<!-- ... or using form input helper -->
|
71
|
+
|
72
|
+
<%= form_for @post do |f| %>
|
73
|
+
<%= f.ckeditor5 :content, required: true %>
|
74
|
+
<% end %>
|
68
75
|
```
|
69
76
|
|
70
77
|
Voilà! You have CKEditor 5 integrated with your Rails application. 🎉
|
@@ -91,6 +98,7 @@ Want to extend CKEditor's functionality? Check out our [plugins directory](https
|
|
91
98
|
- [Try Our Demos! 🎮 ✨](#try-our-demos--)
|
92
99
|
- [Table of Contents 📚](#table-of-contents-)
|
93
100
|
- [Presets 🎨](#presets-)
|
101
|
+
- [Automatic upgrades 🔄](#automatic-upgrades-)
|
94
102
|
- [Available Configuration Methods ⚙️](#available-configuration-methods-️)
|
95
103
|
- [`cdn(cdn = nil, &block)` method](#cdncdn--nil-block-method)
|
96
104
|
- [`version(version)` method](#versionversion-method)
|
@@ -110,7 +118,6 @@ Want to extend CKEditor's functionality? Check out our [plugins directory](https
|
|
110
118
|
- [`plugins(*names, **kwargs)` method](#pluginsnames-kwargs-method)
|
111
119
|
- [`inline_plugin(name, code)` method](#inline_pluginname-code-method)
|
112
120
|
- [`simple_upload_adapter(url)` method](#simple_upload_adapterurl-method)
|
113
|
-
- [Automatic upgrades 🔄](#automatic-upgrades-)
|
114
121
|
- [Controller / View helpers 📦](#controller--view-helpers-)
|
115
122
|
- [`ckeditor5_element_ref(selector)` method](#ckeditor5_element_refselector-method)
|
116
123
|
- [`ckeditor5_preset(&block)` method](#ckeditor5_presetblock-method)
|
@@ -223,6 +230,22 @@ end
|
|
223
230
|
|
224
231
|
Configuration of the editor can be complex, and it's recommended to use the [CKEditor 5 online builder](https://ckeditor.com/ckeditor-5/online-builder/) to generate the configuration. It allows you to select the features you want to include and generate the configuration code in JavaScript format. Keep in mind that you need to convert the JavaScript configuration to Ruby format before using it in this gem.
|
225
232
|
|
233
|
+
### Automatic upgrades 🔄
|
234
|
+
|
235
|
+
The gem includes a feature that automatically upgrades the CKEditor 5 version when it's released. It's enabled by default for the `:default` preset. It means that the editor will automatically check the version of the editor during the initialization and upgrade it to the latest version if the new patch or minor version is released.
|
236
|
+
|
237
|
+
If you want to disable automatic upgrades, you can pass the `enabled: false` keyword argument to the `automatic_upgrades` method.
|
238
|
+
|
239
|
+
```rb
|
240
|
+
# config/initializers/ckeditor5.rb
|
241
|
+
|
242
|
+
CKEditor5::Rails.configure do
|
243
|
+
# ... other configuration
|
244
|
+
|
245
|
+
automatic_upgrades enabled: false
|
246
|
+
end
|
247
|
+
```
|
248
|
+
|
226
249
|
### Available Configuration Methods ⚙️
|
227
250
|
|
228
251
|
#### `cdn(cdn = nil, &block)` method
|
@@ -638,22 +661,6 @@ CKEditor5::Rails.configure do
|
|
638
661
|
end
|
639
662
|
```
|
640
663
|
|
641
|
-
### Automatic upgrades 🔄
|
642
|
-
|
643
|
-
The gem includes a feature that automatically upgrades the CKEditor 5 version when it's released. It's enabled by default for the `:default` preset. It means that the editor will automatically check the version of the editor during the initialization and upgrade it to the latest version if the new patch or minor version is released.
|
644
|
-
|
645
|
-
If you want to disable automatic upgrades, you can pass the `enabled: false` keyword argument to the `automatic_upgrades` method.
|
646
|
-
|
647
|
-
```rb
|
648
|
-
# config/initializers/ckeditor5.rb
|
649
|
-
|
650
|
-
CKEditor5::Rails.configure do
|
651
|
-
# ... other configuration
|
652
|
-
|
653
|
-
automatic_upgrades enabled: false
|
654
|
-
end
|
655
|
-
```
|
656
|
-
|
657
664
|
### Controller / View helpers 📦
|
658
665
|
|
659
666
|
#### `ckeditor5_element_ref(selector)` method
|
@@ -36,6 +36,13 @@ module CKEditor5::Rails::Plugins
|
|
36
36
|
xhr.open('POST', config.uploadUrl, true);
|
37
37
|
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
38
38
|
|
39
|
+
// Add CSRF token from meta tag
|
40
|
+
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content;
|
41
|
+
|
42
|
+
if (csrfToken) {
|
43
|
+
xhr.setRequestHeader('X-CSRF-Token', csrfToken);
|
44
|
+
}
|
45
|
+
|
39
46
|
xhr.upload.onprogress = (evt) => {
|
40
47
|
if (evt.lengthComputable) {
|
41
48
|
loader.uploadTotal = evt.total;
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ckeditor5
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
4
|
+
version: 1.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mateusz Bagiński
|
8
8
|
- Łukasz Modliński
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-11-
|
12
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '9.0'
|
34
|
-
description:
|
34
|
+
description:
|
35
35
|
email: cziken58@gmail.com
|
36
36
|
executables: []
|
37
37
|
extensions: []
|
@@ -82,7 +82,7 @@ homepage: https://github.com/Mati365/ckeditor5-rails
|
|
82
82
|
licenses:
|
83
83
|
- GPL-2.0
|
84
84
|
metadata: {}
|
85
|
-
post_install_message:
|
85
|
+
post_install_message:
|
86
86
|
rdoc_options: []
|
87
87
|
require_paths:
|
88
88
|
- lib
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
100
|
rubygems_version: 3.5.22
|
101
|
-
signing_key:
|
101
|
+
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: CKEditor 5 for Rails
|
104
104
|
test_files:
|