jekyll-crypto-donations 0.1.4 → 0.1.5

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: f3dc55d911315aa95d989a90708643a442ceeab03a277fcef007a0b4cda7a8dc
4
- data.tar.gz: 9dbf3ae4a4f446d13b2266c17f39ff433154c708bcd6c44bb6e273505f060240
3
+ metadata.gz: 1af0450ced0c532252747d1d494b8f0176ca34a009061e99b90de97c1fa809e5
4
+ data.tar.gz: 8becb52614fcdde46cee273c21d150f6787fd47475e8d6f174891223fb2ec9ca
5
5
  SHA512:
6
- metadata.gz: a3bd80a2052fc28a49105dec7f3636432f392681b1199a3c17c8f6cb8aedc24cbdf16bae1523e62b2d88ad090a93741d4bbaa0eb2f0d883e959d04bb3e6de224
7
- data.tar.gz: 6883e7b32f56ac8407974a713647644c45862118083974be94aa207b959d2d081317e2e31f4e019ad700d8368c6fd5f3d90c3c7eb7778018c3b03861eeb08ef0
6
+ metadata.gz: d86d0a107bc608ad37ae4acf407faf8b64b98c336cf2cb51a66cae8e2315296c4f8420cf90f7c932bee2f8a13218f4ba93f00f2107905fd68c45fbfa1eff54c9
7
+ data.tar.gz: a22b602580735141407cf9192da22c4f96222b835d8e724fb4bfc5397d3bff82e48db11811db947a7ff9dd34c9bf1458789af3d32f040d7c999bfd42b6dfe7bc
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module CryptoDonations
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "jekyll"
4
+ require "securerandom"
4
5
  require "jekyll-crypto-donations/version"
5
6
  # require "jekyll_crypto_donations/generator"
6
7
 
@@ -23,6 +24,7 @@ module Jekyll
23
24
 
24
25
  def currency_html(currency_ticker, address)
25
26
  currency = CRYPTO_CURRENCIES[currency_ticker]
27
+ total_id = "#{@instance_id}_#{currency_ticker}-total"
26
28
  <<~HTML
27
29
  <div class="jekyll-crypto-donations__item">
28
30
  <span class="jekyll-crypto-donations__crypto-name">#{currency[:name]} (#{currency[:ticker]})</span>
@@ -32,16 +34,16 @@ module Jekyll
32
34
  <span>#{address}</span>
33
35
  </div>
34
36
  <div class="jekyll-crypto-donations__crypto-buttons">
35
- <button class="jekyll-crypto-donations__crypto-btn-copy">
36
- <svg id="svg" fill="#ededed" stroke="#ededed" width="20" height="20" version="1.1" viewBox="144 144 512 512" xmlns="http://www.w3.org/2000/svg" stroke-width="20">
37
- <g id="IconSvg_bgCarrier" stroke-width="0"></g>
38
- <g id="IconSvg_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" stroke="#CCCCCC" stroke-width="0">
37
+ <button class="jekyll-crypto-donations__crypto-btn-copy" type="button" aria-label="Copy #{currency[:ticker]} address">
38
+ <svg fill="#ededed" stroke="#ededed" width="20" height="20" version="1.1" viewBox="144 144 512 512" xmlns="http://www.w3.org/2000/svg" stroke-width="20" aria-hidden="true">
39
+ <g stroke-width="0"></g>
40
+ <g stroke-linecap="round" stroke-linejoin="round" stroke="#CCCCCC" stroke-width="0">
39
41
  <g xmlns="http://www.w3.org/2000/svg">
40
42
  <path d="m458.74 466.8h123.13 17.23c5.4414 0 10.078-4.6367 10.078-10.078v-86.957-139.15-31.84c0-5.4414-4.6367-10.078-10.078-10.078h-87.359-138.95-31.641c-5.4414 0-10.078 4.6367-10.078 10.078v126.66 17.938c0 13 20.152 13 20.152 0v-126.66-17.938c-3.3242 3.3242-6.75 6.75-10.078 10.078h87.359 138.95 31.641c-3.3242-3.3242-6.75-6.75-10.078-10.078v86.957 139.15 31.84l10.078-10.078h-123.13-17.23c-12.992 0.003906-12.992 20.156 0.003907 20.156z"></path>
41
43
  <path d="m458.74 591.14h-86.957-139.15-31.84l10.078 10.078v-86.957-139.15-31.84c-3.3242 3.3242-6.75 6.75-10.078 10.078h86.957 139.15 31.84c-3.3242-3.3242-6.75-6.75-10.078-10.078v86.957 139.15 31.84c0 13 20.152 13 20.152 0v-86.957-139.15-31.84c0-5.4414-4.6367-10.078-10.078-10.078h-86.957-139.15-31.84c-5.4414 0-10.078 4.6367-10.078 10.078v86.957 139.15 31.84c0 5.4414 4.6367 10.078 10.078 10.078h86.957 139.15 31.84c13.004-0.003906 13.004-20.156 0.003907-20.156z"></path>
42
44
  </g>
43
45
  </g>
44
- <g id="IconSvg_iconCarrier">
46
+ <g>
45
47
  <g xmlns="http://www.w3.org/2000/svg">
46
48
  <path d="m458.74 466.8h123.13 17.23c5.4414 0 10.078-4.6367 10.078-10.078v-86.957-139.15-31.84c0-5.4414-4.6367-10.078-10.078-10.078h-87.359-138.95-31.641c-5.4414 0-10.078 4.6367-10.078 10.078v126.66 17.938c0 13 20.152 13 20.152 0v-126.66-17.938c-3.3242 3.3242-6.75 6.75-10.078 10.078h87.359 138.95 31.641c-3.3242-3.3242-6.75-6.75-10.078-10.078v86.957 139.15 31.84l10.078-10.078h-123.13-17.23c-12.992 0.003906-12.992 20.156 0.003907 20.156z"></path>
47
49
  <path d="m458.74 591.14h-86.957-139.15-31.84l10.078 10.078v-86.957-139.15-31.84c-3.3242 3.3242-6.75 6.75-10.078 10.078h86.957 139.15 31.84c-3.3242-3.3242-6.75-6.75-10.078-10.078v86.957 139.15 31.84c0 13 20.152 13 20.152 0v-86.957-139.15-31.84c0-5.4414-4.6367-10.078-10.078-10.078h-86.957-139.15-31.84c-5.4414 0-10.078 4.6367-10.078 10.078v86.957 139.15 31.84c0 5.4414 4.6367 10.078 10.078 10.078h86.957 139.15 31.84c13.004-0.003906 13.004-20.156 0.003907-20.156z"></path>
@@ -49,10 +51,10 @@ module Jekyll
49
51
  </g>
50
52
  </svg>
51
53
  </button>
52
- <button class="jekyll-crypto-donations__crypto-btn-qr">
53
- <svg id="svg" fill="#ededed" stroke="#ededed" width="20" height="20" version="1.1" viewBox="144 144 512 512" xmlns="http://www.w3.org/2000/svg" stroke-width="0">
54
- <g id="IconSvg_bgCarrier" stroke-width="0"></g>
55
- <g id="IconSvg_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" stroke="#CCCCCC" stroke-width="0">
54
+ <button class="jekyll-crypto-donations__crypto-btn-qr" type="button" aria-label="Show #{currency[:ticker]} QR code">
55
+ <svg fill="#ededed" stroke="#ededed" width="20" height="20" version="1.1" viewBox="144 144 512 512" xmlns="http://www.w3.org/2000/svg" stroke-width="0" aria-hidden="true">
56
+ <g stroke-width="0"></g>
57
+ <g stroke-linecap="round" stroke-linejoin="round" stroke="#CCCCCC" stroke-width="0">
56
58
  <g xmlns="http://www.w3.org/2000/svg">
57
59
  <path d="m379.01 588.93h-167.94v-167.93h167.94zm-125.95-41.984h83.969v-83.965h-83.969z"></path>
58
60
  <path d="m588.93 379.01h-167.93v-167.94h167.94zm-125.95-41.984h83.969l-0.003906-83.969h-83.965z"></path>
@@ -63,7 +65,7 @@ module Jekyll
63
65
  <path d="m504.96 420.99h83.969v41.984h-83.969z"></path>
64
66
  </g>
65
67
  </g>
66
- <g id="IconSvg_iconCarrier">
68
+ <g>
67
69
  <g xmlns="http://www.w3.org/2000/svg">
68
70
  <path d="m379.01 588.93h-167.94v-167.93h167.94zm-125.95-41.984h83.969v-83.965h-83.969z"></path>
69
71
  <path d="m588.93 379.01h-167.93v-167.94h167.94zm-125.95-41.984h83.969l-0.003906-83.969h-83.965z"></path>
@@ -77,12 +79,12 @@ module Jekyll
77
79
  </svg>
78
80
  </button>
79
81
  <div class="jekyll-crypto-donations__crypto-total-received">
80
- <span id="jekyll-crypto-donations_#{currency_ticker}-total">Loading...</span>
82
+ <span id="#{total_id}">Loading...</span>
81
83
  </div>
82
84
  </div>
83
85
  </div>
84
86
  <div class="jekyll-crypto-donations__crypto-image-qr">
85
- <img alt="" width="150px" heght="150px" src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=#{address}">
87
+ <img alt="#{currency[:name]} donation QR code" width="150" height="150" src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&amp;data=#{address}">
86
88
  </div>
87
89
  </div>
88
90
  </div>
@@ -110,27 +112,30 @@ module Jekyll
110
112
  def btc_js
111
113
  return "" unless btc_address
112
114
 
115
+ total_id = "#{@instance_id}_btc-total"
113
116
  <<~JS
114
117
  const btcDonations = await getDonations('btc', '#{btc_address}');
115
- document.getElementById('jekyll-crypto-donations_btc-total').innerText = `Total received: ${btcDonations} BTC`;
118
+ document.getElementById('#{total_id}').innerText = `Total received: ${btcDonations} BTC`;
116
119
  JS
117
120
  end
118
121
 
119
122
  def eth_js
120
123
  return "" unless eth_address
121
124
 
125
+ total_id = "#{@instance_id}_eth-total"
122
126
  <<~JS
123
127
  const ethDonations = await getDonations('eth', '#{eth_address}');
124
- document.getElementById('jekyll-crypto-donations_eth-total').innerText = `Total received: ${ethDonations} ETH`;
128
+ document.getElementById('#{total_id}').innerText = `Total received: ${ethDonations} ETH`;
125
129
  JS
126
130
  end
127
131
 
128
132
  def usdt_js
129
133
  return "" unless usdt_address
130
134
 
135
+ total_id = "#{@instance_id}_usdt-total"
131
136
  <<~JS
132
137
  const usdtDonations = await getDonations('usdt', '#{usdt_address}');
133
- document.getElementById('jekyll-crypto-donations_usdt-total').innerText = `Total received: ${usdtDonations} USDT`;
138
+ document.getElementById('#{total_id}').innerText = `Total received: ${usdtDonations} USDT`;
134
139
  JS
135
140
  end
136
141
 
@@ -143,7 +148,7 @@ module Jekyll
143
148
 
144
149
  def opening_html
145
150
  <<~HTML
146
- <div id="jekyll-crypto-donations">
151
+ <div id="#{@instance_id}" class="jekyll-crypto-donations">
147
152
  <div class="jekyll-crypto-donations__description">
148
153
  <span>#{@text}</span>
149
154
  </div>
@@ -184,6 +189,7 @@ module Jekyll
184
189
  end
185
190
 
186
191
  def render(context)
192
+ @instance_id = "jekyll-crypto-donations-#{SecureRandom.hex(4)}"
187
193
  site_config(context)
188
194
  return if btc_address.nil? && eth_address.nil? && usdt_address.nil?
189
195
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-crypto-donations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - madmatvey
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-06-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: jekyll
@@ -59,8 +58,8 @@ email:
59
58
  executables: []
60
59
  extensions: []
61
60
  extra_rdoc_files:
62
- - README.md
63
61
  - LICENSE
62
+ - README.md
64
63
  files:
65
64
  - LICENSE
66
65
  - README.md
@@ -76,7 +75,6 @@ metadata:
76
75
  source_code_uri: https://github.com/madmatvey/jekyll-crypto-donations.git
77
76
  changelog_uri: https://github.com/madmatvey/jekyll-crypto-donations/blob/master/CHANGELOG.md
78
77
  rubygems_mfa_required: 'true'
79
- post_install_message:
80
78
  rdoc_options: []
81
79
  require_paths:
82
80
  - lib
@@ -91,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
89
  - !ruby/object:Gem::Version
92
90
  version: '0'
93
91
  requirements: []
94
- rubygems_version: 3.2.3
95
- signing_key:
92
+ rubygems_version: 4.0.11
96
93
  specification_version: 4
97
94
  summary: A Jekyll plugin for crypto donations
98
95
  test_files: []