diff options
author | Ananya Sen | 2012-02-08 15:37:23 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-08 15:37:23 -0800 |
commit | ab6f2f7ada39a9b27408575af9a565daf0a9d291 (patch) | |
tree | 92a796e34530d1a724ddb24ef22e59ffef13c12a | |
parent | 36b2e540f06cef3887e7d0fea60527fee51e2a40 (diff) | |
parent | 5a69d5be181ea98fa842977885ebd8c861dda6ca (diff) | |
download | ninja-ab6f2f7ada39a9b27408575af9a565daf0a9d291.tar.gz |
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into FileIO
100 files changed, 3297 insertions, 865 deletions
@@ -125,21 +125,35 @@ | |||
125 | if(navigator.userAgent.toLowerCase().indexOf("chrome") === -1) { | 125 | if(navigator.userAgent.toLowerCase().indexOf("chrome") === -1) { |
126 | window.location = "./redirect.html"; | 126 | window.location = "./redirect.html"; |
127 | } | 127 | } |
128 | // Load the version json | 128 | window.ninjaVersion = {}; |
129 | var req = new XMLHttpRequest(); | 129 | window.ninjaVersion.ninja = {}; |
130 | req.open("GET", "versions.json"); | 130 | if (window.chrome.app.isInstalled) { |
131 | req.onreadystatechange = (function(req) { | 131 | // Ninja is running as an installed app, started via the app launcher. |
132 | return function(event) { | 132 | var info = chrome.app.getDetails(); |
133 | if (req.readyState === 4) { | 133 | if(info) { |
134 | if (req.status === 200) { | 134 | window.ninjaVersion.ninja.version = info.version; |
135 | window.ninjaVersion = JSON.parse(req.responseText); | 135 | } |
136 | } else { | 136 | } else { |
137 | console.log("Ninja version file could not be loaded"); | 137 | // Ninja is running via a bookmark/link as a hosted web application. |
138 | // Load the version json | ||
139 | var req = new XMLHttpRequest(); | ||
140 | req.open("GET", "manifest.json"); | ||
141 | req.onreadystatechange = (function(req) { | ||
142 | return function(event) { | ||
143 | if (req.readyState === 4) { | ||
144 | if (req.status === 200) { | ||
145 | var manifestInfo = JSON.parse(req.responseText); | ||
146 | if(manifestInfo) { | ||
147 | window.ninjaVersion.ninja.version = manifestInfo.version; | ||
148 | } | ||
149 | } else { | ||
150 | console.log("Ninja version file could not be loaded"); | ||
151 | } | ||
138 | } | 152 | } |
139 | } | 153 | } |
140 | } | 154 | })(req); |
141 | })(req); | 155 | req.send(); |
142 | req.send(); | 156 | } |
143 | // | 157 | // |
144 | var star = document.getElementById('star'); | 158 | var star = document.getElementById('star'); |
145 | // | 159 | // |
diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js index a68a7d6b..bc433f52 100755 --- a/js/components/combobox.reel/combobox.js +++ b/js/components/combobox.reel/combobox.js | |||
@@ -15,7 +15,7 @@ exports.Combobox = Montage.create(Component, { | |||
15 | }, | 15 | }, |
16 | 16 | ||
17 | _wasSetByCode: { | 17 | _wasSetByCode: { |