Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Restructure again since Im not going to get to where I want this to b…

…e today. Ship it
  • Loading branch information...
commit e0a7337c2f55849c1437d1f1ec3786458456e1ac 1 parent ef5d475
Dave Johnson authored
Showing with 18,330 additions and 11,377 deletions.
  1. 0  {test → app}/Makefile
  2. 0  {test → app}/bin/build/android
  3. 0  {test → app}/bin/build/android-copy-icons
  4. 0  {test → app}/bin/build/blackberry
  5. 0  {test → app}/bin/build/blackberry-copy-icons
  6. 0  {test → app}/bin/build/ios
  7. 0  {test → app}/bin/build/ios-add-plugins
  8. 0  {test → app}/bin/build/ios-copy-icons
  9. +5 −0 app/bin/build/webos
  10. +7 −2 {test → app}/bin/create/android
  11. 0  {test → app}/bin/create/android-convert-config
  12. 0  {test → app}/bin/create/blackberry
  13. 0  {test → app}/bin/create/ios
  14. 0  {test → app}/bin/create/templates/android/Activity.java
  15. 0  {test → app}/bin/create/templates/android/intents.xml
  16. 0  {test → app}/bin/create/templates/android/phonegap-0.9.4.jar
  17. 0  {test → app}/bin/create/templates/android/phonegap-0.9.4.js
  18. 0  {test → app}/bin/create/templates/blackberry/build.xml
  19. 0  {test → app}/bin/create/templates/blackberry/config.xml
  20. 0  .../templates/blackberry/lib/phonegap.0.9.4 → app/bin/create/templates/blackberry}/ext/phonegap.0.9.4.jar
  21. 0  {test → app}/bin/create/templates/blackberry/img/icon.png
  22. 0  {test → app}/bin/create/templates/blackberry/img/icon_hover.png
  23. 0  {test → app}/bin/create/templates/blackberry/img/loading_foreground.png
  24. 0  {test → app}/bin/create/templates/blackberry/javascript/phonegap-0.9.4.js
  25. 0  {test → app}/bin/create/templates/blackberry/javascript/phonegap-0.9.4.min.js
  26. 0  {test → app}/bin/create/templates/blackberry/lib/ant-contrib/LICENSE.txt
  27. 0  {test → app}/bin/create/templates/blackberry/lib/ant-contrib/ant-contrib-1.0b3.jar
  28. 0  .../templates/blackberry → app/bin/create/templates/blackberry/lib/phonegap.0.9.4}/ext/phonegap.0.9.4.jar
  29. 0  {test → app}/bin/create/templates/blackberry/lib/phonegap.0.9.4/javascript/phonegap.0.9.4.js
  30. 0  {test → app}/bin/create/templates/blackberry/lib/phonegap.0.9.4/javascript/phonegap.0.9.4.min.js
  31. 0  {test → app}/bin/create/templates/blackberry/project.properties
  32. 0  {test → app}/bin/create/templates/ios/.gitignore
  33. 0  {test → app}/bin/create/templates/ios/Classes/___PROJECTNAMEASIDENTIFIER___AppDelegate.h
  34. 0  {test → app}/bin/create/templates/ios/Classes/___PROJECTNAMEASIDENTIFIER___AppDelegate.m
  35. 0  {test → app}/bin/create/templates/ios/Default-Landscape.png
  36. 0  {test → app}/bin/create/templates/ios/Default-Portrait.png
  37. 0  {test → app}/bin/create/templates/ios/Default.png
  38. 0  {test → app}/bin/create/templates/ios/PhoneGap.plist
  39. 0  {test → app}/bin/create/templates/ios/PhoneGapBuildSettings.xcconfig
  40. 0  {test → app}/bin/create/templates/ios/Plugins/README
  41. 0  {test → app}/bin/create/templates/ios/___PROJECTNAMEASIDENTIFIER___-Info.plist
  42. 0  {test → app}/bin/create/templates/ios/___PROJECTNAMEASIDENTIFIER____Prefix.pch
  43. 0  {test → app}/bin/create/templates/ios/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
  44. 0  {test → app}/bin/create/templates/ios/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
  45. 0  {test → app}/bin/create/templates/ios/___PROJECTNAME___.xcodeproj/project.pbxproj
  46. 0  {test → app}/bin/create/templates/ios/icon-72.png
  47. 0  {test → app}/bin/create/templates/ios/icon.png
  48. 0  {test → app}/bin/create/templates/ios/icon@2x.png
  49. 0  {test → app}/bin/create/templates/ios/main.m
  50. 0  {test → app}/bin/create/templates/ios/www/index.html
  51. +9 −0 app/bin/create/templates/webos/appinfo.json
  52. +16 −0 app/bin/create/templates/webos/index.html
  53. +11 −11 {test → app}/bin/create/webos
  54. 0  {test → app}/bin/debug/android
  55. 0  {test → app}/bin/debug/blackberry
  56. 0  {test → app}/bin/debug/ios
  57. 0  {test/bin/test → app/bin/debug}/webos
  58. 0  {test → app}/bin/emulate/android
  59. 0  {test → app}/bin/emulate/ios
  60. +3 −0  app/bin/emulate/webos
  61. 0  {test → app}/bin/log/android
  62. 0  {test → app}/bin/log/ios
  63. +3 −0  app/bin/log/webos
  64. 0  {test → app}/bin/plugin/find
  65. 0  {test → app}/bin/plugin/install
  66. 0  {test → app}/bin/plugin/list
  67. 0  {test → app}/bin/plugin/register
  68. 0  {test → app}/bin/plugin/remove
  69. 0  {test → app}/bin/plugin/shotgun/android
  70. 0  {test → app}/bin/plugin/shotgun/ios
  71. 0  {test → app}/bin/plugin/validate
  72. 0  {test → app}/bin/test/android
  73. 0  {test → app}/bin/test/ios
  74. 0  {test/bin/debug → app/bin/test}/webos
  75. 0  {test → app}/bin/util/BeautifulSoup.py
  76. 0  {test → app}/bin/util/read-config
  77. 0  {test → app}/bin/util/validate-config
  78. 0  {test → app}/bin/util/version-index
  79. 0  {test → app}/bin/util/weinre.jar
  80. +1 −0  app/lib/README.md
  81. +1 −0  app/lib/plugin/README.md
  82. +18 −0 app/test/index.html
  83. +6 −16 {test/www → app/test}/qunit.css
  84. +85 −89 {test/www → app/test}/qunit.js
  85. +314 −0 app/test/test.js
  86. +10 −0 app/tmp/android/AndroidManifest.xml
  87. +16 −0 app/tmp/android/assets/www/config.xml
  88. 0  app/{ → tmp/android/assets/www}/facebook.js
  89. 0  app/{ → tmp/android/assets/www}/icon.png
  90. 0  app/{ → tmp/android/assets/www}/index.html
  91. +4,227 −0 app/tmp/android/assets/www/phonegap-0.9.4.js
  92. +17 −0 app/tmp/android/build.properties
  93. +79 −0 app/tmp/android/build.xml
  94. +11 −0 app/tmp/android/default.properties
  95. +22 −0 app/tmp/android/gen/com/phonegap/example/R.java
  96. BIN  app/tmp/android/libs/facebook-android-sdk.jar
  97. BIN  app/tmp/android/libs/phonegap-0.9.4.jar
  98. +10 −0 app/tmp/android/local.properties
  99. +36 −0 app/tmp/android/proguard.cfg
  100. BIN  app/tmp/android/res/drawable-hdpi/icon.png
  101. BIN  app/tmp/android/res/drawable-ldpi/icon.png
  102. BIN  app/tmp/android/res/drawable-mdpi/icon.png
  103. +13 −0 app/tmp/android/res/layout/main.xml
  104. +4 −0 app/tmp/android/res/values/strings.xml
  105. +137 −0 app/tmp/android/src/com/facebook/phonegap/ConnectPlugin.java
  106. +16 −0 app/tmp/android/src/com/phonegap/example/ExampleApp.java
  107. +16 −0 app/tmp/android/src/com/phonegap/example/ExampleApp.java''
  108. +13 −0 app/tmp/ios.log
  109. +6 −0 app/tmp/ios/.gitignore
  110. +16 −0 app/tmp/ios/Classes/ExampleAppAppDelegate.h
  111. +81 −0 app/tmp/ios/Classes/ExampleAppAppDelegate.m
  112. BIN  app/tmp/ios/Default-Landscape.png
  113. BIN  app/tmp/ios/Default-Portrait.png
  114. BIN  app/tmp/ios/Default.png
  115. +49 −0 app/tmp/ios/ExampleApp-Info.plist
  116. BIN  app/tmp/ios/ExampleApp.xcodeproj/TemplateIcon.icns
  117. +8 −0 app/tmp/ios/ExampleApp.xcodeproj/TemplateInfo.plist
  118. +451 −0 app/tmp/ios/ExampleApp.xcodeproj/project.pbxproj
  119. +8 −0 app/tmp/ios/ExampleApp_Prefix.pch
  120. +14 −0 app/tmp/ios/PhoneGap.plist
  121. +8 −0 app/tmp/ios/PhoneGapBuildSettings.xcconfig
  122. BIN  app/tmp/ios/icon-72.png
  123. BIN  app/tmp/ios/icon.png
  124. BIN  app/tmp/ios/icon@2x.png
  125. +17 −0 app/tmp/ios/main.m
  126. +16 −0 app/tmp/ios/www/config.xml
  127. +4,551 −0 app/tmp/ios/www/facebook.js
  128. BIN  app/tmp/ios/www/icon.png
  129. +131 −0 app/tmp/ios/www/index.html
  130. +3,169 −0 app/tmp/ios/www/phonegap.0.9.5.js
  131. +1 −0  app/tmp/ios/www/phonegap.0.9.5.min.js
  132. +16 −0 app/www/config.xml
  133. +4,551 −0 app/www/facebook.js
  134. BIN  app/www/icon.png
  135. +131 −0 app/www/index.html
  136. BIN  native/android/libs/facebook-android-sdk.jar
  137. +0 −19 run-tests
  138. +0 −3  test/.gitignore
  139. +0 −5 test/bin/build/webos
  140. +0 −121 test/bin/create/templates/webos/app/assistants/Main-assistant.js
  141. +0 −56 test/bin/create/templates/webos/app/views/main/main-scene.html
  142. +0 −9 test/bin/create/templates/webos/appinfo.json
  143. +0 −10 test/bin/create/templates/webos/css/main.css
  144. BIN  test/bin/create/templates/webos/img/icon.png
  145. +0 −56 test/bin/create/templates/webos/index.html
  146. +0 −506 test/bin/create/templates/webos/jqtouch/jqtouch.css
  147. +0 −900 test/bin/create/templates/webos/jqtouch/jqtouch.js
  148. +0 −6,240 test/bin/create/templates/webos/jqtouch/jquery-1.4.2.js
  149. +0 −154 test/bin/create/templates/webos/jqtouch/jquery-1.4.2.min.js
  150. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/activeButton.png
  151. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/backButton.png
  152. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/cancel.png
  153. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/chevron.png
  154. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/grayButton.png
  155. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/greenButton.png
  156. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/listArrowSel.png
  157. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/listGroup.png
  158. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/loading.gif
  159. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/on_off.png
  160. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/pinstripes.png
  161. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/redButton.png
  162. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/selection.png
  163. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/thumb.png
  164. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/toggle.png
  165. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/toggleOn.png
  166. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/toolButton.png
  167. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/toolbar.png
  168. BIN  test/bin/create/templates/webos/jqtouch/themes/apple/img/whiteButton.png
  169. +0 −740 test/bin/create/templates/webos/jqtouch/themes/apple/theme.css
  170. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/backButton.png
  171. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/backButtonActive.png
  172. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/bigButton.png
  173. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/bigButtonActive.png
  174. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/button.png
  175. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/buttonActive.png
  176. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/chevron.png
  177. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/chevronActive.png
  178. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/chevronCircle.png
  179. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/chevronCircleActive.png
  180. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/loading.gif
  181. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/toggleSwitch.png
  182. BIN  test/bin/create/templates/webos/jqtouch/themes/default/img/toolbarBackground.png
  183. +0 −556 test/bin/create/templates/webos/jqtouch/themes/default/theme.css
  184. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/activeButton.png
  185. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/back_button.png
  186. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/back_button_clicked.png
  187. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/blueButton.png
  188. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/button.png
  189. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/button_clicked.png
  190. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/chevron.png
  191. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/chevron_circle.png
  192. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/grayButton.png
  193. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/greenButton.png
  194. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/loading.gif
  195. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/on_off.png
  196. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/redButton.png
  197. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/rowhead.png
  198. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/toggle.png
  199. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/toggleOn.png
  200. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/toolbar.png
  201. BIN  test/bin/create/templates/webos/jqtouch/themes/jqt/img/whiteButton.png
  202. +0 −577 test/bin/create/templates/webos/jqtouch/themes/jqt/theme.css
  203. +0 −38 test/bin/create/templates/webos/js/app.js
  204. +0 −1,209 test/bin/create/templates/webos/js/phonegap.js
  205. +0 −18 test/bin/create/templates/webos/root.html
  206. +0 −4 test/bin/create/templates/webos/sources.json
  207. +0 −3  test/bin/emulate/webos
  208. +0 −3  test/bin/log/webos
  209. 0  test/{www → }/facebook-connect-tests.js
  210. +0 −1  test/tmp/README.md
  211. BIN  test/tmp/cache
  212. +0 −9 test/www/config.xml
  213. +0 −19 test/www/index.html
  214. +0 −3  {lib → www}/pg-plugin-fb-connect.js
View
0  test/Makefile → app/Makefile
File renamed without changes
View
0  test/bin/build/android → app/bin/build/android
File renamed without changes
View
0  test/bin/build/android-copy-icons → app/bin/build/android-copy-icons
File renamed without changes
View
0  test/bin/build/blackberry → app/bin/build/blackberry
File renamed without changes
View
0  test/bin/build/blackberry-copy-icons → app/bin/build/blackberry-copy-icons
File renamed without changes
View
0  test/bin/build/ios → app/bin/build/ios
File renamed without changes
View
0  test/bin/build/ios-add-plugins → app/bin/build/ios-add-plugins
File renamed without changes
View
0  test/bin/build/ios-copy-icons → app/bin/build/ios-copy-icons
File renamed without changes
View
5 app/bin/build/webos
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+palm-package -o ./tmp/webos/ ./tmp/webos/
+palm-install $(find ./tmp/webos -name '*.ipk')
+palm-launch $(./bin/util/read-config id)
View
9 test/bin/create/android → app/bin/create/android
@@ -8,11 +8,16 @@ FULL="./tmp/android/src/"$PTH"/"$ACT".java"
# clobber existing build sludge
rm -rf ./tmp/android
-if [ `uname -o` = "Cygwin" ]
-then
+
+
+if [ `uname -o` = "Cygwin" ]; then
# Cygwin specific stuff
ANDROID="android.bat"
SEDARG=""
+elif [ `uname -o` = "GNU/Linux" ]; then
+ # Linux
+ ANDROID="android"
+ SEDARG=""
else
# Other UNIX (Linux, etc.) specific stuff
ANDROID="android"
View
0  test/bin/create/android-convert-config → app/bin/create/android-convert-config
File renamed without changes
View
0  test/bin/create/blackberry → app/bin/create/blackberry
File renamed without changes
View
0  test/bin/create/ios → app/bin/create/ios
File renamed without changes
View
0  ...in/create/templates/android/Activity.java → ...in/create/templates/android/Activity.java
File renamed without changes
View
0  .../bin/create/templates/android/intents.xml → app/bin/create/templates/android/intents.xml
File renamed without changes
View
0  ...eate/templates/android/phonegap-0.9.4.jar → ...eate/templates/android/phonegap-0.9.4.jar
File renamed without changes
View
0  ...reate/templates/android/phonegap-0.9.4.js → ...reate/templates/android/phonegap-0.9.4.js
File renamed without changes
View
0  ...bin/create/templates/blackberry/build.xml → ...bin/create/templates/blackberry/build.xml
File renamed without changes
View
0  ...in/create/templates/blackberry/config.xml → ...in/create/templates/blackberry/config.xml
File renamed without changes
View
0  ...lib/phonegap.0.9.4/ext/phonegap.0.9.4.jar → ...mplates/blackberry/ext/phonegap.0.9.4.jar
File renamed without changes
View
0  .../create/templates/blackberry/img/icon.png → .../create/templates/blackberry/img/icon.png
File renamed without changes
View
0  ...e/templates/blackberry/img/icon_hover.png → ...e/templates/blackberry/img/icon_hover.png
File renamed without changes
View
0  ...tes/blackberry/img/loading_foreground.png → ...tes/blackberry/img/loading_foreground.png
File renamed without changes
View
0  ...s/blackberry/javascript/phonegap-0.9.4.js → ...s/blackberry/javascript/phonegap-0.9.4.js
File renamed without changes
View
0  ...ackberry/javascript/phonegap-0.9.4.min.js → ...ackberry/javascript/phonegap-0.9.4.min.js
File renamed without changes
View
0  ...es/blackberry/lib/ant-contrib/LICENSE.txt → ...es/blackberry/lib/ant-contrib/LICENSE.txt
File renamed without changes
View
0  ...rry/lib/ant-contrib/ant-contrib-1.0b3.jar → ...rry/lib/ant-contrib/ant-contrib-1.0b3.jar
File renamed without changes
View
0  ...mplates/blackberry/ext/phonegap.0.9.4.jar → ...lib/phonegap.0.9.4/ext/phonegap.0.9.4.jar
File renamed without changes
View
0  ...onegap.0.9.4/javascript/phonegap.0.9.4.js → ...onegap.0.9.4/javascript/phonegap.0.9.4.js
File renamed without changes
View
0  ...ap.0.9.4/javascript/phonegap.0.9.4.min.js → ...ap.0.9.4/javascript/phonegap.0.9.4.min.js
File renamed without changes
View
0  ...e/templates/blackberry/project.properties → ...e/templates/blackberry/project.properties
File renamed without changes
View
0  test/bin/create/templates/ios/.gitignore → app/bin/create/templates/ios/.gitignore
File renamed without changes
View
0  ...__PROJECTNAMEASIDENTIFIER___AppDelegate.h → ...__PROJECTNAMEASIDENTIFIER___AppDelegate.h
File renamed without changes
View
0  ...__PROJECTNAMEASIDENTIFIER___AppDelegate.m → ...__PROJECTNAMEASIDENTIFIER___AppDelegate.m
File renamed without changes
View
0  ...reate/templates/ios/Default-Landscape.png → ...reate/templates/ios/Default-Landscape.png
File renamed without changes
View
0  ...create/templates/ios/Default-Portrait.png → ...create/templates/ios/Default-Portrait.png
File renamed without changes
View
0  test/bin/create/templates/ios/Default.png → app/bin/create/templates/ios/Default.png
File renamed without changes
View
0  test/bin/create/templates/ios/PhoneGap.plist → app/bin/create/templates/ios/PhoneGap.plist
File renamed without changes
View
0  ...plates/ios/PhoneGapBuildSettings.xcconfig → ...plates/ios/PhoneGapBuildSettings.xcconfig
File renamed without changes
View
0  test/bin/create/templates/ios/Plugins/README → app/bin/create/templates/ios/Plugins/README
File renamed without changes
View
0  .../___PROJECTNAMEASIDENTIFIER___-Info.plist → .../___PROJECTNAMEASIDENTIFIER___-Info.plist
File renamed without changes
View
0  .../___PROJECTNAMEASIDENTIFIER____Prefix.pch → .../___PROJECTNAMEASIDENTIFIER____Prefix.pch
File renamed without changes
View
0  ...ROJECTNAME___.xcodeproj/TemplateIcon.icns → ...ROJECTNAME___.xcodeproj/TemplateIcon.icns
File renamed without changes
View
0  ...OJECTNAME___.xcodeproj/TemplateInfo.plist → ...OJECTNAME___.xcodeproj/TemplateInfo.plist
File renamed without changes
View
0  ..._PROJECTNAME___.xcodeproj/project.pbxproj → ..._PROJECTNAME___.xcodeproj/project.pbxproj
File renamed without changes
View
0  test/bin/create/templates/ios/icon-72.png → app/bin/create/templates/ios/icon-72.png
File renamed without changes
View
0  test/bin/create/templates/ios/icon.png → app/bin/create/templates/ios/icon.png
File renamed without changes
View
0  test/bin/create/templates/ios/icon@2x.png → app/bin/create/templates/ios/icon@2x.png
File renamed without changes
View
0  test/bin/create/templates/ios/main.m → app/bin/create/templates/ios/main.m
File renamed without changes
View
0  test/bin/create/templates/ios/www/index.html → app/bin/create/templates/ios/www/index.html
File renamed without changes
View
9 app/bin/create/templates/webos/appinfo.json
@@ -0,0 +1,9 @@
+{
+ "id": "com.phonegap.example",
+ "version": "0.1.0",
+ "vendor": "HP",
+ "type": "web",
+ "main": "index.html",
+ "title": "PhoneGap WebOS",
+ "uiRevision": 2
+}
View
16 app/bin/create/templates/webos/index.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+
+
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>PhoneGap WebOS</title>
+
+</head>
+<body>
+
+Hello World
+
+
+</body>
+</html>
View
22 test/bin/create/webos → app/bin/create/webos
@@ -2,14 +2,14 @@
import sys, os
from xml.dom.minidom import parse
-from BeautifulSoup import BeautifulSoup
+# from BeautifulSoup import BeautifulSoup
def copy_template():
# clobber and create the webos src dir
os.system("rm -rf ./tmp/webos")
os.system("cp -r ./bin/create/templates/webos ./tmp/webos")
# copy www contents into the src
- os.system("cp -r ./www ./tmp/webos/")
+ os.system("cp -r ./www/ ./tmp/webos/")
def read_config():
# read in the config.xml values
@@ -21,18 +21,18 @@ def main():
copy_template()
read_config()
- soup = BeautifulSoup(open('./www/index.html').read())
- body = ''.join(map(unicode, soup.body.contents))
+# soup = BeautifulSoup(open('./www/index.html').read())
+# body = ''.join(map(unicode, soup.body.contents))
# reset body to nothin
- soup.body.contents = ''
+# soup.body.contents = ''
# write the layout
- root = open('./tmp/webos/root.html','w')
- root.write(str(soup))
- root.close()
+# root = open('./tmp/webos/root.html','w')
+# root.write(str(soup))
+# root.close()
# write the content
- main = open('./tmp/webos/app/views/main/main-scene.html','w')
- main.write(body)
- main.close()
+# main = open('./tmp/webos/app/views/main/main-scene.html','w')
+# main.write(body)
+# main.close()
# write appinfo.json
# write sources.json
View
0  test/bin/debug/android → app/bin/debug/android
File renamed without changes
View
0  test/bin/debug/blackberry → app/bin/debug/blackberry
File renamed without changes
View
0  test/bin/debug/ios → app/bin/debug/ios
File renamed without changes
View
0  test/bin/test/webos → app/bin/debug/webos
File renamed without changes
View
0  test/bin/emulate/android → app/bin/emulate/android
File renamed without changes
View
0  test/bin/emulate/ios → app/bin/emulate/ios
File renamed without changes
View
3  app/bin/emulate/webos
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+palm-emulator --start "SDK 2.1.0.519 (320x480)"
View
0  test/bin/log/android → app/bin/log/android
File renamed without changes
View
0  test/bin/log/ios → app/bin/log/ios
File renamed without changes
View
3  app/bin/log/webos
@@ -0,0 +1,3 @@
+#! /usr/sh
+
+palm-log $(./bin/util/read-config id)
View
0  test/bin/plugin/find → app/bin/plugin/find
File renamed without changes
View
0  test/bin/plugin/install → app/bin/plugin/install
File renamed without changes
View
0  test/bin/plugin/list → app/bin/plugin/list
File renamed without changes
View
0  test/bin/plugin/register → app/bin/plugin/register
File renamed without changes
View
0  test/bin/plugin/remove → app/bin/plugin/remove
File renamed without changes
View
0  test/bin/plugin/shotgun/android → app/bin/plugin/shotgun/android
File renamed without changes
View
0  test/bin/plugin/shotgun/ios → app/bin/plugin/shotgun/ios
File renamed without changes
View
0  test/bin/plugin/validate → app/bin/plugin/validate
File renamed without changes
View
0  test/bin/test/android → app/bin/test/android
File renamed without changes
View
0  test/bin/test/ios → app/bin/test/ios
File renamed without changes
View
0  test/bin/debug/webos → app/bin/test/webos
File renamed without changes
View
0  test/bin/util/BeautifulSoup.py → app/bin/util/BeautifulSoup.py
File renamed without changes
View
0  test/bin/util/read-config → app/bin/util/read-config
File renamed without changes
View
0  test/bin/util/validate-config → app/bin/util/validate-config
File renamed without changes
View
0  test/bin/util/version-index → app/bin/util/version-index
File renamed without changes
View
0  test/bin/util/weinre.jar → app/bin/util/weinre.jar
File renamed without changes
View
1  app/lib/README.md
@@ -0,0 +1 @@
+This file was generated by Cordova. This folder is a great place for your scripts and utilities.
View
1  app/lib/plugin/README.md
@@ -0,0 +1 @@
+TODO
View
18 app/test/index.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>QUnit Test Suite</title>
+ <link rel="stylesheet" href="qunit.css" type="text/css" media="screen">
+ <script type="text/javascript" src="qunit.js"></script>
+ <script type="text/javascript" src="test.js"></script>
+ <script type="text/javascript" src="app.js"></script>
+</head>
+<body>
+ <h1 id="qunit-header">QUnit Test Suite</h1>
+ <h2 id="qunit-banner"></h2>
+ <div id="qunit-testrunner-toolbar"></div>
+ <h2 id="qunit-userAgent"></h2>
+ <ol id="qunit-tests"></ol>
+ <div id="qunit-fixture">test markup</div>
+</body>
+</html>
View
22 test/www/qunit.css → app/test/qunit.css 100755 → 100644
@@ -1,17 +1,7 @@
-/**
- * QUnit - A JavaScript Unit Testing Framework
- *
- * http://docs.jquery.com/QUnit
- *
- * Copyright (c) 2011 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * or GPL (GPL-LICENSE.txt) licenses.
- */
-
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
- font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
+ font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
}
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
@@ -37,7 +27,7 @@
font-size: 1.5em;
line-height: 1em;
font-weight: normal;
-
+
border-radius: 15px 15px 0 0;
-moz-border-radius: 15px 15px 0 0;
-webkit-border-top-right-radius: 15px;
@@ -105,13 +95,13 @@
#qunit-tests ol {
margin-top: 0.5em;
padding: 0.5em;
-
+
background-color: #fff;
-
+
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
-
+
box-shadow: inset 0px 2px 13px #999;
-moz-box-shadow: inset 0px 2px 13px #999;
-webkit-box-shadow: inset 0px 2px 13px #999;
@@ -174,7 +164,7 @@
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
-
+
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
View
174 test/www/qunit.js → app/test/qunit.js 100755 → 100644
@@ -1,6 +1,6 @@
-/**
+/*
* QUnit - A JavaScript Unit Testing Framework
- *
+ *
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2011 John Resig, Jörn Zaefferer
@@ -78,7 +78,7 @@ Test.prototype = {
// allow utility functions to access the current test environment
// TODO why??
QUnit.current_testEnvironment = this.testEnvironment;
-
+
try {
if ( !config.pollution ) {
saveGlobal();
@@ -114,8 +114,8 @@ Test.prototype = {
},
teardown: function() {
try {
- this.testEnvironment.teardown.call(this.testEnvironment);
checkPollution();
+ this.testEnvironment.teardown.call(this.testEnvironment);
} catch(e) {
QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message );
}
@@ -124,7 +124,7 @@ Test.prototype = {
if ( this.expected && this.expected != this.assertions.length ) {
QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
}
-
+
var good = 0, bad = 0,
tests = id("qunit-tests");
@@ -154,9 +154,9 @@ Test.prototype = {
// store result when possible
if ( QUnit.config.reorder && defined.sessionStorage ) {
if (bad) {
- sessionStorage.setItem("qunit-" + this.module + "-" + this.testName, bad);
+ sessionStorage.setItem("qunit-" + this.module + "-" + this.testName, bad)
} else {
- sessionStorage.removeItem("qunit-" + this.module + "-" + this.testName);
+ sessionStorage.removeItem("qunit-" + this.testName);
}
}
@@ -166,17 +166,17 @@ Test.prototype = {
var b = document.createElement("strong");
b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
-
+
var a = document.createElement("a");
a.innerHTML = "Rerun";
a.href = QUnit.url({ filter: getText([b]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
-
+
addEvent(b, "click", function() {
var next = b.nextSibling.nextSibling,
display = next.style.display;
next.style.display = display === "none" ? "block" : "none";
});
-
+
addEvent(b, "dblclick", function(e) {
var target = e && e.target ? e.target : window.event.srcElement;
if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
@@ -217,7 +217,7 @@ Test.prototype = {
total: this.assertions.length
} );
},
-
+
queue: function() {
var test = this;
synchronize(function() {
@@ -246,7 +246,7 @@ Test.prototype = {
synchronize(run);
};
}
-
+
};
var QUnit = {
@@ -265,7 +265,7 @@ var QUnit = {
QUnit.test(testName, expected, callback, true);
},
-
+
test: function(testName, expected, callback, async) {
var name = '<span class="test-name">' + testName + '</span>', testEnvironmentArg;
@@ -286,13 +286,13 @@ var QUnit = {
if ( !validTest(config.currentModule + ": " + testName) ) {
return;
}
-
+
var test = new Test(name, testName, expected, testEnvironmentArg, async, callback);
test.module = config.currentModule;
test.moduleTestEnvironment = config.currentModuleTestEnviroment;
test.queue();
},
-
+
/**
* Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
*/
@@ -337,7 +337,7 @@ var QUnit = {
notEqual: function(actual, expected, message) {
QUnit.push(expected != actual, actual, expected, message);
},
-
+
deepEqual: function(actual, expected, message) {
QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
},
@@ -356,34 +356,34 @@ var QUnit = {
raises: function(block, expected, message) {
var actual, ok = false;
-
+
if (typeof expected === 'string') {
message = expected;
expected = null;
}
-
+
try {
block();
} catch (e) {
actual = e;
}
-
+
if (actual) {
// we don't want to validate thrown error
if (!expected) {
ok = true;
- // expected is a regexp
+ // expected is a regexp
} else if (QUnit.objectType(expected) === "regexp") {
ok = expected.test(actual);
- // expected is a constructor
+ // expected is a constructor
} else if (actual instanceof expected) {
ok = true;
- // expected is a validation function which returns true is validation passed
+ // expected is a validation function which returns true is validation passed
} else if (expected.call({}, actual) === true) {
ok = true;
}
}
-
+
QUnit.ok(ok, message);
},
@@ -412,7 +412,7 @@ var QUnit = {
process();
}
},
-
+
stop: function(timeout) {
config.semaphore++;
config.blocking = true;
@@ -438,7 +438,7 @@ var config = {
// block until document ready
blocking: true,
-
+
// by default, run previously failed tests first
// very useful in combination with "Hide passed tests" checked
reorder: true,
@@ -519,7 +519,7 @@ extend(QUnit, {
if ( result ) {
result.parentNode.removeChild( result );
}
-
+
if ( tests ) {
result = document.createElement( "p" );
result.id = "qunit-testresult";
@@ -528,23 +528,23 @@ extend(QUnit, {
result.innerHTML = 'Running...<br/>&nbsp;';
}
},
-
+
/**
* Resets the test setup. Useful for tests that modify the DOM.
- *
+ *
* If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
*/
reset: function() {
if ( window.jQuery ) {
- jQuery( "#qunit-fixture" ).html( config.fixture );
+ jQuery( "#main, #qunit-fixture" ).html( config.fixture );
} else {
- var main = id( 'qunit-fixture' );
+ var main = id( 'main' ) || id( 'qunit-fixture' );
if ( main ) {
main.innerHTML = config.fixture;
}
}
},
-
+
/**
* Trigger an event on an element.
*
@@ -564,12 +564,12 @@ extend(QUnit, {
elem.fireEvent("on"+type);
}
},
-
+
// Safe object type checking
is: function( type, obj ) {
return QUnit.objectType( obj ) == type;
},
-
+
objectType: function( obj ) {
if (typeof obj === "undefined") {
return "undefined";
@@ -603,7 +603,7 @@ extend(QUnit, {
}
return undefined;
},
-
+
push: function(result, actual, expected, message) {
var details = {
result: result,
@@ -611,7 +611,7 @@ extend(QUnit, {
actual: actual,
expected: expected
};
-
+
message = escapeHtml(message) || (result ? "okay" : "failed");
message = '<span class="test-message">' + message + "</span>";
expected = escapeHtml(QUnit.jsDump.parse(expected));
@@ -629,15 +629,15 @@ extend(QUnit, {
}
}
output += "</table>";
-
+
QUnit.log(details);
-
+
config.current.assertions.push({
result: !!result,
message: output
});
},
-
+
url: function( params ) {
params = extend( extend( {}, QUnit.urlParams ), params );
var querystring = "?",
@@ -648,7 +648,7 @@ extend(QUnit, {
}
return window.location.pathname + querystring.slice( 0, -1 );
},
-
+
// Logging callbacks; all receive a single argument with the listed properties
// run test/logs.html for any related changes
begin: function() {},
@@ -672,7 +672,7 @@ if ( typeof document === "undefined" || document.readyState === "complete" ) {
addEvent(window, "load", function() {
QUnit.begin({});
-
+
// Initialize the config, saving the execution queue
var oldconfig = extend({}, config);
QUnit.init();
@@ -695,7 +695,7 @@ addEvent(window, "load", function() {
window.location = QUnit.url( params );
});
}
-
+
var toolbar = id("qunit-testrunner-toolbar");
if ( toolbar ) {
var filter = document.createElement("input");
@@ -730,7 +730,7 @@ addEvent(window, "load", function() {
toolbar.appendChild( label );
}
- var main = id('qunit-fixture');
+ var main = id('main') || id('qunit-fixture');
if ( main ) {
config.fixture = main.innerHTML;
}
@@ -774,19 +774,13 @@ function done() {
banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
}
- if ( tests ) {
+ if ( tests ) {
id( "qunit-testresult" ).innerHTML = html;
}
- if ( typeof document !== "undefined" && document.title ) {
- // show ✖ for good, ✔ for bad suite result in title
- // use escape sequences in case file gets loaded with non-utf-8-charset
- document.title = (config.stats.bad ? "\u2716" : "\u2714") + " " + document.title;
- }
-
QUnit.done( {
failed: config.stats.bad,
- passed: passed,
+ passed: passed,
total: config.stats.all,
runtime: runtime
} );
@@ -800,7 +794,7 @@ function validTest( name ) {
return true;
}
- var not = filter.charAt( 0 ) === "!";
+ not = filter.charAt( 0 ) === "!";
if ( not ) {
filter = filter.slice( 1 );
}
@@ -875,7 +869,7 @@ function process() {
function saveGlobal() {
config.pollution = [];
-
+
if ( config.noglobals ) {
for ( var key in window ) {
config.pollution.push( key );
@@ -886,15 +880,17 @@ function saveGlobal() {
function checkPollution( name ) {
var old = config.pollution;
saveGlobal();
-
- var newGlobals = diff( config.pollution, old );
+
+ var newGlobals = diff( old, config.pollution );
if ( newGlobals.length > 0 ) {
ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
+ config.current.expected++;
}
- var deletedGlobals = diff( old, config.pollution );
+ var deletedGlobals = diff( config.pollution, old );
if ( deletedGlobals.length > 0 ) {
ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
+ config.current.expected++;
}
}
@@ -972,7 +968,7 @@ QUnit.equiv = function () {
}
}
}
-
+
var callbacks = function () {
// for string, boolean, number and null
@@ -1026,13 +1022,13 @@ QUnit.equiv = function () {
// b could be an object literal here
if ( ! (QUnit.objectType(b) === "array")) {
return false;
- }
-
+ }
+
len = a.length;
if (len !== b.length) { // safe and faster
return false;
}
-
+
//track reference to avoid circular references
parents.push(a);
for (i = 0; i < len; i++) {
@@ -1065,7 +1061,7 @@ QUnit.equiv = function () {
callers.push(a.constructor);
//track reference to avoid circular references
parents.push(a);
-
+
for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
loop = false;
for(j=0;j<parents.length;j++){
@@ -1131,7 +1127,7 @@ QUnit.jsDump = (function() {
return '"' + str.toString().replace(/"/g, '\\"') + '"';
};
function literal( o ) {
- return o + '';
+ return o + '';
};
function join( pre, arr, post ) {
var s = jsDump.separator(),
@@ -1144,21 +1140,21 @@ QUnit.jsDump = (function() {
return [ pre, inner + arr, base + post ].join(s);
};
function array( arr ) {
- var i = arr.length, ret = Array(i);
+ var i = arr.length, ret = Array(i);
this.up();
while ( i-- )
- ret[i] = this.parse( arr[i] );
+ ret[i] = this.parse( arr[i] );
this.down();
return join( '[', ret, ']' );
};
-
+
var reName = /^function (\w+)/;
-
+
var jsDump = {
parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
var parser = this.parsers[ type || this.typeOf(obj) ];
- type = typeof parser;
-
+ type = typeof parser;
+
return type == 'function' ? parser.call( this, obj ) :
type == 'string' ? parser :
this.parsers.error;
@@ -1209,7 +1205,7 @@ QUnit.jsDump = (function() {
this.parsers[name] = parser;
},
// The next 3 are exposed so you can use them
- quote:quote,
+ quote:quote,
literal:literal,
join:join,
//
@@ -1228,7 +1224,7 @@ QUnit.jsDump = (function() {
if ( name )
ret += ' ' + name;
ret += '(';
-
+
ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join('');
return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' );
},
@@ -1246,10 +1242,10 @@ QUnit.jsDump = (function() {
node:function( node ) {
var open = QUnit.jsDump.HTML ? '&lt;' : '<',
close = QUnit.jsDump.HTML ? '&gt;' : '>';
-
+
var tag = node.nodeName.toLowerCase(),
ret = open + tag;
-
+
for ( var a in QUnit.jsDump.DOMAttrs ) {
var val = node[QUnit.jsDump.DOMAttrs[a]];
if ( val )
@@ -1259,8 +1255,8 @@ QUnit.jsDump = (function() {
},
functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
var l = fn.length;
- if ( !l ) return '';
-
+ if ( !l ) return '';
+
var args = Array(l);
while ( l-- )
args[l] = String.fromCharCode(97+l);//97 is 'a'
@@ -1317,34 +1313,34 @@ function getText( elems ) {
*
* More Info:
* http://ejohn.org/projects/javascript-diff-algorithm/
- *
+ *
* Usage: QUnit.diff(expected, actual)
- *
+ *
* QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
*/
QUnit.diff = (function() {
function diff(o, n){
var ns = new Object();
var os = new Object();
-
+
for (var i = 0; i < n.length; i++) {
- if (ns[n[i]] == null)
+ if (ns[n[i]] == null)
ns[n[i]] = {
rows: new Array(),
o: null
};
ns[n[i]].rows.push(i);
}
-
+
for (var i = 0; i < o.length; i++) {
- if (os[o[i]] == null)
+ if (os[o[i]] == null)
os[o[i]] = {
rows: new Array(),
n: null
};
os[o[i]].rows.push(i);
}
-
+
for (var i in ns) {
if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
n[ns[i].rows[0]] = {
@@ -1357,7 +1353,7 @@ QUnit.diff = (function() {
};
}
}
-
+
for (var i = 0; i < n.length - 1; i++) {
if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null &&
n[i + 1] == o[n[i].row + 1]) {
@@ -1371,7 +1367,7 @@ QUnit.diff = (function() {
};
}
}
-
+
for (var i = n.length - 1; i > 0; i--) {
if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
n[i - 1] == o[n[i].row - 1]) {
@@ -1385,20 +1381,20 @@ QUnit.diff = (function() {
};
}
}
-
+
return {
o: o,
n: n
};
}
-
+
return function(o, n){
o = o.replace(/\s+$/, '');
n = n.replace(/\s+$/, '');
var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/));
var str = "";
-
+
var oSpace = o.match(/\s+/g);
if (oSpace == null) {
oSpace = [" "];
@@ -1413,7 +1409,7 @@ QUnit.diff = (function() {
else {
nSpace.push(" ");
}
-
+
if (out.n.length == 0) {
for (var i = 0; i < out.o.length; i++) {
str += '<del>' + out.o[i] + oSpace[i] + "</del>";
@@ -1425,14 +1421,14 @@ QUnit.diff = (function() {
str += '<del>' + out.o[n] + oSpace[n] + "</del>";
}
}
-
+
for (var i = 0; i < out.n.length; i++) {
if (out.n[i].text == null) {
str += '<ins>' + out.n[i] + nSpace[i] + "</ins>";
}
else {
var pre = "";
-
+
for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) {
pre += '<del>' + out.o[n] + oSpace[n] + "</del>";
}
@@ -1440,7 +1436,7 @@ QUnit.diff = (function() {
}
}
}
-
+
return str;
};
})();
View
314 app/test/test.js
@@ -0,0 +1,314 @@
+test("module without setup/teardown (default)", function() {
+ expect(1);
+ ok(true);
+});
+
+test("expect in test", 3, function() {
+ ok(true);
+ ok(true);
+ ok(true);
+});
+
+test("expect in test", 1, function() {
+ ok(true);
+});
+
+module("setup test", {
+ setup: function() {
+ ok(true);
+ }
+});
+
+test("module with setup", function() {
+ expect(2);
+ ok(true);
+});
+
+test("module with setup, expect in test call", 2, function() {
+ ok(true);
+});
+
+var state;
+
+module("setup/teardown test", {
+ setup: function() {
+ state = true;
+ ok(true);
+ },
+ teardown: function() {
+ ok(true);
+ }
+});
+
+test("module with setup/teardown", function() {
+ expect(3);
+ ok(true);
+});
+
+module("setup/teardown test 2");
+
+test("module without setup/teardown", function() {
+ expect(1);
+ ok(true);
+});
+
+if (typeof setTimeout !== 'undefined') {
+state = 'fail';
+
+module("teardown and stop", {
+ teardown: function() {
+ equal(state, "done", "Test teardown.");
+ }
+});
+
+test("teardown must be called after test ended", function() {
+ expect(1);
+ stop();
+ setTimeout(function() {
+ state = "done";
+ start();
+ }, 13);
+});
+
+module("async setup test", {
+ setup: function() {
+ stop();
+ setTimeout(function(){
+ ok(true);
+ start();
+ }, 500);
+ }
+});
+
+asyncTest("module with async setup", function() {
+ expect(2);
+ ok(true);
+ start();
+});
+
+module("async teardown test", {
+ teardown: function() {
+ stop();
+ setTimeout(function(){
+ ok(true);
+ start();
+ }, 500);
+ }
+});
+
+asyncTest("module with async teardown", function() {
+ expect(2);
+ ok(true);
+ start();
+});
+
+module("asyncTest");
+
+asyncTest("asyncTest", function() {
+ expect(2);
+ ok(true);
+ setTimeout(function() {
+ state = "done";
+ ok(true);
+ start();
+ }, 13);
+});
+
+asyncTest("asyncTest", 2, function() {
+ ok(true);
+ setTimeout(function() {
+ state = "done";
+ ok(true);
+ start();
+ }, 13);
+});
+
+test("sync", 2, function() {
+ stop();
+ setTimeout(function() {
+ ok(true);
+ start();
+ }, 13);
+ stop();
+ setTimeout(function() {
+ ok(true);
+ start();
+ }, 125);
+});
+}
+
+module("save scope", {
+ setup: function() {
+ this.foo = "bar";
+ },
+ teardown: function() {
+ deepEqual(this.foo, "bar");
+ }
+});
+test("scope check", function() {
+ expect(2);
+ deepEqual(this.foo, "bar");
+});
+
+module("simple testEnvironment setup", {
+ foo: "bar",
+ bugid: "#5311" // example of meta-data
+});
+test("scope check", function() {
+ deepEqual(this.foo, "bar");
+});
+test("modify testEnvironment",function() {
+ this.foo="hamster";
+});
+test("testEnvironment reset for next test",function() {
+ deepEqual(this.foo, "bar");
+});
+
+module("testEnvironment with object", {
+ options:{
+ recipe:"soup",
+ ingredients:["hamster","onions"]
+ }
+});
+test("scope check", function() {
+ deepEqual(this.options, {recipe:"soup",ingredients:["hamster","onions"]}) ;
+});
+test("modify testEnvironment",function() {
+ // since we do a shallow copy, the testEnvironment can be modified
+ this.options.ingredients.push("carrots");
+});
+test("testEnvironment reset for next test",function() {
+ deepEqual(this.options, {recipe:"soup",ingredients:["hamster","onions","carrots"]}, "Is this a bug or a feature? Could do a deep copy") ;
+});
+
+
+module("testEnvironment tests");
+
+function makeurl() {
+ var testEnv = QUnit.current_testEnvironment;
+ var url = testEnv.url || 'http://example.com/search';
+ var q = testEnv.q || 'a search test';
+ return url + '?q='+encodeURIComponent(q);
+}
+
+test("makeurl working",function() {
+ equal( QUnit.current_testEnvironment, this, 'The current testEnvironment is global');
+ equal( makeurl(), 'http://example.com/search?q=a%20search%20test', 'makeurl returns a default url if nothing specified in the testEnvironment');
+});
+
+module("testEnvironment with makeurl settings", {
+ url: 'http://google.com/',
+ q: 'another_search_test'
+});
+test("makeurl working with settings from testEnvironment", function() {
+ equal( makeurl(), 'http://google.com/?q=another_search_test', 'rather than passing arguments, we use test metadata to form the url');
+});
+test("each test can extend the module testEnvironment", {
+ q:'hamstersoup'
+}, function() {
+ equal( makeurl(), 'http://google.com/?q=hamstersoup', 'url from module, q from test');
+});
+
+module("jsDump");
+test("jsDump output", function() {
+ equals( QUnit.jsDump.parse([1, 2]), "[\n 1,\n 2\n]" );
+ equals( QUnit.jsDump.parse({top: 5, left: 0}), "{\n \"top\": 5,\n \"left\": 0\n}" );
+ if (typeof document !== 'undefined' && document.getElementById("qunit-header")) {
+ equals( QUnit.jsDump.parse(document.getElementById("qunit-header")), "<h1 id=\"qunit-header\"></h1>" );
+ equals( QUnit.jsDump.parse(document.getElementsByTagName("h1")), "[\n <h1 id=\"qunit-header\"></h1>\n]" );
+ }
+});
+
+module("assertions");
+test("raises",function() {
+ function CustomError( message ) {
+ this.message = message;
+ }
+
+ CustomError.prototype.toString = function() {
+ return this.message;
+ };
+
+ raises(
+ function() {
+ throw "error"
+ }
+ );
+
+ raises(
+ function() {
+ throw "error"
+ },
+ 'raises with just a message, no expected'
+ );
+
+ raises(
+ function() {
+ throw new CustomError();
+ },
+ CustomError,
+ 'raised error is an instance of CustomError'
+ );
+
+ raises(
+ function() {
+ throw new CustomError("some error description");
+ },
+ /description/,
+ "raised error message contains 'description'"
+ );
+
+ raises(
+ function() {
+ throw new CustomError("some error description");
+ },
+ function( err ) {
+ if ( (err instanceof CustomError) && /description/.test(err) ) {
+ return true;
+ }
+ },
+ "custom validation function"
+ );
+
+});
+
+if (typeof document !== "undefined") {
+
+module("fixture");
+test("setup", function() {
+ document.getElementById("qunit-fixture").innerHTML = "foobar";
+});
+test("basics", function() {
+ equal( document.getElementById("qunit-fixture").innerHTML, "test markup", "automatically reset" );
+});
+
+}
+
+module("custom assertions");
+(function() {
+ function mod2(value, expected, message) {
+ var actual = value % 2;
+ QUnit.push(actual == expected, actual, expected, message);
+ }
+ test("mod2", function() {
+ mod2(2, 0, "2 % 2 == 0");
+ mod2(3, 1, "3 % 2 == 1");
+ })
+})();
+
+(function() {
+ var reset = QUnit.reset;
+ function afterTest() {
+ ok( false, "reset should not modify test status" );
+ }
+ module("reset");
+ test("reset runs assertions", function() {
+ QUnit.reset = function() {
+ afterTest();
+ reset.apply( this, arguments );
+ };
+ });
+ test("reset runs assertions2", function() {
+ QUnit.reset = reset;
+ });
+})();
View
10 app/tmp/android/AndroidManifest.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" ?><manifest android:versionCode="1" android:versionName="1.0" package="com.phonegap.example" xmlns:android="http://schemas.android.com/apk/res/android">
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <activity android:configChanges="orientation|keyboardHidden" android:label="@string/app_name" android:name="ExampleApp">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+<uses-permission android:name="android.permission.CAMERA"/><uses-permission android:name="android.permission.VIBRATE"/><uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/><uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/><uses-permission android:name="android.permission.READ_PHONE_STATE"/><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.RECEIVE_SMS"/><uses-permission android:name="android.permission.RECORD_AUDIO"/><uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/><uses-permission android:name="android.permission.READ_CONTACTS"/><uses-permission android:name="android.permission.WRITE_CONTACTS"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/></manifest>
View
16 app/tmp/android/assets/www/config.xml
@@ -0,0 +1,16 @@
+<widget id="com.phonegap.example" version="0.1.0">
+ <name>Example App</name>
+ <!--
+ TODO feature
+ http://api.phonegap.com/1.0/camera
+ http://api.phonegap.com/1.0/contacts
+ http://api.phonegap.com/1.0/file
+ http://api.phonegap.com/1.0/geolocation
+ http://api.phonegap.com/1.0/media
+ http://api.phonegap.com/1.0/network
+ http://api.phonegap.com/1.0/notification
+ -->
+    <icon src="img/icon-57.png" width="57" height="57" />
+    <icon src="img/icon-72.png" width="72" height="72" />
+    <icon src="img/icon-114.png" width="114" height="114" />
+</widget>
View
0  app/facebook.js → app/tmp/android/assets/www/facebook.js
File renamed without changes
View
0  app/icon.png → app/tmp/android/assets/www/icon.png
File renamed without changes
View
0  app/index.html → app/tmp/android/assets/www/index.html
File renamed without changes
View
4,227 app/tmp/android/assets/www/phonegap-0.9.4.js
4,227 additions, 0 deletions not shown
View
17 app/tmp/android/build.properties
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+# 'source.dir' for the location of your java source folder and
+# 'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+# 'key.store' for the location of your keystore and
+# 'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
View
79 app/tmp/android/build.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="ExampleApp" default="help">
+
+<!-- The local.properties file is created and updated by the 'android'
+ tool.
+ It contains the path to the SDK. It should *NOT* be checked into
+ Version Control Systems. -->
+ <property file="local.properties" />
+
+ <!-- The build.properties file can be created by you and is never touched
+ by the 'android' tool. This is the place to change some of the
+ default property values used by the Ant rules.
+ Here are some properties you may want to change/update:
+
+ source.dir
+ The name of the source directory. Default is 'src'.
+ out.dir
+ The name of the output directory. Default is 'bin'.
+
+ Properties related to the SDK location or the project target should
+ be updated using the 'android' tool with the 'update' action.
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems.
+
+ -->
+ <property file="build.properties" />
+
+ <!-- The default.properties file is created and updated by the 'android'
+ tool, as well as ADT.
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems. -->
+ <property file="default.properties" />
+
+
+ <!-- Required pre-setup import -->
+ <import file="${sdk.dir}/tools/ant/pre_setup.xml" />
+
+
+<!-- extension targets. Uncomment the ones where you want to do custom work
+ in between standard targets -->
+<!--
+ <target name="-pre-build">
+ </target>
+ <target name="-pre-compile">
+ </target>
+
+ [This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir}]
+ <target name="-post-compile">
+ </target>
+-->
+
+ <!-- Execute the Android Setup task that will setup some properties
+ specific to the target, and import the build rules files.
+
+ The rules file is imported from
+ <SDK>/tools/ant/
+ Depending on the project type it can be either:
+ - main_rules.xml
+ - lib_rules.xml
+ - test_rules.xml
+
+ To customize existing targets, there are two options:
+ - Customize only one target:
+ - copy/paste the target into this file, *before* the
+ <setup> task.
+ - customize it to your needs.
+ - Customize the whole script.
+ - copy/paste the content of the rules files (minus the top node)
+ into this file, *after* the <setup> task
+ - disable the import of the rules by changing the setup task
+ below to <setup import="false" />.
+ - customize to your needs.
+ -->
+ <setup />
+
+</project>
View
11 app/tmp/android/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-12
View
22 app/tmp/android/gen/com/phonegap/example/R.java
@@ -0,0 +1,22 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package com.phonegap.example;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static final int icon=0x7f020000;
+ }
+ public static final class layout {
+ public static final int main=0x7f030000;
+ }
+ public static final class string {
+ public static final int app_name=0x7f040000;
+ }
+}
View
BIN  app/tmp/android/libs/facebook-android-sdk.jar
Binary file not shown
View
BIN  app/tmp/android/libs/phonegap-0.9.4.jar
Binary file not shown
View
10 app/tmp/android/local.properties
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must *NOT* be checked in Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk.dir=/Users/davejohnson/Sdk/android-sdk-mac_x86
View
36 app/tmp/android/proguard.cfg
@@ -0,0 +1,36 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembernames class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembernames class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
View
BIN  app/tmp/android/res/drawable-hdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/tmp/android/res/drawable-ldpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/tmp/android/res/drawable-mdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
13 app/tmp/android/res/layout/main.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+<TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Hello World, ExampleApp"
+ />
+</LinearLayout>
+
View
4 app/tmp/android/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">ExampleApp</string>
+</resources>
View
137 app/tmp/android/src/com/facebook/phonegap/ConnectPlugin.java
@@ -0,0 +1,137 @@
+package com.facebook.phonegap;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+
+import com.facebook.android.DialogError;
+import com.facebook.android.Facebook;
+import com.facebook.android.Facebook.DialogListener;
+import com.facebook.android.FacebookError;
+import com.phonegap.DroidGap;
+import com.phonegap.api.Plugin;
+import com.phonegap.api.PluginResult;
+
+public class ConnectPlugin extends Plugin {
+
+ Facebook facebook;
+
+ @Override
+ public PluginResult execute(String action, JSONArray args, final String callbackId) {
+ PluginResult pr = new PluginResult(PluginResult.Status.NO_RESULT);
+ pr.setKeepCallback(true);
+ if (action.equals("init")) {
+ try {
+ facebook = new Facebook(args.getString(0));
+ return new PluginResult(PluginResult.Status.OK);
+ } catch (JSONException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return new PluginResult(PluginResult.Status.ERROR, "Invalid JSON args used. expected a string as the first arg.");
+ }
+ } else if (action.equals("login")) {
+ if (facebook != null) {
+ if (facebook.isSessionValid()) {
+ Log.d("FB", "Session already valid");
+ pr = new PluginResult(PluginResult.Status.OK, getResponse());
+ } else {
+ final ConnectPlugin me = this;
+ String[] permissions = new String[args.length()];
+ try {
+ for (int i=0; i<args.length(); i++) {
+ permissions[i] = args.getString(i);
+ }
+ } catch (JSONException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ return new PluginResult(PluginResult.Status.ERROR, "Invalid JSON args used. Expected a string array of permissions.");
+ }
+
+ this.ctx.setActivityResultCallback(this);
+ this.facebook.authorize(this.ctx, permissions, 1234567890, new DialogListener() {
+ @Override
+ public void onComplete(Bundle values) {
+ Log.d("FB", "authorized");
+ me.success(getResponse(), callbackId);
+ }
+
+ @Override
+ public void onFacebookError(FacebookError error) {
+ Log.d("FB", "facebook error");
+ me.error("Facebook error: " + error.getMessage(), callbackId);
+ }
+
+ @Override
+ public void onError(DialogError e) {
+ Log.d("FB", "other error");
+ me.error("Dialog error: " + e.getMessage(), callbackId);
+ }
+
+ @Override
+ public void onCancel() {
+ Log.d("FB", "cancel");
+ me.error("Cancelled", callbackId);
+ }
+ });
+ }
+ } else {
+ pr = new PluginResult(PluginResult.Status.ERROR, "Must call FB.init before FB.login");
+ }
+ } else if (action.equals("logout")) {
+ if (facebook != null) {
+ try {
+ facebook.logout(this.ctx);
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ pr = new PluginResult(PluginResult.Status.MALFORMED_URL_EXCEPTION, "Error logging out.");
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ pr = new PluginResult(PluginResult.Status.IO_EXCEPTION, "Error logging out.");
+ }
+ pr = new PluginResult(PluginResult.Status.OK, getResponse());
+ }
+ } else if (action.equals("getLoginStatus")) {
+ if (facebook != null) {
+ pr = new PluginResult(PluginResult.Status.OK, getResponse());
+ }
+ }
+ return pr;
+ }
+
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+
+ facebook.authorizeCallback(requestCode, resultCode, data);
+ }
+
+ public JSONObject getResponse() {
+ String response = "{"+
+ " \"status\": \""+(facebook.isSessionValid() ? "connected" : "unknown")+"\","+
+ " \"session\": {"+
+ " \"access_token\": \""+facebook.getAccessToken()+"\","+
+ " \"expires\": \""+facebook.getAccessExpires()+"\","+
+ " \"secret\": \"b082c4620cdac27e0371f2c674026662\","+
+ " \"session_key\": true,"+
+ " \"sig\": \"...\","+
+ " \"uid\": \"...\""+
+ " }"+
+ "}";
+ try {
+ return new JSONObject(response);
+ } catch (JSONException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return new JSONObject();
+ }
+}
View
16 app/tmp/android/src/com/phonegap/example/ExampleApp.java
@@ -0,0 +1,16 @@
+package com.phonegap.example;
+
+import android.app.Activity;
+import android.os.Bundle;
+import com.phonegap.*;
+
+public class ExampleApp extends DroidGap
+{
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/index.html");
+ }
+}
+
View
16 app/tmp/android/src/com/phonegap/example/ExampleApp.java''
@@ -0,0 +1,16 @@
+package __ID__;
+
+import android.app.Activity;
+import android.os.Bundle;
+import com.phonegap.*;
+
+public class ExampleApp extends DroidGap
+{
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/index.html");
+ }
+}
+
View
13 app/tmp/ios.log
@@ -0,0 +1,13 @@
+2011-07-11 16:08:08.195 ExampleApp[57158:207] applicationDidBecomeActive
+2011-07-11 16:08:10.110 ExampleApp[57158:207] Device initialization: DeviceInfo = {"name":"iPhone Simulator","uuid":"4D50411B-275A-5B21-BBF6-0432733BD814","platform":"iPhone Simulator","gap":"0.9.5","version":"4.3.2"};
+2011-07-11 16:08:25.420 ExampleApp[57368:207] applicationDidBecomeActive
+2011-07-11 16:08:27.119 ExampleApp[57368:207] Device initialization: DeviceInfo = {"name":"iPhone Simulator","uuid":"4D50411B-275A-5B21-BBF6-0432733BD814","platform":"iPhone Simulator","gap":"0.9.5","version":"4.3.2"};
+2011-07-11 16:16:11.970 ExampleApp[57976:207] applicationDidBecomeActive
+2011-07-11 16:16:15.093 ExampleApp[57976:207] Device initialization: DeviceInfo = {"name":"iPhone Simulator","uuid":"4D50411B-275A-5B21-BBF6-0432733BD814","platform":"iPhone Simulator","gap":"0.9.5","version":"4.3.2"};
+Terminating in response to SpringBoard's termination.
+2011-07-11 16:31:17.403 ExampleApp[58827:207] applicationDidBecomeActive
+2011-07-11 16:31:19.512 ExampleApp[58827:207] Device initialization: DeviceInfo = {"name":"iPhone Simulator","uuid":"4D50411B-275A-5B21-BBF6-0432733BD814","platform":"iPhone Simulator","gap":"0.9.5","version":"4.3.2"};
+Terminating in response to SpringBoard's termination.
+2011-07-11 16:34:13.296 ExampleApp[59278:207] applicationDidBecomeActive
+2011-07-11 16:34:14.854 ExampleApp[59278:207] Device initialization: DeviceInfo = {"name":"iPhone Simulator","uuid":"4D50411B-275A-5B21-BBF6-0432733BD814","platform":"iPhone Simulator","gap":"0.9.5","version":"4.3.2"};
+Terminating in response to SpringBoard's termination.
View
6 app/tmp/ios/.gitignore
@@ -0,0 +1,6 @@
+*.mode1v3
+*.perspectivev3
+*.pbxuser
+.DS_Store
+build
+www/phonegap.js
View
16 app/tmp/ios/Classes/ExampleAppAppDelegate.h
@@ -0,0 +1,16 @@
+//
+// ExampleAppAppDelegate.h
+// ExampleApp
+//
+// Created by ___FULLUSERNAME___ on ___DATE___.