Permalink
Browse files

updated to version 0.9.6

  • Loading branch information...
1 parent 2465729 commit 15ae7d101d619edaf63bb2bd713645582533d448 stevengill committed Jun 28, 2011
Showing with 1,826 additions and 730 deletions.
  1. +1 −1 Android/Sample/assets/www/index.html
  2. +54 −70 Android/Sample/assets/www/{phonegap.0.9.5.1.js → phonegap.0.9.6.js}
  3. BIN Android/Sample/libs/phonegap.0.9.5.1.jar
  4. BIN Android/Sample/libs/phonegap.0.9.6.jar
  5. BIN Android/phonegap.0.9.5.1.jar
  6. BIN Android/phonegap.0.9.6.jar
  7. +54 −70 Android/{phonegap.0.9.5.1.js → phonegap.0.9.6.js}
  8. +8 −0 Android/phonegap.0.9.6.min.js
  9. +2 −1 Bada/VERSION
  10. +2 −2 BlackBerry-WebWorks/LICENSE
  11. +1 −1 BlackBerry-WebWorks/VERSION
  12. +4 −4 BlackBerry-WebWorks/build.xml
  13. +9 −0 BlackBerry-WebWorks/changes.txt
  14. +1 −1 BlackBerry-WebWorks/framework/ext/src/com/phonegap/device/Device.java
  15. +376 −0 BlackBerry-WebWorks/framework/ext/src/com/phonegap/network/ConnectionInfoAction.java
  16. +16 −2 BlackBerry-WebWorks/framework/ext/src/com/phonegap/network/Network.java
  17. +1 −1 BlackBerry-WebWorks/framework/ext/src/library.xml
  18. +22 −7 BlackBerry-WebWorks/javascript/_phonegap.js
  19. +51 −1 BlackBerry-WebWorks/javascript/network.js
  20. +1 −1 BlackBerry-WebWorks/template/project/www/config.xml
  21. +23 −3 BlackBerry-WebWorks/template/project/www/index.html
  22. 0 BlackBerry-WebWorks/template/project/www/{javascript → }/json2.js
  23. +7 −0 Documentation/_index.html
  24. +1 −1 Documentation/_index.json
  25. +5 −0 Documentation/index.html
  26. +13 −24 Documentation/phonegap_accelerometer_accelerometer.md.html
  27. +5 −7 Documentation/phonegap_camera_camera.md.html
  28. +10 −18 Documentation/phonegap_compass_compass.md.html
  29. +189 −0 Documentation/phonegap_connection_connection.md.html
  30. +25 −48 Documentation/phonegap_contacts_contacts.md.html
  31. +16 −30 Documentation/phonegap_device_device.md.html
  32. +313 −22 Documentation/phonegap_events_events.md.html
  33. +14 −25 Documentation/phonegap_file_file.md.html
  34. +16 −30 Documentation/phonegap_geolocation_geolocation.md.html
  35. +1 −0 Documentation/phonegap_media_capture_CaptureError.md.html
  36. +65 −8 Documentation/phonegap_media_capture_capture.md.html
  37. +19 −36 Documentation/phonegap_media_media.md.html
  38. +9 −11 Documentation/phonegap_network_network.md.html
  39. +13 −24 Documentation/phonegap_notification_notification.md.html
  40. +19 −36 Documentation/phonegap_storage_storage.md.html
  41. +2 −1 Symbian/VERSION
  42. +2 −0 VERSION
  43. +188 −0 changes.txt
  44. BIN iOS/PhoneGapInstaller.pkg
  45. +139 −0 iOS/README.md
  46. +1 −2 webOS/Makefile
  47. +20 −21 webOS/README.md
  48. +2 −1 webOS/VERSION
  49. +2 −1 webOS/framework/appinfo.json
  50. +1 −2 webOS/framework/dashboard.html
  51. +66 −10 webOS/framework/index.html
  52. +13 −103 webOS/framework/phonegap.js
  53. +19 −1 webOS/js/device.js
  54. +0 −4 webOS/js/mojo.js
  55. +5 −0 webOS/js/phonegap.js.base
  56. +0 −99 webOS/js/storage.js
@@ -5,7 +5,7 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
- <script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.1.js"></script>
+ <script type="text/javascript" charset="utf-8" src="phonegap.0.9.6.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
@@ -99,7 +99,7 @@ PhoneGap.Channel.prototype.subscribe = function(f, c, g) {
if (f === null) { return; }
var func = f;
- if (typeof c === "object" && f instanceof Function) { func = PhoneGap.close(c, f); }
+ if (typeof c === "object" && typeof f === "function") { func = PhoneGap.close(c, f); }
g = g || func.observer_guid || f.observer_guid || this.guid++;
func.observer_guid = g;
@@ -120,7 +120,7 @@ PhoneGap.Channel.prototype.subscribeOnce = function(f, c) {
_this.unsubscribe(g);
};
if (this.fired) {
- if (typeof c === "object" && f instanceof Function) { f = PhoneGap.close(c, f); }
+ if (typeof c === "object" && typeof f === "function") { f = PhoneGap.close(c, f); }
f.apply(this, this.fireArgs);
} else {
g = this.subscribe(m);
@@ -132,7 +132,7 @@ PhoneGap.Channel.prototype.subscribeOnce = function(f, c) {
* Unsubscribes the function with the given guid from the channel.
*/
PhoneGap.Channel.prototype.unsubscribe = function(g) {
- if (g instanceof Function) { g = g.observer_guid; }
+ if (typeof g === "function") { g = g.observer_guid; }
this.handlers[g] = null;
delete this.handlers[g];
};
@@ -147,7 +147,7 @@ PhoneGap.Channel.prototype.fire = function(e) {
for (item in this.handlers) {
if (this.handlers.hasOwnProperty(item)) {
handler = this.handlers[item];
- if (handler instanceof Function) {
+ if (typeof handler === "function") {
rv = (handler.apply(this, arguments) === false);
fail = fail || rv;
}
@@ -344,10 +344,13 @@ PhoneGap.Channel.join(function() {
}
else {
var polling = prompt("usePolling", "gap_callbackServer:");
+ PhoneGap.UsePolling = polling;
if (polling == "true") {
+ PhoneGap.UsePolling = true;
PhoneGap.JSCallbackPolling();
}
else {
+ PhoneGap.UsePolling = false;
PhoneGap.JSCallback();
}
}
@@ -507,7 +510,7 @@ PhoneGap.clone = function(obj) {
return retVal;
}
- if (obj instanceof Function) {
+ if (typeof obj === "function") {
return obj;
}
@@ -767,8 +770,8 @@ PhoneGap.JSCallback = function() {
// If callback has JavaScript statement to execute
if (xmlhttp.status === 200) {
- // Need to url decode the response and replace %20 with a space
- var msg = decodeURIComponent(xmlhttp.responseText.replace(/\+/g, '%20'));
+ // Need to url decode the response
+ var msg = decodeURIComponent(xmlhttp.responseText);
setTimeout(function() {
try {
var t = eval(msg);
@@ -802,13 +805,11 @@ PhoneGap.JSCallback = function() {
console.log("JSCallback Error: Bad request. Stopping callbacks.");
}
- // If error, restart callback server
+ // If error, revert to polling
else {
console.log("JSCallback Error: Request failed.");
- prompt("restartServer", "gap_callbackServer:");
- PhoneGap.JSCallbackPort = null;
- PhoneGap.JSCallbackToken = null;
- setTimeout(PhoneGap.JSCallback, 100);
+ PhoneGap.UsePolling = true;
+ PhoneGap.JSCallbackPolling();
}
}
};
@@ -935,7 +936,11 @@ PhoneGap.includeJavascript = function(jsfile, successCallback) {
*/
var PluginManager = {
addService: function(serviceType, className) {
- navigator.app.addService(serviceType, className);
+ try {
+ navigator.app.addService(serviceType, className);
+ } catch (e) {
+ console.log("Error adding service "+serviceType+": "+e);
+ }
}
};
@@ -1066,8 +1071,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -1162,8 +1165,6 @@ PhoneGap.addConstructor(function() {
navigator.app = window.app = new App();
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -1261,8 +1262,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -1453,9 +1452,7 @@ PhoneGap.addConstructor(function(){
navigator.device.capture = window.device.capture = new Capture();
}
});
-}
-
-/*
+}/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
@@ -1574,8 +1571,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -1885,8 +1880,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -1930,8 +1923,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -2037,8 +2028,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -3085,7 +3074,7 @@ LocalFileSystem.prototype._castDate = function(pluginResult) {
file.type = pluginResult.message.type;
file.name = pluginResult.message.name;
file.fullPath = pluginResult.message.fullPath;
- file.lastModifedDate = new Date(pluginResult.message.lastModifiedDate);
+ file.lastModifiedDate = new Date(pluginResult.message.lastModifiedDate);
pluginResult.message = file;
}
return pluginResult;
@@ -3102,8 +3091,6 @@ PhoneGap.addConstructor(function() {
if(typeof window.resolveLocalFileSystemURI == "undefined") window.resolveLocalFileSystemURI = pgLocalFileSystem.resolveLocalFileSystemURI;
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -3189,8 +3176,6 @@ var FileUploadOptions = function(fileKey, fileName, mimeType, params) {
this.params = params || null;
};
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -3389,17 +3374,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
-/*
- * PhoneGap is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -3611,8 +3585,6 @@ PhoneGap.Media.onStatus = function(id, msg, value) {
}
};
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -3680,29 +3652,49 @@ Network.prototype.isReachable = function(uri, callback, options) {
*/
var Connection = function() {
this.type = null;
- this.homeNW = null;
- this.currentNW = null;
+ this._firstRun = true;
+ this._timer = null;
+ this.timeout = 500;
var me = this;
this.getInfo(
- function(info) {
- me.type = info.type;
- me.homeNW = info.homeNW;
- me.currentNW = info.currentNW;
- PhoneGap.onPhoneGapConnectionReady.fire();
+ function(type) {
+ // Need to send events if we are on or offline
+ if (type == "none") {
+ // set a timer if still offline at the end of timer send the offline event
+ me._timer = setTimeout(function(){
+ me.type = type;
+ PhoneGap.fireEvent('offline');
+ me._timer = null;
+ }, me.timeout);
+ } else {
+ // If there is a current offline event pending clear it
+ if (me._timer != null) {
+ clearTimeout(me._timer);
+ me._timer = null;
+ }
+ me.type = type;
+ PhoneGap.fireEvent('online');
+ }
+
+ // should only fire this once
+ if (me._firstRun) {
+ me._firstRun = false;
+ PhoneGap.onPhoneGapConnectionReady.fire();
+ }
},
function(e) {
console.log("Error initializing Network Connection: " + e);
});
};
-Connection.UNKNOWN = 0;
-Connection.ETHERNET = 1;
-Connection.WIFI = 2;
-Connection.CELL_2G = 3;
-Connection.CELL_3G = 4;
-Connection.CELL_4G = 5;
-Connection.NONE = 20;
+Connection.UNKNOWN = "unknown";
+Connection.ETHERNET = "ethernet";
+Connection.WIFI = "wifi";
+Connection.CELL_2G = "2g";
+Connection.CELL_3G = "3g";
+Connection.CELL_4G = "4g";
+Connection.NONE = "none";
/**
* Get connection info
@@ -3725,8 +3717,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -3849,8 +3839,6 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -3940,8 +3928,6 @@ PositionError.PERMISSION_DENIED = 1;
PositionError.POSITION_UNAVAILABLE = 2;
PositionError.TIMEOUT = 3;
}
-
-
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
@@ -4370,5 +4356,3 @@ PhoneGap.addConstructor(function() {
}
});
}
-
-
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit 15ae7d1

Please sign in to comment.