jekyll-web-novel 0.2.0 → 0.2.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/assets/js/bookReader.js +6 -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: 0e5b30286bc79f810c396c9cc8f55f9c3bd56be8c2195d5513ad8264bb592f6c
|
|
4
|
+
data.tar.gz: 89447827c2847861b08a3ba44797621cffa434e3adaa2ac0650499aaf12b1087
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ff5b24af5f8072a93ba667de2e891fcc31bafb84eaf72fd2c072fb4c1d08f2c596a69c9f0d9cf0f542adad507733c2983d645cdaf617ae1866ec63e0eef9dc9
|
|
7
|
+
data.tar.gz: 401510a04f3a3090bbc88ef3cf140611dba02814dd5cc731e637cd48e97a4eebb337198e29eeed07101c57e44a609eb156ee610e0223f74780f0f5724ebd87eb
|
data/assets/js/bookReader.js
CHANGED
|
@@ -44,7 +44,7 @@ class BookReader {
|
|
|
44
44
|
if(p.innerHTML.match('...')) {
|
|
45
45
|
c = c+1;
|
|
46
46
|
var a = document.createElement('a');
|
|
47
|
-
a.addEventListener('click',(e)=>{BookReader.saveBookMark(
|
|
47
|
+
a.addEventListener('click',(e)=>{BookReader.saveBookMark(p)});
|
|
48
48
|
a.setAttribute(anchorTag, `#p${c}`)
|
|
49
49
|
a.setAttribute('class', `anchor`)
|
|
50
50
|
p.setAttribute('id', `p${c}`)
|
|
@@ -63,16 +63,18 @@ class BookReader {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
static saveBookMark(
|
|
66
|
+
static saveBookMark(p) {
|
|
67
67
|
var url = new URL(window.location);
|
|
68
|
-
url.hash = '#
|
|
68
|
+
url.hash = '#'+p.getAttribute('id');
|
|
69
69
|
window.localStorage.setItem('bookmark', url.href)
|
|
70
70
|
custom_alert_function('Saved Bookmark')
|
|
71
|
+
console.log(window.localStorage.getItem('bookmark'));
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
setBookMarkLink() {
|
|
74
|
-
var bm =
|
|
75
|
+
var bm = window.localStorage.getItem('bookmark');
|
|
75
76
|
if(bm != undefined) {
|
|
77
|
+
bm = new URL(bm);
|
|
76
78
|
document.querySelectorAll('[go-to-bookmark]').forEach((b)=>{
|
|
77
79
|
b.setAttribute('href', bm.href)
|
|
78
80
|
b.setAttribute('title', 'Bookmark: '+bm.pathname+bm.hash)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-web-novel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- opsaaaaa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-05-
|
|
11
|
+
date: 2022-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: webrick
|