diff options
author | Pushkar Joshi | 2012-02-08 15:42:40 -0800 |
---|---|---|
committer | Pushkar Joshi | 2012-02-08 15:42:40 -0800 |
commit | 18243deb66ab14a014756bfb0be1a52648c7771a (patch) | |
tree | c64660f7f69840cac5186fd730221335bd0a67af /index.html | |
parent | 802e92eb70b00849dadacf2c6590d27edbe65d99 (diff) | |
parent | 0537f8f29e7b8dd48fd08f20b1533fbe92a54c4b (diff) | |
download | ninja-18243deb66ab14a014756bfb0be1a52648c7771a.tar.gz |
Merge branch 'master' into pentool
Conflicts:
js/helper-classes/RDGE/GLWorld.js
js/helper-classes/RDGE/MaterialsLibrary.js
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 40 |
1 files changed, 27 insertions, 13 deletions
@@ -172,21 +172,35 @@ | |||
172 | if(navigator.userAgent.toLowerCase().indexOf("chrome") === -1) { | 172 | if(navigator.userAgent.toLowerCase().indexOf("chrome") === -1) { |
173 | window.location = "./redirect.html"; | 173 | window.location = "./redirect.html"; |
174 | } | 174 | } |
175 | // Load the version json | 175 | window.ninjaVersion = {}; |
176 | var req = new XMLHttpRequest(); | 176 | window.ninjaVersion.ninja = {}; |
177 | req.open("GET", "versions.json"); | 177 | if (window.chrome.app.isInstalled) { |
178 | req.onreadystatechange = (function(req) { | 178 | // Ninja is running as an installed app, started via the app launcher. |
179 | return function(event) { | 179 | var info = chrome.app.getDetails(); |
180 | if (req.readyState === 4) { | 180 | if(info) { |
181 | if (req.status === 200) { | 181 | window.ninjaVersion.ninja.version = info.version; |
182 | window.ninjaVersion = JSON.parse(req.responseText); | 182 | } |
183 | } else { | 183 | } else { |
184 | console.log("Ninja version file could not be loaded"); | 184 | // Ninja is running via a bookmark/link as a hosted web application. |
185 | // Load the version json | ||
186 | var req = new XMLHttpRequest(); | ||
187 | req.open("GET", "manifest.json"); | ||
188 | req.onreadystatechange = (function(req) { | ||
189 | return function(event) { | ||
190 | if (req.readyState === 4) { | ||
191 | if (req.status === 200) { | ||
192 | var manifestInfo = JSON.parse(req.responseText); | ||
193 | if(manifestInfo) { | ||
194 | window.ninjaVersion.ninja.version = manifestInfo.version; | ||
195 | } | ||
196 | } else { | ||
197 | console.log("Ninja version file could not be loaded"); | ||
198 | } | ||
185 | } | 199 | } |
186 | } | 200 | } |
187 | } | 201 | })(req); |
188 | })(req); | 202 | req.send(); |
189 | req.send(); | 203 | } |
190 | // | 204 | // |
191 | var star = document.getElementById('star'); | 205 | var star = document.getElementById('star'); |
192 | // | 206 | // |