-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
115 lines (99 loc) · 4.39 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
let text = "wanna try new version ? ";
if (confirm(text) == true) {
window.location.href = "https://kkupgrader.eu.org/tools/";
}
(function() {
var observer = new IntersectionObserver(onIntersect);
document.querySelectorAll("[data-src]").forEach((img) => {
observer.observe(img);
});
function onIntersect(entries) {
entries.forEach((entry) => {
if (entry.target.getAttribute("data-processed") || !entry.isIntersecting)
return true;
entry.target.setAttribute("src", entry.target.getAttribute("data-src"));
entry.target.setAttribute("data-processed", true);
entry.target.classList.remove("lazy");
});
}
})();
function loadCSS(e, t, n) {
"use strict";
var i = window.document.createElement("link");
var o = t || window.document.getElementsByTagName("script")[0];
i.rel = "stylesheet";
i.href = e;
i.media = "only x";
o.parentNode.insertBefore(i, o);
setTimeout(function() { i.media = n || "all" })
}
var prism_js = document.createElement("script");
function addCopyButtons(t) {
document.querySelectorAll("pre > code").forEach(function(n) {
var e = document.createElement("button");
(e.className = "copyify"),
(e.classList.add("btn")),
(e.type = "button"),
(e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z" fill="rgba(0,143,229,1)"/></svg>'),
e.addEventListener("click", function() {
t.writeText(n.innerText).then(
function() {
e.blur(),
(e.innerHTML =
' <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><style>@keyframes check{to{stroke-dashoffset: 0;}}</style><path stroke="#0A0A30" stroke-linecap="round" stroke-width="1.5" d="M5.387 12.68l3.955 3.956 9.271-9.272" style="animation:check 2s infinite cubic-bezier(.99,-.1,.01,1.02)" stroke-dashoffset="100" stroke-dasharray="100"/></svg>'),
setTimeout(function() {
e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z" fill="rgba(0,143,229,1)"/></svg>';
}, 2000);
},
function(t) {
e.innerText = "Error";
}
);
});
var o = n.parentNode;
if (o.parentNode.classList.contains("highlight")) {
var i = o.parentNode;
i.parentNode.insertBefore(e, i);
} else o.parentNode.insertBefore(e, o);
});
}
if (
((prism_js.src =
"/plugins/prism/prism.js"),
(prism_js.onload = function() {
loadCSS("/plugins/prism/prism.css");
Prism.highlightAll();
}),
document.body.appendChild(prism_js),
navigator && navigator.clipboard)
)
addCopyButtons(navigator.clipboard);
else {
var copy_btn = document.createElement("script");
(copy_btn.src =
"https://cdnjs.cloudflare.com/ajax/libs/clipboard-polyfill/2.7.0/clipboard-polyfill.promise.js"),
(copy_btn.integrity =
"sha256-waClS2re9NUbXRsryKoof+F9qc1gjjIhc2eT7ZbIv94="),
(copy_btn.crossOrigin = "anonymous"),
(copy_btn.onload = function() {
addCopyButtons(clipboard);
}),
document.body.appendChild(copy_btn);
}
////$(".Copy").on("click", copyToClipboard);
//function copyToClipboard() {
//var copyText = $(".CopyThis").val();
// navigator.clipboard.writeText(copyText).then(() => {
// Alert the user that the action took place.
// Nobody likes hidden stuff being done under the hood!
// alert("Copied to clipboard");
// });
//}
//var creditsyear = new Date().getFullYear();
// document.querySelector(".date").innerHTML = creditsyear;
//var script = document.createElement("script");
/////script.src = "";
//script.onload = function () {
///
//};
//document.body.appendChild(script);