editmode 1.6.2 → 1.7.0.pre.1
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/lib/editmode/action_view_extensions/editmode_helper.rb +2 -2
- data/lib/editmode/script_tag.rb +18 -2
- data/lib/editmode/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 313e1df1d86642ca691796a539f96e858778d750907e68cc100858dfded13383
|
4
|
+
data.tar.gz: 869dd13bc453613476cb29b5a47dd7ff624839f3d9b49503f1254a84719297a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb741fae8de3d34b844e1b42ee698fd832aa90fff5f7099082fbc61c1c7eaea3cb39b67f0d1d565ece04eea97523c3789c98b0b17d0fc1360d61b7a90478aba3
|
7
|
+
data.tar.gz: 7d12781cab8bcf4b1629ce6614f1f9586f1afcd4323004c1c2bdc1ec095f733fdf6180ea7f0872e96b3c5e0b15849e33e14f742b237dd1f5349dc9c1df3405af
|
@@ -63,7 +63,7 @@ module Editmode
|
|
63
63
|
end
|
64
64
|
|
65
65
|
if chunks.any?
|
66
|
-
content_tag :div, class: "chunks-collection-wrapper #{parent_class}", data: {chunk_collection_identifier: collection_identifier} do
|
66
|
+
content_tag :div, class: "chunks-collection-wrapper #{parent_class}", data: {chunk_collection_identifier: collection_identifier, chunk_tags: tags.join("|")} do
|
67
67
|
chunks.each_with_index do |chunk, index|
|
68
68
|
@custom_field_chunk = chunk
|
69
69
|
concat(content_tag(:div, class: "chunks-collection-item--wrapper #{item_class}") do
|
@@ -73,7 +73,7 @@ module Editmode
|
|
73
73
|
|
74
74
|
# Placeholder element for new collection item
|
75
75
|
@custom_field_chunk = chunks.first.merge!({placeholder: true})
|
76
|
-
concat(content_tag(:
|
76
|
+
concat(content_tag(:template, class: "chunks-hide chunks-col-placeholder-wrapper") do
|
77
77
|
yield(@custom_field_chunk)
|
78
78
|
end)
|
79
79
|
end
|
data/lib/editmode/script_tag.rb
CHANGED
@@ -14,9 +14,25 @@ module Editmode
|
|
14
14
|
true
|
15
15
|
end
|
16
16
|
|
17
|
+
def has_watermark
|
18
|
+
has_watermark = Rails.cache.fetch('chunks_project_has_watermark', expires_in: 1.hour,) do
|
19
|
+
project = HTTParty.get(Editmode.api_root_url + "/projects/#{Editmode.project_id}")
|
20
|
+
project["has_watermark"]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def watermark_tag
|
25
|
+
if has_watermark
|
26
|
+
'<div style="z-index: 9999; bottom: 8px; right: 8px; position: fixed; opacity: 1; display: flex; align-items: center; background: rgba(255, 255, 255, 0.9); cursor: pointer; border-radius: 5px; padding: 2px 5px 2px 2px; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;"><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 548 532" version="1.1" fill="currentColor"><g id="Page-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-2-Copy" fill="#02164B" fill-rule="nonzero"><path d="M355.57238,93.227099 C421.07938,126.760445 463.228656,200.366589 458.662484,275.197013 C456.789183,321.18219 437.646387,365.465318 406.824729,398.879222 C371.729602,436.503458 321.735878,458.271766 270.922584,458.988418 C203.22031,459.764791 137.596229,421.453764 104.754918,360.956382 C83.2997657,322.496052 75.4553171,276.928922 82.5387371,233.302725 C89.0952911,193.767417 107.828303,156.501508 135.840009,128.343052 C167.861751,95.3770553 211.620895,75.6989829 256.902096,72.4143274 C290.88495,70.1150686 325.248318,77.4308922 355.57238,93.227099 Z M302.597364,108.707879 C244.580186,94.7144282 181.478422,121.295874 147.91428,172.136709 C125.753716,204.951046 116.495656,247.175826 123.079165,286.681355 C127.575938,318.48743 142.800303,348.796389 164.461226,371.680876 C195.556552,404.281339 240.406711,421.818983 284.492713,417.297082 C306.976574,415.738859 326.903446,407.153357 347.094835,397.529041 C333.927816,397.406827 321.113485,400.462166 307.975856,399.881651 C293.691992,399.33169 279.114221,397.284614 265.565123,392.487732 C232.823919,381.213532 204.168018,358.573473 185.916413,328.020087 C170.074843,302.721883 162.668395,271.465768 167.841152,241.52345 C172.896347,214.850343 187.297774,190.224314 208.429665,174.061573 C244.874093,144.791428 299.77586,145.463603 335.750037,175.344815 C370.842495,203.117843 385.273313,253.25595 370.783713,296.550099 C362.524936,322.978778 344.831754,343.357887 322.553628,358.145726 C342.069031,355.12094 360.261854,348.643622 375.985862,336.025074 C406.7285,312.315646 423.275446,271.129681 418.043907,231.715813 C408.727065,170.822914 360.320636,120.89868 302.597364,108.707879 Z M322.507627,229.728263 C308.735553,203.164192 276.64924,189.629307 248.46453,198.136949 C218.823998,206.287627 198.529842,236.927037 201.907349,268.072146 C204.498711,292.375445 220.017772,314.804683 242.932407,323.074349 C267.302864,332.68263 295.895205,325.930061 313.510648,306.148306 C331.970469,285.593129 335.813839,254.180297 322.507627,229.728263 Z" id="Combined-Shape"></path></g></g></svg><span style="font-size: 13px; font-weight: 600;">Powered by Editmode</span></div>'
|
27
|
+
else
|
28
|
+
""
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
17
32
|
def output
|
18
|
-
|
19
33
|
str = <<-EDITMODE_SCRIPT
|
34
|
+
#{watermark_tag}
|
35
|
+
<script>window.chunksProjectLoaded = true</script>
|
20
36
|
<script>window.chunksProjectIdentifier = '#{Editmode.project_id}'</script>
|
21
37
|
<script>window.editmodeENV = '#{ENV["EDITMODE_ENV"] || 'production'}'</script>
|
22
38
|
<script src="#{script_url}" async ></script>
|
@@ -27,7 +43,7 @@ module Editmode
|
|
27
43
|
end
|
28
44
|
|
29
45
|
def script_url
|
30
|
-
ENV["EDITMODE_OVERRIDE_SCRIPT_URL"] || "https://
|
46
|
+
ENV["EDITMODE_OVERRIDE_SCRIPT_URL"] || "https://unpkg.com/editmode-magic-editor@^0/dist/magic-editor.js"
|
31
47
|
end
|
32
48
|
|
33
49
|
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: 1.
|
4
|
+
version: 1.7.0.pre.1
|
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-07-
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,9 +108,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
110
|
requirements:
|
111
|
-
- - "
|
111
|
+
- - ">"
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
113
|
+
version: 1.3.1
|
114
114
|
requirements: []
|
115
115
|
rubygems_version: 3.0.3.1
|
116
116
|
signing_key:
|