ocr update
This commit is contained in:
		@@ -28,7 +28,7 @@ function movePurchases() {
 | 
			
		||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
			
		||||
        $.ajax({
 | 
			
		||||
            type: "POST",
 | 
			
		||||
            url: "/donepurchases",
 | 
			
		||||
            url: "/dones",
 | 
			
		||||
            data:{
 | 
			
		||||
                idtoken: idtoken,
 | 
			
		||||
                sl_id: "BplQ5lFU",
 | 
			
		||||
@@ -47,11 +47,38 @@ function movePurchases() {
 | 
			
		||||
$(".test").click(function() {
 | 
			
		||||
    movePurchases();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
function analyzeUploaded() {
 | 
			
		||||
    var img = document.getElementById("blah");
 | 
			
		||||
 | 
			
		||||
    Tesseract.recognize(img).progress((progress) => {
 | 
			
		||||
 | 
			
		||||
        if (progress.status == "recognizing text") {
 | 
			
		||||
           loading = true;
 | 
			
		||||
        }
 | 
			
		||||
    }).then((result) => {
 | 
			
		||||
        loading = false;
 | 
			
		||||
        $(".output").text(result.text);
 | 
			
		||||
        $('#modal1').modal("open");
 | 
			
		||||
        movePurchases();
 | 
			
		||||
        $(".determinate").css("width", "0%");
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
setInterval(updateProgress(), 500);
 | 
			
		||||
 | 
			
		||||
function updateProgress(percent) {
 | 
			
		||||
    if(loading == true) {
 | 
			
		||||
        $(".determinate").css("width", progress.progress * 100 + "%");
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
var loading = false;
 | 
			
		||||
 | 
			
		||||
function analyze() {
 | 
			
		||||
/*function analyze() {
 | 
			
		||||
    var img = document.getElementById("canvas").toDataURL();
 | 
			
		||||
 | 
			
		||||
    Tesseract.recognize(img).progress((progress) => {
 | 
			
		||||
@@ -67,29 +94,4 @@ function analyze() {
 | 
			
		||||
        $(".determinate").css("width", "0%");
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function analyzeUploaded() {
 | 
			
		||||
    var img = document.getElementById("blah");
 | 
			
		||||
 | 
			
		||||
    Tesseract.recognize(img).progress((progress) => {
 | 
			
		||||
 | 
			
		||||
        if (progress.status == "recognizing text") {
 | 
			
		||||
           loading = true;
 | 
			
		||||
        }
 | 
			
		||||
    }).then((result) => {
 | 
			
		||||
        loading = false;
 | 
			
		||||
        $(".output").text(result.text);
 | 
			
		||||
        $('#modal1').modal("open");
 | 
			
		||||
 | 
			
		||||
        $(".determinate").css("width", "0%");
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
setInterval(updateProgress(), 500);
 | 
			
		||||
 | 
			
		||||
function updateProgress(percent) {
 | 
			
		||||
    if(loading == true) {
 | 
			
		||||
        $(".determinate").css("width", progress.progress * 100 + "%");
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user