editmode 1.4.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/editmode/action_view_extensions/editmode_helper.rb +6 -5
- data/lib/editmode/helper.rb +1 -1
- data/lib/editmode/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fff57d95ac86fdc9e8ed38b229db1af91bfbf5ce800d9267a53a23cdb171ac49
|
4
|
+
data.tar.gz: 82c91e009fddbf8425f347c1623005ac6fe56c3d00adead787ebe3149d14395c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23b94b470c954703662f0536e435c94a7df34e40a5422cf396028325b509c312867690cbb757cb866aa42c1a90647f3c7dc9b2389c0a82ed63bd7c90da0b2eff
|
7
|
+
data.tar.gz: e6148ce31116c2b0713ce05c42319c7c199c890e2ba4d6d4c13ef4eb61c71679d07b6c685b65681ba50b86130fdbedcd0e4af0fd2abb8d1857eb38e641f98e2e
|
data/README.md
CHANGED
@@ -33,6 +33,11 @@ end
|
|
33
33
|
That's it, you're all set up. By default Editmode will now include editmode.js in every page of your rails application, unless you disable auto-include.
|
34
34
|
<hr/>
|
35
35
|
|
36
|
+
#### 3. (Rails 6) Ensuring the Magic Editor works with Content Security Policy
|
37
|
+
|
38
|
+
- Add "https://static.editmode.com" to `style_src` and `script_src` in your content security policy.
|
39
|
+
- Add "https://api.editmode.com" to `connect_src` in your content security policy.
|
40
|
+
|
36
41
|
## Rendering Content
|
37
42
|
|
38
43
|
Editmode provides helper methods for use in your rails views and controllers.
|
@@ -38,7 +38,8 @@ module Editmode
|
|
38
38
|
:collection_identifier => collection_identifier,
|
39
39
|
:branch_id => branch_id,
|
40
40
|
:limit => limit,
|
41
|
-
:tags => tags
|
41
|
+
:tags => tags,
|
42
|
+
:project_id => Editmode.project_id
|
42
43
|
}.to_query
|
43
44
|
|
44
45
|
url = URI(api_root_url)
|
@@ -63,10 +64,10 @@ module Editmode
|
|
63
64
|
|
64
65
|
if chunks.any?
|
65
66
|
content_tag :div, class: "chunks-collection-wrapper #{parent_class}", data: {chunk_collection_identifier: collection_identifier} do
|
66
|
-
chunks.
|
67
|
+
chunks.each_with_index do |chunk, index|
|
67
68
|
@custom_field_chunk = chunk
|
68
69
|
concat(content_tag(:div, class: "chunks-collection-item--wrapper #{item_class}") do
|
69
|
-
yield(@custom_field_chunk)
|
70
|
+
yield(@custom_field_chunk, index)
|
70
71
|
end)
|
71
72
|
end
|
72
73
|
|
@@ -90,7 +91,7 @@ module Editmode
|
|
90
91
|
def chunk_field_value(parent_chunk_object, custom_field_identifier, options = {})
|
91
92
|
begin
|
92
93
|
chunk_identifier = parent_chunk_object["identifier"]
|
93
|
-
chunk_value = Editmode::ChunkValue.new(parent_chunk_object["identifier"], options.merge({response: parent_chunk_object}))
|
94
|
+
chunk_value = Editmode::ChunkValue.new(parent_chunk_object["identifier"], **options.merge({response: parent_chunk_object}))
|
94
95
|
custom_field_item = chunk_value.field_chunk(custom_field_identifier)
|
95
96
|
|
96
97
|
options[:field] = custom_field_identifier
|
@@ -164,7 +165,7 @@ module Editmode
|
|
164
165
|
begin
|
165
166
|
field = options[:field].presence || ""
|
166
167
|
options[:referrer] = request.present? && request.url || ""
|
167
|
-
chunk_value = Editmode::ChunkValue.new(identifier, options)
|
168
|
+
chunk_value = Editmode::ChunkValue.new(identifier, **options)
|
168
169
|
|
169
170
|
if field.present? && chunk_value.chunk_type == 'collection_item'
|
170
171
|
chunk_content = chunk_value.field(field)
|
data/lib/editmode/helper.rb
CHANGED
@@ -4,7 +4,7 @@ module Editmode
|
|
4
4
|
def e(identifier, *args)
|
5
5
|
field, options = parse_arguments(args)
|
6
6
|
begin
|
7
|
-
chunk = Editmode::ChunkValue.new(identifier, options.merge({raw: true}))
|
7
|
+
chunk = Editmode::ChunkValue.new(identifier, **options.merge({raw: true}))
|
8
8
|
|
9
9
|
if chunk.chunk_type == 'collection_item'
|
10
10
|
chunk.field(field)
|
data/lib/editmode/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: editmode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Ennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
|
-
rubygems_version: 3.0.3
|
115
|
+
rubygems_version: 3.0.3.1
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: Editmode allows you to turn plain text in your rails app into easily inline-editable
|