Skip to content

Commit

Permalink
parsing for Laura
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasalmeida committed Feb 13, 2015
1 parent 0d8e692 commit ba0106a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
18 changes: 18 additions & 0 deletions jobs/laura.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
console.log('parsing for Laura')

openHealthJob.innerHTML='<h3 style="color:green"> <i style="color:navy">Parsing for Laura</h3>Laura, this is a simple tool to parse your text documents with blocks of lines into rows of columns. This is a rough little draft I wrote to help Ivan learn how he can port in spreadsheet code into an autonomous web app. When using it please check the length in the last column to see if some cells may have been parsed out of the range found in the first block of lines. When you find a discrepancy just go to the text you have in the text area and edit it - the table is automatically updated as you edit. Enough disclaiming, just throw some text into textarea below and you can collect the Excell spreadsheet by clicking the button at the very bottom of the table.</i>'
openHealthJob.innerHTML+='<textarea id="txtInput"></textarea><div id="parsedTable"></div>'
txtInput.style.color="blue"
txtInput.style.width="100%"
txtInput.style.height="400px"
txtInput.onkeyup=function(evt){
//if(evt.keyCode==13){
if(true){
var txt = txtInput.value;
var y=txt.split(/\n{2,}/).map(function(t){
return t.split(/\n/)
})
parsedTable.innerHTML=""
parsedTable.appendChild(openHealth.crossdoc2html(y))
}
}
12 changes: 9 additions & 3 deletions openHealth.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,9 @@ this.createLog=function(h){ // create log div, if posiible, within an existing o
this.startJobMsgURL=function(){ // post URL of job into the div.id="msg" if it exists
var divMsg=document.getElementById("msg")
if(divMsg){
divMsg.innerHTML='Processing ... : <a href="'+window.location.search.slice(1)+'" target=_blank>'+window.location.search.slice(1)+'</a>';
var sUrl = window.location.search.slice(1);
if(sUrl.slice(-1)=="/"){sUrl=sUrl.slice(0,-1)}
divMsg.innerHTML='Processing ... : <a href="'+sUrl+'" target=_blank>'+sUrl+'</a>';
divMsg.style.color="red";
}
this.createLog('<p style="color:red">Executing job, please wait ...</p>')
Expand All @@ -579,9 +581,13 @@ this.endJobMsgURL=function(){ // post URL of job into the div.id="msg" if it exi
if(divMsg){
//document.getElementById("openHealthJob").innerHTML="";
divMsg.style.color="blue";
divMsg.innerHTML='Processing ... done : <a href="'+window.location.search.slice(1)+'" target=_blank>'+window.location.search.slice(1)+'</a>';
var sUrl = window.location.search.slice(1);
if(sUrl.slice(-1)=="/"){sUrl=sUrl.slice(0,-1)}
divMsg.innerHTML='Processing ... done : <a href="'+sUrl+'" target=_blank>'+sUrl+'</a>';
setTimeout(function(){
divMsg.innerHTML='Script (<a href="'+window.location.search.slice(1)+'" target=_blank>'+window.location.search.slice(1)+'</a>) processed <i>'+new Date(Date.now())+'</i>:';
var sUrl = window.location.search.slice(1);
if(sUrl.slice(-1)=="/"){sUrl=sUrl.slice(0,-1)}
divMsg.innerHTML='Script (<a href="'+sUrl+'" target=_blank>'+sUrl+'</a>) processed <i>'+new Date(Date.now())+'</i>:';
divMsg.style.color="green";
},1000)

Expand Down

0 comments on commit ba0106a

Please sign in to comment.