From c7b5edf0351d678d26b17eb5e2f995a140e209bb Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Wed, 8 Feb 2012 14:38:25 -0800 Subject: Added manifest.json, and image file required for being a packaged chrome application. Removed the old versions.json and updated the main page to detect if it is running as a chrome app and retrieve the version info from the chrome.app object. If the app is running hosted, the code will use an XHR to load the manifest.json and retrieve the version number from it directly. --- index.html | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index f3018823..53bd6605 100644 --- a/index.html +++ b/index.html @@ -172,21 +172,35 @@ if(navigator.userAgent.toLowerCase().indexOf("chrome") === -1) { window.location = "./redirect.html"; } - // Load the version json - var req = new XMLHttpRequest(); - req.open("GET", "versions.json"); - req.onreadystatechange = (function(req) { - return function(event) { - if (req.readyState === 4) { - if (req.status === 200) { - window.ninjaVersion = JSON.parse(req.responseText); - } else { - console.log("Ninja version file could not be loaded"); + window.ninjaVersion = {}; + window.ninjaVersion.ninja = {}; + if (window.chrome.app.isInstalled) { + // Ninja is running as an installed app, started via the app launcher. + var info = chrome.app.getDetails(); + if(info) { + window.ninjaVersion.ninja.version = info.version; + } + } else { + // Ninja is running via a bookmark/link as a hosted web application. + // Load the version json + var req = new XMLHttpRequest(); + req.open("GET", "manifest.json"); + req.onreadystatechange = (function(req) { + return function(event) { + if (req.readyState === 4) { + if (req.status === 200) { + var manifestInfo = JSON.parse(req.responseText); + if(manifestInfo) { + window.ninjaVersion.ninja.version = manifestInfo.version; + } + } else { + console.log("Ninja version file could not be loaded"); + } } } - } - })(req); - req.send(); + })(req); + req.send(); + } // var star = document.getElementById('star'); // -- cgit v1.2.3 From 5708e1728b92c750b9cbdf1b2ff10a8e0e46253c Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Thu, 9 Feb 2012 09:30:42 -0800 Subject: Implemented final splash screen, the credits page and the license page --- index.html | 291 +++++++++++++------------------------------------------------ 1 file changed, 59 insertions(+), 232 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 53bd6605..306906c2 100644 --- a/index.html +++ b/index.html @@ -8,20 +8,19 @@
-Version: 0.0.0.0
+Copyright © 2012 Motorola Mobility, Inc. All rights reserved.
+The Ninja application is made possible by the Ninja open source project and other open source software.
+Ninja is available under BSD License.
+