39 lines
1.1 KiB
HTML
39 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<meta charset="UTF-8">
|
|
<meta name=viewport content="width=device-width, initial-scale=1">
|
|
|
|
<input type="text" placeholder="Nice Name" id="nicename">
|
|
<input type="text" placeholder="name_invite.txt" id="filename">
|
|
<p>
|
|
<textarea rows="1" cols="100" readonly onclick="this.focus();this.select()" id="out">https://zirk.arti.ee/22/invite</textarea>
|
|
</p>
|
|
|
|
<script>
|
|
var nicename = document.getElementById("nicename");
|
|
var filename = document.getElementById("filename");
|
|
var out = document.getElementById("out");
|
|
|
|
nicename.addEventListener("input", newLink);
|
|
filename.addEventListener("input", newLink);
|
|
|
|
|
|
function newLink(e) {
|
|
var base = "https://zirk.arti.ee/22/invite/";
|
|
n = nicename.value;
|
|
f = filename.value;
|
|
|
|
if (f === "") {
|
|
//f = n.toLowerCase() + "_invite.txt";
|
|
f= "invite_from_arti_to_"+n.toLowerCase()+".txt";
|
|
filename.setAttribute("placeholder", f);
|
|
}
|
|
jsonObj = n;
|
|
jsonStr = JSON.stringify(jsonObj);
|
|
out.innerText = base + "?" + window.encodeURIComponent(window.btoa(jsonStr));
|
|
}
|
|
|
|
</script>
|
|
|
|
</html>
|