Updated Branches: refs/heads/master 1d2efa0d2 -> b9b2c6a01
Updating sample project Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/b9b2c6a0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/b9b2c6a0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/b9b2c6a0 Branch: refs/heads/master Commit: b9b2c6a0138893e7829ccea8f5270f13bfd1cf15 Parents: 1d2efa0 Author: Joe Bowser <[email protected]> Authored: Mon Jul 23 10:43:23 2012 -0700 Committer: Joe Bowser <[email protected]> Committed: Mon Jul 23 10:43:23 2012 -0700 ---------------------------------------------------------------------- bin/templates/project/assets/www/index.html | 4 ++-- bin/templates/project/assets/www/js/index.js | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/b9b2c6a0/bin/templates/project/assets/www/index.html ---------------------------------------------------------------------- diff --git a/bin/templates/project/assets/www/index.html b/bin/templates/project/assets/www/index.html index f5cf621..fc9dd1d 100644 --- a/bin/templates/project/assets/www/index.html +++ b/bin/templates/project/assets/www/index.html @@ -2,14 +2,14 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <meta name = "format-detection" content = "telephone=no"> + <meta name = "format-detection" content = "telephone=no"/> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width;" /> <link rel="stylesheet" type="text/css" href="css/index.css" /> <title>Hello Cordova</title> </head> <body> <div class="app"> - <h1>Apache Cordovaâ¢</h1> + <h1>Apache Cordova</h1> <div id="deviceready"> <p class="status pending blink">Connecting to Device</p> <p class="status complete blink hide">Device is Ready</p> http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/b9b2c6a0/bin/templates/project/assets/www/js/index.js ---------------------------------------------------------------------- diff --git a/bin/templates/project/assets/www/js/index.js b/bin/templates/project/assets/www/js/index.js index f3894b8..6140331 100644 --- a/bin/templates/project/assets/www/js/index.js +++ b/bin/templates/project/assets/www/js/index.js @@ -6,10 +6,15 @@ var app = { document.addEventListener('deviceready', this.deviceready, false); }, deviceready: function() { + // note that this is an event handler so the scope is that of the event + // so we need to call app.report(), and not this.report() app.report('deviceready'); }, - report: function(id) { - document.querySelector('#' + id + ' .pending').classList.add('hide'); - document.querySelector('#' + id + ' .complete').classList.remove('hide'); + report: function(id) { + console.log("report:" + id); + // hide the .pending <p> and show the .complete <p> + document.querySelector('#' + id + ' .pending').className += ' hide'; + var completeElem = document.querySelector('#' + id + ' .complete'); + completeElem.className = completeElem.className.split('hide').join(''); } };
