PHP Classes

File: js/index.js

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Simple PHP Blog Script   js/index.js   Download  
File: js/index.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Simple PHP Blog Script
Manage blog articles stored in a MySQL database
Author: By
Last change:
Date: 1 year ago
Size: 1,310 bytes
 

Contents

Class file image Download
/** * main proccess function */ function proccess(file){ $(".result").html(""); //Preview Image var src = (window.URL ? URL : webkitURL).createObjectURL(file); $("#image").attr("src", src); //Proccess Image Tesseract.recognize(file) .progress(function(data){ console.log(data); progress(data); }) .then(function(data){ console.log(data); result(data) }) } /** * progress function */ function progress(packet){ var r = $(".result"); if(r.length > 0 && r.find(".status").last().html() == packet.status){ if('progress' in packet) { r.find("progress").last().val(packet.progress); } } else { var tStatus = "<div class='status ten wide column'>" + packet.status +"</div>"; var tProgress = "<div class='six wide column'>" + (typeof packet.progress == "undefined" ? "" : ("<progress value='" + packet.progress + "' max='1'>")) +"</div>"; r.append(tStatus + tProgress); } } /** * reporting function */ function result(data){ var r = $(".result"); //r.html(""); r.append( "<div class='sixteen wide column output'>success" + "<div class='ui message'><pre>" + data.text +"</pre></div>" + "</div>" ); }