Skip to content

Commit 08c33d5

Browse files
committed
Removed unneeded semicolons
1 parent 5cb4c79 commit 08c33d5

File tree

4 files changed

+365
-365
lines changed

4 files changed

+365
-365
lines changed
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
11
// Add back-to-top button
22

33
// Create/style button
4-
const button = document.createElement('button');
5-
button.classList.add('back-to-top');
4+
const button = document.createElement('button')
5+
button.classList.add('back-to-top')
66

77
// Create button SVG
8-
const svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
9-
svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
10-
svgElement.setAttribute('height', '2em');
11-
svgElement.setAttribute('viewBox', '0 0 448 512');
8+
const svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
9+
svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg')
10+
svgElement.setAttribute('height', '2em')
11+
svgElement.setAttribute('viewBox', '0 0 448 512')
1212

1313
// Create button SVG path
14-
const pathElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');
15-
pathElement.setAttribute('d', 'M246.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 109.3 361.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160zm160 352l-160-160c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 301.3 361.4 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z');
14+
const pathElement = document.createElementNS('http://www.w3.org/2000/svg', 'path')
15+
pathElement.setAttribute('d', 'M246.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 109.3 361.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160zm160 352l-160-160c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 301.3 361.4 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z')
1616

1717
// Merge elements
18-
svgElement.append(pathElement); button.append(svgElement);
19-
document.body.append(button);
18+
svgElement.append(pathElement) ; button.append(svgElement)
19+
document.body.append(button)
2020

2121
function fadeIn(el, duration) {
22-
if (el.classList.contains('done')) return;
23-
el.classList.add('done'); el.style.opacity = 0;
24-
let last = +new Date();
22+
if (el.classList.contains('done')) return
23+
el.classList.add('done') ; el.style.opacity = 0
24+
let last = +new Date()
2525
const tick = () => {
26-
el.style.opacity = +el.style.opacity + (new Date() - last) / duration;
27-
last = +new Date();
26+
el.style.opacity = +el.style.opacity + (new Date() - last) / duration
27+
last = +new Date()
2828
if (+el.style.opacity < 1)
2929
(window.requestAnimationFrame && requestAnimationFrame(tick)) ||
30-
setTimeout(tick, 16);
31-
else el.style.display = 'block';
32-
};
33-
tick();
30+
setTimeout(tick, 16)
31+
else el.style.display = 'block'
32+
}
33+
tick()
3434
}
3535

3636
function fadeOut(el, duration) {
37-
if (!el.classList.contains('done')) return;
38-
el.classList.remove('done'); el.style.opacity = 1;
39-
let last = +new Date();
37+
if (!el.classList.contains('done')) return
38+
el.classList.remove('done') ; el.style.opacity = 1
39+
let last = +new Date()
4040
const tick = () => {
41-
el.style.opacity = +el.style.opacity - (new Date() - last) / duration;
42-
last = +new Date();
41+
el.style.opacity = +el.style.opacity - (new Date() - last) / duration
42+
last = +new Date()
4343
if (+el.style.opacity > 0)
4444
(window.requestAnimationFrame && requestAnimationFrame(tick)) ||
45-
setTimeout(tick, 16);
46-
else el.style.display = 'none';
47-
};
48-
tick();
45+
setTimeout(tick, 16)
46+
else el.style.display = 'none'
47+
}
48+
tick()
4949
}
5050

5151
function scrollToTop() {
5252
const c = document.documentElement.scrollTop || document.body.scrollTop;
5353
if (c > 0) {
54-
window.requestAnimationFrame(scrollToTop);
55-
window.scrollTo(0, c - c / 8);
54+
window.requestAnimationFrame(scrollToTop)
55+
window.scrollTo(0, c - c / 8)
5656
}
5757
}
58-
button.addEventListener('click', scrollToTop);
58+
button.addEventListener('click', scrollToTop)
5959

6060
window.addEventListener('scroll', () => {
6161
const scrollTop = window.scrollY || document.documentElement.scrollTop;
62-
if (scrollTop > 0) fadeIn(button, 500);
63-
else fadeOut(button, 500);
64-
});
62+
if (scrollTop > 0) fadeIn(button, 500)
63+
else fadeOut(button, 500)
64+
});

docs/assets/js/src/copy-code-button.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
return (s =
66
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
77
? function (o) {
8-
return typeof o;
8+
return typeof o
99
}
1010
: function (o) {
11-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
12-
})(o);
11+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o
12+
})(o)
1313
}
1414
!(function (o, e) {
15-
void 0 === e && (e = {});
16-
var t = e.insertAt;
15+
void 0 === e && (e = {})
16+
var t = e.insertAt
1717
if (o && "undefined" != typeof document) {
1818
var n = document.head || document.getElementsByTagName("head")[0],
1919
c = document.createElement("style");
20-
(c.type = "text/css"), "top" === t && n.firstChild ? n.insertBefore(c, n.firstChild) : n.append(c), c.styleSheet ? (c.styleSheet.cssText = o) : c.append(document.createTextNode(o));
20+
(c.type = "text/css"), "top" === t && n.firstChild ? n.insertBefore(c, n.firstChild) : n.append(c), c.styleSheet ? (c.styleSheet.cssText = o) : c.append(document.createTextNode(o))
2121
}
2222
})(
2323
".docsify-copy-code-button,.docsify-copy-code-button span{cursor:pointer}.docsify-copy-code-button{position:absolute;z-index:1;top:0;right:0;overflow:visible;padding:.65em .8em;border:0;border-radius:0;outline:0;font-size:1em;background:grey;background:var(--theme-color,grey);color:#fff;opacity:1}.docsify-copy-code-button span{border-radius:3px;background:inherit;pointer-events:none}.docsify-copy-code-button .error,.docsify-copy-code-button .success{position:absolute;z-index:1000;top:24px;left:12px;padding:.5em .65em;font-size:.825em;opacity:0;transform:translateX(-88%)translateY(-50%)}.docsify-copy-code-button.error .error,.docsify-copy-code-button.success .success{left:12px;top:24px;opacity:1;,pre:hover .docsify-copy-code-button{opacity:1}"
@@ -27,65 +27,65 @@
2727
init: function () {
2828
return function (o, e) {
2929
o.ready(function () {
30-
console.warn("[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary.");
31-
});
32-
};
30+
console.warn("[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary.")
31+
})
32+
}
3333
},
3434
}),
3535
(window.$docsify = window.$docsify || {}),
3636
(window.$docsify.plugins = [
3737
function (o, r) {
3838
o.doneEach(function () {
3939
var o = Array.apply(null, document.querySelectorAll("pre[data-lang]")),
40-
c = { buttonText: "<> Copy code", errorText: "Error", successText: "Code copied!" };
40+
c = { buttonText: "<> Copy code", errorText: "Error", successText: "Code copied!" }
4141
r.config.copyCode &&
4242
Object.keys(c).forEach(function (t) {
43-
var n = r.config.copyCode[t];
43+
var n = r.config.copyCode[t]
4444
"string" == typeof n
4545
? (c[t] = n)
4646
: "object" === s(n) &&
4747
Object.keys(n).some(function (o) {
48-
var e = -1 < location.href.indexOf(o);
49-
return (c[t] = e ? n[o] : c[t]), e;
50-
});
51-
});
48+
var e = -1 < location.href.indexOf(o)
49+
return (c[t] = e ? n[o] : c[t]), e
50+
})
51+
})
5252
var e = [
5353
'<button class="docsify-copy-code-button">',
5454
'<span class="label">'.concat(c.buttonText, "</span>"),
5555
'<span class="error">'.concat(c.errorText, "</span>"),
5656
'<span class="success">'.concat(c.successText, "</span>"),
5757
"</button>",
58-
].join("");
58+
].join("")
5959
o.forEach(function (o) {
6060
o.insertAdjacentHTML("beforeend", e);
61-
});
61+
})
6262
}),
6363
o.mounted(function () {
6464
document.querySelector(".content").addEventListener("click", function (o) {
6565
if (o.target.classList.contains("docsify-copy-code-button")) {
6666
var e = "BUTTON" === o.target.tagName ? o.target : o.target.parentNode,
6767
t = document.createRange(),
6868
n = e.parentNode.querySelector("code"),
69-
c = window.getSelection();
70-
t.selectNode(n), c.removeAllRanges(), c.addRange(t);
69+
c = window.getSelection()
70+
t.selectNode(n), c.removeAllRanges(), c.addRange(t)
7171
try {
7272
document.execCommand("copy") &&
7373
(e.classList.add("success"), e.querySelector('.label').style.display = 'none',
7474
setTimeout(function () {
75-
e.classList.remove("success");
76-
e.querySelector('.label').style.display = 'inline';
77-
}, 2000));
75+
e.classList.remove("success")
76+
e.querySelector('.label').style.display = 'inline';
77+
}, 2000))
7878
} catch (o) {
7979
console.error("docsify-copy-code: ".concat(o)),
8080
e.classList.add("error"),
8181
setTimeout(function () {
82-
e.classList.remove("error");
82+
e.classList.remove("error")
8383
}, 2000);
8484
}
85-
"function" == typeof (c = window.getSelection()).removeRange ? c.removeRange(t) : "function" == typeof c.removeAllRanges && c.removeAllRanges();
85+
"function" == typeof (c = window.getSelection()).removeRange ? c.removeRange(t) : "function" == typeof c.removeAllRanges && c.removeAllRanges()
8686
}
87-
});
88-
});
87+
})
88+
})
8989
},
90-
].concat(window.$docsify.plugins || []));
91-
})();
90+
].concat(window.$docsify.plugins || []))
91+
})();

0 commit comments

Comments
 (0)