-
Notifications
You must be signed in to change notification settings - Fork 13
/
index-mobile.html
183 lines (148 loc) · 4.77 KB
/
index-mobile.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="script-src * 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<title>Hello World</title>
<script type="text/javascript" src="cordova.js"></script>
<script src="mobile/fw7/build/js/framework7.js"></script>
<script src="lib/jQuery.js"></script>
<!-- NB: react cant go after the dojo -->
<script src="mobile/react/react.js"></script>
<script type="text/javascript">
dojoConfig = {
isDebug: true,
has: {
"csp-restrictions": false
}
}
</script>
<script src="lib/dojo.xd.js"></script>
<script src="lib/lz-string.js"></script>
<script src="lib/dropbox.js"></script>
<script src="lib/system.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-29812134-1', 'bloodrizer.ru');
ga('send', 'pageview');
</script>
<link rel="stylesheet" href="mobile/fw7/build/css/framework7.ios.css">
<link rel="stylesheet" href="mobile/fw7/build/css/framework7.ios.colors.css">
<link rel="stylesheet" href="mobile/css/ui.css">
<title>Kittens Game - a Dark Souls of incremental gaming</title>
</head>
<body>
<script type="text/javascript">
var version = "_" + Date.now();
game = null;
function _import(i, def, modules){
if (!def){
return System.import(modules[i] + ".js?v=" + version);
} else {
return def.then(function(){
return System.import(modules[i] + ".js?v=" + version);
});
}
}
function bootstrap(){
$("#tooltip").hide();
SystemJS.config({
baseURL: ''
});
var modules = [
"core",
"js/resources",
"js/calendar",
"js/buildings",
"js/village",
"js/science",
"js/workshop",
"js/diplomacy",
"js/religion",
"js/achievements",
"js/space",
"js/prestige",
"js/time",
"js/stats",
"js/challenges",
"game",
"js/ui",
"js/toolbar",
//----- mobile -----
"mobile/js/ui",
"mobile/js/mobile",
"mobile/jsx/widgets/widgets.jsx",
"mobile/jsx/tabs/buildings.jsx",
"mobile/jsx/tabs/village.jsx",
"mobile/jsx/sidebar.jsx",
"mobile/jsx/resources.jsx",
"mobile/jsx/viewport.jsx"
];
var def = System.import('core.js');
for (var i in modules){
def = _import(i, def, modules);
}
def.then(function() {
try {
game = new com.nuclearunicorn.game.ui.GamePage();
game.setUI(new classes.ui.FW7UI("gameContainerId"));
game.load();
game.updateKarma();
game.render();
game.start();
/**
* NB: don't ever try to console.log game
*/
//finally render ui and stuff
setupFW7();
} catch (ex){
console.log(ex);
console.log(new Error().stack);
}
});
}
function onDeviceReady(){
console.log("device is ready, bootstrapping application...");
bootstrap();
}
dojo.addOnLoad(function() {
document.addEventListener('deviceready', onDeviceReady, false);
});
document.addEventListener('deviceready', onDeviceReady, false);
var $r = React.createElement;
function setupFW7(){
console.log("setting fw7 framework...");
var fw7App = new Framework7();
var viewport = $r(WViewport);
React.render(viewport, document.getElementById('viewportContainer'));
}
function wipe(){
if (confirm("All save data will be DESTROYED, are you sure?")){
if (confirm("Are you ABSOLUTELY sure?")) {
gamePage.wipe();
}
}
}
</script>
<!-- not sure if it is such a good idea -->
<div id="viewportContainer" style="height:100%">
Loading...
</div>
</body>
</html>