heavens_door 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/heavens_door.js +23 -5
- data/lib/heavens_door/version.rb +1 -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: 565dd1e19224191e1e7d6643a4de6319b5fd4e716cc4a19848a29f24fda86c3c
|
4
|
+
data.tar.gz: 35941fbcef05fc35f843e620b7e4b32e537c027fe41684ad2fdfc1fce1442cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bc0a6fb9e7fe768ca04c161f4fe3bb6a21c21a2a2e54d3e1083fb08312d36811a273ca356657eb06ebaba5794a1b210092352ff537490698cd1616e8320daa4
|
7
|
+
data.tar.gz: 7c95472f8989d84c00eee533792747fd3c010f4aa3dda8ef8f40ab4eeb291efc412b9d5018c92003c1073fcad89c350729e4fa70955c3ea8c3a28975b3e0b5c6
|
@@ -37,11 +37,29 @@
|
|
37
37
|
});
|
38
38
|
|
39
39
|
copyButton.addEventListener('click', () => {
|
40
|
-
navigator.clipboard
|
41
|
-
.
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
if (navigator.clipboard) {
|
41
|
+
navigator.clipboard.writeText(sessionStorage.heavensDoor)
|
42
|
+
.catch(err => {
|
43
|
+
console.error('Could not copy text: ', err);
|
44
|
+
alert(sessionStorage.heavensDoor);
|
45
|
+
});
|
46
|
+
} else {
|
47
|
+
const dummyElement = document.createElement('span');
|
48
|
+
dummyElement.style.whiteSpace = 'pre'
|
49
|
+
dummyElement.textContent = sessionStorage.heavensDoor;
|
50
|
+
document.body.appendChild(dummyElement)
|
51
|
+
|
52
|
+
const selection = window.getSelection();
|
53
|
+
selection.removeAllRanges()
|
54
|
+
const range = document.createRange()
|
55
|
+
range.selectNode(dummyElement)
|
56
|
+
selection.addRange(range)
|
57
|
+
|
58
|
+
document.execCommand('copy');
|
59
|
+
|
60
|
+
selection.removeAllRanges()
|
61
|
+
document.body.removeChild(dummyElement)
|
62
|
+
}
|
45
63
|
});
|
46
64
|
|
47
65
|
if (sessionStorage.heavensDoor) {
|
data/lib/heavens_door/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heavens_door
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|