Skip to content
Browse files

Merge pull request #677 from vingtetun/gh-pages

Updated gh-pages
  • Loading branch information...
2 parents 5c4810e + c30e700 commit 05ade1cc00080ab6c9be0d858ceb7f820fa81a75 @vingtetun vingtetun committed
Showing with 210,375 additions and 170,979 deletions.
  1. +47 −1 Makefile
  2. +32 −0 apps/bbc/bbc.html
  3. +12 −0 apps/bbc/manifest.webapp
  4. +15 −7 apps/browser/browser.html
  5. +121 −43 apps/browser/js/browser.js
  6. +180 −20 apps/browser/style/browser.css
  7. BIN apps/browser/style/fonts/Open-Sans-Bold.woff
  8. BIN apps/browser/style/fonts/Open-Sans-Semibold.woff
  9. BIN apps/browser/style/fonts/Open-Sans.woff
  10. BIN apps/browser/style/images/back-disabled.png
  11. BIN apps/browser/style/images/back-pressed.png
  12. BIN apps/browser/style/images/back.png
  13. BIN apps/browser/style/images/bookmark.png
  14. BIN apps/browser/style/images/downloads.png
  15. BIN apps/browser/style/images/favicon.png
  16. BIN apps/browser/style/images/forward.png
  17. BIN apps/browser/style/images/loading.gif
  18. BIN apps/browser/style/images/menu-pressed.png
  19. BIN apps/browser/style/images/menu.png
  20. BIN apps/browser/style/images/refresh.png
  21. BIN apps/browser/style/images/settings.png
  22. +0 −1,967 apps/browser/webapi+apps.js
  23. +11 −6 apps/camera/camera.html
  24. +77 −15 apps/camera/js/camera.js
  25. +60 −4 apps/camera/style/camera.css
  26. BIN apps/camera/style/images/capture-pressed.png
  27. BIN apps/camera/style/images/capture.png
  28. BIN apps/camera/style/images/gallery-pressed.png
  29. BIN apps/camera/style/images/gallery.png
  30. BIN apps/camera/style/images/switch-pressed.png
  31. BIN apps/camera/style/images/switch.png
  32. +0 −1,967 apps/camera/webapi+apps.js
  33. +28 −8 apps/clock/clock.html
  34. +7 −0 apps/clock/js/clock.js
  35. +12 −7 apps/clock/js/stopwatch.js
  36. +93 −0 apps/clock/js/timer.js
  37. +90 −18 apps/clock/style/clock.css
  38. BIN apps/clock/style/images/alarm.png
  39. BIN apps/clock/style/images/stopwatch.png
  40. BIN apps/clock/style/images/timer.png
  41. +0 −1,967 apps/clock/webapi+apps.js
  42. +32 −0 apps/cnn/cnn.html
  43. +12 −0 apps/cnn/manifest.webapp
  44. BIN apps/contacts/contact0-small.png
  45. BIN apps/contacts/contact0.png
  46. BIN apps/contacts/contact1-small.png
  47. BIN apps/contacts/contact1.png
  48. BIN apps/contacts/contact2-small.png
  49. BIN apps/contacts/contact2.png
  50. BIN apps/contacts/contact3-small.png
  51. BIN apps/contacts/contact3.png
  52. BIN apps/contacts/contact4-small.png
  53. BIN apps/contacts/contact4.png
  54. BIN apps/contacts/contact5-small.png
  55. BIN apps/contacts/contact5.png
  56. BIN apps/contacts/contact6-small.png
  57. BIN apps/contacts/contact6.png
  58. BIN apps/contacts/contact7-small.png
  59. BIN apps/contacts/contact7.png
  60. BIN apps/contacts/contact8-small.png
  61. BIN apps/contacts/contact8.png
  62. BIN apps/contacts/contact9-small.png
  63. BIN apps/contacts/contact9.png
  64. +98 −0 apps/crystalskull/crystalskull.html
  65. +113 −0 apps/crystalskull/j3d.js
  66. +12 −0 apps/crystalskull/models/skull.js
  67. BIN apps/crystalskull/models/textures/skybox/back.jpg
  68. BIN apps/crystalskull/models/textures/skybox/down.jpg
  69. BIN apps/crystalskull/models/textures/skybox/front.jpg
  70. BIN apps/crystalskull/models/textures/skybox/left.jpg
  71. BIN apps/crystalskull/models/textures/skybox/right.jpg
  72. BIN apps/crystalskull/models/textures/skybox/up.jpg
  73. +49 −0 apps/crystalskull/shaders/Glass.glsl
  74. +6 −0 apps/crystalskull/style/common.css
  75. BIN apps/crystalskull/style/icons/CrystalSkull.png
  76. +129 −58 apps/dialer/dialer.html
  77. +47 −42 apps/dialer/js/contacts.js
  78. +174 −87 apps/dialer/js/dialer.js
  79. +4 −0 apps/dialer/js/helper.js
  80. +44 −0 apps/dialer/js/recents.js
  81. +581 −384 apps/dialer/style/dialer.css
  82. BIN apps/dialer/style/fonts/Open-Sans-Bold.woff
  83. BIN apps/dialer/style/fonts/Open-Sans-Semibold.woff
  84. BIN apps/dialer/style/fonts/Open-Sans.woff
  85. BIN apps/dialer/style/fonts/Roboto-Bold.ttf
  86. BIN apps/dialer/style/fonts/Roboto-BoldItalic.ttf
  87. BIN apps/dialer/style/fonts/Roboto-Italic.ttf
  88. BIN apps/dialer/style/fonts/Roboto-Regular.ttf
  89. BIN apps/dialer/style/images/accept-call-bg-active.png
  90. BIN apps/dialer/style/images/accept-call-bg.png
  91. BIN apps/dialer/style/images/app-texture.png
  92. BIN apps/dialer/style/images/backspace-active.png
  93. BIN apps/dialer/style/images/backspace.png
  94. BIN apps/dialer/style/images/call-button-bg-active.png
  95. BIN apps/dialer/style/images/call-button-bg.png
  96. BIN apps/dialer/style/images/call-screen-bg-top-large.png
  97. BIN apps/dialer/style/images/call-screen-bg-top.png
  98. BIN apps/dialer/style/images/call-screen-bg.png
  99. BIN apps/dialer/style/images/contact-input-bg.png
  100. BIN apps/dialer/style/images/contacts-circle.png
  101. BIN apps/dialer/style/images/contacts-icon-active.png
  102. BIN apps/dialer/style/images/contacts-icon.png
  103. BIN apps/dialer/style/images/current-tab.png
  104. BIN apps/dialer/style/images/diagonal-pattern.png
  105. BIN apps/dialer/style/images/dialing-pattern.png
  106. BIN apps/dialer/style/images/end-call-bg-active.png
  107. BIN apps/dialer/style/images/end-call-bg-large-active.png
  108. BIN apps/dialer/style/images/end-call-bg-large.png
  109. BIN apps/dialer/style/images/end-call-bg.png
  110. BIN apps/dialer/style/images/favorite-icon.png
  111. BIN apps/dialer/style/images/hold-icon-active.png
  112. BIN apps/dialer/style/images/hold-icon.png
  113. BIN apps/dialer/style/images/input-icon-search.png
  114. BIN apps/dialer/style/images/keypad-bg.png
  115. BIN apps/dialer/style/images/lens.png
  116. BIN apps/dialer/style/images/missing.png
  117. BIN apps/dialer/style/images/mute-icon-active.png
  118. BIN apps/dialer/style/images/mute-icon.png
  119. BIN apps/dialer/style/images/numpad-icon-active.png
  120. BIN apps/dialer/style/images/numpad-icon.png
  121. BIN apps/dialer/style/images/recents-icon-active.png
  122. BIN apps/dialer/style/images/recents-icon.png
  123. BIN apps/dialer/style/images/speaker-icon-active.png
  124. BIN apps/dialer/style/images/speaker-icon.png
  125. BIN apps/dialer/style/images/speaker.png
  126. BIN apps/dialer/style/images/texture.png
  127. BIN apps/dialer/style/images/title-bar-plus.png
  128. +0 −1,967 apps/dialer/webapi+apps.js
  129. +12 −0 apps/facebook/manifest.webapp
  130. +10 −8 apps/gallery/gallery.html
  131. +321 −169 apps/gallery/js/gallery.js
  132. BIN apps/gallery/sample_photos/DSC_1677.jpg
  133. BIN apps/gallery/sample_photos/DSC_1701.jpg
  134. BIN apps/gallery/sample_photos/DSC_1727.jpg
  135. BIN apps/gallery/sample_photos/DSC_1729.jpg
  136. BIN apps/gallery/sample_photos/DSC_1759.jpg
  137. BIN apps/gallery/sample_photos/DSC_4236.jpg
  138. BIN apps/gallery/sample_photos/DSC_4767.jpg
  139. BIN apps/gallery/sample_photos/DSC_4858.jpg
  140. BIN apps/gallery/sample_photos/DSC_4861.jpg
  141. BIN apps/gallery/sample_photos/DSC_4903.jpg
  142. BIN apps/gallery/sample_photos/DSC_6842.jpg
  143. BIN apps/gallery/sample_photos/DSC_6859.jpg
  144. BIN apps/gallery/sample_photos/DSC_6883.jpg
  145. BIN apps/gallery/sample_photos/DSC_7150.jpg
  146. BIN apps/gallery/sample_photos/IMG_0139.jpg
  147. BIN apps/gallery/sample_photos/IMG_0160.jpg
  148. BIN apps/gallery/sample_photos/IMG_0211.jpg
  149. BIN apps/gallery/sample_photos/IMG_0225.jpg
  150. BIN apps/gallery/sample_photos/IMG_0251.jpg
  151. BIN apps/gallery/sample_photos/IMG_0281.jpg
  152. BIN apps/gallery/sample_photos/IMG_0476.jpg
  153. BIN apps/gallery/sample_photos/IMG_0498.jpg
  154. BIN apps/gallery/sample_photos/IMG_0506.jpg
  155. BIN apps/gallery/sample_photos/IMG_0546.jpg
  156. BIN apps/gallery/sample_photos/IMG_0554.jpg
  157. BIN apps/gallery/sample_photos/IMG_0592.jpg
  158. BIN apps/gallery/sample_photos/IMG_0610.jpg
  159. BIN apps/gallery/sample_photos/IMG_0668.jpg
  160. BIN apps/gallery/sample_photos/IMG_0676.jpg
  161. BIN apps/gallery/sample_photos/IMG_1132.jpg
  162. BIN apps/gallery/sample_photos/IMG_1307.jpg
  163. BIN apps/gallery/sample_photos/IMG_1706.jpg
  164. BIN apps/gallery/sample_photos/IMG_1974.jpg
  165. BIN apps/gallery/sample_photos/IMG_7928.jpg
  166. BIN apps/gallery/sample_photos/IMG_7990.jpg
  167. BIN apps/gallery/sample_photos/IMG_8085.jpg
  168. BIN apps/gallery/sample_photos/IMG_8164.jpg
  169. BIN apps/gallery/sample_photos/IMG_8631.jpg
  170. BIN apps/gallery/sample_photos/IMG_8638.jpg
  171. BIN apps/gallery/sample_photos/IMG_8648.jpg
  172. BIN apps/gallery/sample_photos/IMG_8652.jpg
  173. BIN apps/gallery/sample_photos/P1000115.jpg
  174. BIN apps/gallery/sample_photos/P1000404.jpg
  175. BIN apps/gallery/sample_photos/P1000469.jpg
  176. BIN apps/gallery/sample_photos/P1000486.jpg
  177. BIN apps/gallery/sample_photos/_MG_0053.jpg
  178. +0 −5 apps/gallery/sample_photos/attribution.txt
  179. BIN apps/gallery/sample_photos/bigcat.jpg
  180. BIN apps/gallery/sample_photos/bison.jpg
  181. BIN apps/gallery/sample_photos/butterfly.jpg
  182. BIN apps/gallery/sample_photos/cat.jpg
  183. BIN apps/gallery/sample_photos/catterpillar.jpg
  184. BIN apps/gallery/sample_photos/cow.jpg
  185. BIN apps/gallery/sample_photos/duck.jpg
  186. BIN apps/gallery/sample_photos/elephant.jpg
  187. BIN apps/gallery/sample_photos/fly.jpg
  188. BIN apps/gallery/sample_photos/giraffe.jpg
  189. BIN apps/gallery/sample_photos/grasshopper.jpg
  190. BIN apps/gallery/sample_photos/hippo.jpg
  191. BIN apps/gallery/sample_photos/hoverfly.jpg
  192. BIN apps/gallery/sample_photos/kangaroo.jpg
  193. BIN apps/gallery/sample_photos/lizard.jpg
  194. BIN apps/gallery/sample_photos/mantis.jpg
  195. BIN apps/gallery/sample_photos/ostrich.jpg
  196. BIN apps/gallery/sample_photos/peacock.jpg
  197. BIN apps/gallery/sample_photos/rabbit.jpg
  198. BIN apps/gallery/sample_photos/sheep.jpg
  199. BIN apps/gallery/sample_photos/snail.jpg
  200. BIN apps/gallery/sample_photos/thumbnails/DSC_1677.jpg
  201. BIN apps/gallery/sample_photos/thumbnails/DSC_1701.jpg
  202. BIN apps/gallery/sample_photos/thumbnails/DSC_1727.jpg
  203. BIN apps/gallery/sample_photos/thumbnails/DSC_1729.jpg
  204. BIN apps/gallery/sample_photos/thumbnails/DSC_1759.jpg
  205. BIN apps/gallery/sample_photos/thumbnails/DSC_4236.jpg
  206. BIN apps/gallery/sample_photos/thumbnails/DSC_4767.jpg
  207. BIN apps/gallery/sample_photos/thumbnails/DSC_4858.jpg
  208. BIN apps/gallery/sample_photos/thumbnails/DSC_4861.jpg
  209. BIN apps/gallery/sample_photos/thumbnails/DSC_4903.jpg
  210. BIN apps/gallery/sample_photos/thumbnails/DSC_6842.jpg
  211. BIN apps/gallery/sample_photos/thumbnails/DSC_6859.jpg
  212. BIN apps/gallery/sample_photos/thumbnails/DSC_6883.jpg
  213. BIN apps/gallery/sample_photos/thumbnails/DSC_7150.jpg
  214. BIN apps/gallery/sample_photos/thumbnails/IMG_0139.jpg
  215. BIN apps/gallery/sample_photos/thumbnails/IMG_0160.jpg
  216. BIN apps/gallery/sample_photos/thumbnails/IMG_0211.jpg
  217. BIN apps/gallery/sample_photos/thumbnails/IMG_0225.jpg
  218. BIN apps/gallery/sample_photos/thumbnails/IMG_0251.jpg
  219. BIN apps/gallery/sample_photos/thumbnails/IMG_0281.jpg
  220. BIN apps/gallery/sample_photos/thumbnails/IMG_0476.jpg
  221. BIN apps/gallery/sample_photos/thumbnails/IMG_0498.jpg
  222. BIN apps/gallery/sample_photos/thumbnails/IMG_0506.jpg
  223. BIN apps/gallery/sample_photos/thumbnails/IMG_0546.jpg
  224. BIN apps/gallery/sample_photos/thumbnails/IMG_0554.jpg
  225. BIN apps/gallery/sample_photos/thumbnails/IMG_0592.jpg
  226. BIN apps/gallery/sample_photos/thumbnails/IMG_0610.jpg
  227. BIN apps/gallery/sample_photos/thumbnails/IMG_0668.jpg
  228. BIN apps/gallery/sample_photos/thumbnails/IMG_0676.jpg
  229. BIN apps/gallery/sample_photos/thumbnails/IMG_1132.jpg
  230. BIN apps/gallery/sample_photos/thumbnails/IMG_1307.jpg
  231. BIN apps/gallery/sample_photos/thumbnails/IMG_1706.jpg
  232. BIN apps/gallery/sample_photos/thumbnails/IMG_1974.jpg
  233. BIN apps/gallery/sample_photos/thumbnails/IMG_7928.jpg
  234. BIN apps/gallery/sample_photos/thumbnails/IMG_7990.jpg
  235. BIN apps/gallery/sample_photos/thumbnails/IMG_8085.jpg
  236. BIN apps/gallery/sample_photos/thumbnails/IMG_8164.jpg
  237. BIN apps/gallery/sample_photos/thumbnails/IMG_8631.jpg
  238. BIN apps/gallery/sample_photos/thumbnails/IMG_8638.jpg
  239. BIN apps/gallery/sample_photos/thumbnails/IMG_8648.jpg
  240. BIN apps/gallery/sample_photos/thumbnails/IMG_8652.jpg
  241. BIN apps/gallery/sample_photos/thumbnails/P1000115.jpg
  242. BIN apps/gallery/sample_photos/thumbnails/P1000404.jpg
  243. BIN apps/gallery/sample_photos/thumbnails/P1000469.jpg
  244. BIN apps/gallery/sample_photos/thumbnails/P1000486.jpg
  245. BIN apps/gallery/sample_photos/thumbnails/_MG_0053.jpg
  246. BIN apps/gallery/sample_photos/thumbnails/bigcat.jpg
  247. BIN apps/gallery/sample_photos/thumbnails/bison.jpg
  248. BIN apps/gallery/sample_photos/thumbnails/butterfly.jpg
  249. BIN apps/gallery/sample_photos/thumbnails/cat.jpg
  250. BIN apps/gallery/sample_photos/thumbnails/catterpillar.jpg
  251. BIN apps/gallery/sample_photos/thumbnails/cow.jpg
  252. BIN apps/gallery/sample_photos/thumbnails/duck.jpg
  253. BIN apps/gallery/sample_photos/thumbnails/elephant.jpg
  254. BIN apps/gallery/sample_photos/thumbnails/fly.jpg
  255. BIN apps/gallery/sample_photos/thumbnails/giraffe.jpg
  256. BIN apps/gallery/sample_photos/thumbnails/grasshopper.jpg
  257. BIN apps/gallery/sample_photos/thumbnails/hippo.jpg
  258. BIN apps/gallery/sample_photos/thumbnails/hoverfly.jpg
  259. BIN apps/gallery/sample_photos/thumbnails/kangaroo.jpg
  260. BIN apps/gallery/sample_photos/thumbnails/lizard.jpg
  261. BIN apps/gallery/sample_photos/thumbnails/mantis.jpg
  262. BIN apps/gallery/sample_photos/thumbnails/ostrich.jpg
  263. BIN apps/gallery/sample_photos/thumbnails/peacock.jpg
  264. BIN apps/gallery/sample_photos/thumbnails/rabbit.jpg
  265. BIN apps/gallery/sample_photos/thumbnails/sheep.jpg
  266. BIN apps/gallery/sample_photos/thumbnails/snail.jpg
  267. BIN apps/gallery/sample_photos/thumbnails/tortoise.jpg
  268. BIN apps/gallery/sample_photos/thumbnails/wolf.jpg
  269. BIN apps/gallery/sample_photos/thumbnails/zebra.jpg
  270. BIN apps/gallery/sample_photos/tortoise.jpg
  271. BIN apps/gallery/sample_photos/wolf.jpg
  272. BIN apps/gallery/sample_photos/zebra.jpg
  273. BIN apps/gallery/style/fonts/Open-Sans-Bold.woff
  274. BIN apps/gallery/style/fonts/Open-Sans.woff
  275. +104 −35 apps/gallery/style/gallery.css
  276. BIN apps/gallery/style/images/app-texture.png
  277. BIN apps/gallery/style/images/close.png
  278. BIN apps/gallery/style/images/pause.png
  279. BIN apps/gallery/style/images/play.png
  280. +0 −1,967 apps/gallery/webapi+apps.js
  281. +31 −25 apps/homescreen/homescreen.html
  282. +3 −0 apps/homescreen/imes/jspinyin/COPYING
  283. +65,107 −0 apps/homescreen/imes/jspinyin/db.json
  284. +329 −0 apps/homescreen/imes/jspinyin/jspinyin.js
  285. +18 −0 apps/homescreen/imes/jszhuying/README
  286. +0 −158,075 apps/homescreen/imes/jszhuying/data.json
  287. +863 −0 apps/homescreen/imes/jszhuying/jszhuying.js
  288. +0 −720 apps/homescreen/imes/jszhuying/loader.js
  289. +125,946 −0 apps/homescreen/imes/jszhuying/phrases.json
  290. +42 −0 apps/homescreen/imes/jszhuying/tools/cook.js
  291. +27 −0 apps/homescreen/imes/jszhuying/tools/cook.sh
  292. +14,175 −0 apps/homescreen/imes/jszhuying/words.json
  293. +88 −285 apps/homescreen/js/app_manager.js
  294. +547 −280 apps/homescreen/js/homescreen.js
  295. +463 −138 apps/homescreen/js/keyboard.js
  296. +92 −28 apps/homescreen/js/keyboardLayout.js
  297. +0 −444 apps/homescreen/js/scenegraph.js
  298. +111 −232 apps/homescreen/js/task_manager.js
Sorry, we could not display the entire diff because too many files (459) changed.
View
48 Makefile
@@ -1,7 +1,53 @@
B2G_HOMESCREEN=file://${GAIA}/homescreen.html
INJECTED_GAIA = "$(MOZ_OBJDIR)/_tests/testing/mochitest/browser/gaia"
+TEST_PATH=gaia/tests/${TEST_FILE}
+
mochitest:
test -L $(INJECTED_GAIA) || ln -s $(GAIA) $(INJECTED_GAIA)
- TEST_PATH=gaia/tests/ make -C $(MOZ_OBJDIR) mochitest-browser-chrome EXTRA_TEST_ARGS=--browser-arg=""
+ TEST_PATH=$(TEST_PATH) make -C $(MOZ_OBJDIR) mochitest-browser-chrome EXTRA_TEST_ARGS=--browser-arg=""
+
+# The targets below all require adb
+# It should be in your path somewhere, or you can edit this line
+# to specify its location.
+ADB?=adb
+
+
+# If your gaia/ directory is a sub-directory of the B2G directory, then
+# you should use the install-gaia target of the B2G Makefile. But if you're
+# working on just gaia itself, and you already have B2G firmware on your
+# phone, and you have adb in your path, then you can use this target to
+# update the gaia files and reboot b2g
+
+PROFILE := $$($(ADB) shell ls -d /data/b2g/mozilla/*.default | tr -d '\r')
+PROFILE_DATA := profile
+.PHONY: install-gaia
+install-gaia:
+ $(ADB) start-server
+ $(ADB) shell rm -r /data/local/*
+ @for i in $$(ls); do $(ADB) push $$i /data/local/$$i; done
+ @echo 'Rebooting b2g now'
+ $(ADB) shell killall b2g
+
+# Erase all the indexedDB databases on the phone, so apps have to rebuild them.
+.PHONY: delete-databases
+delete-databases:
+ $(ADB) shell rm -r /data/b2g/mozilla/*.default/indexedDB/*
+
+# Take a screenshot of the device and put it in screenshot.png
+.PHONY: screenshot
+screenshot:
+ mkdir screenshotdata
+ $(ADB) pull /dev/graphics/fb0 screenshotdata/fb0
+ dd bs=1920 count=800 if=screenshotdata/fb0 of=screenshotdata/fb0b
+ ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 480x800 -i screenshotdata/fb0b -f image2 -vcodec png screenshot.png
+ rm -rf screenshotdata
+
+# Port forwarding to use the RIL daemon from the device
+.PHONY: forward
+forward:
+ $(ADB) shell touch /data/local/rilproxyd
+ $(ADB) shell killall rilproxy
+ $(ADB) forward tcp:6200 localreserved:rilproxyd
+
View
32 apps/bbc/bbc.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="pragma" content="no-cache">
+ <title>BBC</title>
+ <style type="text/css">
+ html, body, iframe {
+ overflow: hidden;
+ background-color: white;
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ border: none;
+ }
+ iframe {
+ position: fixed;
+ overflow: auto;
+ }
+ </style>
+ <script type="text/javascript">
+ function browse(url) {
+ var frame = document.querySelector('iframe');
+ frame.src = url;
+ }
+ </script>
+</head>
+<body onload="browse('http://m.bbc.co.uk/');">
+ <iframe></iframe>
+</body>
+</html>
View
12 apps/bbc/manifest.webapp
@@ -0,0 +1,12 @@
+{
+ "name": "BBC",
+ "description": "BBC Mobile Application",
+ "launch_path": "/bbc.html",
+ "developer": {
+ "name": "BBC",
+ "url": "http://m.bbc.co.uk/"
+ },
+ "icons": {
+ "120": "/icons/BBC.png"
+ }
+}
View
22 apps/browser/browser.html
@@ -1,27 +1,35 @@
<!DOCTYPE html>
-<html manifest="manifest.appcache" id="browser-html">
+<html manifest="manifest.appcache">
<head>
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache">
<title>Browser</title>
- <script type="text/javascript" src="webapi+apps.js"></script>
<link rel="stylesheet" href="style/browser.css" type="text/css" />
<script type="text/javascript" src="js/browser.js"></script>
</head>
- <body id="browser-body">
+ <body>
<div id="browser-tab">
<div id="browser-toolbar">
- <input type="image" src="style/images/back-disabled.png" id="browser-back-button" class="browser-button" alt="Back">
+ <input type="button" value="" id="browser-back-button" class="browser-button" alt="Back" title="" disabled="true"></input>
<form id="browser-address">
- <input type="text" id="browser-url" value="https://wiki.mozilla.org/B2G">
- <input type="image" src="style/images/go.png" id="browser-go-button" class="browser-button" alt="Go">
+ <input type="url" id="browser-url" value="http://www.google.com/m"></input>
</form>
+ <span id="browser-tab-button">9</span>
+ <input type="button" value="" id="browser-menu-button" class="browser-button" alt="Menu" title=""></input>
</div>
- <iframe id="browser-iframe">
+ <iframe id="browser-content" mozbrowser>
</iframe>
</div>
+ <div id="browser-shade" class="hidden"></div>
+ <ul id="browser-menu" class="hidden">
+ <li id="menu-refresh"><a href="#">Reload</a></li>
+ <li id="menu-forward"><a href="#">Forward</a></li>
+ <li id="menu-bookmark"><a href="#">Bookmark</a></li>
+ <li id="menu-settings"><a href="#">Settings</a></li>
+ <li id="menu-downloads"><a href="#">Downloads</a></li>
+ </ul>
</body>
</html>
View
164 apps/browser/js/browser.js
@@ -1,69 +1,140 @@
-var Browser = {
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+var Browser = {
get backButton() {
delete this.backButton;
return this.backButton =
document.getElementById('browser-back-button');
},
+ get urlbar() {
+ delete this.urlbar;
+ return this.urlbar = document.getElementById('browser-url');
+ },
+
+ /* Browser content */
get content() {
delete this.content;
- return this.content = document.getElementById('browser-iframe');
+ return this.content = document.getElementById('browser-content');
},
- get address() {
- delete this.address;
- return this.address = document.getElementById('browser-address');
+ get menu() {
+ delete this.menu;
+ return this.menu = document.getElementById('browser-menu');
},
- get urlBar() {
- delete this.urlBar;
- return this.urlBar =
- document.getElementById('browser-url');
+ get shade() {
+ delete this.shade;
+ return this.shade = document.getElementById('browser-shade');
},
- get iframe() {
- delete this.iframe;
- return document.getElementById('browser-iframe');
+ get menuButton() {
+ delete this.menuButton;
+ return this.menuButton = document.getElementById('browser-menu-button');
},
- init: function() {
+ get refreshButton() {
+ delete this.refreshButton;
+ return this.refreshButton = document.getElementById('menu-refresh');
+ },
- this.address.addEventListener('submit', (function submitHandler(evt) {
- var url = this.urlBar.value;
- MockHistory.pushState(null, '', url);
- this.navigate(url);
- evt.preventDefault();
- }).bind(this));
+ get forwardButton() {
+ delete this.forwardButton;
+ return this.forwardButton = document.getElementById('menu-forward');
+ },
- this.iframe.addEventListener('load', (function loadedHandler(evt) {
- this.urlBar.classList.remove('loading');
+ init: function browser_init() {
+ this.backButton.addEventListener('click', this.goBack.bind(this));
+ this.menuButton.addEventListener('click', this.toggleMenu.bind(this));
+ this.refreshButton.addEventListener('click', this.refresh.bind(this));
+ this.forwardButton.addEventListener('click', this.goForward.bind(this));
+ this.shade.addEventListener('click', this.toggleMenu.bind(this));
+ window.addEventListener('submit', this);
+ window.addEventListener('keypress', this, true);
+
+ var browserEvents = ['loadstart', 'loadend', 'locationchange'];
+ browserEvents.forEach((function attachBrowserEvent(type) {
+ this.content.addEventListener('mozbrowser' + type, this);
}).bind(this));
- this.backButton.addEventListener('click', (function backHandler(evt) {
- MockHistory.back();
- }).bind(this));
+ var url = this.urlbar.value;
+ this.navigate(url);
+ this.updateHistory(url);
+ },
+
+ handleEvent: function browser_handleEvent(evt) {
+ var urlbar = this.urlbar;
+
+ switch (evt.type) {
+ case 'submit':
+ var url = urlbar.value.trim();
+ var protocolRegexp = /^([a-z]+:)(\/\/)?/i;
+ var protocol = protocolRegexp.exec(url);
+ if (!protocol)
+ url = 'http://' + url;
- window.addEventListener('keypress', function keyPressHandler(evt) {
- if (MockHistory.backLength() && evt.keyCode == evt.DOM_VK_ESCAPE) {
- MockHistory.back();
+ this.navigate(url);
+ urlbar.value = url;
+ urlbar.blur();
evt.preventDefault();
- }
- });
+ break;
- var url = this.urlBar.value;
+ case 'keypress':
+ if (!MockHistory.backLength() || evt.keyCode != evt.DOM_VK_ESCAPE)
+ break;
+
+ this.goBack();
+ evt.preventDefault();
+ break;
+
+ case 'mozbrowserloadstart':
+ urlbar.classList.add('loading');
+ break;
+
+ case 'mozbrowserloadend':
+ urlbar.classList.remove('loading');
+ break;
+
+ case 'mozbrowserlocationchange':
+ this.locationChange(evt.detail);
+ break;
+ }
+ },
+
+ navigate: function browser_navigate(url) {
+ this.content.setAttribute('src', url);
+ },
+
+ goBack: function browser_goBack() {
+ MockHistory.back();
+ this.backButton.disabled = !MockHistory.backLength();
+ },
+
+ goForward: function browser_goForward() {
+ MockHistory.forward();
+ this.toggleMenu();
+ },
+
+ updateHistory: function browser_updateHistory(url) {
MockHistory.pushState(null, '', url);
- this.navigate(url);
+ this.backButton.disabled = !MockHistory.backLength();
+ },
+
+ locationChange: function browser_locationChange(url) {
+ this.urlbar.value = url;
+ this.updateHistory(url);
},
- navigate: function(url) {
- this.urlBar.value = url;
+ refresh: function browser_refresh() {
+ var url = this.urlbar.value;
this.content.setAttribute('src', url);
- this.urlBar.classList.add('loading');
- if (MockHistory.backLength())
- this.backButton.src = 'style/images/back.png';
- else
- this.backButton.src = 'style/images/back-disabled.png';
+ this.toggleMenu();
+ },
+
+ toggleMenu: function browser_toggleMenu() {
+ this.menu.classList.toggle('hidden');
+ this.shade.classList.toggle('hidden');
}
};
@@ -77,12 +148,17 @@ var MockHistory = {
historyIndex: -1,
back: function() {
- if (this.backLength() < 1) {
+ if (this.backLength() < 1)
return;
- }
Browser.navigate(this.history[--this.historyIndex]);
},
+ forward: function() {
+ if(this.forwardLength() < 1)
+ return;
+ Browser.navigate(this.history[++this.historyIndex]);
+ },
+
historyLength: function() {
return this.history.length;
},
@@ -98,16 +174,18 @@ var MockHistory = {
},
pushState: function(stateObj, title, url) {
- if (url == this.history[this.historyIndex])
+ var history = this.history;
+ var index = this.historyIndex;
+ if (url == history[index])
return;
// If history contains forward entries, replace them with the new location
if (this.forwardLength()) {
- this.history.splice((this.historyIndex + 1), this.forwardLength(), url);
+ history.splice(index + 1, this.forwardLength(), url);
this.historyIndex++;
} else {
// Otherwise just append the new location to the end of the array
- this.historyIndex = this.history.push(url) - 1;
+ this.historyIndex = history.push(url) - 1;
}
}
};
View
200 apps/browser/style/browser.css
@@ -1,16 +1,32 @@
-#browser-html, #browser-body {
+@font-face {
+ font-family: 'Open Sans';
+ src: url('fonts/Open-Sans.woff');
+}
+@font-face {
+ font-family: 'Open Sans';
+ font-weight: bold;
+ src: url('fonts/Open-Sans-Bold.woff');
+}
+@font-face {
+ font-family: 'Open Sans';
+ font-weight: 600;
+ src: url('fonts/Open-Sans-Semibold.woff');
+}
+
+html, body {
height: 100%;
padding: 0;
margin: 0;
}
-#browser-body {
+body {
margin: 0;
display: -moz-box;
-moz-box-orient: vertical;
width: 100%;
height: 100%;
background-color: #000;
+ font-family: 'Open Sans', sans-serif;
}
#browser-tab {
@@ -20,35 +36,39 @@
}
#browser-toolbar {
- background-color: #666;
display: -moz-box;
-moz-box-orient: horizontal;
- width: 100%;
- height: 60px;
+ height: 62px;
+ background-color: #fff;
+ background-image: -moz-linear-gradient(#fff, #eaeae4);
margin: 0;
+ padding: 0;
+ border-top-left-radius: 8px;
+ border-top-right-radius: 8px;
+ border-bottom: solid 2px #a3a3a3;
}
#browser-address {
- background-color: #333;
- border-radius: 10px;
-moz-box-flex: 1;
display: -moz-box;
-moz-box-orient: horizontal;
- height: 40px;
- margin: 10px;
padding: 0;
+ margin: 0;
}
#browser-url {
+ font-family: 'Open Sans';
-moz-box-flex: 1;
- border: none;
- border-radius: 10px;
- height: 32px;
- padding: 4px 10px 4px 42px;
- font-size: 24px;
+ border: solid 2px #9ca1a6;
+ border-radius: 22px;
+ height: 44px;
+ margin: 9px 2px;
+ padding: 0 0 0 40px;
+ font-size: 18px;
background-image: url('images/favicon.png');
background-repeat: no-repeat;
- background-position: 4px 4px;
+ background-position: 14px 12px;
+ font-weight: 600;
}
#browser-url.loading {
@@ -56,19 +76,159 @@
}
.browser-button {
+ background-color: transparent;
+ -moz-appearance: none;
+ border: none;
display: block;
- margin: 10px 0;
- width: 40px;
- height: 40px;
+ margin: 0;
+ padding: 0;
+ width: 56px;
+ height: 62px;
+}
+
+#browser-back-button {
+ background-image: url("images/back.png");
+}
+
+#browser-back-button:active {
+ background-image: url("images/back-pressed.png");
+}
+
+#browser-menu-button {
+ background-image: url("images/menu.png");
+}
+
+input::-moz-focus-inner {
+ border: 0;
+}
+
+#browser-tab-button {
+ display: block;
+ height: 62px;
+ line-height: 62px;
+ width: 54px;
+ margin: 0;
+ font-weight: bold;
+ font-size: 24px;
+ text-align: center;
+ color: #555;
+}
+
+#browser-tab-button::after {
+ display: block;
+ width: 1px;
+ content: ' ';
+ height: 42px;
+ background-color: rgba(0, 0, 0, 0.1);
+ position: absolute;
+ top: 22px;
+ right: 56px;
+}
+
+#browser-back-button[disabled] {
+ background-image: url("images/back-disabled.png");
}
#browser-go-button {
- margin: 0 4px;
+ margin: 0 2px;
}
-#browser-iframe {
+#browser-content {
-moz-box-flex: 1;
width: 100%;
border: none;
background-color: white;
}
+
+#browser-shade {
+ position: absolute;
+ top: 62px;
+ left: 0;
+ width: 100%;
+ height: -moz-calc(100% - 62px);
+ background-color: rgba(5, 5, 5, 0.5);
+}
+
+#browser-menu {
+ position: absolute;
+ right: 8px;
+ top: 72px;
+ width: 50%;
+ background-color: #f5f2f3;
+ border-radius: 8px;
+ z-index: 999;
+ margin: 0;
+ padding: 0;
+ box-shadow: 0 0 5px #333;
+}
+
+#browser-menu::before {
+ content: '';
+ display: block;
+ width: 16px;
+ height: 16px;
+ position: absolute;
+ top: -8px;
+ right: 12px;
+ -moz-transform: rotate(-45deg);
+ background-color: #f5f2f3;
+ box-shadow: 0 0 4px #333;
+}
+
+#browser-menu::after {
+ content: '';
+ display: block;
+ width: 30px;
+ height: 16px;
+ position: absolute;
+ top: 0;
+ right: 7px;
+ background-color: #f5f2f3;
+}
+
+#browser-menu li {
+ padding: 0;
+ margin: 0 16px;
+ list-style-type: none;
+}
+
+
+#browser-menu li:last-child {
+ border-bottom: none;
+}
+
+#browser-menu li a {
+ display: block;
+ font-size: 22px;
+ padding: 19px 19px 19px 44px;
+ border-bottom: solid 1px #d0cecf;
+ text-decoration: none;
+ color: #4f5357;
+ background-repeat: no-repeat;
+ background-position: 5px 20px;
+ font-weight: 600;
+}
+
+#menu-refresh a {
+ background-image: url('images/refresh.png');
+}
+
+#menu-forward a {
+ background-image: url('images/forward.png');
+}
+
+#menu-bookmark a {
+ background-image: url('images/bookmark.png');
+}
+
+#menu-settings a {
+ background-image: url('images/settings.png');
+}
+
+#menu-downloads a {
+ background-image: url('images/downloads.png');
+}
+
+.hidden {
+ display: none;
+}
View
BIN apps/browser/style/fonts/Open-Sans-Bold.woff
Binary file not shown.
View
BIN apps/browser/style/fonts/Open-Sans-Semibold.woff
Binary file not shown.
View
BIN apps/browser/style/fonts/Open-Sans.woff
Binary file not shown.
View
BIN apps/browser/style/images/back-disabled.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/back-pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/bookmark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/downloads.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/forward.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/menu-pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/refresh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/browser/style/images/settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1,967 apps/browser/webapi+apps.js
0 additions, 1,967 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
17 apps/camera/camera.html
@@ -3,14 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache">
- <title>Camera</title>
- <script type="text/javascript" src="webapi+apps.js"></script>
-
- <link rel="stylesheet" href="style/camera.css" type="text/css" />
+ <title>Camera</title>
+ <link type="text/css" rel="stylesheet" href="style/camera.css"/>
<script type="text/javascript" src="js/camera.js"></script>
</head>
<body>
- <input id="chooser" type="file" accept="image/*">
- <img id="preview" class="hidden"/>
+
+ <video id="viewfinder" autoplay> </video>
+
+ <div id="controls">
+ <a id="switch-button" name="Switch source"></a>
+ <a id="capture-button" name="Capture"></a>
+ <a id="gallery-button" name="Go to gallery"></a>
+ </div>
+
</body>
</html>
View
92 apps/camera/js/camera.js
@@ -1,24 +1,86 @@
+'use strict';
+
var Camera = {
+ _camera: 0,
+
+ get viewfinder() {
+ return document.getElementById('viewfinder');
+ },
+
+ get switchButton() {
+ return document.getElementById('switch-button');
+ },
+
+ get captureButton() {
+ return document.getElementById('capture-button');
+ },
+
+ get galleryButton() {
+ return document.getElementById('gallery-button');
+ },
+
init: function cameraInit() {
- chooser = document.getElementById('chooser');
- chooser.addEventListener('change', this.showPreview);
+ this.switchButton.addEventListener('click', this.toggleCamera.bind(this));
+ this.galleryButton.addEventListener('click', function() {
+ // This is bad. It should eventually become a hyperlink or Web Intent.
+ window.parent.WindowManager.launch('../gallery/gallery.html');
+ });
+
+ var width, height;
+ var viewfinder = this.viewfinder;
+
+ width = document.body.clientHeight;
+ height = document.body.clientWidth;
+
+ var top = ((width/2) - ((height)/2));
+ var left = -((width/2) - (height/2));
+ viewfinder.style.top = top + 'px';
+ viewfinder.style.left = left + 'px';
+
+ var transform = 'rotate(90deg)';
+ if (this._camera == 1)
+ transform += ' scale(-1, 1)';
+
+ viewfinder.style.MozTransform = transform;
+
+ var config = {
+ height: height,
+ width: width,
+ camera: this._camera
+ }
+
+ viewfinder.style.width = width + 'px';
+ viewfinder.style.height = height + 'px';
+ if(navigator.mozCamera)
+ viewfinder.src = navigator.mozCamera.getCameraURI(config);
+ },
+
+ pause: function pause() {
+ this.viewfinder.pause();
+ },
+
+ toggleCamera: function toggleCamera() {
+ this._camera = 1 - this._camera;
+ this.viewfinder.src = '';
+ this.init();
},
- showPreview: function cameraShowPreview() {
- var file = document.getElementById('chooser').files.item(0);
- var image = document.getElementById('preview');
- image.file = file;
- var reader = new FileReader();
- reader.onload = (function readerOnload(loadedFile) {
- return function fileHandler(evt) {
- loadedFile.src = evt.target.result;
- loadedFile.classList.remove('hidden');
- };
- })(image);
- reader.readAsDataURL(file);
- }
};
window.addEventListener('DOMContentLoaded', function CameraInit() {
Camera.init();
});
+
+// Bug 690056 implement a visibility API, and it's likely that
+// we want this event to be fire when an app come back to life
+// or is minimized (it does not now).
+window.addEventListener('message', function CameraPause(evt) {
+ if (evt.data.message !== 'visibilitychange')
+ return;
+
+ if (evt.data.hidden) {
+ Camera.pause();
+ } else {
+ Camera.init();
+ }
+});
View
64 apps/camera/style/camera.css
@@ -1,7 +1,63 @@
-body {
- background-color: #000;
+html, body {
+ height: 100%;
+ width: 100%;
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+ background-color: black;
}
-.hidden {
- display: none;
+#viewfinder {
+ position: absolute;
+}
+
+#controls {
+ position: absolute;
+ bottom: 0;
+ height: 128px;
+ background-color: #555e64;
+ width: 100%;
+ text-align: center;
+ border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+}
+
+#switch-button {
+ display: block;
+ position: absolute;
+ left: 8px;
+ bottom: 8px;
+ width: 113px;
+ height: 112px;
+ background-image: url('images/switch.png');
+}
+
+#switch-button:active {
+ background-image: url('images/switch-pressed.png');
+}
+
+#capture-button {
+ display: block;
+ margin: 8px auto;
+ width: 192px;
+ height: 112px;
+ background-image: url('images/capture.png');
+}
+
+#capture-button:active {
+ background-image: url('images/capture-pressed.png');
+}
+
+#gallery-button {
+ display: block;
+ position: absolute;
+ right: 8px;
+ bottom: 8px;
+ width: 113px;
+ height: 112px;
+ background-image: url('images/gallery.png');
+}
+
+#gallery-button:active {
+ background-image: url('images/gallery-pressed.png');
}
View
BIN apps/camera/style/images/capture-pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/camera/style/images/capture.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/camera/style/images/gallery-pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/camera/style/images/gallery.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/camera/style/images/switch-pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/camera/style/images/switch.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1,967 apps/camera/webapi+apps.js
0 additions, 1,967 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
36 apps/clock/clock.html
@@ -3,21 +3,21 @@
<head>
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache">
- <script type="text/javascript" src="webapi+apps.js"></script>
<link rel="stylesheet" type="text/css" href="style/clock.css" />
<script type="application/javascript" src="js/clock.js"></script>
<script type="application/javascript" src="js/stopwatch.js"></script>
+ <script type="application/javascript" src="js/timer.js"></script>
</head>
<body>
<div id="views">
<div id="stopwatch-view" class="view">
- <div id="chrono-view-container">
+ <div class="chrono-view-container">
<div>
- <div id="chrono-view">00:00</div>
+ <div class="chrono-view" id="stopwatch-chrono-view">00:00</div>
</div>
- <div id="ticker-view">
+ <div class="ticker-view" id="stopwatch-ticker-view">
</div>
</div>
@@ -27,7 +27,7 @@
</div>
</div>
- <div id="start-stop-button" class="button-container" data-action="start" onclick="StopWatch.execute(this.dataset.action)">
+ <div id="stopwatch-action-button" class="button-container" data-action="start" onclick="StopWatch.execute(this.dataset.action)">
<div>
<span>Start</span>
<span>Stop</span>
@@ -35,18 +35,38 @@
</div>
</div>
- <div id="alarm-view" class="view" hidden="true">
+ <div id="timer-view" class="view" hidden="true">
+ <div class="chrono-view-container">
+ <div>
+ <div class="chrono-view" id="timer-chrono-view">00:00</div>
+ </div>
+ <div class="ticker-view" id="timer-ticker-view">
+ </div>
+ </div>
+
+ <div class="button-container">
+ <div>
+ <input id="duration-field" type="text" value="02:00" required pattern="([0-9]{1,2}\:)+[0-5][0-9]" />
+ </div>
+ </div>
+
+ <div id="timer-action-button" class="button-container" data-action="start" onclick="Timer.execute(this.dataset.action)">
+ <div>
+ <span>Start</span>
+ <span>Cancel</span>
+ </div>
+ </div>
</div>
- <div id="timer-view" class="view" hidden="true">
+ <div id="alarm-view" class="view" hidden="true">
</div>
</div>
<div id="tabs-container">
<div id="tabs" onclick="choiceChanged(event.target)">
<fieldset>
<label id="stopwatch-label" for="stopwatch-choice" data-choice="stopwatch" data-active="true"><input id="stopwatch-choice" type="radio" name="tabs" checked="checked" /></label>
- <label id="alarm-label" for="alarm-choice" data-choice="alarm"><input id="alarm-choice" type="radio" name="tabs" checked="" /></label>
<label id="timer-label" for="timer-choice" data-choice="timer"><input id="timer-choice" type="radio" name="tabs" checked="" /></label>
+ <label id="alarm-label" for="alarm-choice" data-choice="alarm"><input id="alarm-choice" type="radio" name="tabs" checked="" /></label>
</fieldset>
</div>
</div>
View
7 apps/clock/js/clock.js
@@ -1,3 +1,4 @@
+'use strict';
function choiceChanged(target) {
var choice = target.dataset.choice;
@@ -22,3 +23,9 @@ function choiceChanged(target) {
target.dataset.active = true;
view.hidden = false;
}
+
+window.addEventListener('load', function clockLoad(evt) {
+ window.removeEventListener('load', clockLoad);
+
+ window.parent.postMessage('appready', '*');
+});
View
19 apps/clock/js/stopwatch.js
@@ -1,19 +1,22 @@
+'use strict';
+
var StopWatch = {
_elapsed: 0,
- get startStopButton() {
- delete this.startStopButton;
- return this.startStopButton = document.getElementById('start-stop-button');
+ get actionButton() {
+ delete this.actionButton;
+ var id = 'stopwatch-action-button';
+ return this.actionButton = document.getElementById(id);
},
get tickerView() {
delete this.tickerView;
- return this.tickerView = document.getElementById('ticker-view');
+ return this.tickerView = document.getElementById('stopwatch-ticker-view');
},
get chronoView() {
delete this.chronoView;
- return this.chronoView = document.getElementById('chrono-view');
+ return this.chronoView = document.getElementById('stopwatch-chrono-view');
},
execute: function sw_execute(action) {
@@ -25,7 +28,7 @@ var StopWatch = {
},
start: function sw_start() {
- this.startStopButton.dataset.action = 'stop';
+ this.actionButton.dataset.action = 'stop';
this.updateChrono(this._elapsed);
this.tickerView.classList.add('running');
@@ -38,11 +41,13 @@ var StopWatch = {
},
stop: function sw_stop() {
- this.startStopButton.dataset.action = 'start';
+ this.actionButton.dataset.action = 'start';
this.tickerView.classList.remove('running');
this._elapsed += Date.now() - this._startTime;
clearInterval(this._ticker);
+ delete this._ticker;
+ delete this._startTime;
},
reset: function sw_reset() {
View
93 apps/clock/js/timer.js
@@ -0,0 +1,93 @@
+'use strict';
+
+var Timer = {
+ get actionButton() {
+ delete this.actionButton;
+ return this.actionButton = document.getElementById('timer-action-button');
+ },
+
+ get tickerView() {
+ delete this.tickerView;
+ return this.tickerView = document.getElementById('timer-ticker-view');
+ },
+
+ get chronoView() {
+ delete this.chronoView;
+ return this.chronoView = document.getElementById('timer-chrono-view');
+ },
+
+ get durationField() {
+ delete this.durationField;
+ return this.durationField = document.getElementById('duration-field');
+ },
+
+ execute: function ti_execute(action) {
+ if (!this[action]) {
+ return;
+ }
+
+ this[action]();
+ },
+
+ start: function ti_start() {
+ if (!this.durationField.validity.valid) {
+ return;
+ }
+
+ this.actionButton.dataset.action = 'cancel';
+ this.chronoView.parentNode.classList.remove('ended');
+ this.tickerView.classList.add('running');
+ this.durationField.disabled = true;
+
+ var duration = this.duration(this.durationField.value);
+ var endTime = Date.now() + duration;
+ this.updateChrono(duration);
+
+ this._ticker = setInterval(function ti_updateChrono(self) {
+ var remaining = endTime - Date.now();
+ if (remaining <= 0) {
+ self.updateChrono(0);
+ self.end();
+ return;
+ }
+
+ self.updateChrono(remaining);
+ }, 1000, this);
+ },
+
+ cancel: function ti_cancel() {
+ this.actionButton.dataset.action = 'start';
+ this.tickerView.classList.remove('running');
+ this.durationField.disabled = false;
+
+ this.updateChrono(0);
+
+ clearInterval(this._ticker);
+ delete this._ticker;
+ },
+
+ end: function ti_end() {
+ //TODO: ring too
+ try {
+ navigator.mozVibrate([200, 200, 200, 200, 200]);
+ } catch (e) {}
+
+ this.cancel();
+ this.chronoView.parentNode.classList.add('ended');
+ },
+
+ updateChrono: function ti_updateChrono(remaining) {
+ this.chronoView.innerHTML = new Date(remaining).toLocaleFormat('%M:%S');
+ },
+
+ duration: function ti_duration(value) {
+ var durationComponents = value.split(':');
+ var duration = 0;
+ for (var i = 0; i < durationComponents.length; i++) {
+ var unitHandler = Math.pow(60, durationComponents.length - 1 - i);
+ duration += unitHandler * 1000 * durationComponents[i];
+ }
+
+ return duration;
+ }
+};
View
108 apps/clock/style/clock.css
@@ -103,8 +103,25 @@ html * {
border-radius: 0 3px 3px 0;
}
-#tabs label[data-active] {
- background: -moz-linear-gradient(top, hsl(0,0%,44%) 0, hsl(0,0%,37%) 1px, hsl(0,0%,56%) 100%);
+#stopwatch-label {
+ background-image: url(images/stopwatch.png);
+}
+#stopwatch-label[data-active] {
+ background: url(images/stopwatch.png) no-repeat 50% 50%, -moz-linear-gradient(top, hsl(0,0%,44%) 0, hsl(0,0%,37%) 1px, hsl(0,0%,56%) 100%);
+}
+
+#timer-label {
+ background-image: url(images/timer.png);
+}
+#timer-label[data-active] {
+ background: url(images/timer.png) no-repeat 50% 50%, -moz-linear-gradient(top, hsl(0,0%,44%) 0, hsl(0,0%,37%) 1px, hsl(0,0%,56%) 100%);
+}
+
+#alarm-label {
+ background-image: url(images/alarm.png);
+}
+#alarm-label[data-active] {
+ background: url(images/alarm.png) no-repeat 50% 50%, -moz-linear-gradient(top, hsl(0,0%,44%) 0, hsl(0,0%,37%) 1px, hsl(0,0%,56%) 100%);
}
#views {
@@ -120,9 +137,7 @@ html * {
height: 100%;
}
-/* === Stop watch === */
-
-#chrono-view-container {
+.chrono-view-container {
width: -moz-calc(100% - 38px);
height: -moz-calc(100% - 20px - 30mozmm - 94px);
margin: 20px auto;
@@ -132,7 +147,7 @@ html * {
background:rgba(0,0,0,0.3);
}
-#chrono-view-container > div:first-child {
+.chrono-view-container > div:first-child {
position: relative;
display: block;
height: -moz-calc(100% - 20px);
@@ -149,7 +164,11 @@ html * {
white-space: nowrap;
}
-#chrono-view {
+.chrono-view-container > div.ended {
+ background: rgba(167, 221, 17, 0.3);
+}
+
+.chrono-view {
position: absolute;
top: -moz-calc(50% - 2em);
width: 100%;
@@ -157,7 +176,7 @@ html * {
line-height: 4em;
}
-#ticker-view {
+.ticker-view {
height: 10px;
margin-top: 10px;
@@ -169,7 +188,7 @@ html * {
visibility: hidden;
}
-#ticker-view.running {
+.ticker-view.running {
visibility: visible;
-moz-animation-duration: 2s;
@@ -226,34 +245,87 @@ html * {
background: -moz-linear-gradient(center bottom , #A5A5A5 0pt, #878787 1px, #545454 100%) repeat scroll 0 0 transparent;
}
+/* === Stop watch === */
+
#reset-button {
bottom: -moz-calc(15mozmm + 38px);
}
-#start-stop-button {
+#stopwatch-action-button {
+ bottom: 0;
+}
+
+#stopwatch-action-button > div > span {
+ background: -moz-linear-gradient(top, rgb(177,214,0) 1px, rgb(143,195,0) 2px, rgb(82,107,23) 100%);
+}
+#stopwatch-action-button > div > span:last-child {
+ background: -moz-linear-gradient(top, hsl(355,93%,42%) 0, hsl(356,94%,37%) 1px, hsl(353,100%,22%) 100%);
+}
+
+#stopwatch-action-button:active span:first-child {
+ background: -moz-linear-gradient(top, rgb(82,107,23) 0, rgb(143,195,0) 100%);
+}
+#stopwatch-action-button:active span:last-child {
+ background: -moz-linear-gradient(top, hsl(353,100%,22%) 0, hsl(356,94%,37%) 100%);
+}
+
+
+#stopwatch-action-button[data-action='start'] > div > span:last-child,
+#stopwatch-action-button[data-action='stop'] > div > span:first-child {
+ display: none;
+}
+#stopwatch-action-button[data-action='stop'] > div > span:last-child,
+#stopwatch-action-button[data-action='start'] > div > span:first-child {
+ display: block;
+}
+
+/* === Timer === */
+
+#timer-action-button {
bottom: 0;
}
-#start-stop-button > div > span {
+#timer-action-button > div > span {
background: -moz-linear-gradient(top, rgb(177,214,0) 1px, rgb(143,195,0) 2px, rgb(82,107,23) 100%);
}
-#start-stop-button > div > span:last-child {
+#timer-action-button > div > span:last-child {
background: -moz-linear-gradient(top, hsl(355,93%,42%) 0, hsl(356,94%,37%) 1px, hsl(353,100%,22%) 100%);
}
-#start-stop-button:active span:first-child {
+#timer-action-button:active span:first-child {
background: -moz-linear-gradient(top, rgb(82,107,23) 0, rgb(143,195,0) 100%);
}
-#start-stop-button:active span:last-child {
+#timer-action-button:active span:last-child {
background: -moz-linear-gradient(top, hsl(353,100%,22%) 0, hsl(356,94%,37%) 100%);
}
-#start-stop-button[data-action='start'] > div > span:last-child,
-#start-stop-button[data-action='stop'] > div > span:first-child {
+#timer-action-button[data-action='start'] > div > span:last-child,
+#timer-action-button[data-action='cancel'] > div > span:first-child {
display: none;
}
-#start-stop-button[data-action='stop'] > div > span:last-child,
-#start-stop-button[data-action='start'] > div > span:first-child {
+#timer-action-button[data-action='cancel'] > div > span:last-child,
+#timer-action-button[data-action='start'] > div > span:first-child {
display: block;
}
+
+#timer-ticker-view {
+ -moz-animation-direction: alternate;
+}
+
+#duration-field {
+ height: 15mozmm;
+ border: none;
+ background: none;
+
+ color: white;
+ text-align: center;
+ font-size: 2em;
+ font-weight: bold;
+ text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
+}
+
+#duration-field:invalid {
+ box-shadow: none;
+ color: red;
+}
View
BIN apps/clock/style/images/alarm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/clock/style/images/stopwatch.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/clock/style/images/timer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1,967 apps/clock/webapi+apps.js
0 additions, 1,967 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
32 apps/cnn/cnn.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="pragma" content="no-cache">
+ <title>CNN</title>
+ <style type="text/css">
+ html, body, iframe {
+ overflow: hidden;
+ background-color: white;
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ border: none;
+ }
+ iframe {
+ position: fixed;
+ overflow: auto;
+ }
+ </style>
+ <script type="text/javascript">
+ function browse(url) {
+ var frame = document.querySelector('iframe');
+ frame.src = url;
+ }
+ </script>
+</head>
+<body onload="browse('http://m.cnn.com/');">
+ <iframe></iframe>
+</body>
+</html>
View
12 apps/cnn/manifest.webapp
@@ -0,0 +1,12 @@
+{
+ "name": "CNN",
+ "description": "CNN Mobile Application",
+ "launch_path": "/cnn.html",
+ "developer": {
+ "name": "CNN",
+ "url": "http://m.cnn.com/"
+ },
+ "icons": {
+ "120": "/icons/CNN.png"
+ }
+}
View
BIN apps/contacts/contact0-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/contacts/contact0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/contacts/contact1-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/contacts/contact1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN apps/contacts/contact2-small.png
Diff not rendered.
View
BIN apps/contacts/contact2.png
Diff not rendered.
View
BIN apps/contacts/contact3-small.png
Diff not rendered.
View
BIN apps/contacts/contact3.png
Diff not rendered.
View
BIN apps/contacts/contact4-small.png
Diff not rendered.
View
BIN apps/contacts/contact4.png
Diff not rendered.
View
BIN apps/contacts/contact5-small.png
Diff not rendered.
View
BIN apps/contacts/contact5.png
Diff not rendered.
View
BIN apps/contacts/contact6-small.png
Diff not rendered.
View
BIN apps/contacts/contact6.png
Diff not rendered.
View
BIN apps/contacts/contact7-small.png
Diff not rendered.
View
BIN apps/contacts/contact7.png
Diff not rendered.
View
BIN apps/contacts/contact8-small.png
Diff not rendered.
View
BIN apps/contacts/contact8.png
Diff not rendered.
View
BIN apps/contacts/contact9-small.png
Diff not rendered.
View
BIN apps/contacts/contact9.png
Diff not rendered.
View
98 apps/crystalskull/crystalskull.html
@@ -0,0 +1,98 @@
+<!doctype html5>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="pragma" content="no-cache">
+ <title>Glass / Refraction, reflection, fresnel, chromatic dispersion | J3D</title>
+
+ <link type="text/css" rel="stylesheet" href="style/common.css">
+ <script type="text/javascript" src="j3d.js"></script>
+
+ <script>
+ var engine, scene;
+ var root, model, shader;
+ var mx = 0, my = 0;
+
+ var properties = {
+ dispersionRed: 0.90,
+ dispersionGreen: 0.97,
+ dispersionBlue: 1.04,
+ bias: 0.9,
+ scale: 0.7,
+ power: 1.1
+ };