-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
22 lines (18 loc) · 1.35 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
var clipboard = new Clipboard('.clipboard');
let code =(id,bg)=>{
if(bg) var abg = "&bg="+bg; else abg = ""
document.querySelector('#code').innerHTML = `
<pre class=" language-html"><code class=" language-html" id="code"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>https://cdn.jsdelivr.net/gh/sh20raj/soploader/sl.js?id=${id}&t=2${abg}<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script language-javascript"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
</code></pre>
`;// <script src="https://soploader.sh20raj.repl.co/sl.js?id=${id}&t=2${abg}"></script>
document.querySelector('#preview').href = "preview.html?id="+id+""+abg;
}
function copy_data(containerid) {
var range = document.createRange();
range.selectNode(containerid); //changed here
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand("copy");
window.getSelection().removeAllRanges();
alert("Code Copied!");
}