diff --git a/jobs/laura.js b/jobs/laura.js new file mode 100644 index 0000000..5431d19 --- /dev/null +++ b/jobs/laura.js @@ -0,0 +1,18 @@ +console.log('parsing for Laura') + +openHealthJob.innerHTML='

Parsing for Laura

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.' +openHealthJob.innerHTML+='
' +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)) + } +} diff --git a/openHealth.js b/openHealth.js index 5aadcae..6e5334e 100644 --- a/openHealth.js +++ b/openHealth.js @@ -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 ... : '+window.location.search.slice(1)+''; + var sUrl = window.location.search.slice(1); + if(sUrl.slice(-1)=="/"){sUrl=sUrl.slice(0,-1)} + divMsg.innerHTML='Processing ... : '+sUrl+''; divMsg.style.color="red"; } this.createLog('

Executing job, please wait ...

') @@ -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 : '+window.location.search.slice(1)+''; + var sUrl = window.location.search.slice(1); + if(sUrl.slice(-1)=="/"){sUrl=sUrl.slice(0,-1)} + divMsg.innerHTML='Processing ... done : '+sUrl+''; setTimeout(function(){ - divMsg.innerHTML='Script ('+window.location.search.slice(1)+') processed '+new Date(Date.now())+':'; + var sUrl = window.location.search.slice(1); + if(sUrl.slice(-1)=="/"){sUrl=sUrl.slice(0,-1)} + divMsg.innerHTML='Script ('+sUrl+') processed '+new Date(Date.now())+':'; divMsg.style.color="green"; },1000)