@xiee/utils 1.13.18 → 1.13.20
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.
- package/css/article.css +65 -61
- package/css/article.min.css +1 -1
- package/css/article.min.css.map +1 -1
- package/js/external-link.js +1 -1
- package/js/pages.js +3 -3
- package/js/pages.min.js +1 -1
- package/js/pages.min.js.map +1 -1
- package/package.json +1 -1
package/css/article.css
CHANGED
|
@@ -12,19 +12,17 @@ body, blockquote, .side, .menu { background: #fafafa; }
|
|
|
12
12
|
.article-meta .terms, .appendix, .footnotes, main .side > *, .body .side, figcaption, .caption { font-size: .9em; }
|
|
13
13
|
.single .appendix, .body ~ .appendix, .frontmatter { background: none; }
|
|
14
14
|
.appendix h2 { border-bottom: 1px dashed #666; }
|
|
15
|
-
#TOC {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
text-decoration: none;
|
|
25
|
-
}
|
|
26
|
-
#TOC ul ul {
|
|
27
|
-
border-left: 1px solid lightsteelblue;
|
|
15
|
+
#TOC {
|
|
16
|
+
top: 0;
|
|
17
|
+
ul { list-style-position: inside; }
|
|
18
|
+
& > ul {
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
li > ul { padding-left: 1em; }
|
|
23
|
+
.numbered { list-style: none; }
|
|
24
|
+
a { text-decoration: none; }
|
|
25
|
+
ul ul { border-left: 1px solid lightsteelblue; }
|
|
28
26
|
}
|
|
29
27
|
.bg-number {
|
|
30
28
|
padding: 1px 5px;
|
|
@@ -64,10 +62,12 @@ body, blockquote, .side, .menu { background: #fafafa; }
|
|
|
64
62
|
}
|
|
65
63
|
.embed-left { margin-left: calc(0px - var(--side-width) - 2em); }
|
|
66
64
|
.embed-right { margin-right: calc(0px - var(--side-width) - 2em); }
|
|
67
|
-
.side
|
|
68
|
-
.embed-left
|
|
69
|
-
.quote-left
|
|
70
|
-
|
|
65
|
+
:is(.side, .embed-left, .embed-right) > :first-child { margin-top: 0; }
|
|
66
|
+
:is(.embed-left, .embed-right) > :last-child { margin-bottom: 0; }
|
|
67
|
+
:is(.quote-left, .quote-right) {
|
|
68
|
+
& > :first-child { padding-top: .1px; }
|
|
69
|
+
& > :last-child { padding-bottom: .1px; }
|
|
70
|
+
}
|
|
71
71
|
|
|
72
72
|
/* wide elements */
|
|
73
73
|
.fullwidth, .fullwidth * { margin: auto 0; }
|
|
@@ -115,54 +115,58 @@ body, blockquote, .side, .menu { background: #fafafa; }
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
@media (max-width: 1264px) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
118
|
+
body:not(.pagesjs) {
|
|
119
|
+
#TOC {
|
|
120
|
+
border: 1px solid #eee;
|
|
121
|
+
border-radius: 5px;
|
|
122
|
+
padding: 1em;
|
|
123
|
+
position: initial;
|
|
124
|
+
float: none;
|
|
125
|
+
columns: 2;
|
|
126
|
+
}
|
|
127
|
+
.side { width: 100%; }
|
|
128
|
+
main .side, .body .side {
|
|
129
|
+
padding: 0 2em;
|
|
130
|
+
color: darkslategray;
|
|
131
|
+
}
|
|
132
|
+
.side-left, .side-right {
|
|
133
|
+
clear: both;
|
|
134
|
+
margin: 1em auto;
|
|
135
|
+
background: none;
|
|
136
|
+
}
|
|
137
|
+
:not(.note-ref) + .side { float: none; }
|
|
138
|
+
.footnote-ref + .footnotes { float: left; }
|
|
139
|
+
.side > :last-child { margin-bottom: 0; }
|
|
140
|
+
.embed-left, .embed-right {
|
|
141
|
+
float: inherit;
|
|
142
|
+
margin: auto;
|
|
143
|
+
padding: 1em;
|
|
144
|
+
}
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
147
|
@media (max-width: 800px) {
|
|
146
|
-
body {
|
|
147
|
-
main, .body { padding: 0 .5em 0; }
|
|
148
|
-
#TOC { columns: 1; }
|
|
149
|
-
.quote-left, .quote-right {
|
|
150
|
-
width: inherit;
|
|
151
|
-
float: inherit;
|
|
152
|
-
margin: auto;
|
|
153
|
-
}
|
|
154
|
-
.fullwidth:not(.fullscroll) * { max-width: 100%; }
|
|
155
|
-
.fullwidth {
|
|
156
|
-
margin: initial;
|
|
157
|
-
transform: initial;
|
|
158
|
-
float: none;
|
|
159
|
-
min-width: initial;
|
|
160
|
-
background: none;
|
|
161
|
-
border: none;
|
|
162
|
-
}
|
|
163
|
-
.fullwidth figcaption, .fullwidth .caption {
|
|
164
|
-
margin: initial;
|
|
148
|
+
body:not(.pagesjs) {
|
|
165
149
|
padding: initial;
|
|
150
|
+
main, .body { padding: 0 .5em 0; }
|
|
151
|
+
#TOC { columns: 1; }
|
|
152
|
+
.quote-left, .quote-right {
|
|
153
|
+
width: inherit;
|
|
154
|
+
float: inherit;
|
|
155
|
+
margin: auto;
|
|
156
|
+
}
|
|
157
|
+
.fullwidth:not(.fullscroll) * { max-width: 100%; }
|
|
158
|
+
.fullwidth {
|
|
159
|
+
margin: initial;
|
|
160
|
+
transform: initial;
|
|
161
|
+
float: none;
|
|
162
|
+
min-width: initial;
|
|
163
|
+
background: none;
|
|
164
|
+
border: none;
|
|
165
|
+
}
|
|
166
|
+
.fullwidth figcaption, .fullwidth .caption {
|
|
167
|
+
margin: initial;
|
|
168
|
+
padding: initial;
|
|
169
|
+
}
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
172
|
|
package/css/article.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--side-width:200px}body,blockquote,.side,.menu{background:#fafafa}.article-list,.body,.single main,.single .appendix,.body~.appendix,.frontmatter,.fullwidth,.embed-left,.embed-right{background:#fff;margin-top:2em;padding:1em;box-shadow:0 0 8px #ccc}.article-meta{background:#f8f8f8}.article-meta .terms,.appendix,.footnotes,main .side>*,.body .side,figcaption,.caption{font-size:.9em}.single .appendix,.body~.appendix,.frontmatter{background:0 0}.appendix h2{border-bottom:1px dashed #666}#TOC{top:0
|
|
1
|
+
:root{--side-width:200px}body,blockquote,.side,.menu{background:#fafafa}.article-list,.body,.single main,.single .appendix,.body~.appendix,.frontmatter,.fullwidth,.embed-left,.embed-right{background:#fff;margin-top:2em;padding:1em;box-shadow:0 0 8px #ccc}.article-meta{background:#f8f8f8}.article-meta .terms,.appendix,.footnotes,main .side>*,.body .side,figcaption,.caption{font-size:.9em}.single .appendix,.body~.appendix,.frontmatter{background:0 0}.appendix h2{border-bottom:1px dashed #666}#TOC{top:0;& ul{list-style-position:inside}&>ul{margin:0;padding:0}& li>ul{padding-left:1em}& .numbered{list-style:none}& a{text-decoration:none}& ul ul{border-left:1px solid #b0c4de}}.bg-number{color:#fff;background:#789;border-radius:5px;padding:1px 5px}.side{width:var(--side-width);margin:0 auto}.side-left{float:left;clear:left;margin-left:calc(0px - var(--side-width) - 2em);position:sticky}.side-right{float:right;clear:right;margin-right:calc(0px - var(--side-width) - 2em)}.quote-left,.quote-right{width:45%}.embed-left,.embed-right{margin-top:auto;padding:0}.quote-left,.embed-left{float:left;margin-right:1em}.quote-right,.embed-right{float:right;margin-left:1em}.embed-left{margin-left:calc(0px - var(--side-width) - 2em)}.embed-right{margin-right:calc(0px - var(--side-width) - 2em)}:is(.side,.embed-left,.embed-right)>:first-child{margin-top:0}:is(.embed-left,.embed-right)>:last-child{margin-bottom:0}:is(.quote-left,.quote-right){&>:first-child{padding-top:.1px}&>:last-child{padding-bottom:.1px}}.fullwidth,.fullwidth *{margin:auto 0}.fullwidth *{max-width:calc(100vw - 4em)}.fullscroll *{max-width:initial}.fullwidth{float:left;background:#fff;min-width:100%;max-width:calc(100vw - 2em);margin:1em 0 1em 50%;transform:translate(-50%)}.fullscroll,.fullscroll figure,.fullscroll .figure{overflow-x:auto}.fullwidth figcaption,.fullwidth .caption{width:800px;margin-left:calc(50% - 400px);padding:1em 1em 0}@media (width>=1264.02px){.article,.body,.appendix{position:relative}#TOC.side{& .active{color:#32cd32}& li li .active{border-left:3px solid;margin-left:calc(-1em - 3px);padding-left:1em}& li:not(:has(.active)) ul{display:none}}.note-ref{cursor:pointer}.note-ref:hover+.side{z-index:1;box-sizing:content-box;background-color:#f8f8f8;margin-left:1em;padding:.5em;display:inline-block;position:absolute}}@media (width<=1264px){body:not(.pagesjs){& #TOC{position:initial;float:none;columns:2;border:1px solid #eee;border-radius:5px;padding:1em}& .side{width:100%}& main .side,& .body .side{color:#2f4f4f;padding:0 2em}& .side-left,& .side-right{clear:both;background:0 0;margin:1em auto}& :not(.note-ref)+.side{float:none}& .footnote-ref+.footnotes{float:left}& .side>:last-child{margin-bottom:0}& .embed-left,& .embed-right{float:inherit;margin:auto;padding:1em}}}@media (width<=800px){body:not(.pagesjs){padding:initial;& main,& .body{padding:0 .5em}& #TOC{columns:1}& .quote-left,& .quote-right{width:inherit;float:inherit;margin:auto}& .fullwidth:not(.fullscroll) *{max-width:100%}& .fullwidth{margin:initial;transform:initial;float:none;min-width:initial;background:0 0;border:none}& .fullwidth figcaption,& .fullwidth .caption{margin:initial;padding:initial}}}@media print{body{background:0 0}}
|
|
2
2
|
/*# sourceMappingURL=article.min.css.map */
|
package/css/article.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,yBAGA,+CACA,uLAMA,iCACA,sGACA,8DACA,2CACA,
|
|
1
|
+
{"version":3,"mappings":"AAAA,yBAGA,+CACA,uLAMA,iCACA,sGACA,8DACA,2CACA,WAEE,gCACA,wBAIA,yBACA,4BACA,yBACA,uCAEF,wEAQA,4CAIA,iGAMA,qFAKA,mCACA,mDAIA,oDAIA,sDAIA,4DACA,8DACA,8DACA,0DACA,8BACE,gCACA,mCAIF,sCACA,yCACA,gCACA,gIAQA,mEACA,sGAMA,0BACE,2CACA,UACE,wBAGA,oFAKA,yCAIF,yBACA,qJAUF,uBACE,mBACE,iGAQA,mBACA,uDAIA,qEAKA,mCACA,sCACA,oCACA,qEAOJ,sBACE,mCAEE,8BACA,iBACA,qEAKA,+CACA,sGAQA,+EAOJ,aACE","sources":["article.css"],"sourcesContent":[":root {\n --side-width: 200px;\n}\nbody, blockquote, .side, .menu { background: #fafafa; }\n.article-list, .body, .single main, .single .appendix, .body ~ .appendix, .frontmatter, .fullwidth, .embed-left, .embed-right {\n margin-top: 2em;\n padding: 1em;\n box-shadow: 0 0 8px #ccc;\n background: #fff;\n}\n.article-meta { background: #f8f8f8; }\n.article-meta .terms, .appendix, .footnotes, main .side > *, .body .side, figcaption, .caption { font-size: .9em; }\n.single .appendix, .body ~ .appendix, .frontmatter { background: none; }\n.appendix h2 { border-bottom: 1px dashed #666; }\n#TOC {\n top: 0;\n ul { list-style-position: inside; }\n & > ul {\n padding: 0;\n margin: 0;\n }\n li > ul { padding-left: 1em; }\n .numbered { list-style: none; }\n a { text-decoration: none; }\n ul ul { border-left: 1px solid lightsteelblue; }\n}\n.bg-number {\n padding: 1px 5px;\n border-radius: 5px;\n background: lightslategray;\n color: #fff;\n}\n\n/* left/right elements*/\n.side {\n width: var(--side-width);\n margin: 0 auto;\n}\n.side-left {\n float: left;\n clear: left;\n margin-left: calc(0px - var(--side-width) - 2em);\n position: sticky;\n}\n.side-right {\n float: right;\n clear: right;\n margin-right: calc(0px - var(--side-width) - 2em);\n}\n.quote-left, .quote-right { width: 45%; }\n.embed-left, .embed-right {\n margin-top: auto;\n padding: 0;\n}\n.quote-left, .embed-left {\n float: left;\n margin-right: 1em;\n}\n.quote-right, .embed-right {\n float: right;\n margin-left: 1em;\n}\n.embed-left { margin-left: calc(0px - var(--side-width) - 2em); }\n.embed-right { margin-right: calc(0px - var(--side-width) - 2em); }\n:is(.side, .embed-left, .embed-right) > :first-child { margin-top: 0; }\n:is(.embed-left, .embed-right) > :last-child { margin-bottom: 0; }\n:is(.quote-left, .quote-right) {\n & > :first-child { padding-top: .1px; }\n & > :last-child { padding-bottom: .1px; }\n}\n\n/* wide elements */\n.fullwidth, .fullwidth * { margin: auto 0; }\n.fullwidth * { max-width: calc(100vw - 4em); }\n.fullscroll * { max-width: initial; }\n.fullwidth {\n max-width: calc(100vw - 2em);\n margin: 1em 0 1em 50%;\n transform: translateX(-50%);\n float: left;\n min-width: 100%;\n background: #fff;\n}\n.fullscroll, .fullscroll figure, .fullscroll .figure { overflow-x: auto; }\n.fullwidth figcaption, .fullwidth .caption {\n margin-left: calc(50% - 400px);\n width: 800px;\n padding: 1em 1em 0;\n}\n\n@media (min-width: 1264.02px) {\n .article, .body, .appendix { position: relative; }\n #TOC.side {\n .active {\n color: limegreen;\n }\n li li .active {\n border-left: 3px solid;\n margin-left: calc(-1em - 3px);\n padding-left: 1em;\n }\n li:not(:has(.active)) ul {\n display: none;\n }\n }\n .note-ref { cursor: pointer; }\n .note-ref:hover + .side {\n display: inline-block;\n background-color: #f8f8f8;\n position: absolute;\n z-index: 1;\n margin-left: 1em;\n padding: .5em;\n box-sizing: content-box;\n }\n}\n@media (max-width: 1264px) {\n body:not(.pagesjs) {\n #TOC {\n border: 1px solid #eee;\n border-radius: 5px;\n padding: 1em;\n position: initial;\n float: none;\n columns: 2;\n }\n .side { width: 100%; }\n main .side, .body .side {\n padding: 0 2em;\n color: darkslategray;\n }\n .side-left, .side-right {\n clear: both;\n margin: 1em auto;\n background: none;\n }\n :not(.note-ref) + .side { float: none; }\n .footnote-ref + .footnotes { float: left; }\n .side > :last-child { margin-bottom: 0; }\n .embed-left, .embed-right {\n float: inherit;\n margin: auto;\n padding: 1em;\n }\n }\n}\n@media (max-width: 800px) {\n body:not(.pagesjs) {\n padding: initial;\n main, .body { padding: 0 .5em 0; }\n #TOC { columns: 1; }\n .quote-left, .quote-right {\n width: inherit;\n float: inherit;\n margin: auto;\n }\n .fullwidth:not(.fullscroll) * { max-width: 100%; }\n .fullwidth {\n margin: initial;\n transform: initial;\n float: none;\n min-width: initial;\n background: none;\n border: none;\n }\n .fullwidth figcaption, .fullwidth .caption {\n margin: initial;\n padding: initial;\n }\n }\n}\n\n@media print {\n body {\n background: none;\n }\n}\n"],"names":[]}
|
package/js/external-link.js
CHANGED
package/js/pages.js
CHANGED
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
if (!item) break;
|
|
63
63
|
el2.append(item);
|
|
64
64
|
if (box_cur.scrollHeight > H) {
|
|
65
|
-
el
|
|
65
|
+
// move item back to el, only if the clone el2 is not the only element on page
|
|
66
|
+
el2.previousElementSibling && el.insertBefore(item, el.firstChild);
|
|
66
67
|
break;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
@@ -120,8 +121,7 @@
|
|
|
120
121
|
$$('.body').forEach(el => {
|
|
121
122
|
// preserve book chapter classes if exist
|
|
122
123
|
box_cls = ['chapter', 'appendix'].filter(i => el.classList.contains(i));
|
|
123
|
-
newPage(box);
|
|
124
|
-
book && box.innerText !== '' && box.after(newPage());
|
|
124
|
+
book && (box.innerText === '' ? newPage(box) : box.after(newPage()));
|
|
125
125
|
[...el.children].map(fill);
|
|
126
126
|
// clean up container and self if empty
|
|
127
127
|
removeBlank(el.parentNode); removeBlank(el);
|
package/js/pages.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}const r=e.createElement("div"),a=n("h1").length>1;r.className="pagesjs-page",r.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>';let s,i,o,l=[];function c(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",r.innerHTML),s=e||r.cloneNode(!0),i=s.children[1],l.length&&s.classList.add(...l),s}function d(e){if(!e)return!1;const t=""===e.innerText.trim();return t&&e.remove(),t}function f(e){if(e.classList.contains("pagesjs-page"))return s.after(c(e)),void(e.childElementCount>3&&(i.append(...[...e.children].slice(3)),s.after(c())));if(s.scrollHeight>o){const[e,t]=[s,i];e.after(c()),t.childElementCount>1&&i.append(t.lastElementChild)}i.append(e),p(e)}function p(e,t,n,r){if(s.scrollHeight<=o)return;const a=r||s,l=e.cloneNode();if(t?t.append(l):(i.append(l),a.after(c()),i.append(e)),"DIV"===e.tagName&&1===e.childElementCount&&p(e.firstElementChild,l,e,a),["UL","BLOCKQUOTE"].indexOf(e.tagName)>-1&&e.childElementCount>1)for(;;){const t=e.firstChild;if(!t)break;if(l.append(t),a.scrollHeight>o){e.insertBefore(t,e.firstChild);break}}l.lastChild||l.remove(),p(t?n:e)}function
|
|
1
|
+
(e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}const r=e.createElement("div"),a=n("h1").length>1;r.className="pagesjs-page",r.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>';let s,i,o,l=[];function c(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",r.innerHTML),s=e||r.cloneNode(!0),i=s.children[1],l.length&&s.classList.add(...l),s}function d(e){if(!e)return!1;const t=""===e.innerText.trim();return t&&e.remove(),t}function f(e){if(e.classList.contains("pagesjs-page"))return s.after(c(e)),void(e.childElementCount>3&&(i.append(...[...e.children].slice(3)),s.after(c())));if(s.scrollHeight>o){const[e,t]=[s,i];e.after(c()),t.childElementCount>1&&i.append(t.lastElementChild)}i.append(e),p(e)}function p(e,t,n,r){if(s.scrollHeight<=o)return;const a=r||s,l=e.cloneNode();if(t?t.append(l):(i.append(l),a.after(c()),i.append(e)),"DIV"===e.tagName&&1===e.childElementCount&&p(e.firstElementChild,l,e,a),["UL","BLOCKQUOTE"].indexOf(e.tagName)>-1&&e.childElementCount>1)for(;;){const t=e.firstChild;if(!t)break;if(l.append(t),a.scrollHeight>o){l.previousElementSibling&&e.insertBefore(t,e.firstChild);break}}l.lastChild||l.remove(),p(t?n:e)}function g(e){return e&&(e.dataset.shortTitle||e.innerText)}const h=g(t("h1.title, .frontmatter h1, .title, h1")),u=(a?"h1":"h2")+":not(.frontmatter *)",m=["top","bottom"].map((t=>+getComputedStyle(e.documentElement).getPropertyValue(`--paper-margin-${t}`).replace("px","")||0));function b(){const r=e.body.classList;if(r.contains("pagesjs"))return;r.add("pagesjs"),a&&r.add("page-book"),e.body.insertAdjacentElement("afterbegin",c()),o=s.clientHeight||window.innerHeight,n(":is(#TOC, .footnotes, .chapter-before, .chapter-after):is(.side-left, .side-right).side").forEach((e=>{e.classList.remove("side","side-left","side-right")})),r.add("pagesjs-filling"),n(".frontmatter, #TOC, .abstract").forEach((e=>(f(e),a&&s.after(c())))),n(".body").forEach((e=>{l=["chapter","appendix"].filter((t=>e.classList.contains(t))),a&&(""===s.innerText?c(s):s.after(c())),[...e.children].map(f),d(e.parentNode),d(e)})),r.remove("pagesjs-filling"),n('#TOC a[href^="#"]').forEach((t=>{const n=e.createElement("span"),r=t.firstElementChild;for(r?.classList.contains("section-number")?r.after(n):t.insertAdjacentElement("afterbegin",n);n.nextSibling;)n.append(n.nextSibling);t.insertAdjacentHTML("beforeend",'<span class="dot-leader"></span>'),t.dataset.pageNumber="000"}));let i,p=0;n(".pagesjs-page").forEach((e=>{if(d(e))return;if(a){if(t(".frontmatter",e))return;t(u,e)&&(i="")}const r=function(e){let t=+e.dataset.pagesOffset;if(t)return t;const r=e.scrollHeight;if(t=Math.ceil(r/o),t<=1)return t;const a=m.concat([...n("thead",e)].map((e=>+e.offsetHeight))).reduce(((e,t)=>e+t));if(!a)return t;function s(){return Math.ceil((r+(t-1)*a)/o)}let i=s();for(;i>t;)t=i,i=s();return t}(e);r>1&&e.classList.add("page-multiple"),p+=r;const s={pageNumber:p,mainTitle:h,pageTitle:i};let l;[e.children[0],e.children[2]].forEach((e=>{for(const t in s)s[t]&&(e.dataset[t]=s[t])})),i=g([...n(u,e)].pop())||i,n(".footnotes",e).forEach(((t,n)=>{0===n?(l=t,e.children[1].after(t)):(l.append(...t.children),t.remove())}))})),n('#TOC a[href^="#"]').forEach((e=>{const n=t(`.pagesjs-page:has(${e.getAttribute("href")}) .pagesjs-header`);e.dataset.pageNumber=n?n.dataset.pageNumber:""}))}addEventListener("beforeprint",b);let E=sessionStorage.getItem("pagesjs");E&&b(),addEventListener("keypress",(e=>"p"===e.key&&(b(),E=E?"":"1",sessionStorage.setItem("pagesjs",E),E||location.reload())))})(document);
|
package/js/pages.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","tpl","createElement","book","length","className","innerHTML","box","box_body","H","box_cls","newPage","insertAdjacentHTML","cloneNode","children","classList","add","removeBlank","v","innerText","trim","remove","fill","contains","after","childElementCount","append","slice","scrollHeight","box2","box_body2","lastElementChild","fragment","container","parent","page","box_cur","el2","tagName","firstElementChild","indexOf","item","firstChild","insertBefore","lastChild","shortTitle","h","dataset","main","ps","tb","map","i","getComputedStyle","documentElement","getPropertyValue","replace","paginate","cls","body","insertAdjacentElement","clientHeight","window","innerHeight","forEach","filter","parentNode","a","n","nextSibling","pageNumber","page_title","N","pagesOffset","Math","ceil","m","concat","offsetHeight","reduce","m1","m2","newPages","n2","calcPages","info","mainTitle","pageTitle","ft","key","pop","p","getAttribute","addEventListener","pg","sessionStorage","getItem","e","setItem","location","reload","document"],"sources":["pages.js"],"mappings":"AAEA,CAACA,IACC,SAAUC,EAAEC,EAAGC,EAAKH,GAAK,OAAOG,GAAIC,cAAcF,EAAI,CACtD,SAASG,EAAGH,EAAGC,EAAKH,GAAK,OAAOG,EAAKA,EAAGG,iBAAiBJ,GAAK,EAAI,CAElE,MAAMK,EAAMP,EAAEQ,cAAc,OAAQC,EAAOJ,EAAG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AGyC,UAAY,GAAKzC,EAAG4B,kBAAoB,EAAG,OAAa,CAC1F,MAAMgB,EAAO5C,EAAG6C,WAChB,IAAKD,EAAM,MAEX,GADAJ,EAAIX,OAAOe,GACPL,EAAQR,aAAenB,EAAG,
|
|
1
|
+
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","tpl","createElement","book","length","className","innerHTML","box","box_body","H","box_cls","newPage","insertAdjacentHTML","cloneNode","children","classList","add","removeBlank","v","innerText","trim","remove","fill","contains","after","childElementCount","append","slice","scrollHeight","box2","box_body2","lastElementChild","fragment","container","parent","page","box_cur","el2","tagName","firstElementChild","indexOf","item","firstChild","previousElementSibling","insertBefore","lastChild","shortTitle","h","dataset","main","ps","tb","map","i","getComputedStyle","documentElement","getPropertyValue","replace","paginate","cls","body","insertAdjacentElement","clientHeight","window","innerHeight","forEach","filter","parentNode","a","n","nextSibling","pageNumber","page_title","N","pagesOffset","Math","ceil","m","concat","offsetHeight","reduce","m1","m2","newPages","n2","calcPages","info","mainTitle","pageTitle","ft","key","pop","p","getAttribute","addEventListener","pg","sessionStorage","getItem","e","setItem","location","reload","document"],"sources":["pages.js"],"mappings":"AAEA,CAACA,IACC,SAAUC,EAAEC,EAAGC,EAAKH,GAAK,OAAOG,GAAIC,cAAcF,EAAI,CACtD,SAASG,EAAGH,EAAGC,EAAKH,GAAK,OAAOG,EAAKA,EAAGG,iBAAiBJ,GAAK,EAAI,CAElE,MAAMK,EAAMP,EAAEQ,cAAc,OAAQC,EAAOJ,EAAG,MAAMK,OAAS,EAC7DH,EAAII,UAAY,eAChBJ,EAAIK,UAAY,2GAGhB,IAAIC,EAAKC,EAAUC,EAAGC,EAAU,GAChC,SAASC,EAAQd,GAIf,OAHAA,IAAOF,EAAE,gBAAiBE,IAAOA,EAAGe,mBAAmB,aAAcX,EAAIK,WACzEC,EAAMV,GAAMI,EAAIY,WAAU,GAAOL,EAAWD,EAAIO,SAAS,GACzDJ,EAAQN,QAAUG,EAAIQ,UAAUC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