-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
78 lines (75 loc) · 3.91 KB
/
index.html
File metadata and controls
78 lines (75 loc) · 3.91 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
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>eSeeCode</title>
<meta name="author" content="Jacobo Vilella Vilahur" />
<meta name="description" content="Easy computer programming eLearning development platform for schools and fun" />
<meta name="keywords" content="esee,code,eseecode,programming,school" />
<link rel="manifest" href="manifest.json">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, interactive-widget=overlays-content" />
<meta name="application-name" content="eSeeCode">
<link rel="icon" href="images/favicon.svg" type="image/svg+xml">
<!-- The lines below are for Chrome devices only -->
<meta name="mobile-web-app-capable" content="yes">
<!-- The lines below are for Apple devices only -->
<link rel="mask-icon" href="images/favicon.svg" />
<link rel="apple-touch-icon" href="images/favicon.png" color="green" />
<link rel="apple-touch-startup-image" href="images/favicon.png" color="#000000">
<meta name="apple-mobile-web-app-title" content="eSeeCode">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<body>
<script type="text/javascript">
// To keep JS synthax backwards compatible in this feature-testing page, arguments is used instead of the spread operator, var here is used instead of const, function() is used instead of arrow functions
try { // Feature-test the browser for compatibility
// Test if the browser supports ECMAScript 2017, CSS Grid and PointerEvent
eval("(async function() {})()");
if (
typeof URLSearchParams == "undefined" ||
typeof JSON === "undefined" ||
!Array.prototype.map ||
!("PointerEvent" in window) ||
typeof CSS === "undefined" ||
!CSS.supports ||
!CSS.supports("display", "grid") ||
!CSS.supports("width", "max-content")
) throw new Error("incompatbile browser");
// Shorthands for debugging
function ñ() { console.log.apply(this, arguments); }
function ññ() { console.log.apply(this, Array.from(arguments).map(function(arg) { var o; try { o = JSON.parse(JSON.stringify(arg)) } catch(e) { o = "*****" + JSON.stringify(arg) }; return { frozen: o, live: arg, typeof: typeof arg, }; })); }
// Run
function init(v) {
var el = document.createElement("script");
el.type = "text/javascript";
el.src = "js/eseecode.js" + (v ? '?v=' + v : '');
document.body.appendChild(el);
}
var v = (new URLSearchParams(window.location.search)).get("v");
if (v === "") v = Date.now(); // ?v= is passed without value
if (v) {
init(v);
} else {
// No explicit v= parameter, default to the version number so when there is a version bump all files are refreshed
window.$e = {};
const el = document.createElement("script");
el.onload = function() {
document.title = $e.platform.name;
init($e.platform.version);
};
el.setAttribute("src", "js/init.js?=" + Date.now()); // We want to make sure the file containing the version number is always refreshed
document.head.appendChild(el);
}
} catch (error) {
console.error(error);
const timeToRedirect = 10;
document.body.innerHTML = "<p><b>The latest eSeeCode version is not compatible with your browser!</b></p>";
document.body.innerHTML += "<p>Please use one of the following browsers:<ul><li>Chrome >= 57</li><li>Edge >= 79</li><li>Firefox >= 66</li><li>Safari >= 13</li><li>Opera >= 44</li></ul></p>";
document.body.innerHTML += "<p><i>Alternatively, <a href=\"https://play.eseecode.com/versions\">you can try using an older version of eSeeCode</a>.</i></p>";
document.body.innerHTML += "<p>In " + timeToRedirect + " seconds you will be automatically redirected to eSeeCode version 2.4 (released in 2016) as a fallback for compatibility with your device.</p>";
setTimeout(function () { window.location.href = "https://play.eseecode.com/2.4"; }, timeToRedirect * 1000);
}
</script>
</body>
</html>