@xwadex/fesd 0.0.14-re.92 → 0.0.14-re.93
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 +140 -147
- package/dist/fesd-bundle.js.map +1 -1
- package/dist/image-preview-bundle.js +233 -237
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
package/dist/fesd-bundle.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
var Z = (
|
2
|
-
if (!e.has(
|
1
|
+
var Z = (r, e, t) => {
|
2
|
+
if (!e.has(r))
|
3
3
|
throw TypeError("Cannot " + t);
|
4
4
|
};
|
5
|
-
var d = (
|
6
|
-
if (e.has(
|
5
|
+
var d = (r, e, t) => {
|
6
|
+
if (e.has(r))
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
8
|
-
e instanceof WeakSet ? e.add(
|
8
|
+
e instanceof WeakSet ? e.add(r) : e.set(r, t);
|
9
9
|
};
|
10
|
-
var l = (
|
11
|
-
import { i as F, a as
|
10
|
+
var l = (r, e, t) => (Z(r, e, "access private method"), t);
|
11
|
+
import { i as F, a as B, g as C, v as ee, c as te, b as se, d as re, e as ie, f as oe, s as ae } from "./image-preview-bundle.js";
|
12
12
|
import { A as xe, j as Se, C as Ee, h as Ce, D as Le, m as qe, I as We, k as ke, M as Te, l as _e, R as Me, T as Oe } from "./image-preview-bundle.js";
|
13
13
|
import { S as ne } from "./vendor-bundle.js";
|
14
|
-
const
|
15
|
-
const
|
14
|
+
const $ = () => {
|
15
|
+
const r = navigator.userAgent, e = {
|
16
16
|
// Firefox 1.0+
|
17
17
|
isFirefox: typeof InstallTrigger < "u",
|
18
18
|
// Opera 8.0+
|
19
|
-
isOpera: !!window.opr && !!opr.addons || !!window.opera ||
|
19
|
+
isOpera: !!window.opr && !!opr.addons || !!window.opera || r.indexOf(" OPR/") >= 0,
|
20
20
|
// Internet Explorer 6-11
|
21
21
|
isIE: (
|
22
22
|
/*@cc_on!@*/
|
@@ -25,70 +25,70 @@ const A = () => {
|
|
25
25
|
// Edge 20+
|
26
26
|
isEdge: !document.documentMode && !!window.StyleMedia,
|
27
27
|
// Edge (based on chromium) detection
|
28
|
-
isEdgeChromium: /\sedg\//i.test(
|
28
|
+
isEdgeChromium: /\sedg\//i.test(r) || /edg([ea]|ios)/i.test(r),
|
29
29
|
// Safari 3.0+ "[object HTMLElementConstructor]"
|
30
|
-
isSafari: !/chrome|crios|crmo/i.test(
|
30
|
+
isSafari: !/chrome|crios|crmo/i.test(r) && /safari/i.test(r),
|
31
31
|
// Chrome 1 - 79
|
32
|
-
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(
|
32
|
+
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(r)
|
33
33
|
}, t = {
|
34
34
|
// Android
|
35
|
-
isAndroid:
|
35
|
+
isAndroid: r.indexOf("Android") > -1 || r.indexOf("Adr") > -1,
|
36
36
|
// iOS | ipad
|
37
|
-
isiOS:
|
37
|
+
isiOS: r.indexOf("Mac") > -1 && "ontouchend" in document
|
38
38
|
}, s = {
|
39
39
|
// window
|
40
|
-
isWindows:
|
40
|
+
isWindows: r.indexOf("Win") > -1,
|
41
41
|
// macos
|
42
|
-
isMacOS:
|
42
|
+
isMacOS: r.indexOf("Mac") > -1,
|
43
43
|
// UNIX
|
44
|
-
isUNIX:
|
44
|
+
isUNIX: r.indexOf("X11") > -1,
|
45
45
|
// Linux
|
46
|
-
isLinux:
|
46
|
+
isLinux: r.indexOf("Linux") > -1
|
47
47
|
};
|
48
48
|
return { browser: e, mobile: t, os: s };
|
49
49
|
}, le = () => {
|
50
|
-
const { browser:
|
51
|
-
return Object.keys(
|
52
|
-
if (
|
53
|
-
return
|
50
|
+
const { browser: r } = $();
|
51
|
+
return Object.keys(r).find((e) => {
|
52
|
+
if (r[e])
|
53
|
+
return r[e];
|
54
54
|
});
|
55
55
|
}, ce = () => {
|
56
|
-
const { mobile:
|
57
|
-
return Object.keys(
|
58
|
-
if (
|
59
|
-
return
|
56
|
+
const { mobile: r } = $();
|
57
|
+
return Object.keys(r).some((e) => {
|
58
|
+
if (r[e])
|
59
|
+
return r[e];
|
60
60
|
});
|
61
61
|
}, de = () => {
|
62
|
-
const { os:
|
63
|
-
return Object.keys(
|
64
|
-
if (
|
65
|
-
return
|
62
|
+
const { os: r } = $();
|
63
|
+
return Object.keys(r).find((e) => {
|
64
|
+
if (r[e])
|
65
|
+
return r[e];
|
66
66
|
});
|
67
|
-
}, ue = () => console.dir(
|
67
|
+
}, ue = () => console.dir($());
|
68
68
|
function we() {
|
69
69
|
return {
|
70
|
-
init:
|
70
|
+
init: $,
|
71
71
|
isBrowser4: le,
|
72
72
|
isMobile4: ce,
|
73
73
|
isOs4: de,
|
74
74
|
logs: ue
|
75
75
|
};
|
76
76
|
}
|
77
|
-
const
|
78
|
-
|
77
|
+
const u = (r, e, t) => {
|
78
|
+
r && (se(r) ? r.forEach((s) => s.style[e] = t) : r.style[e] = t);
|
79
79
|
};
|
80
|
-
var L, U, q, V,
|
80
|
+
var L, U, q, V, f, R, W, z, y, j, k, G;
|
81
81
|
class ve {
|
82
82
|
constructor(e, t = {}) {
|
83
83
|
d(this, L);
|
84
84
|
d(this, q);
|
85
85
|
// 取得元件上的設定值
|
86
|
-
d(this,
|
86
|
+
d(this, f);
|
87
87
|
// 設置設定值的 CSS 樣式
|
88
88
|
d(this, W);
|
89
|
-
d(this,
|
89
|
+
d(this, y);
|
90
90
|
d(this, k);
|
91
|
-
!F(e) || !
|
91
|
+
!F(e) || !B(e) || (this.__storage__ = {
|
92
92
|
el: e,
|
93
93
|
options: t
|
94
94
|
}, this.active = "data-article-active", l(this, L, U).call(this));
|
@@ -97,23 +97,23 @@ class ve {
|
|
97
97
|
const { elements: e } = this;
|
98
98
|
e.forEach((t) => {
|
99
99
|
t.querySelectorAll("._article").forEach((s) => {
|
100
|
-
s.article = {}, s.article.parent = t, s.article.params = l(this,
|
100
|
+
s.article = {}, s.article.parent = t, s.article.params = l(this, f, R).call(this, s), l(this, y, j).call(this, s);
|
101
101
|
});
|
102
102
|
});
|
103
103
|
}
|
104
104
|
}
|
105
105
|
L = new WeakSet(), U = function() {
|
106
|
-
const { el: e, options: t } = this.__storage__, { SETTINGS: s } =
|
106
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: s } = re;
|
107
107
|
this.elements = t.state == "not active" ? C(e + `:not([${this.active}])`) : C(e), this.elements = C(e), this.options = Object.assign({}, s, t), l(this, q, V).call(this);
|
108
108
|
}, q = new WeakSet(), V = function() {
|
109
109
|
const { elements: e } = this;
|
110
110
|
e.forEach((t) => {
|
111
111
|
t.setAttribute(this.active, ""), t.querySelectorAll("._article").forEach((s) => {
|
112
|
-
var
|
113
|
-
s.article = {}, s.article.parent = t, s.article.params = l(this,
|
112
|
+
var i, a;
|
113
|
+
s.article = {}, s.article.parent = t, s.article.params = l(this, f, R).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, l(a = l(i = l(this, W, z).call(this, s), y, j).call(i, s), k, G).call(a, s);
|
114
114
|
});
|
115
115
|
});
|
116
|
-
},
|
116
|
+
}, f = new WeakSet(), R = function(e) {
|
117
117
|
return {
|
118
118
|
// 元件本身
|
119
119
|
$selector: e,
|
@@ -147,23 +147,22 @@ L = new WeakSet(), U = function() {
|
|
147
147
|
};
|
148
148
|
}, W = new WeakSet(), z = function(e) {
|
149
149
|
const { params: t } = e.article;
|
150
|
-
return
|
151
|
-
},
|
150
|
+
return u(t.$h, "color", t.hColor), u(t.$subH, "color", t.subHColor), u(t.$p, "color", t.pColor), u(t.$description, "color", t.descriptionColor), u(t.$button, "backgroundColor", t.buttonColor), u(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), u(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), u(t.$backgroundWrap, "backgroundColor", t.typeFullColor), u(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), this;
|
151
|
+
}, y = new WeakSet(), j = function(e) {
|
152
152
|
const { params: t } = e.article;
|
153
153
|
return t.$video.length && new ee(t.$video), this;
|
154
154
|
}, k = new WeakSet(), G = function(e) {
|
155
|
-
var w, x;
|
156
155
|
const { basic_rwd: t } = this.options, { params: s } = e.article;
|
157
156
|
if (!s.$swiper)
|
158
157
|
return;
|
159
|
-
const
|
158
|
+
const i = te(), a = this;
|
160
159
|
let o = {
|
161
160
|
on: {
|
162
161
|
init(n) {
|
163
|
-
const
|
164
|
-
s.$video.length && ([...
|
165
|
-
var
|
166
|
-
(
|
162
|
+
const g = n.$el[0];
|
163
|
+
s.$video.length && ([...g.querySelectorAll("[video4-active]")].forEach((v) => {
|
164
|
+
var x, p;
|
165
|
+
(x = v.querySelector(ie.SETTINGS.videoButton)) == null || x.remove(), (p = v.querySelector(".overlay")) == null || p.remove(), v.removeAttribute("video4-active");
|
167
166
|
}), a.update());
|
168
167
|
},
|
169
168
|
observerUpdate(n) {
|
@@ -173,19 +172,19 @@ L = new WeakSet(), U = function() {
|
|
173
172
|
observer: !0,
|
174
173
|
breakpoints: {}
|
175
174
|
};
|
176
|
-
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${
|
175
|
+
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${i}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
|
177
176
|
const n = document.createElement("div");
|
178
|
-
n.className = `swiper-button-next swiper-${
|
179
|
-
const
|
180
|
-
|
181
|
-
nextEl: `.swiper-button-next.swiper-${
|
182
|
-
prevEl: `.swiper-button-prev.swiper-${
|
177
|
+
n.className = `swiper-button-next swiper-${i}`, s.$swiperButtonCover.appendChild(n);
|
178
|
+
const g = document.createElement("div");
|
179
|
+
g.className = `swiper-button-prev swiper-${i}`, s.$swiperButtonCover.appendChild(g), o.navigation = {
|
180
|
+
nextEl: `.swiper-button-next.swiper-${i}`,
|
181
|
+
prevEl: `.swiper-button-prev.swiper-${i}`
|
183
182
|
};
|
184
183
|
}
|
185
184
|
if (s.$selector.getAttribute("swiper-nav") !== "off" || !s.$selector.getAttribute("swiper-nav")) {
|
186
185
|
const n = document.createElement("div");
|
187
|
-
n.className = `swiper-pagination swiper-${
|
188
|
-
el: `.swiper-pagination.swiper-${
|
186
|
+
n.className = `swiper-pagination swiper-${i}`, s.$swiper.appendChild(n), o.pagination = {
|
187
|
+
el: `.swiper-pagination.swiper-${i}`,
|
189
188
|
clickable: !0
|
190
189
|
};
|
191
190
|
}
|
@@ -196,115 +195,109 @@ L = new WeakSet(), U = function() {
|
|
196
195
|
disableOnInteraction: !1
|
197
196
|
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (o.loop = !0), s.$selector.getAttribute("swiper-speed") && (o.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (o.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (o.pagination.dynamicBullets = !0, o.pagination ? o.pagination.dynamicBullets = !0 : console.warn("pagination undefined"));
|
198
197
|
let c = () => window.innerWidth > this.basic_rwd && Number(s.$selector.getAttribute("swiper-num")) || 1;
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
n && (n.style.display = "none");
|
203
|
-
const u = (x = s.$selector) == null ? void 0 : x.querySelector(".swiper-pagination");
|
204
|
-
u && (u.style.display = "none"), s.$swiper.classList.add("swiper-no-swiping");
|
205
|
-
}
|
206
|
-
const b = new ne(s.$swiper, o);
|
207
|
-
return e.article.swiperList = [], e.article.swiperList.push(b), this;
|
198
|
+
s.$swiper.querySelectorAll(".swiper-slide").length <= c() && (o.navigation = !1, o.pagination = !1, o.autoplay = !1, o.loop = !1, s.$selector.querySelector(".swiper-button-cover").style.display = "none", s.$selector.querySelector(".swiper-pagination").style.display = "none", s.$swiper.classList.add("swiper-no-swiping"));
|
199
|
+
const h = new ne(s.$swiper, o);
|
200
|
+
return e.article.swiperList = [], e.article.swiperList.push(h), this;
|
208
201
|
};
|
209
|
-
let D = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", H = "ontouchend" in document.documentElement ? "touchend" : "mouseup",
|
210
|
-
function
|
211
|
-
const e = window.getComputedStyle(
|
202
|
+
let D = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", H = "ontouchend" in document.documentElement ? "touchend" : "mouseup", N = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
203
|
+
function m(r) {
|
204
|
+
const e = window.getComputedStyle(r), t = e.transform || e.mozTransform;
|
212
205
|
if (t === "none")
|
213
206
|
return {
|
214
207
|
x: 0,
|
215
208
|
y: 0,
|
216
209
|
z: 0
|
217
210
|
};
|
218
|
-
const s = t.includes("3d") ? "3d" : "2d",
|
211
|
+
const s = t.includes("3d") ? "3d" : "2d", i = t.match(/matrix.*\((.+)\)/)[1].split(", ");
|
219
212
|
if (s === "2d")
|
220
213
|
return {
|
221
|
-
x: Number(
|
222
|
-
y: Number(
|
214
|
+
x: Number(i[4]),
|
215
|
+
y: Number(i[5]),
|
223
216
|
z: 0
|
224
217
|
};
|
225
218
|
if (s === "3d")
|
226
219
|
return {
|
227
|
-
x: Number(
|
228
|
-
y: Number(
|
229
|
-
z: Number(
|
220
|
+
x: Number(i[12]),
|
221
|
+
y: Number(i[13]),
|
222
|
+
z: Number(i[14])
|
230
223
|
};
|
231
224
|
}
|
232
|
-
function E(
|
233
|
-
const t =
|
225
|
+
function E(r) {
|
226
|
+
const t = r.querySelector(".wrapper").querySelectorAll(".item");
|
234
227
|
let s = 0;
|
235
|
-
return t.forEach((
|
236
|
-
const a = getComputedStyle(
|
237
|
-
s +=
|
228
|
+
return t.forEach((i) => {
|
229
|
+
const a = getComputedStyle(i), o = parseInt(a.marginLeft), c = parseInt(a.marginRight);
|
230
|
+
s += i.getBoundingClientRect().width + o + c;
|
238
231
|
}), s;
|
239
232
|
}
|
240
|
-
function
|
241
|
-
if (
|
233
|
+
function X(r) {
|
234
|
+
if (m(r.slideWrapEl).x >= r.translateMin)
|
242
235
|
return "is-start";
|
243
|
-
if (
|
236
|
+
if (m(r.slideWrapEl).x <= r.translateMax)
|
244
237
|
return "is-end";
|
245
|
-
if (
|
238
|
+
if (m(r.slideWrapEl).x < r.translateMin && m(r.slideWrapEl).x > r.translateMax)
|
246
239
|
return "is-middle";
|
247
240
|
}
|
248
|
-
function pe(
|
249
|
-
const e =
|
241
|
+
function pe(r) {
|
242
|
+
const e = r.el, t = e.querySelector(".wrapper");
|
250
243
|
t.addEventListener(D, function(s) {
|
251
|
-
switch (
|
244
|
+
switch (r.isDown = !0, r.slidable && t.classList.add("dragging"), D) {
|
252
245
|
case "mousedown":
|
253
|
-
|
246
|
+
r.startX = s.pageX;
|
254
247
|
break;
|
255
248
|
case "touchstart":
|
256
|
-
|
249
|
+
r.startX = s.changedTouches[0].pageX;
|
257
250
|
break;
|
258
251
|
}
|
259
|
-
|
252
|
+
r.nowTranslateX = m(t).x;
|
260
253
|
}), t.addEventListener(H, function(s) {
|
261
|
-
|
262
|
-
let
|
263
|
-
switch (
|
254
|
+
r.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
|
255
|
+
let i;
|
256
|
+
switch (N) {
|
264
257
|
case "mousemove":
|
265
|
-
|
258
|
+
i = s.pageX - r.startX;
|
266
259
|
break;
|
267
260
|
case "touchmove":
|
268
|
-
|
261
|
+
i = s.changedTouches[0].pageX - r.startX;
|
269
262
|
break;
|
270
263
|
}
|
271
|
-
if (
|
264
|
+
if (i === 0 && s.target.closest(".item")) {
|
272
265
|
if (H === "mouseup" && s.button !== 0)
|
273
266
|
return;
|
274
267
|
t.querySelectorAll(".item").forEach((o) => {
|
275
268
|
o.classList.remove("active");
|
276
|
-
}), s.target.closest(".item").classList.add("active"),
|
269
|
+
}), s.target.closest(".item").classList.add("active"), r.moveActive(r.params.speed);
|
277
270
|
} else
|
278
|
-
|
271
|
+
r.slidable && r.resetPos(e);
|
279
272
|
}), t.addEventListener("mouseleave", function() {
|
280
|
-
|
281
|
-
}), t.addEventListener(
|
282
|
-
if (
|
283
|
-
if (!
|
273
|
+
r.isDown && r.slidable && (r.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), r.resetPos(e));
|
274
|
+
}), t.addEventListener(N, function(s) {
|
275
|
+
if (r.draggable && r.slidable) {
|
276
|
+
if (!r.isDown)
|
284
277
|
return;
|
285
278
|
s.preventDefault();
|
286
|
-
let
|
287
|
-
switch (
|
279
|
+
let i;
|
280
|
+
switch (N) {
|
288
281
|
case "mousemove":
|
289
|
-
|
282
|
+
i = s.pageX - r.startX;
|
290
283
|
break;
|
291
284
|
case "touchmove":
|
292
|
-
|
285
|
+
i = s.changedTouches[0].pageX - r.startX;
|
293
286
|
break;
|
294
287
|
}
|
295
|
-
if (
|
288
|
+
if (i !== 0) {
|
296
289
|
t.classList.add("moving");
|
297
290
|
const a = {
|
298
291
|
transition: "all 0ms ease 0s",
|
299
|
-
transform: `translate3d(${
|
292
|
+
transform: `translate3d(${r.nowTranslateX + i}px,0,0)`
|
300
293
|
};
|
301
294
|
Object.assign(t.style, a);
|
302
295
|
}
|
303
296
|
}
|
304
297
|
});
|
305
298
|
}
|
306
|
-
function me(
|
307
|
-
const e =
|
299
|
+
function me(r) {
|
300
|
+
const e = r.querySelectorAll("a");
|
308
301
|
for (var t = 0, s = e.length; t < s; t++)
|
309
302
|
e[t].draggable = !1;
|
310
303
|
}
|
@@ -314,7 +307,7 @@ class fe {
|
|
314
307
|
speed: 300,
|
315
308
|
clickSwitch: !0,
|
316
309
|
breakpoint: !1
|
317
|
-
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX =
|
310
|
+
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = m(this.slideWrapEl).x, this.slideTotalWidth = E(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
|
318
311
|
Math.abs(
|
319
312
|
E(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
|
320
313
|
)
|
@@ -352,7 +345,7 @@ class fe {
|
|
352
345
|
t.slideWrapEl.addEventListener(
|
353
346
|
"transitionend",
|
354
347
|
function() {
|
355
|
-
switch (t.nowTranslateX =
|
348
|
+
switch (t.nowTranslateX = m(t.slideWrapEl).x, X(t)) {
|
356
349
|
case "is-start":
|
357
350
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
358
351
|
break;
|
@@ -367,7 +360,7 @@ class fe {
|
|
367
360
|
!1
|
368
361
|
);
|
369
362
|
else
|
370
|
-
switch (t.nowTranslateX =
|
363
|
+
switch (t.nowTranslateX = m(t.slideWrapEl).x, X(t)) {
|
371
364
|
case "is-start":
|
372
365
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
373
366
|
break;
|
@@ -382,7 +375,7 @@ class fe {
|
|
382
375
|
}
|
383
376
|
resetPos() {
|
384
377
|
const e = this;
|
385
|
-
switch (
|
378
|
+
switch (X(e)) {
|
386
379
|
case "is-start":
|
387
380
|
e.el.classList.add("is-start"), e.el.classList.remove("is-end"), Object.assign(e.slideWrapEl.style, {
|
388
381
|
transition: `all ${e.params.speed}ms ease 0s`,
|
@@ -409,16 +402,16 @@ class fe {
|
|
409
402
|
), 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"));
|
410
403
|
}
|
411
404
|
}
|
412
|
-
const P = (
|
413
|
-
if (
|
405
|
+
const P = (r) => {
|
406
|
+
if (r == "facebook")
|
414
407
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
415
|
-
if (
|
408
|
+
if (r == "line")
|
416
409
|
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=";
|
417
|
-
if (
|
410
|
+
if (r == "twitter")
|
418
411
|
return "https://twitter.com/intent/tweet?url=";
|
419
|
-
if (
|
412
|
+
if (r == "linkedin")
|
420
413
|
return `http://www.linkedin.com/shareArticle?mini=true&title=${document.title}&source=${document.title}&url=`;
|
421
|
-
if (
|
414
|
+
if (r == "telegram")
|
422
415
|
return "https://telegram.me/share/url?url=";
|
423
416
|
};
|
424
417
|
var T, Y, _, J, M, K;
|
@@ -435,16 +428,16 @@ class ye {
|
|
435
428
|
}
|
436
429
|
T = new WeakSet(), Y = function() {
|
437
430
|
const { el: e, options: t } = this.__storage__, { SETTINGS: s } = ae;
|
438
|
-
!F(e) || !
|
431
|
+
!F(e) || !B(e) || (this.elements = C(e), this.options = Object.assign({}, s, t), l(this, _, J).call(this));
|
439
432
|
}, _ = new WeakSet(), J = function() {
|
440
433
|
const { elements: e, options: t } = this;
|
441
434
|
e.forEach((s) => {
|
442
|
-
s.querySelectorAll("[share-target]").forEach((
|
443
|
-
|
435
|
+
s.querySelectorAll("[share-target]").forEach((i) => {
|
436
|
+
i.share = {}, i.share.instance = this, i.share.params = t, i.share.eventHandler = l(this, M, K), i.addEventListener("click", i.share.eventHandler);
|
444
437
|
});
|
445
438
|
});
|
446
439
|
}, M = new WeakSet(), K = function() {
|
447
|
-
const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"),
|
440
|
+
const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"), i = {
|
448
441
|
source: this.getAttribute("utm-source"),
|
449
442
|
medium: this.getAttribute("utm-medium"),
|
450
443
|
campaign: this.getAttribute("utm-campaign")
|
@@ -460,36 +453,36 @@ T = new WeakSet(), Y = function() {
|
|
460
453
|
return;
|
461
454
|
}
|
462
455
|
if (s == "url") {
|
463
|
-
if (
|
456
|
+
if (B(".copied-wrapper"))
|
464
457
|
return;
|
465
458
|
document.querySelector("body").insertAdjacentHTML(oe.append, `<div class='copied-wrapper'><div class='text'>${a.success ? a.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
466
|
-
const
|
467
|
-
a.className &&
|
468
|
-
const
|
469
|
-
if (
|
459
|
+
const h = document.querySelector(".copied-wrapper");
|
460
|
+
a.className && h.classList.add(a.className), h.style.top = this.getBoundingClientRect().top + window.scrollY + "px", h.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", h.style.display = "block";
|
461
|
+
const n = document.querySelector("#clipboard");
|
462
|
+
if (n.value = a.text ?? window.location.href, n.setSelectionRange(0, 9999), n.select(), document.execCommand("copy")) {
|
470
463
|
document.execCommand("copy");
|
471
|
-
const
|
472
|
-
|
473
|
-
const
|
474
|
-
let
|
475
|
-
const
|
476
|
-
|
477
|
-
|
478
|
-
|
464
|
+
const g = document.querySelector(".copied-wrapper"), A = document.querySelector(".copied-wrapper .text");
|
465
|
+
A.style.display = "block", A.style.opacity = 0;
|
466
|
+
const v = (p, O) => {
|
467
|
+
let b = 0;
|
468
|
+
const w = 50, S = w / O, I = setInterval(function() {
|
469
|
+
b += S, p.style.opacity = b, b >= 1 && (clearInterval(I), setTimeout(function() {
|
470
|
+
x(p, 300, function() {
|
471
|
+
g.remove();
|
479
472
|
});
|
480
473
|
}, a.duration));
|
481
|
-
},
|
482
|
-
},
|
483
|
-
let
|
484
|
-
const S = 50,
|
485
|
-
|
474
|
+
}, w);
|
475
|
+
}, x = (p, O, b) => {
|
476
|
+
let w = 1;
|
477
|
+
const S = 50, I = S / O, Q = setInterval(() => {
|
478
|
+
w -= I, p.style.opacity = w, w <= 0 && (clearInterval(Q), p.style.display = "none", b && b());
|
486
479
|
}, S);
|
487
480
|
};
|
488
|
-
|
481
|
+
v(A, 300);
|
489
482
|
}
|
490
483
|
return;
|
491
484
|
}
|
492
|
-
c = `${c}${
|
485
|
+
c = `${c}${i.source ? `?utm_source=${i.source}` : ""}${i.medium ? `&utm_medium${i.medium}` : ""}${i.campaign ? `&utm_campaign${i.campaign}` : ""}`, c = c.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${P(s)}${o}`) : window.open(`${P(s)}${c}"e=${c}`), this.removeEventListener("click", e), setTimeout(() => {
|
493
486
|
this.addEventListener("click", e);
|
494
487
|
}, 100);
|
495
488
|
};
|