mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
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() {
|
||||||
@ -55,17 +55,43 @@
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
var preventBehavior = function(e) {
|
var preventBehavior = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function show_pic()
|
||||||
|
{
|
||||||
|
navigator.camera.getPicture(dump_pic, fail, { quality: 50 });
|
||||||
|
}
|
||||||
|
|
||||||
function init(){
|
function dump_pic(data)
|
||||||
document.addEventListener("touchmove", preventBehavior, false);
|
{
|
||||||
deviceInfo();
|
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(){
|
||||||
|
document.addEventListener("touchmove", preventBehavior, false);
|
||||||
|
setTimeout(deviceInfo, 1);
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init();" id="stage" class="theme">
|
<body onload="init();" id="stage" class="theme">
|
||||||
<h1>Welcome to PhoneGap!</h1>
|
<h1>Welcome to PhoneGap!</h1>
|
||||||
@ -84,6 +110,11 @@
|
|||||||
<a href="#" class="btn large" onclick="getLocation();">Get Location</a>
|
<a href="#" class="btn large" onclick="getLocation();">Get Location</a>
|
||||||
<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