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: 98935fb2e9c9e599ba4dde0dfc6331211932cfddec983bb7b7327ae3acbb255f
4
- data.tar.gz: 315beb50a0c8b829be8d6e78aa4f181f7e564418ab77c2d0a888c0bdeaf1661e
3
+ metadata.gz: f95b98f49a419090f8745a3cf5cfb96d2cafb889c22268f759b07ca5fbb326d1
4
+ data.tar.gz: 61e6d4f6acf151d875d990e5b223009deefd1407c7fbad3799793ba703ffde17
5
5
  SHA512:
6
- metadata.gz: 4370f2a10ebb61fd87eed89ffd31c919d7f51e2adf363021135676624048bbbcc3941d7a643e8c9520a830cb943ddbce4a27e3a8ef50d1bac94bb440024885c0
7
- data.tar.gz: fdcca7d3fa91637b3c41f3b14af29e7c1cb2839d5dd9db06c9edfb4c4b415d7e80f5899621f829c6a7ee9607895349681f54df576dd0b581d07361917dafbaa6
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
@@ -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, :content
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}" : ""
@@ -1,3 +1,3 @@
1
1
  module Editmode
2
- VERSION = "1.0.22"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: editmode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.22
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Ennis