Permalink
Browse files

tagged 1.3.0

  • Loading branch information...
1 parent 9f0856d commit b81151fa4d61fc5c42d2d9d61533e6c452bef909 stevengill committed Dec 19, 2011
Showing with 45,648 additions and 16,702 deletions.
  1. +3 −3 Android/README.md
  2. +1 −1 Android/Sample/assets/www/index.html
  3. +170 −234 Android/Sample/assets/www/{phonegap-1.2.0.js → phonegap-1.3.0.js}
  4. BIN Android/Sample/libs/phonegap-1.2.0.jar
  5. BIN Android/Sample/libs/phonegap-1.3.0.jar
  6. +1 −1 Android/Sample/phonegap/templates/project/assets/www/index.html
  7. BIN Android/phonegap-1.2.0.jar
  8. BIN Android/phonegap-1.3.0.jar
  9. +170 −234 Android/{phonegap-1.2.0.js → phonegap-1.3.0.js}
  10. +0 −7 Bada/Res/phonegap/accelerometer.js
  11. +0 −9 Bada/Res/phonegap/camera.js
  12. +0 −8 Bada/Res/phonegap/contact.js
  13. +0 −9 Bada/Res/phonegap/device.js
  14. +0 −9 Bada/Res/phonegap/file.js
  15. +0 −9 Bada/Res/phonegap/geolocation.js
  16. +0 −9 Bada/Res/phonegap/network.js
  17. +0 −9 Bada/Res/phonegap/notification.js
  18. +16 −6 Bada/Res/phonegap/phonegap.base.js
  19. +0 −9 Bada/Res/phonegap/position.js
  20. +1 −1 Bada/VERSION
  21. +16 −0 Bada/inc/Accelerometer.h
  22. +16 −0 Bada/inc/Compass.h
  23. +16 −0 Bada/inc/Contacts.h
  24. +16 −0 Bada/inc/DebugConsole.h
  25. +16 −0 Bada/inc/Device.h
  26. +16 −0 Bada/inc/GeoLocation.h
  27. +16 −0 Bada/inc/Kamera.h
  28. +16 −0 Bada/inc/Network.h
  29. +16 −0 Bada/inc/Notification.h
  30. +22 −0 Bada/inc/PhoneGap.h
  31. +16 −0 Bada/inc/PhoneGapCommand.h
  32. +17 −0 Bada/inc/WebForm.h
  33. +16 −0 Bada/src/Accelerometer.cpp
  34. +16 −0 Bada/src/Compass.cpp
  35. +16 −0 Bada/src/Contacts.cpp
  36. +16 −0 Bada/src/DebugConsole.cpp
  37. +16 −0 Bada/src/Device.cpp
  38. +16 −0 Bada/src/GeoLocation.cpp
  39. +16 −0 Bada/src/Kamera.cpp
  40. +16 −0 Bada/src/Network.cpp
  41. +16 −0 Bada/src/Notification.cpp
  42. +20 −4 Bada/src/PhoneGap.cpp
  43. +16 −0 Bada/src/PhoneGapCommand.cpp
  44. +16 −2 Bada/src/PhoneGapEntry.cpp
  45. +18 −0 Bada/src/WebForm.cpp
  46. +35 −35 BlackBerry/README.md
  47. +316 −0 BlackBerry/sample/blackberry.xml
  48. +115 −290 BlackBerry/sample/build.xml
  49. +47 −47 BlackBerry/sample/lib/ant-contrib/LICENSE.txt
  50. 0 BlackBerry/sample/lib/ant-contrib/ant-contrib-1.0b3.jar
  51. BIN BlackBerry/sample/lib/phonegap.1.2.0/ext/phonegap.1.2.0.jar
  52. +22 −0 BlackBerry/sample/lib/phonegap.1.3.0/ext-air/PhoneGap_Network/library.xml
  53. +67 −0 BlackBerry/sample/lib/phonegap.1.3.0/ext-air/PhoneGap_Network/src/com/phonegap/network/Network.as
  54. BIN BlackBerry/sample/lib/phonegap.1.3.0/ext/phonegap.1.3.0.jar
  55. +5,142 −4,709 BlackBerry/{www/phonegap-1.2.0.js → sample/lib/phonegap.1.3.0/javascript/phonegap-1.3.0.js}
  56. +5,321 −0 BlackBerry/sample/lib/phonegap.1.3.0/javascript/playbook/phonegap-1.3.0.js
  57. +238 −0 BlackBerry/sample/playbook.xml
  58. +97 −52 BlackBerry/sample/project.properties
  59. +63 −53 BlackBerry/sample/www/config.xml
  60. +22 −0 BlackBerry/sample/www/ext-air/PhoneGap_Network/library.xml
  61. +67 −0 BlackBerry/sample/www/ext-air/PhoneGap_Network/src/com/phonegap/network/Network.as
  62. BIN BlackBerry/sample/www/ext/phonegap.1.2.0.jar
  63. BIN BlackBerry/sample/www/ext/phonegap.1.3.0.jar
  64. +973 −973 BlackBerry/sample/www/index.html
  65. +481 −481 BlackBerry/sample/www/json2.js
  66. +5,142 −4,709 BlackBerry/sample/{lib/phonegap.1.2.0/javascript/phonegap-1.2.0.js → www/phonegap-1.3.0.js}
  67. +5,321 −0 BlackBerry/sample/www/playbook/phonegap-1.3.0.js
  68. +15 −13 BlackBerry/sample/www/plugins.xml
  69. 0 BlackBerry/sample/www/resources/icon.png
  70. 0 BlackBerry/sample/www/resources/icon_hover.png
  71. 0 BlackBerry/sample/www/resources/loading_foreground.png
  72. +63 −53 BlackBerry/www/config.xml
  73. BIN BlackBerry/www/ext/phonegap.1.2.0.jar
  74. BIN BlackBerry/www/ext/phonegap.1.3.0.jar
  75. +5,142 −4,709 BlackBerry/{sample/www/phonegap-1.2.0.js → www/phonegap-1.3.0.js}
  76. +5,321 −0 BlackBerry/www/playbook/phonegap-1.3.0.js
  77. +15 −13 BlackBerry/www/plugins.xml
  78. +1 −0 Documentation/en/0.9.2/_index.html
  79. +1 −0 Documentation/en/0.9.2/index.html
  80. +1 −0 Documentation/en/0.9.2/phonegap_accelerometer_accelerometer.md.html
  81. +1 −0 Documentation/en/0.9.2/phonegap_camera_camera.md.html
  82. +1 −0 Documentation/en/0.9.2/phonegap_contacts_contacts.md.html
  83. +1 −0 Documentation/en/0.9.2/phonegap_device_device.md.html
  84. +1 −0 Documentation/en/0.9.2/phonegap_events_events.md.html
  85. +1 −0 Documentation/en/0.9.2/phonegap_geolocation_geolocation.md.html
  86. +1 −0 Documentation/en/0.9.2/phonegap_network_network.md.html
  87. +1 −0 Documentation/en/0.9.2/phonegap_notification_notification.md.html
  88. +1 −0 Documentation/en/0.9.3/_index.html
  89. +1 −0 Documentation/en/0.9.3/index.html
  90. +1 −0 Documentation/en/0.9.3/phonegap_accelerometer_accelerometer.md.html
  91. +1 −0 Documentation/en/0.9.3/phonegap_camera_camera.md.html
  92. +1 −0 Documentation/en/0.9.3/phonegap_compass_compass.md.html
  93. +1 −0 Documentation/en/0.9.3/phonegap_contacts_contacts.md.html
  94. +1 −0 Documentation/en/0.9.3/phonegap_device_device.md.html
  95. +1 −0 Documentation/en/0.9.3/phonegap_events_events.md.html
  96. +1 −0 Documentation/en/0.9.3/phonegap_file_file.md.html
  97. +1 −0 Documentation/en/0.9.3/phonegap_geolocation_geolocation.md.html
  98. +1 −0 Documentation/en/0.9.3/phonegap_media_media.md.html
  99. +1 −0 Documentation/en/0.9.3/phonegap_network_network.md.html
  100. +1 −0 Documentation/en/0.9.3/phonegap_notification_notification.md.html
  101. +1 −0 Documentation/en/0.9.3/phonegap_storage_storage.md.html
  102. +1 −0 Documentation/en/0.9.4/_index.html
  103. +1 −0 Documentation/en/0.9.4/index.html
  104. +1 −0 Documentation/en/0.9.4/phonegap_accelerometer_accelerometer.md.html
  105. +1 −0 Documentation/en/0.9.4/phonegap_camera_camera.md.html
  106. +1 −0 Documentation/en/0.9.4/phonegap_compass_compass.md.html
  107. +1 −0 Documentation/en/0.9.4/phonegap_contacts_contacts.md.html
  108. +1 −0 Documentation/en/0.9.4/phonegap_device_device.md.html
  109. +1 −0 Documentation/en/0.9.4/phonegap_events_events.md.html
  110. +1 −0 Documentation/en/0.9.4/phonegap_file_file.md.html
  111. +1 −0 Documentation/en/0.9.4/phonegap_geolocation_geolocation.md.html
  112. +1 −0 Documentation/en/0.9.4/phonegap_media_media.md.html
  113. +1 −0 Documentation/en/0.9.4/phonegap_network_network.md.html
  114. +1 −0 Documentation/en/0.9.4/phonegap_notification_notification.md.html
  115. +1 −0 Documentation/en/0.9.4/phonegap_storage_storage.md.html
  116. +1 −0 Documentation/en/0.9.5.1/_index.html
  117. +1 −0 Documentation/en/0.9.5.1/index.html
  118. +1 −0 Documentation/en/0.9.5.1/phonegap_accelerometer_accelerometer.md.html
  119. +1 −0 Documentation/en/0.9.5.1/phonegap_camera_camera.md.html
  120. +1 −0 Documentation/en/0.9.5.1/phonegap_compass_compass.md.html
  121. +1 −0 Documentation/en/0.9.5.1/phonegap_contacts_contacts.md.html
  122. +1 −0 Documentation/en/0.9.5.1/phonegap_device_device.md.html
  123. +1 −0 Documentation/en/0.9.5.1/phonegap_events_events.md.html
  124. +1 −0 Documentation/en/0.9.5.1/phonegap_file_file.md.html
  125. +1 −0 Documentation/en/0.9.5.1/phonegap_geolocation_geolocation.md.html
  126. +1 −0 Documentation/en/0.9.5.1/phonegap_media_capture_capture.md.html
  127. +1 −0 Documentation/en/0.9.5.1/phonegap_media_media.md.html
  128. +1 −0 Documentation/en/0.9.5.1/phonegap_network_network.md.html
  129. +1 −0 Documentation/en/0.9.5.1/phonegap_notification_notification.md.html
  130. +1 −0 Documentation/en/0.9.5.1/phonegap_storage_storage.md.html
  131. +1 −0 Documentation/en/0.9.5/_index.html
  132. +1 −0 Documentation/en/0.9.5/index.html
  133. +1 −0 Documentation/en/0.9.5/phonegap_accelerometer_accelerometer.md.html
  134. +1 −0 Documentation/en/0.9.5/phonegap_camera_camera.md.html
  135. +1 −0 Documentation/en/0.9.5/phonegap_compass_compass.md.html
  136. +1 −0 Documentation/en/0.9.5/phonegap_contacts_contacts.md.html
  137. +1 −0 Documentation/en/0.9.5/phonegap_device_device.md.html
  138. +1 −0 Documentation/en/0.9.5/phonegap_events_events.md.html
  139. +1 −0 Documentation/en/0.9.5/phonegap_file_file.md.html
  140. +1 −0 Documentation/en/0.9.5/phonegap_geolocation_geolocation.md.html
  141. +1 −0 Documentation/en/0.9.5/phonegap_media_media.md.html
  142. +1 −0 Documentation/en/0.9.5/phonegap_network_network.md.html
  143. +1 −0 Documentation/en/0.9.5/phonegap_notification_notification.md.html
  144. +1 −0 Documentation/en/0.9.5/phonegap_storage_storage.md.html
  145. +1 −0 Documentation/en/0.9.6/_index.html
  146. +1 −0 Documentation/en/0.9.6/index.html
  147. +1 −0 Documentation/en/0.9.6/phonegap_accelerometer_accelerometer.md.html
  148. +1 −0 Documentation/en/0.9.6/phonegap_camera_camera.md.html
  149. +1 −0 Documentation/en/0.9.6/phonegap_compass_compass.md.html
  150. +1 −0 Documentation/en/0.9.6/phonegap_connection_connection.md.html
  151. +1 −0 Documentation/en/0.9.6/phonegap_contacts_contacts.md.html
  152. +1 −0 Documentation/en/0.9.6/phonegap_device_device.md.html
  153. +1 −0 Documentation/en/0.9.6/phonegap_events_events.md.html
  154. +1 −0 Documentation/en/0.9.6/phonegap_file_file.md.html
  155. +1 −0 Documentation/en/0.9.6/phonegap_geolocation_geolocation.md.html
  156. +1 −0 Documentation/en/0.9.6/phonegap_media_capture_capture.md.html
  157. +1 −0 Documentation/en/0.9.6/phonegap_media_media.md.html
  158. +1 −0 Documentation/en/0.9.6/phonegap_network_network.md.html
  159. +1 −0 Documentation/en/0.9.6/phonegap_notification_notification.md.html
  160. +1 −0 Documentation/en/0.9.6/phonegap_storage_storage.md.html
  161. +1 −0 Documentation/en/1.0.0/_index.html
  162. +1 −0 Documentation/en/1.0.0/index.html
  163. +1 −0 Documentation/en/1.0.0/phonegap_accelerometer_accelerometer.md.html
  164. +1 −0 Documentation/en/1.0.0/phonegap_camera_camera.md.html
  165. +1 −0 Documentation/en/1.0.0/phonegap_compass_compass.md.html
  166. +1 −0 Documentation/en/1.0.0/phonegap_connection_connection.md.html
  167. +1 −0 Documentation/en/1.0.0/phonegap_contacts_contacts.md.html
  168. +1 −0 Documentation/en/1.0.0/phonegap_device_device.md.html
  169. +1 −0 Documentation/en/1.0.0/phonegap_events_events.md.html
  170. +1 −0 Documentation/en/1.0.0/phonegap_file_file.md.html
  171. +1 −0 Documentation/en/1.0.0/phonegap_geolocation_geolocation.md.html
  172. +1 −0 Documentation/en/1.0.0/phonegap_media_capture_capture.md.html
  173. +1 −0 Documentation/en/1.0.0/phonegap_media_media.md.html
  174. +1 −0 Documentation/en/1.0.0/phonegap_notification_notification.md.html
  175. +1 −0 Documentation/en/1.0.0/phonegap_storage_storage.md.html
  176. +1 −0 Documentation/en/1.0.0rc1/_index.html
  177. +1 −0 Documentation/en/1.0.0rc1/index.html
  178. +1 −0 Documentation/en/1.0.0rc1/phonegap_accelerometer_accelerometer.md.html
  179. +1 −0 Documentation/en/1.0.0rc1/phonegap_camera_camera.md.html
  180. +1 −0 Documentation/en/1.0.0rc1/phonegap_compass_compass.md.html
  181. +1 −0 Documentation/en/1.0.0rc1/phonegap_connection_connection.md.html
  182. +1 −0 Documentation/en/1.0.0rc1/phonegap_contacts_contacts.md.html
  183. +1 −0 Documentation/en/1.0.0rc1/phonegap_device_device.md.html
  184. +1 −0 Documentation/en/1.0.0rc1/phonegap_events_events.md.html
  185. +1 −0 Documentation/en/1.0.0rc1/phonegap_file_file.md.html
  186. +1 −0 Documentation/en/1.0.0rc1/phonegap_geolocation_geolocation.md.html
  187. +1 −0 Documentation/en/1.0.0rc1/phonegap_media_capture_capture.md.html
  188. +1 −0 Documentation/en/1.0.0rc1/phonegap_media_media.md.html
  189. +1 −0 Documentation/en/1.0.0rc1/phonegap_network_network.md.html
  190. +1 −0 Documentation/en/1.0.0rc1/phonegap_notification_notification.md.html
  191. +1 −0 Documentation/en/1.0.0rc1/phonegap_storage_storage.md.html
  192. +1 −0 Documentation/en/1.0.0rc2/_index.html
  193. +1 −0 Documentation/en/1.0.0rc2/index.html
  194. +1 −0 Documentation/en/1.0.0rc2/phonegap_accelerometer_accelerometer.md.html
  195. +1 −0 Documentation/en/1.0.0rc2/phonegap_camera_camera.md.html
  196. +1 −0 Documentation/en/1.0.0rc2/phonegap_compass_compass.md.html
  197. +1 −0 Documentation/en/1.0.0rc2/phonegap_connection_connection.md.html
  198. +1 −0 Documentation/en/1.0.0rc2/phonegap_contacts_contacts.md.html
  199. +1 −0 Documentation/en/1.0.0rc2/phonegap_device_device.md.html
  200. +1 −0 Documentation/en/1.0.0rc2/phonegap_events_events.md.html
  201. +1 −0 Documentation/en/1.0.0rc2/phonegap_file_file.md.html
  202. +1 −0 Documentation/en/1.0.0rc2/phonegap_geolocation_geolocation.md.html
  203. +1 −0 Documentation/en/1.0.0rc2/phonegap_media_capture_capture.md.html
  204. +1 −0 Documentation/en/1.0.0rc2/phonegap_media_media.md.html
  205. +1 −0 Documentation/en/1.0.0rc2/phonegap_notification_notification.md.html
  206. +1 −0 Documentation/en/1.0.0rc2/phonegap_storage_storage.md.html
  207. +1 −0 Documentation/en/1.0.0rc3/_index.html
  208. +1 −0 Documentation/en/1.0.0rc3/index.html
  209. +1 −0 Documentation/en/1.0.0rc3/phonegap_accelerometer_accelerometer.md.html
  210. +1 −0 Documentation/en/1.0.0rc3/phonegap_camera_camera.md.html
  211. +1 −0 Documentation/en/1.0.0rc3/phonegap_compass_compass.md.html
  212. +1 −0 Documentation/en/1.0.0rc3/phonegap_connection_connection.md.html
  213. +1 −0 Documentation/en/1.0.0rc3/phonegap_contacts_contacts.md.html
  214. +1 −0 Documentation/en/1.0.0rc3/phonegap_device_device.md.html
  215. +1 −0 Documentation/en/1.0.0rc3/phonegap_events_events.md.html
  216. +1 −0 Documentation/en/1.0.0rc3/phonegap_file_file.md.html
  217. +1 −0 Documentation/en/1.0.0rc3/phonegap_geolocation_geolocation.md.html
  218. +1 −0 Documentation/en/1.0.0rc3/phonegap_media_capture_capture.md.html
  219. +1 −0 Documentation/en/1.0.0rc3/phonegap_media_media.md.html
  220. +1 −0 Documentation/en/1.0.0rc3/phonegap_notification_notification.md.html
  221. +1 −0 Documentation/en/1.0.0rc3/phonegap_storage_storage.md.html
  222. +1 −0 Documentation/en/1.1.0/_index.html
  223. +1 −0 Documentation/en/1.1.0/index.html
  224. +1 −0 Documentation/en/1.1.0/phonegap_accelerometer_accelerometer.md.html
  225. +1 −0 Documentation/en/1.1.0/phonegap_camera_camera.md.html
  226. +1 −0 Documentation/en/1.1.0/phonegap_compass_compass.md.html
  227. +1 −0 Documentation/en/1.1.0/phonegap_connection_connection.md.html
  228. +1 −0 Documentation/en/1.1.0/phonegap_contacts_contacts.md.html
  229. +1 −0 Documentation/en/1.1.0/phonegap_device_device.md.html
  230. +1 −0 Documentation/en/1.1.0/phonegap_events_events.md.html
  231. +1 −0 Documentation/en/1.1.0/phonegap_file_file.md.html
  232. +1 −0 Documentation/en/1.1.0/phonegap_geolocation_geolocation.md.html
  233. +1 −0 Documentation/en/1.1.0/phonegap_media_capture_capture.md.html
  234. +1 −0 Documentation/en/1.1.0/phonegap_media_media.md.html
  235. +1 −0 Documentation/en/1.1.0/phonegap_notification_notification.md.html
  236. +1 −0 Documentation/en/1.1.0/phonegap_storage_storage.md.html
  237. +4 −0 Documentation/en/1.2.0/_index.html
  238. +1 −1 Documentation/en/1.2.0/_index.json
  239. +1 −0 Documentation/en/1.2.0/index.html
  240. +1 −0 Documentation/en/1.2.0/phonegap_accelerometer_accelerometer.md.html
  241. +1 −0 Documentation/en/1.2.0/phonegap_camera_camera.md.html
  242. +1 −0 Documentation/en/1.2.0/phonegap_compass_compass.md.html
  243. +1 −0 Documentation/en/1.2.0/phonegap_connection_connection.md.html
  244. +1 −0 Documentation/en/1.2.0/phonegap_contacts_contacts.md.html
  245. +1 −0 Documentation/en/1.2.0/phonegap_device_device.md.html
  246. +283 −0 Documentation/en/1.2.0/phonegap_events_events.md.html
  247. +1 −0 Documentation/en/1.2.0/phonegap_file_file.md.html
  248. +1 −0 Documentation/en/1.2.0/phonegap_geolocation_geolocation.md.html
  249. +1 −0 Documentation/en/1.2.0/phonegap_media_capture_capture.md.html
  250. +1 −0 Documentation/en/1.2.0/phonegap_media_media.md.html
  251. +1 −0 Documentation/en/1.2.0/phonegap_notification_notification.md.html
  252. +1 −0 Documentation/en/1.2.0/phonegap_storage_storage.md.html
  253. +272 −0 Documentation/en/1.3.0/_index.html
  254. +1 −0 Documentation/en/1.3.0/_index.json
  255. BIN Documentation/en/1.3.0/arrow.png
  256. +385 −0 Documentation/en/1.3.0/index.css
  257. +137 −0 Documentation/en/1.3.0/index.html
  258. +55 −0 Documentation/en/1.3.0/index.js
  259. BIN Documentation/en/1.3.0/line.png
  260. +120 −0 Documentation/en/1.3.0/mobile.css
  261. +614 −0 Documentation/en/1.3.0/phonegap_accelerometer_accelerometer.md.html
  262. +448 −0 Documentation/en/1.3.0/phonegap_camera_camera.md.html
  263. +797 −0 Documentation/en/1.3.0/phonegap_compass_compass.md.html
  264. +202 −0 Documentation/en/1.3.0/phonegap_connection_connection.md.html
  265. +1,521 −0 Documentation/en/1.3.0/phonegap_contacts_contacts.md.html
  266. +527 −0 Documentation/en/1.3.0/phonegap_device_device.md.html
  267. +1,401 −0 Documentation/en/1.3.0/phonegap_events_events.md.html
  268. +1,983 −0 Documentation/en/1.3.0/phonegap_file_file.md.html
  269. +881 −0 Documentation/en/1.3.0/phonegap_geolocation_geolocation.md.html
  270. +1,044 −0 Documentation/en/1.3.0/phonegap_media_capture_capture.md.html
Sorry, we could not display the entire diff because too many files (503) changed.
View
6 Android/README.md
@@ -16,15 +16,15 @@ Setup New Project
2. In the root directory of the project, create two new directories:
- /libs
- /assets/www
-3. Copy phonegap-1.2.0.js from your PhoneGap download earlier to /assets/www
-4. Copy phonegap-1.2.0.jar from your PhoneGap download earlier to /libs
+3. Copy phonegap-1.3.0.js from your PhoneGap download earlier to /assets/www
+4. Copy phonegap-1.3.0.jar from your PhoneGap download earlier to /libs
5. Copy xml folder from your PhoneGap download earlier to /res
6. Make a few adjustments too the project's main Java file found in the src folder in Eclipse:
- Change the class's extend from Activity to DroidGap
- Replace the setContentView() line with super.loadUrl("file:///android_asset/www/index.html");
- Add import com.phonegap.*;
- Remove import android.app.Activity;
-You might experience an error here, where Eclipse can't find phonegap-1.2.0.jar. In this case, right click on the /libs folder and go to Build Paths/ > Configure Build Paths. Then, in the Libraries tab, add phonegap-1.2.0.jar to the Project. If Eclipse is being temperamental, you might need to refresh (F5) the project once again.
+You might experience an error here, where Eclipse can't find phonegap-1.3.0.jar. In this case, right click on the /libs folder and go to Build Paths/ > Configure Build Paths. Then, in the Libraries tab, add phonegap-1.3.0.jar to the Project. If Eclipse is being temperamental, you might need to refresh (F5) the project once again.
7. Right click on AndroidManifest.xml and select Open With > Text Editor
8. Paste the following permissions under versionName:
View
2 Android/Sample/assets/www/index.html
@@ -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-1.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
View
404 Android/Sample/assets/www/phonegap-1.2.0.js → Android/Sample/assets/www/phonegap-1.3.0.js
@@ -50,21 +50,12 @@ if (typeof PhoneGap === "undefined") {
* window.onunload
*/
-if (typeof(DeviceInfo) !== 'object') {
- var DeviceInfo = {};
-}
-
/**
* This represents the PhoneGap API itself, and provides a global namespace for accessing
* information about the state of PhoneGap.
* @class
*/
var PhoneGap = {
- queue: {
- ready: true,
- commands: [],
- timer: null
- },
documentEventHandler: {}, // Collection of custom document event handlers
windowEventHandler: {} // Collection of custom window event handlers
};
@@ -207,11 +198,6 @@ PhoneGap.Channel.join = function(h, c) {
};
/**
- * Boolean flag indicating if the PhoneGap API is available and initialized.
- */ // TODO: Remove this, it is unused here ... -jm
-PhoneGap.available = DeviceInfo.uuid !== undefined;
-
-/**
* Add an initialization function to a queue that ensures it will run and initialize
* application constructors only once PhoneGap has been initialized.
* @param {Function} func The function callback you want run once PhoneGap is initialized
@@ -400,7 +386,7 @@ PhoneGap.m_window_addEventListener = window.addEventListener;
*/
PhoneGap.addWindowEventHandler = function(event, callback) {
PhoneGap.windowEventHandler[event] = callback;
-}
+};
/**
* Add a custom document event handler.
@@ -410,7 +396,7 @@ PhoneGap.addWindowEventHandler = function(event, callback) {
*/
PhoneGap.addDocumentEventHandler = function(event, callback) {
PhoneGap.documentEventHandler[event] = callback;
-}
+};
/**
* Intercept adding document event listeners and handle our own
@@ -738,58 +724,6 @@ PhoneGap.callbackError = function(callbackId, args) {
}
};
-
-/**
- * Internal function used to dispatch the request to PhoneGap. It processes the
- * command queue and executes the next command on the list. If one of the
- * arguments is a JavaScript object, it will be passed on the QueryString of the
- * url, which will be turned into a dictionary on the other end.
- * @private
- */
-// TODO: Is this used?
-PhoneGap.run_command = function() {
- if (!PhoneGap.available || !PhoneGap.queue.ready) {
- return;
- }
- PhoneGap.queue.ready = false;
-
- var args = PhoneGap.queue.commands.shift();
- if (PhoneGap.queue.commands.length === 0) {
- clearInterval(PhoneGap.queue.timer);
- PhoneGap.queue.timer = null;
- }
-
- var uri = [];
- var dict = null;
- var i;
- for (i = 1; i < args.length; i++) {
- var arg = args[i];
- if (arg === undefined || arg === null) {
- arg = '';
- }
- if (typeof(arg) === 'object') {
- dict = arg;
- } else {
- uri.push(encodeURIComponent(arg));
- }
- }
- var url = "gap://" + args[0] + "/" + uri.join("/");
- if (dict !== null) {
- var name;
- var query_args = [];
- for (name in dict) {
- if (dict.hasOwnProperty(name) && (typeof (name) === 'string')) {
- query_args.push(encodeURIComponent(name) + "=" + encodeURIComponent(dict[name]));
- }
- }
- if (query_args.length > 0) {
- url += "?" + query_args.join("&");
- }
- }
- document.location = url;
-
-};
-
PhoneGap.JSCallbackPort = null;
PhoneGap.JSCallbackToken = null;
@@ -1005,6 +939,122 @@ PhoneGap.includeJavascript = function(jsfile, successCallback) {
* under the License.
*/
+if (!PhoneGap.hasResource("device")) {
+PhoneGap.addResource("device");
+
+/**
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
+ * phone, etc.
+ * @constructor
+ */
+var Device = function() {
+ this.available = PhoneGap.available;
+ this.platform = null;
+ this.version = null;
+ this.name = null;
+ this.uuid = null;
+ this.phonegap = null;
+
+ var me = this;
+ this.getInfo(
+ function(info) {
+ me.available = true;
+ me.platform = info.platform;
+ me.version = info.version;
+ me.name = info.name;
+ me.uuid = info.uuid;
+ me.phonegap = info.phonegap;
+ PhoneGap.onPhoneGapInfoReady.fire();
+ },
+ function(e) {
+ me.available = false;
+ console.log("Error initializing PhoneGap: " + e);
+ alert("Error initializing PhoneGap: "+e);
+ });
+};
+
+/**
+ * Get device info
+ *
+ * @param {Function} successCallback The function to call when the heading data is available
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
+ */
+Device.prototype.getInfo = function(successCallback, errorCallback) {
+
+ // successCallback required
+ if (typeof successCallback !== "function") {
+ console.log("Device Error: successCallback is not a function");
+ return;
+ }
+
+ // errorCallback optional
+ if (errorCallback && (typeof errorCallback !== "function")) {
+ console.log("Device Error: errorCallback is not a function");
+ return;
+ }
+
+ // Get info
+ PhoneGap.exec(successCallback, errorCallback, "Device", "getDeviceInfo", []);
+};
+
+/*
+ * DEPRECATED
+ * This is only for Android.
+ *
+ * You must explicitly override the back button.
+ */
+Device.prototype.overrideBackButton = function() {
+ console.log("Device.overrideBackButton() is deprecated. Use App.overrideBackbutton(true).");
+ navigator.app.overrideBackbutton(true);
+};
+
+/*
+ * DEPRECATED
+ * This is only for Android.
+ *
+ * This resets the back button to the default behaviour
+ */
+Device.prototype.resetBackButton = function() {
+ console.log("Device.resetBackButton() is deprecated. Use App.overrideBackbutton(false).");
+ navigator.app.overrideBackbutton(false);
+};
+
+/*
+ * DEPRECATED
+ * This is only for Android.
+ *
+ * This terminates the activity!
+ */
+Device.prototype.exitApp = function() {
+ console.log("Device.exitApp() is deprecated. Use App.exitApp().");
+ navigator.app.exitApp();
+};
+
+PhoneGap.addConstructor(function() {
+ if (typeof navigator.device === "undefined") {
+ navigator.device = window.device = new Device();
+ }
+});
+}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
if (!PhoneGap.hasResource("accelerometer")) {
PhoneGap.addResource("accelerometer");
@@ -1220,16 +1270,6 @@ App.prototype.exitApp = function() {
return PhoneGap.exec(null, null, "App", "exitApp", []);
};
-/**
- * Add entry to approved list of URLs (whitelist) that will be loaded into PhoneGap container instead of default browser.
- *
- * @param origin URL regular expression to allow
- * @param subdomains T=include all subdomains under origin
- */
-App.prototype.addWhiteListEntry = function(origin, subdomains) {
- return PhoneGap.exec(null, null, "App", "addWhiteListEntry", [origin, subdomains]);
-};
-
PhoneGap.addConstructor(function() {
navigator.app = new App();
});
@@ -1286,35 +1326,33 @@ Battery.prototype.eventHandler = function(eventType, handler, add) {
// Register the event listener in the proper array
if (eventType === "batterystatus") {
- var pos = me._batteryListener.indexOf(handler);
- if (pos === -1) {
- me._batteryListener.push(handler);
+ if (me._batteryListener.indexOf(handler) === -1) {
+ me._batteryListener.push(handler);
}
} else if (eventType === "batterylow") {
- var pos = me._lowListener.indexOf(handler);
- if (pos === -1) {
- me._lowListener.push(handler);
+ if (me._lowListener.indexOf(handler) === -1) {
+ me._lowListener.push(handler);
}
} else if (eventType === "batterycritical") {
- var pos = me._criticalListener.indexOf(handler);
- if (pos === -1) {
- me._criticalListener.push(handler);
+ if (me._criticalListener.indexOf(handler) === -1) {
+ me._criticalListener.push(handler);
}
}
} else {
+ var pos = -1;
// Remove the event listener from the proper array
if (eventType === "batterystatus") {
- var pos = me._batteryListener.indexOf(handler);
+ pos = me._batteryListener.indexOf(handler);
if (pos > -1) {
me._batteryListener.splice(pos, 1);
}
} else if (eventType === "batterylow") {
- var pos = me._lowListener.indexOf(handler);
+ pos = me._lowListener.indexOf(handler);
if (pos > -1) {
me._lowListener.splice(pos, 1);
}
} else if (eventType === "batterycritical") {
- var pos = me._criticalListener.indexOf(handler);
+ pos = me._criticalListener.indexOf(handler);
if (pos > -1) {
me._criticalListener.splice(pos, 1);
}
@@ -1335,21 +1373,22 @@ Battery.prototype.eventHandler = function(eventType, handler, add) {
Battery.prototype._status = function(info) {
if (info) {
var me = this;
- if (me._level != info.level || me._isPlugged != info.isPlugged) {
+ var level = info.level;
+ if (me._level !== level || me._isPlugged !== info.isPlugged) {
// Fire batterystatus event
PhoneGap.fireWindowEvent("batterystatus", info);
// Fire low battery event
- if (info.level == 20 || info.level == 5) {
- if (info.level == 20) {
+ if (level === 20 || level === 5) {
+ if (level === 20) {
PhoneGap.fireWindowEvent("batterylow", info);
}
else {
PhoneGap.fireWindowEvent("batterycritical", info);
}
}
}
- me._level = info.level;
+ me._level = level;
me._isPlugged = info.isPlugged;
}
};
@@ -1496,7 +1535,7 @@ Camera.prototype.getPicture = function(successCallback, errorCallback, options)
options.quality = 80;
}
if (options.maxResolution === null || typeof options.maxResolution === "undefined") {
- options.maxResolution = 0;
+ options.maxResolution = 0;
}
if (options.destinationType === null || typeof options.destinationType === "undefined") {
options.destinationType = Camera.DestinationType.DATA_URL;
@@ -1513,7 +1552,7 @@ Camera.prototype.getPicture = function(successCallback, errorCallback, options)
if (options.targetWidth === null || typeof options.targetWidth === "undefined") {
options.targetWidth = -1;
}
- else if (typeof options.targetWidth == "string") {
+ else if (typeof options.targetWidth === "string") {
var width = new Number(options.targetWidth);
if (isNaN(width) === false) {
options.targetWidth = width.valueOf();
@@ -1522,7 +1561,7 @@ Camera.prototype.getPicture = function(successCallback, errorCallback, options)
if (options.targetHeight === null || typeof options.targetHeight === "undefined") {
options.targetHeight = -1;
}
- else if (typeof options.targetHeight == "string") {
+ else if (typeof options.targetHeight === "string") {
var height = new Number(options.targetHeight);
if (isNaN(height) === false) {
options.targetHeight = height.valueOf();
@@ -1732,9 +1771,6 @@ var CaptureAudioOptions = function(){
};
PhoneGap.addConstructor(function(){
- if (typeof navigator.device === "undefined") {
- navigator.device = window.device = new Device();
- }
if (typeof navigator.device.capture === "undefined") {
navigator.device.capture = window.device.capture = new Capture();
}
@@ -1762,15 +1798,15 @@ PhoneGap.addConstructor(function(){
if (!PhoneGap.hasResource("compass")) {
PhoneGap.addResource("compass");
-CompassError = function(){
+var CompassError = function(){
this.code = null;
};
// Capture error codes
CompassError.COMPASS_INTERNAL_ERR = 0;
CompassError.COMPASS_NOT_SUPPORTED = 20;
-CompassHeading = function() {
+var CompassHeading = function() {
this.magneticHeading = null;
this.trueHeading = null;
this.headingAccuracy = null;
@@ -2287,122 +2323,6 @@ PhoneGap.addConstructor(function() {
* under the License.
*/
-if (!PhoneGap.hasResource("device")) {
-PhoneGap.addResource("device");
-
-/**
- * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
- * phone, etc.
- * @constructor
- */
-var Device = function() {
- this.available = PhoneGap.available;
- this.platform = null;
- this.version = null;
- this.name = null;
- this.uuid = null;
- this.phonegap = null;
-
- var me = this;
- this.getInfo(
- function(info) {
- me.available = true;
- me.platform = info.platform;
- me.version = info.version;
- me.name = info.name;
- me.uuid = info.uuid;
- me.phonegap = info.phonegap;
- PhoneGap.onPhoneGapInfoReady.fire();
- },
- function(e) {
- me.available = false;
- console.log("Error initializing PhoneGap: " + e);
- alert("Error initializing PhoneGap: "+e);
- });
-};
-
-/**
- * Get device info
- *
- * @param {Function} successCallback The function to call when the heading data is available
- * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
- */
-Device.prototype.getInfo = function(successCallback, errorCallback) {
-
- // successCallback required
- if (typeof successCallback !== "function") {
- console.log("Device Error: successCallback is not a function");
- return;
- }
-
- // errorCallback optional
- if (errorCallback && (typeof errorCallback !== "function")) {
- console.log("Device Error: errorCallback is not a function");
- return;
- }
-
- // Get info
- PhoneGap.exec(successCallback, errorCallback, "Device", "getDeviceInfo", []);
-};
-
-/*
- * DEPRECATED
- * This is only for Android.
- *
- * You must explicitly override the back button.
- */
-Device.prototype.overrideBackButton = function() {
- console.log("Device.overrideBackButton() is deprecated. Use App.overrideBackbutton(true).");
- navigator.app.overrideBackbutton(true);
-};
-
-/*
- * DEPRECATED
- * This is only for Android.
- *
- * This resets the back button to the default behaviour
- */
-Device.prototype.resetBackButton = function() {
- console.log("Device.resetBackButton() is deprecated. Use App.overrideBackbutton(false).");
- navigator.app.overrideBackbutton(false);
-};
-
-/*
- * DEPRECATED
- * This is only for Android.
- *
- * This terminates the activity!
- */
-Device.prototype.exitApp = function() {
- console.log("Device.exitApp() is deprecated. Use App.exitApp().");
- navigator.app.exitApp();
-};
-
-PhoneGap.addConstructor(function() {
- if (typeof navigator.device === "undefined") {
- navigator.device = window.device = new Device();
- }
-});
-}
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
if (!PhoneGap.hasResource("file")) {
PhoneGap.addResource("file");
@@ -2771,7 +2691,7 @@ FileWriter.prototype.abort = function() {
this.readyState = FileWriter.DONE;
// If write end callback
- if (typeof this.onwriteend == "function") {
+ if (typeof this.onwriteend === "function") {
this.onwriteend({"type":"writeend", "target":this});
}
};
@@ -3229,14 +3149,14 @@ FileEntry.prototype.createWriter = function(successCallback, errorCallback) {
var writer = new FileWriter(filePointer);
if (writer.fileName === null || writer.fileName === "") {
- if (typeof errorCallback == "function") {
+ if (typeof errorCallback === "function") {
errorCallback({
"code": FileError.INVALID_STATE_ERR
});
}
}
- if (typeof successCallback == "function") {
+ if (typeof successCallback === "function") {
successCallback(writer);
}
}, errorCallback);
@@ -3271,7 +3191,7 @@ LocalFileSystem.APPLICATION = 3;
*/
LocalFileSystem.prototype.requestFileSystem = function(type, size, successCallback, errorCallback) {
if (type < 0 || type > 3) {
- if (typeof errorCallback == "function") {
+ if (typeof errorCallback === "function") {
errorCallback({
"code": FileError.SYNTAX_ERR
});
@@ -3379,12 +3299,17 @@ LocalFileSystem.prototype._castDate = function(pluginResult) {
PhoneGap.addConstructor(function() {
var pgLocalFileSystem = new LocalFileSystem();
// Needed for cast methods
- if(typeof window.localFileSystem == "undefined") window.localFileSystem = pgLocalFileSystem;
- if(typeof window.requestFileSystem == "undefined") window.requestFileSystem = pgLocalFileSystem.requestFileSystem;
- if(typeof window.resolveLocalFileSystemURI == "undefined") window.resolveLocalFileSystemURI = pgLocalFileSystem.resolveLocalFileSystemURI;
+ if (typeof window.localFileSystem === "undefined") {
+ window.localFileSystem = pgLocalFileSystem;
+ }
+ if (typeof window.requestFileSystem === "undefined") {
+ window.requestFileSystem = pgLocalFileSystem.requestFileSystem;
+ }
+ if (typeof window.resolveLocalFileSystemURI === "undefined") {
+ window.resolveLocalFileSystemURI = pgLocalFileSystem.resolveLocalFileSystemURI;
+ }
});
-}
-/*
+}/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -3455,7 +3380,7 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
fileKey = options.fileKey;
fileName = options.fileName;
mimeType = options.mimeType;
- if (options.chunkedMode != null || typeof options.chunkedMode != "undefined") {
+ if (options.chunkedMode !== null || typeof options.chunkedMode !== "undefined") {
chunkedMode = options.chunkedMode;
}
if (options.params) {
@@ -3470,6 +3395,17 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
};
/**
+ * Downloads a file form a given URL and saves it to the specified directory.
+ * @param source {String} URL of the server to receive the file
+ * @param target {String} Full path of the file on the device
+ * @param successCallback (Function} Callback to be invoked when upload has completed
+ * @param errorCallback {Function} Callback to be invoked upon error
+ */
+FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {
+ PhoneGap.exec(successCallback, errorCallback, 'FileTransfer', 'download', [source, target]);
+};
+
+/**
* Options to customize the HTTP request used to upload files.
* @constructor
* @param fileKey {String} Name of file request parameter.
@@ -3921,7 +3857,7 @@ PhoneGap.Media.onStatus = function(id, msg, value) {
media.errorCallback({"code":value});
}
}
- else if (msg == Media.MEDIA_POSITION) {
+ else if (msg === Media.MEDIA_POSITION) {
media._position = value;
}
};
@@ -3963,7 +3899,7 @@ var Connection = function() {
this.getInfo(
function(type) {
// Need to send events if we are on or offline
- if (type == "none") {
+ 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;
@@ -3972,7 +3908,7 @@ var Connection = function() {
}, me.timeout);
} else {
// If there is a current offline event pending clear it
- if (me._timer != null) {
+ if (me._timer !== null) {
clearTimeout(me._timer);
me._timer = null;
}
@@ -4019,7 +3955,7 @@ Connection.prototype.getInfo = function(successCallback, errorCallback) {
PhoneGap.addConstructor(function() {
if (typeof navigator.network === "undefined") {
- navigator.network = new Object();
+ navigator.network = {};
}
if (typeof navigator.network.connection === "undefined") {
navigator.network.connection = new Connection();
@@ -4689,10 +4625,10 @@ PhoneGap.addConstructor(function() {
else {
return db;
}
- }
+ };
}
- if (typeof window.localStorage === "undefined") {
+ if ((typeof window.localStorage == "undefined") || (window.localStorage == null)) {
navigator.localStorage = window.localStorage = new CupcakeLocalStorage();
PhoneGap.waitForInitialization("cupcakeStorage");
}
View
BIN Android/Sample/libs/phonegap-1.2.0.jar
Binary file not shown.
View
BIN Android/Sample/libs/phonegap-1.3.0.jar
Binary file not shown.
View
2 Android/Sample/phonegap/templates/project/assets/www/index.html
@@ -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-1.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
View
BIN Android/phonegap-1.2.0.jar
Binary file not shown.
View
BIN Android/phonegap-1.3.0.jar
Binary file not shown.
View
404 Android/phonegap-1.2.0.js → Android/phonegap-1.3.0.js
@@ -50,21 +50,12 @@ if (typeof PhoneGap === "undefined") {
* window.onunload
*/
-if (typeof(DeviceInfo) !== 'object') {
- var DeviceInfo = {};
-}
-
/**
* This represents the PhoneGap API itself, and provides a global namespace for accessing
* information about the state of PhoneGap.
* @class
*/
var PhoneGap = {
- queue: {
- ready: true,
- commands: [],
- timer: null
- },
documentEventHandler: {}, // Collection of custom document event handlers
windowEventHandler: {} // Collection of custom window event handlers
};
@@ -207,11 +198,6 @@ PhoneGap.Channel.join = function(h, c) {
};
/**
- * Boolean flag indicating if the PhoneGap API is available and initialized.
- */ // TODO: Remove this, it is unused here ... -jm
-PhoneGap.available = DeviceInfo.uuid !== undefined;
-
-/**
* Add an initialization function to a queue that ensures it will run and initialize
* application constructors only once PhoneGap has been initialized.
* @param {Function} func The function callback you want run once PhoneGap is initialized
@@ -400,7 +386,7 @@ PhoneGap.m_window_addEventListener = window.addEventListener;
*/
PhoneGap.addWindowEventHandler = function(event, callback) {
PhoneGap.windowEventHandler[event] = callback;
-}
+};
/**
* Add a custom document event handler.
@@ -410,7 +396,7 @@ PhoneGap.addWindowEventHandler = function(event, callback) {
*/
PhoneGap.addDocumentEventHandler = function(event, callback) {
PhoneGap.documentEventHandler[event] = callback;
-}
+};
/**
* Intercept adding document event listeners and handle our own
@@ -738,58 +724,6 @@ PhoneGap.callbackError = function(callbackId, args) {
}
};
-
-/**
- * Internal function used to dispatch the request to PhoneGap. It processes the
- * command queue and executes the next command on the list. If one of the
- * arguments is a JavaScript object, it will be passed on the QueryString of the
- * url, which will be turned into a dictionary on the other end.
- * @private
- */
-// TODO: Is this used?
-PhoneGap.run_command = function() {
- if (!PhoneGap.available || !PhoneGap.queue.ready) {
- return;
- }
- PhoneGap.queue.ready = false;
-
- var args = PhoneGap.queue.commands.shift();
- if (PhoneGap.queue.commands.length === 0) {
- clearInterval(PhoneGap.queue.timer);
- PhoneGap.queue.timer = null;
- }
-
- var uri = [];
- var dict = null;
- var i;
- for (i = 1; i < args.length; i++) {
- var arg = args[i];
- if (arg === undefined || arg === null) {
- arg = '';
- }
- if (typeof(arg) === 'object') {
- dict = arg;
- } else {
- uri.push(encodeURIComponent(arg));
- }
- }
- var url = "gap://" + args[0] + "/" + uri.join("/");
- if (dict !== null) {
- var name;
- var query_args = [];
- for (name in dict) {
- if (dict.hasOwnProperty(name) && (typeof (name) === 'string')) {
- query_args.push(encodeURIComponent(name) + "=" + encodeURIComponent(dict[name]));
- }
- }
- if (query_args.length > 0) {
- url += "?" + query_args.join("&");
- }
- }
- document.location = url;
-
-};
-
PhoneGap.JSCallbackPort = null;
PhoneGap.JSCallbackToken = null;
@@ -1005,6 +939,122 @@ PhoneGap.includeJavascript = function(jsfile, successCallback) {
* under the License.
*/
+if (!PhoneGap.hasResource("device")) {
+PhoneGap.addResource("device");
+
+/**
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
+ * phone, etc.
+ * @constructor
+ */
+var Device = function() {
+ this.available = PhoneGap.available;
+ this.platform = null;
+ this.version = null;
+ this.name = null;
+ this.uuid = null;
+ this.phonegap = null;
+
+ var me = this;
+ this.getInfo(
+ function(info) {
+ me.available = true;
+ me.platform = info.platform;
+ me.version = info.version;
+ me.name = info.name;
+ me.uuid = info.uuid;
+ me.phonegap = info.phonegap;
+ PhoneGap.onPhoneGapInfoReady.fire();
+ },
+ function(e) {
+ me.available = false;
+ console.log("Error initializing PhoneGap: " + e);
+ alert("Error initializing PhoneGap: "+e);
+ });
+};
+
+/**
+ * Get device info
+ *
+ * @param {Function} successCallback The function to call when the heading data is available
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
+ */
+Device.prototype.getInfo = function(successCallback, errorCallback) {
+
+ // successCallback required
+ if (typeof successCallback !== "function") {
+ console.log("Device Error: successCallback is not a function");
+ return;
+ }
+
+ // errorCallback optional
+ if (errorCallback && (typeof errorCallback !== "function")) {
+ console.log("Device Error: errorCallback is not a function");
+ return;
+ }
+
+ // Get info
+ PhoneGap.exec(successCallback, errorCallback, "Device", "getDeviceInfo", []);
+};
+
+/*
+ * DEPRECATED
+ * This is only for Android.
+ *
+ * You must explicitly override the back button.
+ */
+Device.prototype.overrideBackButton = function() {
+ console.log("Device.overrideBackButton() is deprecated. Use App.overrideBackbutton(true).");
+ navigator.app.overrideBackbutton(true);
+};
+
+/*
+ * DEPRECATED
+ * This is only for Android.
+ *
+ * This resets the back button to the default behaviour
+ */
+Device.prototype.resetBackButton = function() {
+ console.log("Device.resetBackButton() is deprecated. Use App.overrideBackbutton(false).");
+ navigator.app.overrideBackbutton(false);
+};
+
+/*
+ * DEPRECATED
+ * This is only for Android.
+ *
+ * This terminates the activity!
+ */
+Device.prototype.exitApp = function() {
+ console.log("Device.exitApp() is deprecated. Use App.exitApp().");
+ navigator.app.exitApp();
+};
+
+PhoneGap.addConstructor(function() {
+ if (typeof navigator.device === "undefined") {
+ navigator.device = window.device = new Device();
+ }
+});
+}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
if (!PhoneGap.hasResource("accelerometer")) {
PhoneGap.addResource("accelerometer");
@@ -1220,16 +1270,6 @@ App.prototype.exitApp = function() {
return PhoneGap.exec(null, null, "App", "exitApp", []);
};
-/**
- * Add entry to approved list of URLs (whitelist) that will be loaded into PhoneGap container instead of default browser.
- *
- * @param origin URL regular expression to allow
- * @param subdomains T=include all subdomains under origin
- */
-App.prototype.addWhiteListEntry = function(origin, subdomains) {
- return PhoneGap.exec(null, null, "App", "addWhiteListEntry", [origin, subdomains]);
-};
-
PhoneGap.addConstructor(function() {
navigator.app = new App();
});
@@ -1286,35 +1326,33 @@ Battery.prototype.eventHandler = function(eventType, handler, add) {
// Register the event listener in the proper array
if (eventType === "batterystatus") {
- var pos = me._batteryListener.indexOf(handler);
- if (pos === -1) {
- me._batteryListener.push(handler);
+ if (me._batteryListener.indexOf(handler) === -1) {
+ me._batteryListener.push(handler);
}
} else if (eventType === "batterylow") {
- var pos = me._lowListener.indexOf(handler);
- if (pos === -1) {
- me._lowListener.push(handler);
+ if (me._lowListener.indexOf(handler) === -1) {
+ me._lowListener.push(handler);
}
} else if (eventType === "batterycritical") {
- var pos = me._criticalListener.indexOf(handler);
- if (pos === -1) {
- me._criticalListener.push(handler);
+ if (me._criticalListener.indexOf(handler) === -1) {
+ me._criticalListener.push(handler);
}
}
} else {
+ var pos = -1;
// Remove the event listener from the proper array
if (eventType === "batterystatus") {
- var pos = me._batteryListener.indexOf(handler);
+ pos = me._batteryListener.indexOf(handler);
if (pos > -1) {
me._batteryListener.splice(pos, 1);
}
} else if (eventType === "batterylow") {
- var pos = me._lowListener.indexOf(handler);
+ pos = me._lowListener.indexOf(handler);
if (pos > -1) {
me._lowListener.splice(pos, 1);
}
} else if (eventType === "batterycritical") {
- var pos = me._criticalListener.indexOf(handler);
+ pos = me._criticalListener.indexOf(handler);
if (pos > -1) {
me._criticalListener.splice(pos, 1);
}
@@ -1335,21 +1373,22 @@ Battery.prototype.eventHandler = function(eventType, handler, add) {
Battery.prototype._status = function(info) {
if (info) {
var me = this;
- if (me._level != info.level || me._isPlugged != info.isPlugged) {
+ var level = info.level;
+ if (me._level !== level || me._isPlugged !== info.isPlugged) {
// Fire batterystatus event
PhoneGap.fireWindowEvent("batterystatus", info);
// Fire low battery event
- if (info.level == 20 || info.level == 5) {
- if (info.level == 20) {
+ if (level === 20 || level === 5) {
+ if (level === 20) {
PhoneGap.fireWindowEvent("batterylow", info);
}
else {
PhoneGap.fireWindowEvent("batterycritical", info);
}
}
}
- me._level = info.level;
+ me._level = level;
me._isPlugged = info.isPlugged;
}
};
@@ -1496,7 +1535,7 @@ Camera.prototype.getPicture = function(successCallback, errorCallback, options)
options.quality = 80;
}
if (options.maxResolution === null || typeof options.maxResolution === "undefined") {
- options.maxResolution = 0;
+ options.maxResolution = 0;
}
if (options.destinationType === null || typeof options.destinationType === "undefined") {
options.destinationType = Camera.DestinationType.DATA_URL;
@@ -1513,7 +1552,7 @@ Camera.prototype.getPicture = function(successCallback, errorCallback, options)
if (options.targetWidth === null || typeof options.targetWidth === "undefined") {
options.targetWidth = -1;
}
- else if (typeof options.targetWidth == "string") {
+ else if (typeof options.targetWidth === "string") {
var width = new Number(options.targetWidth);
if (isNaN(width) === false) {
options.targetWidth = width.valueOf();
@@ -1522,7 +1561,7 @@ Camera.prototype.getPicture = function(successCallback, errorCallback, options)
if (options.targetHeight === null || typeof options.targetHeight === "undefined") {
options.targetHeight = -1;
}
- else if (typeof options.targetHeight == "string") {
+ else if (typeof options.targetHeight === "string") {
var height = new Number(options.targetHeight);
if (isNaN(height) === false) {
options.targetHeight = height.valueOf();
@@ -1732,9 +1771,6 @@ var CaptureAudioOptions = function(){
};
PhoneGap.addConstructor(function(){
- if (typeof navigator.device === "undefined") {
- navigator.device = window.device = new Device();
- }
if (typeof navigator.device.capture === "undefined") {
navigator.device.capture = window.device.capture = new Capture();
}
@@ -1762,15 +1798,15 @@ PhoneGap.addConstructor(function(){
if (!PhoneGap.hasResource("compass")) {
PhoneGap.addResource("compass");
-CompassError = function(){
+var CompassError = function(){
this.code = null;
};
// Capture error codes
CompassError.COMPASS_INTERNAL_ERR = 0;
CompassError.COMPASS_NOT_SUPPORTED = 20;
-CompassHeading = function() {
+var CompassHeading = function() {
this.magneticHeading = null;
this.trueHeading = null;
this.headingAccuracy = null;
@@ -2287,122 +2323,6 @@ PhoneGap.addConstructor(function() {
* under the License.
*/
-if (!PhoneGap.hasResource("device")) {
-PhoneGap.addResource("device");
-
-/**
- * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
- * phone, etc.
- * @constructor
- */
-var Device = function() {
- this.available = PhoneGap.available;
- this.platform = null;
- this.version = null;
- this.name = null;
- this.uuid = null;
- this.phonegap = null;
-
- var me = this;
- this.getInfo(
- function(info) {
- me.available = true;
- me.platform = info.platform;
- me.version = info.version;
- me.name = info.name;
- me.uuid = info.uuid;
- me.phonegap = info.phonegap;
- PhoneGap.onPhoneGapInfoReady.fire();
- },
- function(e) {
- me.available = false;
- console.log("Error initializing PhoneGap: " + e);
- alert("Error initializing PhoneGap: "+e);
- });
-};
-
-/**
- * Get device info
- *
- * @param {Function} successCallback The function to call when the heading data is available
- * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
- */
-Device.prototype.getInfo = function(successCallback, errorCallback) {
-
- // successCallback required
- if (typeof successCallback !== "function") {
- console.log("Device Error: successCallback is not a function");
- return;
- }
-
- // errorCallback optional
- if (errorCallback && (typeof errorCallback !== "function")) {
- console.log("Device Error: errorCallback is not a function");
- return;
- }
-
- // Get info
- PhoneGap.exec(successCallback, errorCallback, "Device", "getDeviceInfo", []);
-};
-
-/*
- * DEPRECATED
- * This is only for Android.
- *
- * You must explicitly override the back button.
- */
-Device.prototype.overrideBackButton = function() {
- console.log("Device.overrideBackButton() is deprecated. Use App.overrideBackbutton(true).");
- navigator.app.overrideBackbutton(true);
-};
-
-/*
- * DEPRECATED
- * This is only for Android.
- *
- * This resets the back button to the default behaviour
- */
-Device.prototype.resetBackButton = function() {
- console.log("Device.resetBackButton() is deprecated. Use App.overrideBackbutton(false).");
- navigator.app.overrideBackbutton(false);
-};
-
-/*
- * DEPRECATED
- * This is only for Android.
- *
- * This terminates the activity!
- */
-Device.prototype.exitApp = function() {
- console.log("Device.exitApp() is deprecated. Use App.exitApp().");
- navigator.app.exitApp();
-};
-
-PhoneGap.addConstructor(function() {
- if (typeof navigator.device === "undefined") {
- navigator.device = window.device = new Device();
- }
-});
-}
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
if (!PhoneGap.hasResource("file")) {
PhoneGap.addResource("file");
@@ -2771,7 +2691,7 @@ FileWriter.prototype.abort = function() {
this.readyState = FileWriter.DONE;
// If write end callback
- if (typeof this.onwriteend == "function") {
+ if (typeof this.onwriteend === "function") {
this.onwriteend({"type":"writeend", "target":this});
}
};
@@ -3229,14 +3149,14 @@ FileEntry.prototype.createWriter = function(successCallback, errorCallback) {
var writer = new FileWriter(filePointer);
if (writer.fileName === null || writer.fileName === "") {
- if (typeof errorCallback == "function") {
+ if (typeof errorCallback === "function") {
errorCallback({
"code": FileError.INVALID_STATE_ERR
});
}
}
- if (typeof successCallback == "function") {
+ if (typeof successCallback === "function") {
successCallback(writer);
}
}, errorCallback);
@@ -3271,7 +3191,7 @@ LocalFileSystem.APPLICATION = 3;
*/
LocalFileSystem.prototype.requestFileSystem = function(type, size, successCallback, errorCallback) {
if (type < 0 || type > 3) {
- if (typeof errorCallback == "function") {
+ if (typeof errorCallback === "function") {
errorCallback({
"code": FileError.SYNTAX_ERR
});
@@ -3379,12 +3299,17 @@ LocalFileSystem.prototype._castDate = function(pluginResult) {
PhoneGap.addConstructor(function() {
var pgLocalFileSystem = new LocalFileSystem();
// Needed for cast methods
- if(typeof window.localFileSystem == "undefined") window.localFileSystem = pgLocalFileSystem;
- if(typeof window.requestFileSystem == "undefined") window.requestFileSystem = pgLocalFileSystem.requestFileSystem;
- if(typeof window.resolveLocalFileSystemURI == "undefined") window.resolveLocalFileSystemURI = pgLocalFileSystem.resolveLocalFileSystemURI;
+ if (typeof window.localFileSystem === "undefined") {
+ window.localFileSystem = pgLocalFileSystem;
+ }
+ if (typeof window.requestFileSystem === "undefined") {
+ window.requestFileSystem = pgLocalFileSystem.requestFileSystem;
+ }
+ if (typeof window.resolveLocalFileSystemURI === "undefined") {
+ window.resolveLocalFileSystemURI = pgLocalFileSystem.resolveLocalFileSystemURI;
+ }
});
-}
-/*
+}/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -3455,7 +3380,7 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
fileKey = options.fileKey;
fileName = options.fileName;
mimeType = options.mimeType;
- if (options.chunkedMode != null || typeof options.chunkedMode != "undefined") {
+ if (options.chunkedMode !== null || typeof options.chunkedMode !== "undefined") {
chunkedMode = options.chunkedMode;
}
if (options.params) {
@@ -3470,6 +3395,17 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
};
/**
+ * Downloads a file form a given URL and saves it to the specified directory.
+ * @param source {String} URL of the server to receive the file
+ * @param target {String} Full path of the file on the device
+ * @param successCallback (Function} Callback to be invoked when upload has completed
+ * @param errorCallback {Function} Callback to be invoked upon error
+ */
+FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {
+ PhoneGap.exec(successCallback, errorCallback, 'FileTransfer', 'download', [source, target]);
+};
+
+/**
* Options to customize the HTTP request used to upload files.
* @constructor
* @param fileKey {String} Name of file request parameter.
@@ -3921,7 +3857,7 @@ PhoneGap.Media.onStatus = function(id, msg, value) {
media.errorCallback({"code":value});
}
}
- else if (msg == Media.MEDIA_POSITION) {
+ else if (msg === Media.MEDIA_POSITION) {
media._position = value;
}
};
@@ -3963,7 +3899,7 @@ var Connection = function() {
this.getInfo(
function(type) {
// Need to send events if we are on or offline
- if (type == "none") {
+ 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;
@@ -3972,7 +3908,7 @@ var Connection = function() {
}, me.timeout);
} else {
// If there is a current offline event pending clear it
- if (me._timer != null) {
+ if (me._timer !== null) {
clearTimeout(me._timer);
me._timer = null;
}
@@ -4019,7 +3955,7 @@ Connection.prototype.getInfo = function(successCallback, errorCallback) {
PhoneGap.addConstructor(function() {
if (typeof navigator.network === "undefined") {
- navigator.network = new Object();
+ navigator.network = {};
}
if (typeof navigator.network.connection === "undefined") {
navigator.network.connection = new Connection();
@@ -4689,10 +4625,10 @@ PhoneGap.addConstructor(function() {
else {
return db;
}
- }
+ };
}
- if (typeof window.localStorage === "undefined") {
+ if ((typeof window.localStorage == "undefined") || (window.localStorage == null)) {
navigator.localStorage = window.localStorage = new CupcakeLocalStorage();
PhoneGap.waitForInitialization("cupcakeStorage");
}
View
7 Bada/Res/phonegap/accelerometer.js
@@ -1,10 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
function Acceleration(x, y, z, timestamp) {
this.x = x;
this.y = y;
View
9 Bada/Res/phonegap/camera.js
@@ -1,12 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
/**
* This class provides access to the device camera.
*
View
8 Bada/Res/phonegap/contact.js
@@ -1,11 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
/**
* Contains information about a single contact.
* @param {DOMString} id unique identifier
View
9 Bada/Res/phonegap/device.js
@@ -1,12 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
/**
* This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
* phone, etc.
View
9 Bada/Res/phonegap/file.js
@@ -1,12 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
/**
* These classes provides generic read and write access to the mobile device file system.
* They are not used to read files from a server.
View
9 Bada/Res/phonegap/geolocation.js
@@ -1,12 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
/**
* This class provides access to device GPS data.
* @constructor
View
9 Bada/Res/phonegap/network.js
@@ -1,12 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
/**
* Network status.
*/
View
9 Bada/Res/phonegap/notification.js
@@ -1,12 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
MessageBox.MSGBOX_STYLE_NONE = 0;
MessageBox.MSGBOX_STYLE_OK = 1;
MessageBox.MSGBOX_STYLE_CANCEL = 2;
View
22 Bada/Res/phonegap/phonegap.base.js
@@ -1,12 +1,22 @@
-
/*
- * 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
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
+
/**
* The order of events during page load and PhoneGap startup is as follows:
*
View
9 Bada/Res/phonegap/position.js
@@ -1,12 +1,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.
- *
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
/**
* This class contains position information.
* @param {Object} lat
View