-
Notifications
You must be signed in to change notification settings - Fork 1
/
initializing.php
46 lines (34 loc) · 982 Bytes
/
initializing.php
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
<script>
const _default_language = "en";
var language = <?php print json_encode($GLOBALS["translations"]); ?>;
function hasWebGL() {
var supported;
try {
var canvas = document.createElement('canvas');
supported = !!window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl'));
} catch(e) {
supported = false;
}
try {
// let is by no means required, but will help us rule out some old browsers/devices with potentially buggy implementations: http://caniuse.com/#feat=let
eval('let foo = 123;');
} catch (e) {
supported = false;
}
if (!supported) {
l(language[lang]["webgl_not_supported"]);
}
canvas = undefined;
return supported;
}
var has_webgl = hasWebGL();
var git_hash = "<?php print get_git_hash(); ?>";
if(!git_hash) {
console.error("git_hash not defined");
}
var original_title = document.title;
var traindata_struct =
<?php
include("traindata.php");
?>
</script>