Permalink
Browse files

Further improved About page

  • Loading branch information...
1 parent 7ea339b commit 54ad284a55748a2a948fd9645d3e3a090e846e44 @patspam committed Dec 4, 2009
Showing with 16 additions and 6 deletions.
  1. +9 −0 src/js/Util.js
  2. +7 −6 src/js/Window/About.js
View
@@ -55,6 +55,15 @@ Tarpo.Util.loadDemoData = function(){
Tarpo.store.med.demoData();
}
+/**
+ * Returns the current Tarpo version (retrieved from application.xml)
+ */
+Tarpo.Util.getVersion = function() {
+ var na = air.NativeApplication.nativeApplication;
+ var appXML = new DOMParser().parseFromString(na.applicationDescriptor, "text/xml");
+ return appXML.getElementsByTagName('version')[0].firstChild.nodeValue;
+}
+
/**
* Displays an error box, and optionally outputs trace debugging info
*/
View
@@ -5,21 +5,22 @@
*/
Ext.namespace('Tarpo.Window.About');
+/**
+ * Builds the dynamic elements on the About page.
+ */
Tarpo.Window.About.init = function() {
- var na = air.NativeApplication.nativeApplication;
- var appXML = new DOMParser().parseFromString(na.applicationDescriptor, "text/xml");
- var version = appXML.getElementsByTagName('version')[0].firstChild.nodeValue
+ // Figure out the current Tarpo and AIR version numbers
var details = [
- 'Tarpo Version', version,
- 'Air Runtime Version', na.runtimeVersion,
+ 'Tarpo Version', Tarpo.Util.getVersion(),
+ 'Air Runtime Version', air.NativeApplication.nativeApplication.runtimeVersion,
];
var detailsString = '';
for(var i = 0; i < details.length; i += 2) {
detailsString += details[i] + ": " + details[i+1] + '<br>';
}
document.getElementById('about-version').innerHTML = detailsString;
-
+ // Pull in the contents of the LICENSE file
var license = air.File.applicationDirectory.resolvePath('LICENSE');
var stream = new air.FileStream();
stream.open(license, air.FileMode.READ);

0 comments on commit 54ad284

Please sign in to comment.