Skip to content

Commit be269c0

Browse files
committed
Append images
1 parent 8f3fc54 commit be269c0

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

Diff for: lib/app.js

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/app.coffee

+19
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,23 @@ class PigeonLogger
55
deviceready: (e) ->
66
alert "deviceready"
77

8+
capturePhoto: ->
9+
# capture callback
10+
captureSuccess = (mediaFiles) ->
11+
navigator.notification.alert "Total files: #{mediaFiles.length}"
12+
for i in [0...mediaFiles.length]
13+
img = document.createElement 'img'
14+
img.src = mediaFiles[i].fullPath
15+
document.body.appendChild img
16+
17+
# capture error callback
18+
captureError = (error) ->
19+
navigator.notification.alert "Error code: " + error.code, null, "Capture Error"
20+
21+
22+
# start image capture
23+
navigator.device.capture.captureImage captureSuccess, captureError,
24+
limit: 2
25+
26+
827
window.app = new PigeonLogger()

0 commit comments

Comments
 (0)