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