@xwadex/fesd 0.0.70 → 0.0.72
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/dist/fesd-bundle.js +194 -189
- package/dist/fesd-bundle.js.map +1 -1
- package/dist/image-preview-bundle.js +485 -358
- package/dist/image-preview-bundle.js.map +1 -1
- package/dist/tools-bundle.js +217 -324
- package/dist/tools-bundle.js.map +1 -1
- package/package.json +1 -1
package/dist/fesd-bundle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as oe, a as ae, C as ne,
|
|
1
|
+
import { J as M, G as E, g as R, u as A, Z as I, o as B, _ as N, H as z, U as X, F as D } from "./image-preview-bundle.js";
|
|
2
|
+
import { A as oe, a as ae, C as ne, m as le, D as ce, I as de, b as ue, M as pe, c as he, d as me, R as ge, T as fe } from "./image-preview-bundle.js";
|
|
3
3
|
import T from "jquery";
|
|
4
4
|
import { m as v, S as H, p as j } from "./vendor-bundle.js";
|
|
5
5
|
const y = () => {
|
|
6
|
-
const
|
|
6
|
+
const i = navigator.userAgent, e = {
|
|
7
7
|
// Firefox 1.0+
|
|
8
8
|
isFirefox: typeof InstallTrigger < "u",
|
|
9
9
|
// Opera 8.0+
|
|
10
|
-
isOpera: !!window.opr && !!opr.addons || !!window.opera ||
|
|
10
|
+
isOpera: !!window.opr && !!opr.addons || !!window.opera || i.indexOf(" OPR/") >= 0,
|
|
11
11
|
// Internet Explorer 6-11
|
|
12
12
|
isIE: (
|
|
13
13
|
/*@cc_on!@*/
|
|
@@ -16,58 +16,58 @@ const y = () => {
|
|
|
16
16
|
// Edge 20+
|
|
17
17
|
isEdge: !document.documentMode && !!window.StyleMedia,
|
|
18
18
|
// Edge (based on chromium) detection
|
|
19
|
-
isEdgeChromium: /\sedg\//i.test(
|
|
19
|
+
isEdgeChromium: /\sedg\//i.test(i) || /edg([ea]|ios)/i.test(i),
|
|
20
20
|
// Safari 3.0+ "[object HTMLElementConstructor]"
|
|
21
|
-
isSafari: !/chrome|crios|crmo/i.test(
|
|
21
|
+
isSafari: !/chrome|crios|crmo/i.test(i) && /safari/i.test(i),
|
|
22
22
|
// Chrome 1 - 79
|
|
23
|
-
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(
|
|
23
|
+
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(i)
|
|
24
24
|
}, t = {
|
|
25
25
|
// Android
|
|
26
|
-
isAndroid:
|
|
26
|
+
isAndroid: i.indexOf("Android") > -1 || i.indexOf("Adr") > -1,
|
|
27
27
|
// iOS | ipad
|
|
28
|
-
isiOS:
|
|
28
|
+
isiOS: i.indexOf("Mac") > -1 && "ontouchend" in document
|
|
29
29
|
}, r = {
|
|
30
30
|
// window
|
|
31
|
-
isWindows:
|
|
31
|
+
isWindows: i.indexOf("Win") > -1,
|
|
32
32
|
// macos
|
|
33
|
-
isMacOS:
|
|
33
|
+
isMacOS: i.indexOf("Mac") > -1,
|
|
34
34
|
// UNIX
|
|
35
|
-
isUNIX:
|
|
35
|
+
isUNIX: i.indexOf("X11") > -1,
|
|
36
36
|
// Linux
|
|
37
|
-
isLinux:
|
|
37
|
+
isLinux: i.indexOf("Linux") > -1
|
|
38
38
|
};
|
|
39
39
|
return { browser: e, mobile: t, os: r };
|
|
40
|
-
}, P = () => {
|
|
41
|
-
const { browser: s } = y();
|
|
42
|
-
return Object.keys(s).find((e) => {
|
|
43
|
-
if (s[e]) return s[e];
|
|
44
|
-
});
|
|
45
40
|
}, F = () => {
|
|
46
|
-
const {
|
|
47
|
-
return Object.keys(
|
|
48
|
-
if (
|
|
41
|
+
const { browser: i } = y();
|
|
42
|
+
return Object.keys(i).find((e) => {
|
|
43
|
+
if (i[e]) return i[e];
|
|
44
|
+
});
|
|
45
|
+
}, P = () => {
|
|
46
|
+
const { mobile: i } = y();
|
|
47
|
+
return Object.keys(i).some((e) => {
|
|
48
|
+
if (i[e]) return i[e];
|
|
49
49
|
});
|
|
50
50
|
}, U = () => {
|
|
51
|
-
const { os:
|
|
52
|
-
return Object.keys(
|
|
53
|
-
if (
|
|
51
|
+
const { os: i } = y();
|
|
52
|
+
return Object.keys(i).find((e) => {
|
|
53
|
+
if (i[e]) return i[e];
|
|
54
54
|
});
|
|
55
55
|
}, V = () => console.dir(y());
|
|
56
|
-
function
|
|
56
|
+
function Q() {
|
|
57
57
|
return {
|
|
58
58
|
init: y,
|
|
59
|
-
isBrowser4:
|
|
60
|
-
isMobile4:
|
|
59
|
+
isBrowser4: F,
|
|
60
|
+
isMobile4: P,
|
|
61
61
|
isOs4: U,
|
|
62
62
|
logs: V
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
const g = (
|
|
66
|
-
|
|
65
|
+
const g = (i, e, t) => {
|
|
66
|
+
i && (z(i) ? i.forEach((r) => r.style[e] = t) : i.style[e] = t);
|
|
67
67
|
};
|
|
68
68
|
class ee {
|
|
69
69
|
constructor(e, t = {}) {
|
|
70
|
-
!M(e) || !
|
|
70
|
+
!M(e) || !E(e) || (this.__storage__ = {
|
|
71
71
|
el: e,
|
|
72
72
|
options: t
|
|
73
73
|
}, this.active = "data-article-active", this.#t());
|
|
@@ -105,6 +105,7 @@ class ee {
|
|
|
105
105
|
$subH: e.querySelector("._subH"),
|
|
106
106
|
$p: e.querySelector("._P"),
|
|
107
107
|
$button: e.querySelector("._button"),
|
|
108
|
+
$tipText: e.querySelector("._tipText"),
|
|
108
109
|
$description: e.querySelectorAll("._description"),
|
|
109
110
|
$video: e.querySelectorAll("[video-id]"),
|
|
110
111
|
// 父層設定
|
|
@@ -118,6 +119,7 @@ class ee {
|
|
|
118
119
|
buttonColorHover: e.getAttribute("button-color-hover"),
|
|
119
120
|
buttonTextColor: e.getAttribute("button-textcolor"),
|
|
120
121
|
descriptionColor: e.getAttribute("description-color"),
|
|
122
|
+
tipColor: e.getAttribute("tip-color"),
|
|
121
123
|
quoteColor: e.getAttribute("quote-color"),
|
|
122
124
|
markdown: e.getAttribute("data-table-markdown") ?? !1
|
|
123
125
|
};
|
|
@@ -125,90 +127,90 @@ class ee {
|
|
|
125
127
|
// 設置設定值的 CSS 樣式
|
|
126
128
|
#o(e) {
|
|
127
129
|
const { params: t } = e.article;
|
|
128
|
-
return g(t.$h, "color", t.hColor), g(t.$subH, "color", t.subHColor), g(t.$p, "color", t.pColor), g(t.$description, "color", t.descriptionColor), g(t.$button, "backgroundColor", t.buttonColor), g(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), g(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), g(t.$backgroundWrap, "backgroundColor", t.typeFullColor), g(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), g(t.$quote, "color", t.quoteColor), this;
|
|
130
|
+
return g(t.$h, "color", t.hColor), g(t.$subH, "color", t.subHColor), g(t.$p, "color", t.pColor), g(t.$description, "color", t.descriptionColor), g(t.$button, "backgroundColor", t.buttonColor), g(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), g(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), g(t.$backgroundWrap, "backgroundColor", t.typeFullColor), g(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), g(t.$quote, "color", t.quoteColor), g(t.$tipText, "color", t.tipColor), this;
|
|
129
131
|
}
|
|
130
132
|
// 表格拖曳功能
|
|
131
133
|
#a(e) {
|
|
132
134
|
const { params: t } = e.article, r = t.$table;
|
|
133
|
-
let o = !1, n, a,
|
|
134
|
-
r.addEventListener("mousedown", function(
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
n =
|
|
135
|
+
let o = !1, n, a, l, d;
|
|
136
|
+
r.addEventListener("mousedown", function(u) {
|
|
137
|
+
u.preventDefault(), o = !0;
|
|
138
|
+
const s = r.getBoundingClientRect();
|
|
139
|
+
n = u.pageX - s.left, a = u.pageY - s.top, l = r.scrollLeft, d = r.scrollTop;
|
|
138
140
|
}), r.addEventListener("mouseleave", function() {
|
|
139
141
|
o = !1;
|
|
140
142
|
}), r.addEventListener("mouseup", function() {
|
|
141
143
|
o = !1;
|
|
142
|
-
}), r.addEventListener("mousemove", function(
|
|
144
|
+
}), r.addEventListener("mousemove", function(u) {
|
|
143
145
|
if (!o) return;
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
r.scrollLeft =
|
|
146
|
+
u.preventDefault();
|
|
147
|
+
const s = r.getBoundingClientRect(), p = u.pageX - s.left, c = u.pageY - s.top, h = p - n, m = c - a;
|
|
148
|
+
r.scrollLeft = l - h, r.scrollTop = d - m;
|
|
147
149
|
});
|
|
148
150
|
}
|
|
149
151
|
// 設置表格凍結
|
|
150
152
|
#n(e, t, r) {
|
|
151
153
|
const { basic_rwd: o } = this.options, n = window.innerWidth < o, a = [...e.querySelectorAll("tr")];
|
|
152
154
|
if (n || !a.length) return;
|
|
153
|
-
const
|
|
154
|
-
this.#d(e,
|
|
155
|
+
const l = this.#l(a);
|
|
156
|
+
this.#d(e, l, t, r);
|
|
155
157
|
}
|
|
156
158
|
#l(e) {
|
|
157
159
|
const t = [], r = /* @__PURE__ */ new Set();
|
|
158
160
|
return e.forEach((o, n) => {
|
|
159
161
|
const a = [...o.children];
|
|
160
162
|
t[n] = [];
|
|
161
|
-
let
|
|
162
|
-
a.forEach((
|
|
163
|
-
const
|
|
164
|
-
for (; t[n][
|
|
165
|
-
|
|
166
|
-
for (let p = 0; p <
|
|
163
|
+
let l = 0;
|
|
164
|
+
a.forEach((d) => {
|
|
165
|
+
const u = +d.getAttribute("rowspan") || 1, s = +d.getAttribute("colspan") || 1;
|
|
166
|
+
for (; t[n][l] || r.has(`${n},${l}`); )
|
|
167
|
+
l++;
|
|
168
|
+
for (let p = 0; p < u; p++) {
|
|
167
169
|
const c = n + p;
|
|
168
170
|
t[c] ??= [];
|
|
169
|
-
for (let h = 0; h <
|
|
170
|
-
const m =
|
|
171
|
+
for (let h = 0; h < s; h++) {
|
|
172
|
+
const m = l + h;
|
|
171
173
|
t[c][m] = {
|
|
172
|
-
el: p === 0 && h === 0 ?
|
|
174
|
+
el: p === 0 && h === 0 ? d : null,
|
|
173
175
|
topRow: n,
|
|
174
|
-
leftCol:
|
|
175
|
-
rowspan:
|
|
176
|
-
colspan:
|
|
176
|
+
leftCol: l,
|
|
177
|
+
rowspan: u,
|
|
178
|
+
colspan: s
|
|
177
179
|
}, p > 0 && r.add(`${c},${m}`);
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
|
-
|
|
182
|
+
l += s;
|
|
181
183
|
});
|
|
182
184
|
}), t;
|
|
183
185
|
}
|
|
184
186
|
#c(e, t) {
|
|
185
187
|
const r = t.length, o = Array(r).fill(0), n = e.getBoundingClientRect().top;
|
|
186
188
|
for (let a = 0; a < r; a++)
|
|
187
|
-
for (let
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
o[a] =
|
|
189
|
+
for (let l = 0; l < (t[a]?.length || 0); l++) {
|
|
190
|
+
const d = t[a][l];
|
|
191
|
+
if (d?.el) {
|
|
192
|
+
const u = d.el.getBoundingClientRect().top;
|
|
193
|
+
o[a] = u - n;
|
|
192
194
|
break;
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
197
|
return o;
|
|
196
198
|
}
|
|
197
199
|
#d(e, t, r, o) {
|
|
198
|
-
const n = this.#c(e, t), a = t[0]?.length ?? 0,
|
|
199
|
-
for (let
|
|
200
|
-
for (let
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
d
|
|
200
|
+
const n = this.#c(e, t), a = t[0]?.length ?? 0, l = Array(a).fill(0);
|
|
201
|
+
for (let d = 0; d < a; d++)
|
|
202
|
+
for (let u = 0; u < t.length; u++) {
|
|
203
|
+
const s = t[u][d];
|
|
204
|
+
if (s?.el) {
|
|
205
|
+
l[d] = s.el.offsetLeft;
|
|
204
206
|
break;
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
t.forEach(
|
|
208
|
-
(
|
|
209
|
-
if (!
|
|
210
|
-
const { el:
|
|
211
|
-
|
|
210
|
+
(d) => d.forEach((u) => {
|
|
211
|
+
if (!u?.el) return;
|
|
212
|
+
const { el: s, topRow: p, leftCol: c } = u, h = p < r, m = c < o;
|
|
213
|
+
s.style.position = "sticky", s.style.zIndex = h && m ? 3 : h ? 2 : m ? 1 : 0, s.style.backgroundColor = getComputedStyle(s).backgroundColor, h && (s.style.top = `${n[p]}px`), m && (s.style.left = `${l[c]}px`);
|
|
212
214
|
})
|
|
213
215
|
);
|
|
214
216
|
}
|
|
@@ -221,11 +223,11 @@ class ee {
|
|
|
221
223
|
{
|
|
222
224
|
name: "center",
|
|
223
225
|
level: "block",
|
|
224
|
-
start(
|
|
225
|
-
return
|
|
226
|
+
start(s) {
|
|
227
|
+
return s.match(/@center@/)?.index;
|
|
226
228
|
},
|
|
227
|
-
tokenizer(
|
|
228
|
-
const c = /^@center@(.+?)@center@/s.exec(
|
|
229
|
+
tokenizer(s) {
|
|
230
|
+
const c = /^@center@(.+?)@center@/s.exec(s);
|
|
229
231
|
if (c)
|
|
230
232
|
return {
|
|
231
233
|
type: "center",
|
|
@@ -234,18 +236,18 @@ class ee {
|
|
|
234
236
|
tokens: this.lexer.inlineTokens(c[1])
|
|
235
237
|
};
|
|
236
238
|
},
|
|
237
|
-
renderer(
|
|
238
|
-
return `<div data-center="true">${v.parser(
|
|
239
|
+
renderer(s) {
|
|
240
|
+
return `<div data-center="true">${v.parser(s.tokens)}</div>`;
|
|
239
241
|
}
|
|
240
242
|
},
|
|
241
243
|
{
|
|
242
244
|
name: "left",
|
|
243
245
|
level: "block",
|
|
244
|
-
start(
|
|
245
|
-
return
|
|
246
|
+
start(s) {
|
|
247
|
+
return s.match(/@left@/)?.index;
|
|
246
248
|
},
|
|
247
|
-
tokenizer(
|
|
248
|
-
const c = /^@left@(.+?)@left@/s.exec(
|
|
249
|
+
tokenizer(s) {
|
|
250
|
+
const c = /^@left@(.+?)@left@/s.exec(s);
|
|
249
251
|
if (c)
|
|
250
252
|
return {
|
|
251
253
|
type: "left",
|
|
@@ -254,18 +256,18 @@ class ee {
|
|
|
254
256
|
tokens: this.lexer.inlineTokens(c[1])
|
|
255
257
|
};
|
|
256
258
|
},
|
|
257
|
-
renderer(
|
|
258
|
-
return `<div data-left="true">${v.parser(
|
|
259
|
+
renderer(s) {
|
|
260
|
+
return `<div data-left="true">${v.parser(s.tokens)}</div>`;
|
|
259
261
|
}
|
|
260
262
|
},
|
|
261
263
|
{
|
|
262
264
|
name: "right",
|
|
263
265
|
level: "block",
|
|
264
|
-
start(
|
|
265
|
-
return
|
|
266
|
+
start(s) {
|
|
267
|
+
return s.match(/@right@/)?.index;
|
|
266
268
|
},
|
|
267
|
-
tokenizer(
|
|
268
|
-
const c = /^@right@(.+?)@right@/s.exec(
|
|
269
|
+
tokenizer(s) {
|
|
270
|
+
const c = /^@right@(.+?)@right@/s.exec(s);
|
|
269
271
|
if (c)
|
|
270
272
|
return {
|
|
271
273
|
type: "right",
|
|
@@ -274,18 +276,18 @@ class ee {
|
|
|
274
276
|
tokens: this.lexer.inlineTokens(c[1])
|
|
275
277
|
};
|
|
276
278
|
},
|
|
277
|
-
renderer(
|
|
278
|
-
return `<div data-right="true">${v.parser(
|
|
279
|
+
renderer(s) {
|
|
280
|
+
return `<div data-right="true">${v.parser(s.tokens)}</div>`;
|
|
279
281
|
}
|
|
280
282
|
},
|
|
281
283
|
{
|
|
282
284
|
name: "sup",
|
|
283
285
|
level: "inline",
|
|
284
|
-
start(
|
|
285
|
-
return
|
|
286
|
+
start(s) {
|
|
287
|
+
return s.match(/@sup@/)?.index;
|
|
286
288
|
},
|
|
287
|
-
tokenizer(
|
|
288
|
-
const c = /^@sup@(.+?)@sup@/.exec(
|
|
289
|
+
tokenizer(s) {
|
|
290
|
+
const c = /^@sup@(.+?)@sup@/.exec(s);
|
|
289
291
|
if (c)
|
|
290
292
|
return {
|
|
291
293
|
type: "sup",
|
|
@@ -294,18 +296,18 @@ class ee {
|
|
|
294
296
|
tokens: this.lexer.inlineTokens(c[1])
|
|
295
297
|
};
|
|
296
298
|
},
|
|
297
|
-
renderer(
|
|
298
|
-
return `<sup>${
|
|
299
|
+
renderer(s) {
|
|
300
|
+
return `<sup>${s.text}</sup>`;
|
|
299
301
|
}
|
|
300
302
|
},
|
|
301
303
|
{
|
|
302
304
|
name: "sub",
|
|
303
305
|
level: "inline",
|
|
304
|
-
start(
|
|
305
|
-
return
|
|
306
|
+
start(s) {
|
|
307
|
+
return s.match(/@sub@/)?.index;
|
|
306
308
|
},
|
|
307
|
-
tokenizer(
|
|
308
|
-
const c = /^@sub@(.+?)@sub@/.exec(
|
|
309
|
+
tokenizer(s) {
|
|
310
|
+
const c = /^@sub@(.+?)@sub@/.exec(s);
|
|
309
311
|
if (c)
|
|
310
312
|
return {
|
|
311
313
|
type: "sub",
|
|
@@ -314,13 +316,13 @@ class ee {
|
|
|
314
316
|
tokens: this.lexer.inlineTokens(c[1])
|
|
315
317
|
};
|
|
316
318
|
},
|
|
317
|
-
renderer(
|
|
318
|
-
return `<sub>${
|
|
319
|
+
renderer(s) {
|
|
320
|
+
return `<sub>${s.text}</sub>`;
|
|
319
321
|
}
|
|
320
322
|
}
|
|
321
323
|
]
|
|
322
324
|
});
|
|
323
|
-
const n = ["h2", "h3", "h4", "h5", "h6", "b", "del", "i", "em", "strong", "p", "ul", "ol", "li", "br", "span", "div", "sup", "sub"], a = ["data-center", "data-right", "data-left"],
|
|
325
|
+
const n = ["h2", "h3", "h4", "h5", "h6", "b", "del", "i", "em", "strong", "p", "ul", "ol", "li", "br", "span", "div", "sup", "sub"], a = ["data-center", "data-right", "data-left"], l = (s) => j.sanitize(s, {
|
|
324
326
|
ALLOWED_TAGS: [
|
|
325
327
|
...n,
|
|
326
328
|
...t ? ["a"] : [],
|
|
@@ -332,11 +334,11 @@ class ee {
|
|
|
332
334
|
...r ? ["src", "alt", "title"] : []
|
|
333
335
|
],
|
|
334
336
|
RETURN_TRUSTED_TYPE: !1
|
|
335
|
-
}),
|
|
336
|
-
e.querySelectorAll("td,th").forEach((
|
|
337
|
-
|
|
338
|
-
const p =
|
|
339
|
-
|
|
337
|
+
}), d = (s) => l(v.parse(s));
|
|
338
|
+
e.querySelectorAll("td,th").forEach((s) => {
|
|
339
|
+
s.innerHTML = s.textContent;
|
|
340
|
+
const p = s.textContent.trim().replace(/<[^>]*>/g, "");
|
|
341
|
+
s.innerHTML = d(p), o && T(s).find("a") && T(s).find("a").attr({
|
|
340
342
|
target: "_blank",
|
|
341
343
|
rel: "noopener noreferrer"
|
|
342
344
|
});
|
|
@@ -346,55 +348,56 @@ class ee {
|
|
|
346
348
|
#p(e) {
|
|
347
349
|
const { scrollStep: t } = this.options, r = e.querySelector("._contentWrap"), o = e.querySelector("._tableCover"), n = e.querySelector("._table"), a = typeof t == "number" ? t : r.clientWidth * 0.5;
|
|
348
350
|
if (!r || !o || o.querySelector(".table_navigation")) return;
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const
|
|
351
|
+
const l = document.createElement("div");
|
|
352
|
+
l.className = "table_navigation";
|
|
353
|
+
const d = document.createElement("div"), u = document.createElement("div");
|
|
354
|
+
d.className = "table-nav-left", u.className = "table-nav-right", l.appendChild(d), l.appendChild(u), o.appendChild(l);
|
|
355
|
+
const s = () => {
|
|
354
356
|
const p = n.scrollLeft, c = n.scrollWidth - n.clientWidth;
|
|
355
|
-
|
|
357
|
+
d.classList.toggle("disabled", p <= 0), u.classList.toggle("disabled", p >= c - 1);
|
|
356
358
|
};
|
|
357
|
-
|
|
359
|
+
d.addEventListener("click", () => {
|
|
358
360
|
n.scrollBy({ left: -a, behavior: "smooth" });
|
|
359
|
-
}),
|
|
361
|
+
}), u.addEventListener("click", () => {
|
|
360
362
|
n.scrollBy({ left: a, behavior: "smooth" });
|
|
361
|
-
}), n.addEventListener("scroll",
|
|
363
|
+
}), n.addEventListener("scroll", s), window.addEventListener("resize", s), s();
|
|
362
364
|
}
|
|
363
365
|
#s(e) {
|
|
364
366
|
const { params: t } = e.article;
|
|
365
|
-
return t.$video.length && new
|
|
367
|
+
return t.$video.length && new I(t.$video, this.options.videoOptions), this;
|
|
366
368
|
}
|
|
367
369
|
#h(e) {
|
|
368
370
|
const { basic_rwd: t } = this.options, { params: r } = e.article;
|
|
369
371
|
if (!r.$swiper) return;
|
|
370
|
-
const o =
|
|
372
|
+
const o = B(), n = this;
|
|
371
373
|
let a = {
|
|
372
374
|
on: {
|
|
373
|
-
init(
|
|
374
|
-
const
|
|
375
|
-
r.$video.length && ([...
|
|
376
|
-
|
|
375
|
+
init(s) {
|
|
376
|
+
const p = s.$el[0];
|
|
377
|
+
r.$video.length && ([...p.querySelectorAll("[video4-active]")].forEach((h) => {
|
|
378
|
+
h.querySelector(N.SETTINGS.videoButton)?.remove(), h.querySelector(".overlay")?.remove(), h.removeAttribute("video4-active");
|
|
377
379
|
}), n.update());
|
|
378
380
|
},
|
|
379
|
-
observerUpdate(
|
|
380
|
-
|
|
381
|
+
observerUpdate(s) {
|
|
382
|
+
s.params.autoplay.enabled && (s.autoplay.start(), s.update());
|
|
381
383
|
}
|
|
382
384
|
},
|
|
383
385
|
observer: !0,
|
|
384
|
-
breakpoints: {}
|
|
386
|
+
breakpoints: {},
|
|
387
|
+
autoHeight: !1
|
|
385
388
|
};
|
|
386
389
|
if (r.$selector.setAttribute("img-swiper", "on"), r.$selector.classList.add(`swiper-${o}`), r.$selector.getAttribute("swiper-arrow") !== "off" && r.$selector.getAttribute("swiper-arrow")) {
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
const
|
|
390
|
-
|
|
390
|
+
const s = document.createElement("div");
|
|
391
|
+
s.className = `swiper-button-next swiper-${o}`, r.$swiperButtonCover.appendChild(s);
|
|
392
|
+
const p = document.createElement("div");
|
|
393
|
+
p.className = `swiper-button-prev swiper-${o}`, r.$swiperButtonCover.appendChild(p), a.navigation = {
|
|
391
394
|
nextEl: `.swiper-button-next.swiper-${o}`,
|
|
392
395
|
prevEl: `.swiper-button-prev.swiper-${o}`
|
|
393
396
|
};
|
|
394
397
|
}
|
|
395
398
|
if (r.$selector.getAttribute("swiper-nav") !== "off" || !r.$selector.getAttribute("swiper-nav")) {
|
|
396
|
-
const
|
|
397
|
-
|
|
399
|
+
const s = document.createElement("div");
|
|
400
|
+
s.className = `swiper-pagination swiper-${o}`, r.$swiper.appendChild(s), a.pagination = {
|
|
398
401
|
el: `.swiper-pagination.swiper-${o}`,
|
|
399
402
|
clickable: !0
|
|
400
403
|
};
|
|
@@ -404,17 +407,19 @@ class ee {
|
|
|
404
407
|
}), (r.$selector.getAttribute("swiper-autoplay") !== "off" || !r.$selector.getAttribute("swiper-autoplay")) && (a.autoplay = {
|
|
405
408
|
delay: 3e3,
|
|
406
409
|
disableOnInteraction: !1
|
|
407
|
-
}), (r.$selector.getAttribute("swiper-loop") !== "off" || !r.$selector.getAttribute("swiper-loop")) && (a.loop = !0), r.$selector.getAttribute("swiper-speed") && (a.speed = parseInt(r.$selector.getAttribute("swiper-speed"))), r.$selector.getAttribute("swiper-parallax") !== "off" && !r.$selector.getAttribute("swiper-loop") && (a.parallax = !0), r.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (a.pagination.dynamicBullets = !0, a.pagination ? a.pagination.dynamicBullets = !0 : console.warn("pagination undefined"));
|
|
408
|
-
let
|
|
409
|
-
r.$swiper.querySelectorAll(".swiper-slide").length <=
|
|
410
|
-
const
|
|
411
|
-
return
|
|
410
|
+
}), (r.$selector.getAttribute("swiper-loop") !== "off" || !r.$selector.getAttribute("swiper-loop")) && (a.loop = !0), r.$selector.getAttribute("swiper-speed") && (a.speed = parseInt(r.$selector.getAttribute("swiper-speed"))), r.$selector.getAttribute("swiper-parallax") !== "off" && !r.$selector.getAttribute("swiper-loop") && (a.parallax = !0), r.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (a.pagination.dynamicBullets = !0, a.pagination ? a.pagination.dynamicBullets = !0 : console.warn("pagination undefined")), r.$selector.getAttribute("swiper-autoheight") === "on" && (a.autoHeight = !0, console.log(a, " $swiperSet"));
|
|
411
|
+
let l = () => window.innerWidth > t && Number(r.$selector.getAttribute("swiper-num")) || 1;
|
|
412
|
+
r.$swiper.querySelectorAll(".swiper-slide").length <= l() && (a.navigation = !1, a.pagination = !1, a.autoplay = !1, a.loop = !1, r.$selector.querySelector(".swiper-button-cover").style.display = "none", r.$selector.querySelector(".swiper-pagination").style.display = "none", r.$swiper.classList.add("swiper-no-swiping"));
|
|
413
|
+
const d = new H(r.$swiper, a), u = r.$swiper.closest("modern-modal");
|
|
414
|
+
return u && u.on("open", function() {
|
|
415
|
+
d.params.autoplay?.enabled && (d.update(), d.autoplay.start());
|
|
416
|
+
}), e.article.swiperList = [], e.article.swiperList.push(d), this;
|
|
412
417
|
}
|
|
413
418
|
#i(e) {
|
|
414
419
|
const { navigation: t } = this.options, { params: r } = e.article;
|
|
415
420
|
if (!r.$table) return;
|
|
416
|
-
const o = e.getAttribute("freeze-table") === "on", n = parseInt(e.getAttribute("freeze-table-row") ?? "0", 10), a = parseInt(e.getAttribute("freeze-table-col") ?? "0", 10),
|
|
417
|
-
o && this.#n(
|
|
421
|
+
const o = e.getAttribute("freeze-table") === "on", n = parseInt(e.getAttribute("freeze-table-row") ?? "0", 10), a = parseInt(e.getAttribute("freeze-table-col") ?? "0", 10), l = e.querySelector("table"), d = e.querySelector("._tipText"), u = e.offsetWidth, s = l.offsetWidth, p = u < s, c = r.markdown === "on", h = () => {
|
|
422
|
+
o && this.#n(l, n, a), (o || p) && this.#a(e), c && this.#u(l), t && p && this.#p(e), p ? (e.classList.add("overflow"), d.style.display = "flex") : (e.classList.remove("overflow"), d.style.display = "none");
|
|
418
423
|
};
|
|
419
424
|
return h(), window.addEventListener("resize", h), this;
|
|
420
425
|
}
|
|
@@ -427,9 +432,9 @@ class ee {
|
|
|
427
432
|
});
|
|
428
433
|
}
|
|
429
434
|
}
|
|
430
|
-
let q = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", W = "ontouchend" in document.documentElement ? "touchend" : "mouseup",
|
|
431
|
-
function f(
|
|
432
|
-
const e = window.getComputedStyle(
|
|
435
|
+
let q = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", W = "ontouchend" in document.documentElement ? "touchend" : "mouseup", C = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
|
436
|
+
function f(i) {
|
|
437
|
+
const e = window.getComputedStyle(i), t = e.transform || e.mozTransform;
|
|
433
438
|
if (t === "none")
|
|
434
439
|
return {
|
|
435
440
|
x: 0,
|
|
@@ -450,80 +455,80 @@ function f(s) {
|
|
|
450
455
|
z: Number(o[14])
|
|
451
456
|
};
|
|
452
457
|
}
|
|
453
|
-
function x(
|
|
454
|
-
const t =
|
|
458
|
+
function x(i) {
|
|
459
|
+
const t = i.querySelector(".wrapper").querySelectorAll(".item");
|
|
455
460
|
let r = 0;
|
|
456
461
|
return t.forEach((o) => {
|
|
457
|
-
const n = getComputedStyle(o), a = parseInt(n.marginLeft),
|
|
458
|
-
r += o.getBoundingClientRect().width + a +
|
|
462
|
+
const n = getComputedStyle(o), a = parseInt(n.marginLeft), l = parseInt(n.marginRight);
|
|
463
|
+
r += o.getBoundingClientRect().width + a + l;
|
|
459
464
|
}), r;
|
|
460
465
|
}
|
|
461
|
-
function L(
|
|
462
|
-
if (f(
|
|
466
|
+
function L(i) {
|
|
467
|
+
if (f(i.slideWrapEl).x >= i.translateMin)
|
|
463
468
|
return "is-start";
|
|
464
|
-
if (f(
|
|
469
|
+
if (f(i.slideWrapEl).x <= i.translateMax)
|
|
465
470
|
return "is-end";
|
|
466
|
-
if (f(
|
|
471
|
+
if (f(i.slideWrapEl).x < i.translateMin && f(i.slideWrapEl).x > i.translateMax)
|
|
467
472
|
return "is-middle";
|
|
468
473
|
}
|
|
469
|
-
function Y(
|
|
470
|
-
const e =
|
|
474
|
+
function Y(i) {
|
|
475
|
+
const e = i.el, t = e.querySelector(".wrapper");
|
|
471
476
|
t.addEventListener(q, function(r) {
|
|
472
|
-
switch (
|
|
477
|
+
switch (i.isDown = !0, i.slidable && t.classList.add("dragging"), q) {
|
|
473
478
|
case "mousedown":
|
|
474
|
-
|
|
479
|
+
i.startX = r.pageX;
|
|
475
480
|
break;
|
|
476
481
|
case "touchstart":
|
|
477
|
-
|
|
482
|
+
i.startX = r.changedTouches[0].pageX;
|
|
478
483
|
break;
|
|
479
484
|
}
|
|
480
|
-
|
|
485
|
+
i.nowTranslateX = f(t).x;
|
|
481
486
|
}), t.addEventListener(W, function(r) {
|
|
482
|
-
|
|
487
|
+
i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
|
|
483
488
|
let o;
|
|
484
|
-
switch (
|
|
489
|
+
switch (C) {
|
|
485
490
|
case "mousemove":
|
|
486
|
-
o = r.pageX -
|
|
491
|
+
o = r.pageX - i.startX;
|
|
487
492
|
break;
|
|
488
493
|
case "touchmove":
|
|
489
|
-
o = r.changedTouches[0].pageX -
|
|
494
|
+
o = r.changedTouches[0].pageX - i.startX;
|
|
490
495
|
break;
|
|
491
496
|
}
|
|
492
497
|
if (o === 0 && r.target.closest(".item")) {
|
|
493
498
|
if (W === "mouseup" && r.button !== 0) return;
|
|
494
499
|
t.querySelectorAll(".item").forEach((a) => {
|
|
495
500
|
a.classList.remove("active");
|
|
496
|
-
}), r.target.closest(".item").classList.add("active"),
|
|
501
|
+
}), r.target.closest(".item").classList.add("active"), i.moveActive(i.params.speed);
|
|
497
502
|
} else
|
|
498
|
-
|
|
503
|
+
i.slidable && i.resetPos(e);
|
|
499
504
|
}), t.addEventListener("mouseleave", function() {
|
|
500
|
-
|
|
501
|
-
}), t.addEventListener(
|
|
502
|
-
if (
|
|
503
|
-
if (!
|
|
505
|
+
i.isDown && i.slidable && (i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), i.resetPos(e));
|
|
506
|
+
}), t.addEventListener(C, function(r) {
|
|
507
|
+
if (i.draggable && i.slidable) {
|
|
508
|
+
if (!i.isDown) return;
|
|
504
509
|
r.preventDefault();
|
|
505
510
|
let o;
|
|
506
|
-
switch (
|
|
511
|
+
switch (C) {
|
|
507
512
|
case "mousemove":
|
|
508
|
-
o = r.pageX -
|
|
513
|
+
o = r.pageX - i.startX;
|
|
509
514
|
break;
|
|
510
515
|
case "touchmove":
|
|
511
|
-
o = r.changedTouches[0].pageX -
|
|
516
|
+
o = r.changedTouches[0].pageX - i.startX;
|
|
512
517
|
break;
|
|
513
518
|
}
|
|
514
519
|
if (o !== 0) {
|
|
515
520
|
t.classList.add("moving");
|
|
516
521
|
const n = {
|
|
517
522
|
transition: "all 0ms ease 0s",
|
|
518
|
-
transform: `translate3d(${
|
|
523
|
+
transform: `translate3d(${i.nowTranslateX + o}px,0,0)`
|
|
519
524
|
};
|
|
520
525
|
Object.assign(t.style, n);
|
|
521
526
|
}
|
|
522
527
|
}
|
|
523
528
|
});
|
|
524
529
|
}
|
|
525
|
-
function G(
|
|
526
|
-
const e =
|
|
530
|
+
function G(i) {
|
|
531
|
+
const e = i.querySelectorAll("a");
|
|
527
532
|
for (var t = 0, r = e.length; t < r; t++)
|
|
528
533
|
e[t].draggable = !1;
|
|
529
534
|
}
|
|
@@ -628,18 +633,18 @@ class te {
|
|
|
628
633
|
), e.slidable = e.slideTotalWidth > Math.round(e.el.getBoundingClientRect().width) && (!e.params.breakpoint || window.innerWidth <= e.params.breakpoint), e.slidable ? (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()) : (e.el.classList.remove("slidable"), e.el.classList.remove("is-start"), e.el.classList.remove("is-end"), e.slideWrapEl.removeAttribute("style"));
|
|
629
634
|
}
|
|
630
635
|
}
|
|
631
|
-
const _ = (
|
|
632
|
-
if (
|
|
636
|
+
const _ = (i) => {
|
|
637
|
+
if (i == "facebook")
|
|
633
638
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
|
634
|
-
if (
|
|
639
|
+
if (i == "line")
|
|
635
640
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "http://line.naver.jp/R/msg/text/?" : "https://lineit.line.me/share/ui?url=";
|
|
636
|
-
if (
|
|
641
|
+
if (i == "twitter")
|
|
637
642
|
return "https://twitter.com/intent/tweet?url=";
|
|
638
|
-
if (
|
|
643
|
+
if (i == "linkedin")
|
|
639
644
|
return `http://www.linkedin.com/shareArticle?mini=true&title=${document.title}&source=${document.title}&url=`;
|
|
640
|
-
if (
|
|
645
|
+
if (i == "telegram")
|
|
641
646
|
return "https://telegram.me/share/url?url=";
|
|
642
|
-
if (
|
|
647
|
+
if (i == "weibo")
|
|
643
648
|
return "https://service.weibo.com/share/share.php?url=";
|
|
644
649
|
};
|
|
645
650
|
class re {
|
|
@@ -651,7 +656,7 @@ class re {
|
|
|
651
656
|
}
|
|
652
657
|
#t() {
|
|
653
658
|
const { el: e, options: t } = this.__storage__, { SETTINGS: r } = X;
|
|
654
|
-
!M(e) || !
|
|
659
|
+
!M(e) || !E(e) || (this.elements = A(e), this.options = Object.assign({}, r, t), this.#r());
|
|
655
660
|
}
|
|
656
661
|
#r() {
|
|
657
662
|
const { elements: e, options: t } = this;
|
|
@@ -672,27 +677,27 @@ class re {
|
|
|
672
677
|
className: this.getAttribute("copy-class") || t.className,
|
|
673
678
|
duration: this.getAttribute("copy-duration") || t.duration
|
|
674
679
|
}, a = encodeURIComponent(document.URL);
|
|
675
|
-
let
|
|
680
|
+
let l = a;
|
|
676
681
|
if (r == "wechat") {
|
|
677
682
|
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${a}&size=250x250`, "share to wechat", "width=300,height=300");
|
|
678
683
|
return;
|
|
679
684
|
}
|
|
680
685
|
if (r == "url") {
|
|
681
|
-
if (
|
|
686
|
+
if (E(".copied-wrapper")) return;
|
|
682
687
|
document.querySelector("body").insertAdjacentHTML(D.append, `<div class='copied-wrapper'><div class='text'>${n.success ? n.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
|
683
|
-
const
|
|
684
|
-
n.className &&
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
688
|
+
const d = document.querySelector(".copied-wrapper");
|
|
689
|
+
n.className && d.classList.add(n.className), d.style.top = this.getBoundingClientRect().top + window.scrollY + "px", d.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", d.style.display = "block";
|
|
690
|
+
const u = document.querySelector("#clipboard");
|
|
691
|
+
if (u.value = n.text ?? window.location.href, u.setSelectionRange(0, 9999), u.select(), document.execCommand("copy")) {
|
|
687
692
|
document.execCommand("copy");
|
|
688
|
-
const
|
|
693
|
+
const s = document.querySelector(".copied-wrapper"), p = document.querySelector(".copied-wrapper .text");
|
|
689
694
|
p.style.display = "block", p.style.opacity = 0;
|
|
690
695
|
const c = (m, k) => {
|
|
691
696
|
let b = 0;
|
|
692
697
|
const w = 50, $ = w / k, S = setInterval(function() {
|
|
693
698
|
b += $, m.style.opacity = b, b >= 1 && (clearInterval(S), setTimeout(function() {
|
|
694
699
|
h(m, 300, function() {
|
|
695
|
-
|
|
700
|
+
s.remove();
|
|
696
701
|
});
|
|
697
702
|
}, n.duration));
|
|
698
703
|
}, w);
|
|
@@ -706,7 +711,7 @@ class re {
|
|
|
706
711
|
}
|
|
707
712
|
return;
|
|
708
713
|
}
|
|
709
|
-
|
|
714
|
+
l = `${l}${o.source ? `?utm_source=${o.source}` : ""}${o.medium ? `&utm_medium${o.medium}` : ""}${o.campaign ? `&utm_campaign${o.campaign}` : ""}`, l = l.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), r == "line" ? window.open(`${_(r)}${a}`) : window.open(`${_(r)}${l}"e=${l}`), this.removeEventListener("click", e), setTimeout(() => {
|
|
710
715
|
this.addEventListener("click", e);
|
|
711
716
|
}, 100);
|
|
712
717
|
}
|
|
@@ -718,7 +723,7 @@ export {
|
|
|
718
723
|
te as CategorySlider,
|
|
719
724
|
ne as Collapse4,
|
|
720
725
|
le as Configs,
|
|
721
|
-
|
|
726
|
+
Q as Detect4,
|
|
722
727
|
ce as Dropdown4,
|
|
723
728
|
de as ImagePreview,
|
|
724
729
|
ue as ImageValidate,
|
|
@@ -728,6 +733,6 @@ export {
|
|
|
728
733
|
ge as Ripple4,
|
|
729
734
|
re as Share4,
|
|
730
735
|
fe as Tab4,
|
|
731
|
-
|
|
736
|
+
I as Video4
|
|
732
737
|
};
|
|
733
738
|
//# sourceMappingURL=fesd-bundle.js.map
|