-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
108 lines (104 loc) · 6.92 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>ZOOM URL Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script>
(function() {
const vars = {}
const parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value
})
if (vars.jump) {
const device = localStorage.getItem("device")
if (!device) localStorage.setItem("device", confirm("using mobile zoom?"))
const prefix = localStorage.getItem("device") == "true" ? "zoomus" : "zoommtg"
const result = `${prefix}://zoom.us/join?confno=${encodeURIComponent(decodeURIComponent(vars.confno))}&pwd=${encodeURIComponent(decodeURIComponent(vars.pwd))}&uname=${encodeURIComponent(decodeURIComponent(vars.uname))}`
console.log(result)
var a = document.createElement("a")
var p = document.createElement("p")
p.innerText = `Conf ID: ${vars.confno}, Redirect Mode: ${device ? 'Mobile' : 'PC'}`
a.innerText = "If nothing happens, click me to review settings."
a.setAttribute("href", "https://skyzh.github.io/zoom-url-generator/")
document.write(p.outerHTML)
document.write(a.outerHTML)
window.location.replace(result)
}
})()
</script>
<link href="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet">
<!-- <link rel="stylesheet" href="./bootstrap.min.css"> -->
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-6">
<h1>Generate Zoom URL</h1>
<div class="form-group">
<label for="meeting-id">Meeting ID</label>
<input class="form-control" id="meeting-id">
<small class="form-text text-muted">"852-901-5944" is Alex Chi's room. You may test the URL with this meeting id.</small>
<small class="form-text text-muted">This field accept all formats including "852-901-5944", "852 901 5944" or "8529015944". We'll strip all non-digit characters for you.</small>
</div>
<div class="form-group">
<label for="meeting-password">Password</label>
<input class="form-control" id="meeting-password">
</div>
<div class="form-group">
<label for="meeting-name">Name when Joining</label>
<input class="form-control" id="meeting-name">
<small class="form-text text-muted">This is your name after joining the conference room. For English class, you may use your English name + Student ID. In this way you don't have to rename every time you enter the conf room.</small>
</div>
<button class="btn btn-primary" id="btn-generate">Generate</button>
<div class="my-3">PC <input class="form-control" id="meeting-url"></div>
<div class="my-3">Mobile <input class="form-control" id="meeting-url-mobile"></div>
<div class="my-3">Redirect <input class="form-control" id="meeting-url-redirect"></div>
<small class="form-text text-muted">You may save this URL to your Notes app, calendar app or a Word document. Click it and you'll join the meeting.</small>
<small class="form-text text-muted">Redirect URL will automatically jump you to Zoom Mobile URL or Zoom PC URL. By using redirect URL, you will need to select your device type upon first visit. You may reset this config at any time by clicking "Clear LocalStorage"</small>
<div class="my-3">PC <a id="meeting-url-a"></a></div>
<div class="my-3">Mobile <a id="meeting-url-a-mobile"></a></div>
<div class="my-3">Redirect <a id="meeting-url-a-redirect"></a></div>
<button class="btn btn-primary" id="btn-clear">Clear LocalStorage</button>
<small class="form-text text-info" id="text-info"></small>
<small class="form-text text-muted">If you're using this web page as URL redirector in sjtu-class-table-generator, and you select wrong device when being prompted, you may click this button to clear information.</small>
<h1 class="mt-3">Known Issues</h1>
<p class="mb-3">Firefox might not pass encoded URL correctly to ZOOM. Please use other browsers to open these URL.</p>
</div>
</div>
</div>
<!-- <script src="./jquery-3.4.1.min.js"></script> -->
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<!-- <script src="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script> -->
<script>
const BASE = "https://skyzh.github.io/zoom-url-generator"
// const BASE = ""
$(document).ready(() => {
$("#meeting-id").val("852-901-5944")
$("#meeting-password").val("")
$("#meeting-name").val("Nobody - 51800000000")
$("#btn-clear").click(() => {
localStorage.clear()
$("#text-info").text("information reset succeed")
})
$("#btn-generate").click(() => {
const id = $("#meeting-id").val().replace(/\D/g,'')
const pwd = $("#meeting-password").val().replace(/\D/g,'')
const name = $("#meeting-name").val().trim()
const result = `zoommtg://zoom.us/join?confno=${id}&pwd=${pwd}&uname=${encodeURIComponent(name)}`
$("#meeting-url").val(result)
$("#meeting-url-a").attr("href", result)
$("#meeting-url-a").text(result)
const result_mobile = `zoomus://zoom.us/join?confno=${id}&pwd=${pwd}&uname=${encodeURIComponent(name)}`
$("#meeting-url-mobile").val(result_mobile)
$("#meeting-url-a-mobile").attr("href", result_mobile)
$("#meeting-url-a-mobile").text(result_mobile)
const redirect_url = `${BASE}/?jump=true&confno=${id}&pwd=${pwd}&uname=${encodeURIComponent(name)}`
$("#meeting-url-redirect").val(redirect_url)
$("#meeting-url-a-redirect").attr("href", redirect_url)
$("#meeting-url-a-redirect").text(redirect_url)
})
})
</script>
</body>
</html>