You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pp...@apache.org on 2013/05/17 16:22:12 UTC

[02/21] js commit: [Tizen, Tizen SDK 2.0, Device.js)

[Tizen, Tizen SDK 2.0, Device.js)

1 - getDeviceInfo method of Device now fires channel.onCordovaInfoReady
2 - Device Constructor calls getDeviceInfo()


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/d263377d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/d263377d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/d263377d

Branch: refs/heads/master
Commit: d263377de2f0c738f9bc88e0914ffac93be50736
Parents: 03d3382
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 10 16:21:23 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:13 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Device.js |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/d263377d/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js
index c97c04e..6c80f92 100644
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@ -32,14 +32,31 @@ function Device() {
     this.model = null;
     this.cordova = "2.5.0";
     this.platform = "Tizen";
+    
+   
+    this.getDeviceInfo()
+    
 }
 
-Device.prototype.getDeviceInfo = function(success, fail, args) {
-    var systemInfo =  tizen.systeminfo.getCapabilities();
-   
-    this.version = systemInfo.platformVersion;
-    this.uuid = systemInfo.duid;
-    this.model = systemInfo.platformName;
+Device.prototype.getDeviceInfo = function() {
+    
+    var deviceCapabilities =  tizen.systeminfo.getCapabilities();
+    
+    if (deviceCapabilities) {
+        
+        this.version = deviceCapabilities.platformVersion;
+        this.uuid = deviceCapabilities.duid;
+        this.model = deviceCapabilities.platformName;
+    
+        channel.onCordovaInfoReady.fire();
+     }
+     else {
+         console.log("error initializing cordova: ");
+     }
+
+
 };
 
 module.exports = new Device();
+
+