editmode 0.0.10.16 → 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"
|
@@ -77,7 +77,7 @@ module Editmode
|
|
77
77
|
display_type = options[:display_type] || "span"
|
78
78
|
end
|
79
79
|
|
80
|
-
chunk_data = { :chunk => chunk_identifier, :chunk_editable => false }
|
80
|
+
chunk_data = { :chunk => chunk_identifier, :chunk_editable => false, :chunk_type => chunk_type }
|
81
81
|
|
82
82
|
if options[:parent_identifier].present?
|
83
83
|
chunk_data.merge!({parent_identifier: options[:parent_identifier]})
|
@@ -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 => css_class, :data => chunk_data ) 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
|
@@ -165,7 +165,7 @@ module Editmode
|
|
165
165
|
end
|
166
166
|
|
167
167
|
def no_response_received(id = "")
|
168
|
-
"Sorry, we can't find a
|
168
|
+
"Sorry, we can't find a chunk using this identifier: \"#{id}\". This can happen if you've deleted a chunk on editmode.com or if your local cache is out of date. If it persists, try running Rails.cache clear."
|
169
169
|
end
|
170
170
|
|
171
171
|
def require_field_id
|
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/script_tag.rb
CHANGED
@@ -26,7 +26,7 @@ module Editmode
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def script_url
|
29
|
-
ENV["EDITMODE_OVERRIDE_SCRIPT_URL"] || "https://static.editmode.com/editmode
|
29
|
+
ENV["EDITMODE_OVERRIDE_SCRIPT_URL"] || "https://static.editmode.com/editmode@^1.0.0/dist/editmode.js"
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
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:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Ennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|