function capturePhoto() {
clearCache();
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1;//January is 0!
var yyyy = today.getFullYear();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
if(dd<10){dd='0'+dd}
if(mm<10){mm='0'+mm}
if(minutes<10){minutes='0'+minutes}
if(seconds<10){seconds='0'+seconds}
var post_todaydate = mm+'/'+dd+'/'+yyyy+' '+hours+':'+minutes+':'+seconds
document.getElementById('timedataid').innerHTML = post_todaydate;
document.getElementById("submitbtndaily").style.display = '';
document.getElementById("timedataid").style.display = '';
document.getElementById("largeImage").style.display = '';
navigator.camera.getPicture(onCapturePhoto, onFailure, {
quality:10,
destinationType: destinationType.FILE_URI
});
}
function clearCache() {
//alert("hi");
navigator.camera.cleanup();
}
<!---------gallery image--------------------------->
function getPhoto(source)
{
clearCache();
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1;//January is 0!
var yyyy = today.getFullYear();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
if(dd<10){dd='0'+dd}
if(mm<10){mm='0'+mm}
if(minutes<10){minutes='0'+minutes}
if(seconds<10){seconds='0'+seconds}
var post_todaydate = mm+'/'+dd+'/'+yyyy+' '+hours+':'+minutes+':'+seconds
document.getElementById('timedataid').innerHTML = post_todaydate;
document.getElementById("submitbtndaily").style.display = '';
document.getElementById("timedataid").style.display = '';
document.getElementById("largeImage").style.display = '';
navigator.camera.getPicture(onCapturePhoto, onFailure, { quality: 10,
destinationType: destinationType.FILE_URI,
sourceType: source });
}
<!--------------upload image failed------------------>
function onFailure(message) {
$('#largeImage').attr('src', '');
//alert('Failed because: ' + message);
$("#camphoto").popup( "close" );
$("body").off("touchmove");
}
// <!----------giving image name,key called from capturephoto/getphoto-------------------->
function onCapturePhoto(fileURI) {
$('#largeImage').attr('src', '');
myfileURI = fileURI;
clearCache();
var largeImage = document.getElementById('largeImage');
largeImage.style.display = 'block';
largeImage.src = fileURI;
options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1);
options.mimeType = "image/jpeg";
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to a topic in the Google Groups "phonegap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phonegap/xHayIk3dIAM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.