@xwadex/fesd 0.0.70 → 0.0.71
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 +196 -192
- 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 fe, T as ge } 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
|
|
66
|
-
|
|
65
|
+
const f = (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
|
|
130
|
+
return f(t.$h, "color", t.hColor), f(t.$subH, "color", t.subHColor), f(t.$p, "color", t.pColor), f(t.$description, "color", t.descriptionColor), f(t.$button, "backgroundColor", t.buttonColor), f(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), f(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), f(t.$backgroundWrap, "backgroundColor", t.typeFullColor), f(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), f(t.$quote, "color", t.quoteColor), f(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,55 @@ 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
386
|
breakpoints: {}
|
|
385
387
|
};
|
|
386
388
|
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
|
-
|
|
389
|
+
const s = document.createElement("div");
|
|
390
|
+
s.className = `swiper-button-next swiper-${o}`, r.$swiperButtonCover.appendChild(s);
|
|
391
|
+
const p = document.createElement("div");
|
|
392
|
+
p.className = `swiper-button-prev swiper-${o}`, r.$swiperButtonCover.appendChild(p), a.navigation = {
|
|
391
393
|
nextEl: `.swiper-button-next.swiper-${o}`,
|
|
392
394
|
prevEl: `.swiper-button-prev.swiper-${o}`
|
|
393
395
|
};
|
|
394
396
|
}
|
|
395
397
|
if (r.$selector.getAttribute("swiper-nav") !== "off" || !r.$selector.getAttribute("swiper-nav")) {
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
+
const s = document.createElement("div");
|
|
399
|
+
s.className = `swiper-pagination swiper-${o}`, r.$swiper.appendChild(s), a.pagination = {
|
|
398
400
|
el: `.swiper-pagination.swiper-${o}`,
|
|
399
401
|
clickable: !0
|
|
400
402
|
};
|
|
@@ -405,16 +407,18 @@ class ee {
|
|
|
405
407
|
delay: 3e3,
|
|
406
408
|
disableOnInteraction: !1
|
|
407
409
|
}), (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
|
+
let l = () => window.innerWidth > t && Number(r.$selector.getAttribute("swiper-num")) || 1;
|
|
411
|
+
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"));
|
|
412
|
+
const d = new H(r.$swiper, a), u = r.$swiper.closest("modern-modal");
|
|
413
|
+
return u && u.on("open", function() {
|
|
414
|
+
d.params.autoplay?.enabled && (d.update(), d.autoplay.start());
|
|
415
|
+
}), e.article.swiperList = [], e.article.swiperList.push(d), this;
|
|
412
416
|
}
|
|
413
417
|
#i(e) {
|
|
414
418
|
const { navigation: t } = this.options, { params: r } = e.article;
|
|
415
419
|
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(
|
|
420
|
+
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 = () => {
|
|
421
|
+
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
422
|
};
|
|
419
423
|
return h(), window.addEventListener("resize", h), this;
|
|
420
424
|
}
|
|
@@ -427,9 +431,9 @@ class ee {
|
|
|
427
431
|
});
|
|
428
432
|
}
|
|
429
433
|
}
|
|
430
|
-
let q = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", W = "ontouchend" in document.documentElement ? "touchend" : "mouseup",
|
|
431
|
-
function
|
|
432
|
-
const e = window.getComputedStyle(
|
|
434
|
+
let q = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", W = "ontouchend" in document.documentElement ? "touchend" : "mouseup", C = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
|
435
|
+
function g(i) {
|
|
436
|
+
const e = window.getComputedStyle(i), t = e.transform || e.mozTransform;
|
|
433
437
|
if (t === "none")
|
|
434
438
|
return {
|
|
435
439
|
x: 0,
|
|
@@ -450,80 +454,80 @@ function f(s) {
|
|
|
450
454
|
z: Number(o[14])
|
|
451
455
|
};
|
|
452
456
|
}
|
|
453
|
-
function x(
|
|
454
|
-
const t =
|
|
457
|
+
function x(i) {
|
|
458
|
+
const t = i.querySelector(".wrapper").querySelectorAll(".item");
|
|
455
459
|
let r = 0;
|
|
456
460
|
return t.forEach((o) => {
|
|
457
|
-
const n = getComputedStyle(o), a = parseInt(n.marginLeft),
|
|
458
|
-
r += o.getBoundingClientRect().width + a +
|
|
461
|
+
const n = getComputedStyle(o), a = parseInt(n.marginLeft), l = parseInt(n.marginRight);
|
|
462
|
+
r += o.getBoundingClientRect().width + a + l;
|
|
459
463
|
}), r;
|
|
460
464
|
}
|
|
461
|
-
function L(
|
|
462
|
-
if (
|
|
465
|
+
function L(i) {
|
|
466
|
+
if (g(i.slideWrapEl).x >= i.translateMin)
|
|
463
467
|
return "is-start";
|
|
464
|
-
if (
|
|
468
|
+
if (g(i.slideWrapEl).x <= i.translateMax)
|
|
465
469
|
return "is-end";
|
|
466
|
-
if (
|
|
470
|
+
if (g(i.slideWrapEl).x < i.translateMin && g(i.slideWrapEl).x > i.translateMax)
|
|
467
471
|
return "is-middle";
|
|
468
472
|
}
|
|
469
|
-
function Y(
|
|
470
|
-
const e =
|
|
473
|
+
function Y(i) {
|
|
474
|
+
const e = i.el, t = e.querySelector(".wrapper");
|
|
471
475
|
t.addEventListener(q, function(r) {
|
|
472
|
-
switch (
|
|
476
|
+
switch (i.isDown = !0, i.slidable && t.classList.add("dragging"), q) {
|
|
473
477
|
case "mousedown":
|
|
474
|
-
|
|
478
|
+
i.startX = r.pageX;
|
|
475
479
|
break;
|
|
476
480
|
case "touchstart":
|
|
477
|
-
|
|
481
|
+
i.startX = r.changedTouches[0].pageX;
|
|
478
482
|
break;
|
|
479
483
|
}
|
|
480
|
-
|
|
484
|
+
i.nowTranslateX = g(t).x;
|
|
481
485
|
}), t.addEventListener(W, function(r) {
|
|
482
|
-
|
|
486
|
+
i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
|
|
483
487
|
let o;
|
|
484
|
-
switch (
|
|
488
|
+
switch (C) {
|
|
485
489
|
case "mousemove":
|
|
486
|
-
o = r.pageX -
|
|
490
|
+
o = r.pageX - i.startX;
|
|
487
491
|
break;
|
|
488
492
|
case "touchmove":
|
|
489
|
-
o = r.changedTouches[0].pageX -
|
|
493
|
+
o = r.changedTouches[0].pageX - i.startX;
|
|
490
494
|
break;
|
|
491
495
|
}
|
|
492
496
|
if (o === 0 && r.target.closest(".item")) {
|
|
493
497
|
if (W === "mouseup" && r.button !== 0) return;
|
|
494
498
|
t.querySelectorAll(".item").forEach((a) => {
|
|
495
499
|
a.classList.remove("active");
|
|
496
|
-
}), r.target.closest(".item").classList.add("active"),
|
|
500
|
+
}), r.target.closest(".item").classList.add("active"), i.moveActive(i.params.speed);
|
|
497
501
|
} else
|
|
498
|
-
|
|
502
|
+
i.slidable && i.resetPos(e);
|
|
499
503
|
}), t.addEventListener("mouseleave", function() {
|
|
500
|
-
|
|
501
|
-
}), t.addEventListener(
|
|
502
|
-
if (
|
|
503
|
-
if (!
|
|
504
|
+
i.isDown && i.slidable && (i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), i.resetPos(e));
|
|
505
|
+
}), t.addEventListener(C, function(r) {
|
|
506
|
+
if (i.draggable && i.slidable) {
|
|
507
|
+
if (!i.isDown) return;
|
|
504
508
|
r.preventDefault();
|
|
505
509
|
let o;
|
|
506
|
-
switch (
|
|
510
|
+
switch (C) {
|
|
507
511
|
case "mousemove":
|
|
508
|
-
o = r.pageX -
|
|
512
|
+
o = r.pageX - i.startX;
|
|
509
513
|
break;
|
|
510
514
|
case "touchmove":
|
|
511
|
-
o = r.changedTouches[0].pageX -
|
|
515
|
+
o = r.changedTouches[0].pageX - i.startX;
|
|
512
516
|
break;
|
|
513
517
|
}
|
|
514
518
|
if (o !== 0) {
|
|
515
519
|
t.classList.add("moving");
|
|
516
520
|
const n = {
|
|
517
521
|
transition: "all 0ms ease 0s",
|
|
518
|
-
transform: `translate3d(${
|
|
522
|
+
transform: `translate3d(${i.nowTranslateX + o}px,0,0)`
|
|
519
523
|
};
|
|
520
524
|
Object.assign(t.style, n);
|
|
521
525
|
}
|
|
522
526
|
}
|
|
523
527
|
});
|
|
524
528
|
}
|
|
525
|
-
function G(
|
|
526
|
-
const e =
|
|
529
|
+
function G(i) {
|
|
530
|
+
const e = i.querySelectorAll("a");
|
|
527
531
|
for (var t = 0, r = e.length; t < r; t++)
|
|
528
532
|
e[t].draggable = !1;
|
|
529
533
|
}
|
|
@@ -533,7 +537,7 @@ class te {
|
|
|
533
537
|
speed: 300,
|
|
534
538
|
clickSwitch: !0,
|
|
535
539
|
breakpoint: !1
|
|
536
|
-
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX =
|
|
540
|
+
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = g(this.slideWrapEl).x, this.slideTotalWidth = x(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
|
|
537
541
|
Math.abs(
|
|
538
542
|
x(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
|
|
539
543
|
)
|
|
@@ -571,7 +575,7 @@ class te {
|
|
|
571
575
|
t.slideWrapEl.addEventListener(
|
|
572
576
|
"transitionend",
|
|
573
577
|
function() {
|
|
574
|
-
switch (t.nowTranslateX =
|
|
578
|
+
switch (t.nowTranslateX = g(t.slideWrapEl).x, L(t)) {
|
|
575
579
|
case "is-start":
|
|
576
580
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
|
577
581
|
break;
|
|
@@ -586,7 +590,7 @@ class te {
|
|
|
586
590
|
!1
|
|
587
591
|
);
|
|
588
592
|
else
|
|
589
|
-
switch (t.nowTranslateX =
|
|
593
|
+
switch (t.nowTranslateX = g(t.slideWrapEl).x, L(t)) {
|
|
590
594
|
case "is-start":
|
|
591
595
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
|
592
596
|
break;
|
|
@@ -628,18 +632,18 @@ class te {
|
|
|
628
632
|
), 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
633
|
}
|
|
630
634
|
}
|
|
631
|
-
const _ = (
|
|
632
|
-
if (
|
|
635
|
+
const _ = (i) => {
|
|
636
|
+
if (i == "facebook")
|
|
633
637
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
|
634
|
-
if (
|
|
638
|
+
if (i == "line")
|
|
635
639
|
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 (
|
|
640
|
+
if (i == "twitter")
|
|
637
641
|
return "https://twitter.com/intent/tweet?url=";
|
|
638
|
-
if (
|
|
642
|
+
if (i == "linkedin")
|
|
639
643
|
return `http://www.linkedin.com/shareArticle?mini=true&title=${document.title}&source=${document.title}&url=`;
|
|
640
|
-
if (
|
|
644
|
+
if (i == "telegram")
|
|
641
645
|
return "https://telegram.me/share/url?url=";
|
|
642
|
-
if (
|
|
646
|
+
if (i == "weibo")
|
|
643
647
|
return "https://service.weibo.com/share/share.php?url=";
|
|
644
648
|
};
|
|
645
649
|
class re {
|
|
@@ -651,7 +655,7 @@ class re {
|
|
|
651
655
|
}
|
|
652
656
|
#t() {
|
|
653
657
|
const { el: e, options: t } = this.__storage__, { SETTINGS: r } = X;
|
|
654
|
-
!M(e) || !
|
|
658
|
+
!M(e) || !E(e) || (this.elements = A(e), this.options = Object.assign({}, r, t), this.#r());
|
|
655
659
|
}
|
|
656
660
|
#r() {
|
|
657
661
|
const { elements: e, options: t } = this;
|
|
@@ -672,27 +676,27 @@ class re {
|
|
|
672
676
|
className: this.getAttribute("copy-class") || t.className,
|
|
673
677
|
duration: this.getAttribute("copy-duration") || t.duration
|
|
674
678
|
}, a = encodeURIComponent(document.URL);
|
|
675
|
-
let
|
|
679
|
+
let l = a;
|
|
676
680
|
if (r == "wechat") {
|
|
677
681
|
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${a}&size=250x250`, "share to wechat", "width=300,height=300");
|
|
678
682
|
return;
|
|
679
683
|
}
|
|
680
684
|
if (r == "url") {
|
|
681
|
-
if (
|
|
685
|
+
if (E(".copied-wrapper")) return;
|
|
682
686
|
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 (
|
|
687
|
+
const d = document.querySelector(".copied-wrapper");
|
|
688
|
+
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";
|
|
689
|
+
const u = document.querySelector("#clipboard");
|
|
690
|
+
if (u.value = n.text ?? window.location.href, u.setSelectionRange(0, 9999), u.select(), document.execCommand("copy")) {
|
|
687
691
|
document.execCommand("copy");
|
|
688
|
-
const
|
|
692
|
+
const s = document.querySelector(".copied-wrapper"), p = document.querySelector(".copied-wrapper .text");
|
|
689
693
|
p.style.display = "block", p.style.opacity = 0;
|
|
690
694
|
const c = (m, k) => {
|
|
691
695
|
let b = 0;
|
|
692
696
|
const w = 50, $ = w / k, S = setInterval(function() {
|
|
693
697
|
b += $, m.style.opacity = b, b >= 1 && (clearInterval(S), setTimeout(function() {
|
|
694
698
|
h(m, 300, function() {
|
|
695
|
-
|
|
699
|
+
s.remove();
|
|
696
700
|
});
|
|
697
701
|
}, n.duration));
|
|
698
702
|
}, w);
|
|
@@ -706,7 +710,7 @@ class re {
|
|
|
706
710
|
}
|
|
707
711
|
return;
|
|
708
712
|
}
|
|
709
|
-
|
|
713
|
+
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
714
|
this.addEventListener("click", e);
|
|
711
715
|
}, 100);
|
|
712
716
|
}
|
|
@@ -718,16 +722,16 @@ export {
|
|
|
718
722
|
te as CategorySlider,
|
|
719
723
|
ne as Collapse4,
|
|
720
724
|
le as Configs,
|
|
721
|
-
|
|
725
|
+
Q as Detect4,
|
|
722
726
|
ce as Dropdown4,
|
|
723
727
|
de as ImagePreview,
|
|
724
728
|
ue as ImageValidate,
|
|
725
729
|
pe as Marquee4,
|
|
726
730
|
he as Modal4,
|
|
727
731
|
me as Multipurpose4,
|
|
728
|
-
|
|
732
|
+
fe as Ripple4,
|
|
729
733
|
re as Share4,
|
|
730
|
-
|
|
731
|
-
|
|
734
|
+
ge as Tab4,
|
|
735
|
+
I as Video4
|
|
732
736
|
};
|
|
733
737
|
//# sourceMappingURL=fesd-bundle.js.map
|