-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
35 lines (35 loc) · 1.33 KB
/
index.html
File metadata and controls
35 lines (35 loc) · 1.33 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name=description content="An open source revision site/app, made by students, for students">
<title>OpenRevise</title>
</head>
<body>
<noscript>
This website requires JavaScript. Please disable NoScript or any other script blocking
addon/service from your browser. We do not serve ads nor collect analytics.
</noscript>
<script>
// Thanks to John Doherty on Stack Overflow for this genius solution
const lastPath = window.location.pathname.split('/').filter(Boolean).pop()
console.log(lastPath)
switch (lastPath) {
case '':
window.location.replace('/app/pages/master.html')
break
case 'index.html':
window.location.replace('../app/pages/master.html')
break
case 'OpenRevise2':
window.location.replace('/OpenRevise2/app/pages/master.html')
break
default:
alert('You will be redirected to OpenRevise.\n\nError: specified URL not recognized')
document.write('<a href="https://oopdevs.github.io/OpenRevise2/app/master.html">Please visit https://oopdevs.github.io/OpenRevise2/app/master.html</a>')
break
}
</script>
</body>
</html>