activeadmin_ckeditor5 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: a5a7fd340d3e084dd71d0f9b4b88d71c4fa5505b9c4a97acc745829eb8b40e48
4
- data.tar.gz: a4ee062638a26c8dc37a3a1f84603ade5fc06ac9b8b8d7a40a6505bef32734dd
3
+ metadata.gz: 0ba0801b88db8d5d6d2688527c5f5495f465890f1dac06f860fdd6609dd0b044
4
+ data.tar.gz: f7a64fc24b832ae522522c11a508f719f1a6d7f6376f6432fcab19530db6ca3c
5
5
  SHA512:
6
- metadata.gz: '09275daa69176302f3f2bfc5e3ae79adf3253259e3bb2f8b3e72a72d92b0c0d89230636bb503756ac2c80af37d045539b8d07195438ed7ab3cee4926d4b4a53c'
7
- data.tar.gz: 64909501835fec9bed8c41a2820b89533e5a1fe51949ac7502777104a0988935ef386151850be8b8f27f3d06172777bdfe88aa337556dac5af1e2553d3e6c7a9
6
+ metadata.gz: 47de1a0808f84d13f85046a0a7ed1b51cb0d6faa0a708284ac8f7490523387cf0ce56bf8a5cd8d6355acd24b32d24960724871090925ad3cee9c3cd0271737fc
7
+ data.tar.gz: 542ed4c9526ff0beca68cbb770a4350f5ff6bb87a4099906ebb25d2f13d43ea20e3301cd2c10cf69f63169a0de424ba810afc14b8c848d3420ca16664297edbb
@@ -2,9 +2,27 @@
2
2
 
3
3
  (function () {
4
4
  function initCkeditors() {
5
- ClassicEditor.create(
6
- document.querySelector("[data-activeadmin-ckcontent]")
7
- );
5
+ const activeAdminCKEditor = document.querySelectorAll("[data-activeadmin-ckeditor]")
6
+ for (let i = 0; i < activeAdminCKEditor.length; i++) {
7
+ ClassicEditor.create(activeAdminCKEditor[i]);
8
+ }
9
+ const formtastic = document.querySelector("form.formtastic");
10
+ if (formtastic) {
11
+ formtastic.onsubmit = () => {
12
+ const editors = document.querySelectorAll(".ck-editor");
13
+ for (let i = 0; i < editors.length; i++) {
14
+ const input = activeAdminCKEditor[i].querySelector('input[type="hidden"]');
15
+ const editorContent = editors[i].querySelector(
16
+ ".ck-editor__main .ck-content"
17
+ );
18
+ if (editorContent) {
19
+ input.value = editorContent.innerHTML;
20
+ } else {
21
+ input.value = "";
22
+ }
23
+ }
24
+ }
25
+ }
8
26
  }
9
27
  $(document).ready(initCkeditors);
10
28
  $(document).on("has_many_add:after", ".has_many_container", initCkeditors);
@@ -1,4 +1,7 @@
1
- body.active_admin [data-activeadmin-ckeditor='1'] {
1
+ body.active_admin .ck-editor {
2
2
  display: inline-block;
3
3
  width: calc(80% - 22px);
4
+ .ck-content {
5
+ min-height: 600px
6
+ }
4
7
  }
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Activeadmin
4
4
  module Ckeditor
5
- VERSION = "0.1.0"
6
- CKEDITOR = '0.1.1'
5
+ VERSION = "0.1.1"
7
6
  end
8
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_ckeditor5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - MingXuanSu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-10 00:00:00.000000000 Z
11
+ date: 2023-01-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails activeadmin integrated CKEditor 5
14
14
  email: