forked from github/cordova-android
Messing with git
This commit is contained in:
parent
a01e3036d7
commit
7eeac7ab7c
@ -10,9 +10,9 @@
|
|||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
|
||||||
var deviceInfo = function(){
|
var deviceInfo = function(){
|
||||||
document.getElementById("platform").innerHTML = Device.getPlatform();
|
document.getElementById("platform").innerHTML = Device.platform;
|
||||||
document.getElementById("version").innerHTML = Device.getVersion();
|
document.getElementById("version").innerHTML = Device.version;
|
||||||
document.getElementById("uuid").innerHTML = Device.getUuid();
|
document.getElementById("uuid").innerHTML = Device.uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
var getLocation = function() {
|
var getLocation = function() {
|
||||||
@ -59,10 +59,36 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function show_pic()
|
||||||
|
{
|
||||||
|
navigator.camera.getPicture(dump_pic, fail, { quality: 50 });
|
||||||
|
}
|
||||||
|
|
||||||
|
function dump_pic(data)
|
||||||
|
{
|
||||||
|
var viewport = document.getElementById('viewport');
|
||||||
|
viewport.style.display = "";
|
||||||
|
viewport.style.position = "absolute";
|
||||||
|
viewport.style.top = "10px";
|
||||||
|
` viewport.style.left = "10px";
|
||||||
|
document.getElementById("test_img").src = "data:image/jpeg;base64," + data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function close()
|
||||||
|
{
|
||||||
|
var viewport = document.getElementById('viewport');
|
||||||
|
viewport.style.position = "relative";
|
||||||
|
viewport.style.display = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
function fail(fail)
|
||||||
|
{
|
||||||
|
alert(fail);
|
||||||
|
}
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
document.addEventListener("touchmove", preventBehavior, false);
|
document.addEventListener("touchmove", preventBehavior, false);
|
||||||
deviceInfo();
|
setTimeout(deviceInfo, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -85,5 +111,10 @@
|
|||||||
<a href="tel://411" class="btn large">Call 411</a>
|
<a href="tel://411" class="btn large">Call 411</a>
|
||||||
<a href="#" class="btn" onclick="beep();">Beep</a>
|
<a href="#" class="btn" onclick="beep();">Beep</a>
|
||||||
<a href="#" class="btn" onclick="vibrate();">Vibrate</a>
|
<a href="#" class="btn" onclick="vibrate();">Vibrate</a>
|
||||||
|
<a href="#" class="btn large" onclick="show_pic();">Get a Picture</a>
|
||||||
|
<div id="viewport" class="viewport">
|
||||||
|
<img style="width:60px;height:60px" id="test_img" src="" />
|
||||||
|
<a href="#" class="btn large" onclick="close();">Close</a>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user