jdvp-codetabs-commonmark 1.1.0 → 1.1.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/jdvp-codetabs-commonmark.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1831135ee1c5f3b8ef79afe62136ff4a68070bfcd3f551e597732c67daa426c4
|
4
|
+
data.tar.gz: a357ed5a71666e8a4bc51afa52b64693651f15f5da45249e3177443dfabf1490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da8f6c7ee8baceab2730a59eee35b1d1569661f6e98e1a404c817df3ae26f9153645ca2cf8bfbb7e0485db1b1cc55adaef8ee452776e004ae168bc0a677cfec0
|
7
|
+
data.tar.gz: 313a67b159981c167b4242e6a3238341190f2b52e14080064111ebabecb3cc48e4b4510ac979e58e987272b8ee5ec2b70265a453c6a8d9cfde6d08c046848532
|
@@ -19,6 +19,13 @@ class CodeTabsCustomerRenderer < JekyllCommonMarkCustomRenderer
|
|
19
19
|
#Get a unique ID per code block in order to allow code copying
|
20
20
|
individual_code_block_id = SecureRandom.uuid
|
21
21
|
|
22
|
+
if (is_copy_action_enabled(node))
|
23
|
+
if (!@added_copy_snackbar)
|
24
|
+
out("<div id=\"code_copied_snackbar\">Copied!</div>")
|
25
|
+
@added_copy_snackbar = true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
22
29
|
#Create a header if necessary and then creates the wrapper for each item
|
23
30
|
#This allows tabs to be selected individaully
|
24
31
|
if (is_header_item)
|
@@ -34,10 +41,6 @@ class CodeTabsCustomerRenderer < JekyllCommonMarkCustomRenderer
|
|
34
41
|
#Changing theme button is added to all code blocks, but the copy button is configurable.
|
35
42
|
out("<div class=\"code_switcher_code_action_container\">")
|
36
43
|
if (is_copy_action_enabled(node))
|
37
|
-
if (!@added_copy_snackbar)
|
38
|
-
out("<div id=\"code_copied_snackbar\">Copied!</div>")
|
39
|
-
@added_copy_snackbar = true
|
40
|
-
end
|
41
44
|
out("<button class=\"code_switcher_copy_button\" title=\"Copy\" onclick=\"copyText(\'#{individual_code_block_id}\', \'#{get_code_copy_Lines(node)}\')\"></button>")
|
42
45
|
end
|
43
46
|
out("<button class=\"code_switcher_theme_button\" onclick=\"updateTheme(true)\"></button>")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jdvp-codetabs-commonmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JD Porterfield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: securerandom
|