You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/03/03 20:33:08 UTC
[9/10] git commit: updates for ios impl
updates for ios impl
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/9bf873be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/9bf873be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/9bf873be
Branch: refs/heads/master
Commit: 9bf873be6c8f84f5ec7cddb8922e1dbcc27009a9
Parents: 95365ec
Author: Fil Maj <fi...@nitobi.com>
Authored: Thu Feb 23 09:52:27 2012 -0800
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri Mar 2 16:03:21 2012 -0800
----------------------------------------------------------------------
lib/plugin/ios/device.js | 31 +++++++++++--------------------
lib/plugin/ios/nativecomm.js | 5 -----
2 files changed, 11 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/9bf873be/lib/plugin/ios/device.js
----------------------------------------------------------------------
diff --git a/lib/plugin/ios/device.js b/lib/plugin/ios/device.js
index 44d6921..c6d117b 100644
--- a/lib/plugin/ios/device.js
+++ b/lib/plugin/ios/device.js
@@ -6,34 +6,25 @@
var exec = require('cordova/exec'),
channel = require('cordova/channel');
- // TODO: pluginize native ios device info so we can call with exec
var Device = function() {
this.platform = null;
this.version = null;
this.name = null;
- this.phonegap = null;
+ this.cordova = null;
this.uuid = null;
- try {
- /*
- this.platform = DeviceInfo.platform;
- this.version = DeviceInfo.version;
- this.name = DeviceInfo.name;
- this.phonegap = DeviceInfo.gap;
- this.uuid = DeviceInfo.uuid;
- */
- var me = this;
- exec(function(deviceinfo) {
- me.platform = deviceinfo.platform;
- /* etc. etc. */
+};
- channel.onCordovaInfoReady.fire();
- }, function() {
- },
- 'DeviceInfo', 'getInfo', []);
+Device.prototype.setInfo = function(info) {
+ try {
+ this.platform = info.platform;
+ this.version = info.version;
+ this.name = info.name;
+ this.cordova = info.gap;
+ this.uuid = info.uuid;
+ channel.onCordovaInfoReady.fire();
} catch(e) {
- // TODO:
+ alert('Error during device info setting in cordova/plugin/ios/device!');
}
- this.available = PhoneGap.available = !!this.uuid;
};
module.exports = new Device();
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/9bf873be/lib/plugin/ios/nativecomm.js
----------------------------------------------------------------------
diff --git a/lib/plugin/ios/nativecomm.js b/lib/plugin/ios/nativecomm.js
index dec76ea..938a68c 100644
--- a/lib/plugin/ios/nativecomm.js
+++ b/lib/plugin/ios/nativecomm.js
@@ -8,8 +8,3 @@ module.exports = function() {
cordova.commandQueue = [];
return json;
};
-
-// TODO: make sure native uses:
-// require('cordova/plugin/ios/nativecomm')();
-// instead of:
-// getAndClearCommandQueue