summoner-jekyll-theme 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_sass/mixins/_highlight.scss +1 -1
- data/assets/js/copy.js +23 -1
- 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: d76f386df8dbf4c6756841f5e298fdbf7ee76b17c42914a24a0ce2ef882a9f72
|
4
|
+
data.tar.gz: b855c7826417a4bca6aa52d9a6fd4d65f4946652ab8014ce2fd4331d8e25fdaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7739898e194b093f024999acae10db6fa4f53eb6a7d506cc7bae675ce910dcec6996bc4aaa6b87a9ca2168ba2f6ea0d90926e8ac137fe16d4f7f0f27089d9f11
|
7
|
+
data.tar.gz: 1075b0d9d26927ea5856769ccdc17e92297fbe8153093758e7e6dc3e4ef738945571c9667f18e9b3edc1f9b7f867c57c957414dfea52c7b8b0bbf01f58e846a6
|
data/assets/js/copy.js
CHANGED
@@ -10,7 +10,29 @@ codeBlocks.forEach((block) => {
|
|
10
10
|
|
11
11
|
copyBtn.addEventListener('click', () => {
|
12
12
|
var code = block.querySelector('code').innerText.trim();
|
13
|
-
|
13
|
+
|
14
|
+
if (window.isSecureContext) {
|
15
|
+
window.navigator.clipboard.writeText(code);
|
16
|
+
} else {
|
17
|
+
const textArea = document.createElement("textarea");
|
18
|
+
textArea.value = code;
|
19
|
+
|
20
|
+
// Move textarea out of the viewport so it's not visible
|
21
|
+
textArea.style.position = "absolute";
|
22
|
+
textArea.style.left = "-999999px";
|
23
|
+
|
24
|
+
document.body.prepend(textArea);
|
25
|
+
textArea.select();
|
26
|
+
|
27
|
+
try {
|
28
|
+
document.execCommand('copy');
|
29
|
+
} catch (error) {
|
30
|
+
console.error(error);
|
31
|
+
} finally {
|
32
|
+
textArea.remove();
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
14
36
|
|
15
37
|
copyBtn.innerHTML = '<img src="/assets/img/check.svg" />';
|
16
38
|
copyBtn.style.border = 'none';
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: summoner-jekyll-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rory Dudley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|