forked from burator/ImagePicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
53 lines (49 loc) · 1.84 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>ImagePicker demo</title>
</head>
<body>
<div class="app">
<h1>ImagePicker demo</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
<button onclick="getPics()">get pics</button>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script>
function getPics() {
imagePicker.getPictures(
function (result) {
var content = '';
for (var i = 0; i < result.length; i++) {
content += '<img src="' + result[i] + '" style="max-width:200px"/>';
//content += '<img src="data:image/jpg;base64,'+result[i]+'" style="max-width:200px"/>';
}
document.getElementById("imageOutput").innerHTML = content;
}, function (error) {
alert('Error: ' + error);
}, {
// if no title is passed, the plugin should use a sane default (preferrably the same as it was, so check the old one.. there are screenshots in the marketplace doc)
maximumImagesCount: 10,
title: 'Select pix',
message: 'Pick max 10 items', // optional default no helper message above the picker UI
// be careful with these options as they require additional processing
width: 400,
quality: 80
// outputType: imagePicker.OutputType.BASE64_STRING
}
);
}
</script>
<div id="imageOutput">
</div>
</body>
</html>