editmode 1.0.22 → 1.1.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f95b98f49a419090f8745a3cf5cfb96d2cafb889c22268f759b07ca5fbb326d1
|
4
|
+
data.tar.gz: 61e6d4f6acf151d875d990e5b223009deefd1407c7fbad3799793ba703ffde17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adcdff8c0127b8ca33ee6fc735d2aaa05b9c009570d0e62f726d1cb08ea42e78b53f89bd825deda483da66423b9870b5b278b79acf24df7f5af533cb0d0bda0f
|
7
|
+
data.tar.gz: 6c530fe95532b300ac069797078133a931f8c5fc6873e42fee1656bcee5bca6ab43f39424eac982ef9f7e0c05e470a95b7b1a070ba8807f153dc1df6b5078899
|
@@ -67,8 +67,8 @@ module Editmode
|
|
67
67
|
|
68
68
|
begin
|
69
69
|
# Always sanitize the content!!
|
70
|
-
chunk_content = ActionController::Base.helpers.sanitize(chunk_content)
|
71
|
-
|
70
|
+
chunk_content = ActionController::Base.helpers.sanitize(chunk_content) unless chunk_type == 'rich_text'
|
71
|
+
|
72
72
|
css_class = options[:class]
|
73
73
|
|
74
74
|
if chunk_type == "image"
|
@@ -86,7 +86,7 @@ module Editmode
|
|
86
86
|
case display_type
|
87
87
|
when "span"
|
88
88
|
if chunk_type == "rich_text"
|
89
|
-
content_tag("em-span", :class => "editmode-richtext-editor #{css_class}", :data => chunk_data.merge!({:chunk_editable => true}) ) do
|
89
|
+
content = content_tag("em-span", :class => "editmode-richtext-editor #{css_class}", :data => chunk_data.merge!({:chunk_editable => true}) ) do
|
90
90
|
chunk_content.html_safe
|
91
91
|
end
|
92
92
|
else
|
data/lib/editmode/chunk_value.rb
CHANGED
@@ -4,7 +4,9 @@ module Editmode
|
|
4
4
|
|
5
5
|
attr_accessor :identifier, :variable_values, :branch_id,
|
6
6
|
:variable_fallbacks, :chunk_type, :project_id,
|
7
|
-
:response
|
7
|
+
:response
|
8
|
+
|
9
|
+
attr_writer :content
|
8
10
|
|
9
11
|
def initialize(identifier, **options)
|
10
12
|
@identifier = identifier
|
@@ -29,11 +31,17 @@ module Editmode
|
|
29
31
|
raise require_field_id
|
30
32
|
end
|
31
33
|
else
|
32
|
-
raise "undefined method field for chunk_type: #{chunk_type}"
|
34
|
+
raise NoMethodError.new "undefined method 'field` for chunk_type: #{chunk_type} \n"
|
33
35
|
end
|
34
36
|
result ||= content
|
35
37
|
end
|
36
38
|
|
39
|
+
def content
|
40
|
+
raise NoMethodError.new "undefined method 'content` for chunk_type: collection_item \nDid you mean? field" if chunk_type == 'collection_item'
|
41
|
+
|
42
|
+
variable_parse!(@content, variable_fallbacks, variable_values)
|
43
|
+
end
|
44
|
+
|
37
45
|
private
|
38
46
|
def get_content
|
39
47
|
branch_params = branch_id.present? ? "branch_id=#{branch_id}" : ""
|
data/lib/editmode/version.rb
CHANGED