-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (38 loc) · 1.41 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
<!DOCTYPE html>
<html>
<head>
<title>SuDoh</title>
<script type="text/javascript">
// Setup our "enjo" variable to track what is available to us
if (typeof enjo === 'undefined') {
enjo = window.Enjo || {};
enjo.WEBOS_AVAILABLE = false;
enjo.ENYO_AVAILABLE = true;
enjo.MOJO_AVAILABLE = false;
if (window.PalmSystem) {
enjo.WEBOS_AVAILABLE = true;
enjo.MOJO_AVAILABLE = true;
var deviceInfo = JSON.parse(PalmSystem.deviceInfo);
if (deviceInfo) {
var majorVersion = deviceInfo["platformVersionMajor"];
if (majorVersion < 3) {
enjo.ENYO_AVAILABLE = false;
}
}
}
}
// Parse our location, and start building out the new location
var currentLocation = window.location.href;
var newLocation = currentLocation.substr(0, currentLocation.lastIndexOf('/') + 1);
// Run logic to determine what file to load
if (enjo.ENYO_AVAILABLE) {
newLocation += "enyo";
} else {
newLocation += "mojo";
}
newLocation += ".html";
// Redirect to the correct file for this environment
window.location.href = newLocation;
</script>
</head>
</html>