This repository has been archived by the owner on Dec 12, 2018. It is now read-only.
/
index.html
105 lines (93 loc) · 3.83 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html>
<head>
<title>Blasting Agent</title>
<meta name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<!-- remove no-cache in prod -->
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<!--<link href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojox/mobile/themes/android/android.css" rel="stylesheet"/>-->
<script data-dojo-config="async:true"
src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js">
</script>
<script>
require(["dojox/mobile/parser", "dojox/mobile/deviceTheme", "dojox/mobile", "dojox/mobile/ScrollableView",
"dojox/mobile/TabBar","dojox/mobile/TabBarButton", "dojox/mobile/compat"],
function(parser) {
parser.parse();
}
);
</script>
<script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script>
<script>
function PictureSourceType() {};
PictureSourceType.PHOTO_LIBRARY = 0;
PictureSourceType.CAMERA = 1;
function getPicture(sourceType)
{
var options = { quality: 10 };
if (sourceType != undefined) {
options["sourceType"] = sourceType;
}
// if no sourceType specified, the default is CAMERA
navigator.camera.getPicture(getPicture_Success, null, options);
};
function getPicture_Success(imageData)
{
alert("getpic success");
document.getElementById("test_img").src = "data:image/jpeg;base64," + imageData;
}
</script>
<style>
/* vertically center the image */
.refresh img {
margin-top:6px;
}
div.actionButton {float:right;}
#screens {background-color: red}
#tabBar{margin-top:-49px;}
</style>
</head>
<body>
<!-- the view or "page"; select it as the "home" screen -->
<div id="home" data-dojo-type="dojox.mobile.ScrollableView" data-dojo-props="selected: true">
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props="fixed: 'top'">Blasting Agent</h1>
<ul data-dojo-type="dojox.mobile.RoundRectList">
<li data-dojo-type="dojox.mobile.ListItem" icon="images/video-display.png" rightText="Slow"
moveTo="screens">
Display Pictures
<div class="mblItemSwitch" data-dojo-type="dojox.mobile.Switch"></div>
</li>
<li data-dojo-type="dojox.mobile.ListItem" icon="images/camera-photo.png" rightText=""
moveTo="camera">
Take Pictures
<!--<button data-dojo-type="dojox.mobile.Button"-->
<!--data-dojo-props='label:"Click me!", onClick:function(e){ alert("button clicked");return true; }'></button>
-->
</li>
</ul>
</div>
<!-- The "General" sub-page -->
<div id="camera" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" back="Home" moveTo="home">Back</h1>
<ul data-dojo-type="dojox.mobile.RoundRectList">
<li data-dojo-type="dojox.mobile.ListItem" icon="images/camera-photo.png" rightText="">
<div data-dojo-type="dojox.mobile.ToolBarButton"
data-dojo-props="icon: 'images/camera-photo.png'" class="actionButton refresh"></div>
<button onclick="getPicture()">From Camera</button>
<button onclick="getPicture(PictureSourceType.PHOTO_LIBRARY)">From Photo Library</button>
</li>
</ul>
</div>
<div id="screens" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" back="Home" moveTo="home">Back</h1>
<img style="width:60px;height:60px" id="test_img" src="" />
</div>
<ul id="tabBar" data-dojo-type="dojox.mobile.TabBar" data-dojo-props="iconBase: 'images/iconStrip.png'">
<li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="iconPos1: '0,0,29,30', iconPos2: '29,0,29,30', selected: true, moveTo: 'screens'">Take Pictures</li>
<li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props="iconPos1: '0,29,29,30', iconPos2: '29,29,29,30', moveTo: 'screens'">Screens</li>
</ul>
</body>
</html>