<commit_before>//document.getElementById('takePhoto').addEventListener('click',function(){
    //navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, 
    //allowEdit: true, destinationType: navigator.camera.DestinationType.DATA_URL });
//});
document.getElementById('takePhoto').addEventListener('click',function(){
    event.preventDefault();
    navigator.notification.confirm(
        'Seleccione el origen de la imagen',
            function(button){
                if(button == 1){
                    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true, targetWidth: 500, targetHeight: 500, destinationType: navigator.camera.DestinationType.DATA_URL });
                } else {
                    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true, targetWidth: 500, targetHeight: 500, sourceType: 0, destinationType: navigator.camera.DestinationType.DATA_URL });
                }
            },
        'Insertar Imagen',
        'Camara,Galeria'
    );
});
document.getElementById('takePhoto2').addEventListener('click',function(){
    event.preventDefault();
    navigator.notification.confirm(
        'Seleccione el origen de la imagen',
            function(button){
                if(button == 1){
                    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true, targetWidth: 500, targetHeight: 500, destinationType: navigator.camera.DestinationType.DATA_URL });
                } else {
                    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true, targetWidth: 500, targetHeight: 500, sourceType: 0, destinationType: navigator.camera.DestinationType.DATA_URL });
                }
            },
        'Insertar Imagen',
        'Camara,Galeria'
    );
});
//document.getElementById('sendPhoto').addEventListener('click',function(){
    //var sendPhoto = document.getElementById('sendPhoto');
    //sendPhoto.addEventListener('click', sendPhoto, false);
//});
//function sendPhoto() {
    //alert('Imagen enviada al servidor');
//}
//function takePhoto(){
    //alert('hola')
    //navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, 
    // allowEdit: true, destinationType: navigator.camera.DestinationType.DATA_URL });
//}
function onPhotoDataSuccess(imageData) {
    var photo = document.getElementById('photo');
    photo.style.display = 'block';
    photo.src = "data:image/jpeg;base64," + imageData;
    //var sendPhoto = document.getElementById('sendPhoto');
    //sendPhoto.style.display = 'block';  
}
function onPhotoDataSuccess(imageData) {
    var photo = document.getElementById('photo2');
    photo.style.display = 'block';
    photo.src = "data:image/jpeg;base64," + imageData;
    //var sendPhoto = document.getElementById('sendPhoto');
    //sendPhoto.style.display = 'block';  
}
function onFail(message) {
    alert('Failed because: ' + message);
}

// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
// Update DOM on a Received Event
//receivedEvent: function(id) {
    //var parentElement = document.getElementById(id);
    //var listeningElement = parentElement.querySelector('.listening');
    //var receivedElement = parentElement.querySelector('.received');
    //listeningElement.setAttribute('style', 'display:none;');
    //receivedElement.setAttribute('style', 'display:block;');
    //console.log('Received Event: ' + id);
//}<commit_msg>cambios en captura de imagen<commit_after>//document.getElementById('takePhoto').addEventListener('click',function(){
    //navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, 
    //allowEdit: true, destinationType: navigator.camera.DestinationType.DATA_URL });
//});
document.getElementById('takePhoto').addEventListener('click',function(){
    event.preventDefault();
    navigator.notification.confirm(
        'Seleccione el origen de la imagen',
            function(button){
                if(button == 1){
                    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true, targetWidth: 500, targetHeight: 500, destinationType: navigator.camera.DestinationType.DATA_URL });
                } else {
                    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true, targetWidth: 500, targetHeight: 500, sourceType: 0, destinationType: navigator.camera.DestinationType.DATA_URL });
                }
            },
        'Insertar Imagen',
        'Camara,Galeria'
    );
});
document.getElementById('takePhoto2').addEventListener('click',function(){
    event.preventDefault();
    navigator.notification.confirm(
        'Seleccione el origen de la imagen',
            function(button){
                if(button == 1){
                    navigator.camera.getPicture(onPhotoDataSuccess2, onFail, { quality: 20, allowEdit: true, targetWidth: 500, targetHeight: 500, destinationType: navigator.camera.DestinationType.DATA_URL });
                } else {
                    navigator.camera.getPicture(onPhotoDataSuccess2, onFail, { quality: 20, allowEdit: true, targetWidth: 500, targetHeight: 500, sourceType: 0, destinationType: navigator.camera.DestinationType.DATA_URL });
                }
            },
        'Insertar Imagen',
        'Camara,Galeria'
    );
});
//document.getElementById('sendPhoto').addEventListener('click',function(){
    //var sendPhoto = document.getElementById('sendPhoto');
    //sendPhoto.addEventListener('click', sendPhoto, false);
//});
//function sendPhoto() {
    //alert('Imagen enviada al servidor');
//}
//function takePhoto(){
    //alert('hola')
    //navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, 
    // allowEdit: true, destinationType: navigator.camera.DestinationType.DATA_URL });
//}
function onPhotoDataSuccess(imageData) {
    var photo = document.getElementById('photo');
    photo.style.display = 'block';
    photo.src = "data:image/jpeg;base64," + imageData;
    //var sendPhoto = document.getElementById('sendPhoto');
    //sendPhoto.style.display = 'block';  
}
function onPhotoDataSuccess2(imageData) {
    var photo = document.getElementById('photo2');
    photo.style.display = 'block';
    photo.src = "data:image/jpeg;base64," + imageData;
    //var sendPhoto = document.getElementById('sendPhoto');
    //sendPhoto.style.display = 'block';  
}
function onFail(message) {
    //alert('Failed because: ' + message);
}

// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
// Update DOM on a Received Event
//receivedEvent: function(id) {
    //var parentElement = document.getElementById(id);
    //var listeningElement = parentElement.querySelector('.listening');
    //var receivedElement = parentElement.querySelector('.received');
    //listeningElement.setAttribute('style', 'display:none;');
    //receivedElement.setAttribute('style', 'display:block;');
    //console.log('Received Event: ' + id);
//}
{'fraction_non_alphanumeric': 0.1415537738457285, 'fraction_numerical': 0.013132430190765827, 'mean_word_length': 3.4688079061148858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3974076', 'n_tokens_mistral': 2075, 'n_tokens_neox': 1951, 'n_words': 400}