jekyll-crypto-donations 0.1.4 → 0.1.6
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/jekyll-crypto-donations/version.rb +1 -1
- data/lib/jekyll-crypto-donations.rb +22 -16
- metadata +5 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de58740bca65b28821decfaf9857eb13bf615238f89b759a41a11f0e7c3a1b62
|
|
4
|
+
data.tar.gz: 5796d24af1bea7073793bed7493ad661b3bcea3634a2b1b006f203706dd3a7c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c607faf0b47eec45100f9b47c9236762dcf510397f058d98f6f94ccc60a50d8372ff2e010ffba422dcb736ed9f3a453d351d79b3e7e649556138dcc64cea6012
|
|
7
|
+
data.tar.gz: 4f71d8d0425b7b831f1384fb37b01bd94575a08ebe4f83735b1f5c1339092f18ed8c014b5ac5206cecd137ab6781e3bef931f1573d310408335e9b4ce548ab68
|
|
@@ -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
|
|
37
|
-
<g
|
|
38
|
-
<g
|
|
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
|
|
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
|
|
54
|
-
<g
|
|
55
|
-
<g
|
|
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
|
|
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="
|
|
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="
|
|
87
|
+
<img alt="#{currency[:name]} donation QR code" width="150" height="150" src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&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('
|
|
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('
|
|
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('
|
|
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
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- madmatvey
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
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
|
|
@@ -84,15 +82,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
84
82
|
requirements:
|
|
85
83
|
- - ">="
|
|
86
84
|
- !ruby/object:Gem::Version
|
|
87
|
-
version: 2.
|
|
85
|
+
version: 2.7.0
|
|
88
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
87
|
requirements:
|
|
90
88
|
- - ">="
|
|
91
89
|
- !ruby/object:Gem::Version
|
|
92
90
|
version: '0'
|
|
93
91
|
requirements: []
|
|
94
|
-
rubygems_version:
|
|
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: []
|