Commit 90afaf8b by Jorem Magcawas

feedback changes latest

parent 1d835085
window.onclick = (event) => {
if (event.path[0].id == 'pause') {
disableForm();
}
if (event.path[0].id == 'continue') {
enableForm();
}
}
function disableForm() { const disableTiffButtons = () => {
var element = document.getElementById("TiffViewer_ButtonContainer"); var element = document.getElementById("TiffViewer_ButtonContainer");
element.style.visibility = 'hidden'; element.style.visibility = 'hidden';
} }
function enableForm() { const enableTiffButtons = () => {
var element = document.getElementById("TiffViewer_ButtonContainer"); var element = document.getElementById("TiffViewer_ButtonContainer");
element.style.visibility = 'visible'; element.style.visibility = 'visible';
} }
\ No newline at end of file
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
<script src='dir.php'></script> <script src='dir.php'></script>
<script src="./disable.js"></script>
<script src="./src/captureMetrics/captureMetrics.js"></script> <script src="./src/captureMetrics/captureMetrics.js"></script>
<!-- fetch the schema --> <!-- fetch the schema -->
<script src="./src/fetchSchema/fetchSchema.js"></script> <script src="./src/fetchSchema/fetchSchema.js"></script>
...@@ -149,7 +150,6 @@ ...@@ -149,7 +150,6 @@
</script> </script>
<script src="./src/endSession/endSession.js"></script> <script src="./src/endSession/endSession.js"></script>
<script src="./src/tiffViewer/tiffViewer.js"></script> <script src="./src/tiffViewer/tiffViewer.js"></script>
<script src="./disable.js"></script> <script src="./src/highlight/highlight.js"></script>
<!-- <script src="./src/highlight/highlight.js"></script> -->
</html> </html>
\ No newline at end of file
record_no,filename,speed,eoe_timestamp,avg_speed
1,0001SVI_0004.tif,11919.068056407114,10/7/2022 9:20:38 AM,11919.068056407114
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Image_Source_Path>./input/0001SVI_0004.tif</Image_Source_Path> <Image_Source_Path>./input/0001SVI_0004.tif</Image_Source_Path>
<No_of_Keystrokes>15</No_of_Keystrokes> <No_of_Keystrokes>27</No_of_Keystrokes>
<Processing_Time_Seconds>9.888</Processing_Time_Seconds> <Processing_Time_Seconds>8.155</Processing_Time_Seconds>
<Payee>dwa</Payee> <Payee>dawdaw</Payee>
<Particulars>dwa</Particulars> <Particulars>dwadwa</Particulars>
<Account_No>dwa</Account_No> <Account_No>dwa</Account_No>
<Transaction_Date>2022-10-12</Transaction_Date> <Transaction_Date>2003-04-02</Transaction_Date>
\ No newline at end of file \ No newline at end of file
...@@ -69,6 +69,10 @@ async function accessFile() { ...@@ -69,6 +69,10 @@ async function accessFile() {
const blob = await res.blob(); const blob = await res.blob();
status('download completed'); status('download completed');
[...document.getElementsByClassName("bar")].forEach(el => {
el.style.display = "none";
});
const request = indexedDB.open("ImageDatabase", 1); const request = indexedDB.open("ImageDatabase", 1);
request.onsuccess = async function () { request.onsuccess = async function () {
// console.log("Database opened successfully " + val ); // console.log("Database opened successfully " + val );
...@@ -323,6 +327,10 @@ function refreshImage() { ...@@ -323,6 +327,10 @@ function refreshImage() {
db.close(); db.close();
status('downloaded '+Math.trunc(size/1000)+" kb"); status('downloaded '+Math.trunc(size/1000)+" kb");
progress(); progress();
[...document.getElementsByClassName("bar")].forEach(el => {
el.style.display = "none";
});
}; };
}; };
} }
...@@ -332,16 +340,6 @@ function promptNoFilesLeft(){ ...@@ -332,16 +340,6 @@ function promptNoFilesLeft(){
var viewer = document.getElementById('viewer'); var viewer = document.getElementById('viewer');
var promptMain = document.createElement('div'); var promptMain = document.createElement('div');
promptMain.setAttribute("id", "prompt"); promptMain.setAttribute("id", "prompt");
promptMain.style.zIndex = 999;
promptMain.style.textAlign = 'center';
promptMain.style.margin = 0 + ' auto';
promptMain.style.position = 'absolute';
promptMain.style.top = '50%';
promptMain.style.left = '50%';
promptMain.style.transform = 'translate(-50%, -50%)';
promptMain.style.backgroundColor = 'white';
promptMain.style.padding = '10px';
promptMain.style.display = 'block';
var message = document.createElement('p'); var message = document.createElement('p');
message.innerHTML = 'No images left to be fetched, Proceed to end session'; message.innerHTML = 'No images left to be fetched, Proceed to end session';
......
...@@ -66,6 +66,7 @@ const startMetricCapture = () => { ...@@ -66,6 +66,7 @@ const startMetricCapture = () => {
window.onclick = (event) => { window.onclick = (event) => {
if (event.path[0].id == 'pause') { if (event.path[0].id == 'pause') {
pauseMetricCapture(); pauseMetricCapture();
disableTiffButtons();
} }
} }
...@@ -207,6 +208,7 @@ function promptPaused() { ...@@ -207,6 +208,7 @@ function promptPaused() {
okButton.onclick = function () { okButton.onclick = function () {
promptMain.style.display = 'none'; promptMain.style.display = 'none';
unpauseMetricCapture(); unpauseMetricCapture();
enableTiffButtons();
}; };
promptMain.appendChild(message); promptMain.appendChild(message);
promptMain.appendChild(okButton); promptMain.appendChild(okButton);
......
...@@ -76,6 +76,9 @@ const displayFields = async (parentID) => { ...@@ -76,6 +76,9 @@ const displayFields = async (parentID) => {
case 'datepicker': case 'datepicker':
input = inputDate(key, validation) input = inputDate(key, validation)
break break
case 'textarea':
input = inputTextArea(key, validation)
break
default: default:
input = noValidation() input = noValidation()
break break
...@@ -99,9 +102,9 @@ const displayFields = async (parentID) => { ...@@ -99,9 +102,9 @@ const displayFields = async (parentID) => {
dropdowns.on('select2:close', handleDropdown) dropdowns.on('select2:close', handleDropdown)
}) })
// upon enbaling highligh.js moved to highlight.js file // upon enbaling highligh.js moved to highlight.js file
$(document).ready(function () { // $(document).ready(function () {
$('form:first *:input[type!=hidden]:first').focus(); // Run code // $('form:first *:input[type!=hidden]:first').focus(); // Run code
}); // });
} catch(err) { } catch(err) {
console.log(err) console.log(err)
...@@ -169,6 +172,53 @@ const inputString = (key, validation) => { ...@@ -169,6 +172,53 @@ const inputString = (key, validation) => {
* @returns * @returns
* created input field element * created input field element
*/ */
const inputTextArea = (key, validation) => {
try {
const { mandatory, fieldLength } = validation
const input = document.createElement('TEXTAREA')
input.setAttribute('id', `${key}`)
input.setAttribute('name', `${key}`)
input.setAttribute('type', 'text')
input.setAttribute('autocomplete', 'off')
input.addEventListener('focusout', handleInput)
input.setAttribute('cols', 30)
if(fieldLength >= 31 && fieldLength <= 60){
input.setAttribute('rows', 2)
}
else if(fieldLength >= 61 && fieldLength <= 90){
input.setAttribute('rows', 3)
}
else if(fieldLength >= 91 && fieldLength <= 120){
input.setAttribute('rows', 4)
}
else{
input.setAttribute('rows', 5)
}
fieldLength ? input.setAttribute('maxLength', `${fieldLength}`) : null
mandatory ? input.setAttribute('required', 'true') : null
return input
} catch(err) {
throw err
}
}
/**
*
* @param {*} key
* will serve as id of input field
* @param {*} validation
* validation of field from schema
* @returns
* created input field element
*/
const inputNumeric = (key, validation) => { const inputNumeric = (key, validation) => {
try { try {
const { mandatory, fieldLength } = validation const { mandatory, fieldLength } = validation
......
...@@ -206,6 +206,7 @@ function initHighlight() { ...@@ -206,6 +206,7 @@ function initHighlight() {
$(document).ready(function () { $(document).ready(function () {
$('form:first *:input[type!=hidden]:first').focus(); // Run code $('form:first *:input[type!=hidden]:first').focus(); // Run code
}); });
}); });
sizeObserver.observe(TIFFimg); sizeObserver.observe(TIFFimg);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"validation": "validation":
{ {
"fieldLength": 200, "fieldLength": 200,
"collection": "alphanumeric", "collection": "textarea",
"mandatory": true "mandatory": true
} }
}, },
......
...@@ -53,6 +53,9 @@ const submitForm = (e) => { ...@@ -53,6 +53,9 @@ const submitForm = (e) => {
el.children[3].removeChild(el.children[3].firstChild); el.children[3].removeChild(el.children[3].firstChild);
} }
}); });
[...document.getElementsByClassName("bar")].forEach(el => {
el.style.removeProperty('display');
});
document.getElementById("counter").innerHTML = ""; document.getElementById("counter").innerHTML = "";
clearTimeout(interval); clearTimeout(interval);
isCanvasNotCreated = true; isCanvasNotCreated = true;
......
...@@ -616,6 +616,6 @@ function TIFFViewer(xhr, TiffViewerImageName) { ...@@ -616,6 +616,6 @@ function TIFFViewer(xhr, TiffViewerImageName) {
div.scrollTop += 20; div.scrollTop += 20;
} }
}); });
// initHighlight(); initHighlight();
} }
...@@ -4,7 +4,7 @@ html { ...@@ -4,7 +4,7 @@ html {
*{ *{
font-size: 13px; font-size: 13px;
font-family: Arial, Helvetica, sans-serif; font-family: Helvetica, sans-serif;
} }
#with-config { #with-config {
...@@ -28,7 +28,7 @@ html { ...@@ -28,7 +28,7 @@ html {
display: flex; display: flex;
position: sticky; position: sticky;
flex-direction: column; flex-direction: column;
background-color: peachpuff; background-color: #FBF0D9;
max-height: 100vh; max-height: 100vh;
right: 0; right: 0;
} }
...@@ -155,14 +155,19 @@ main#viewer { ...@@ -155,14 +155,19 @@ main#viewer {
color: red; color: red;
} }
textarea{
resize: none;
}
#pauseBtn { #pauseBtn {
background-color: peachpuff; background-color: #FBF0D9;
text-align: center;
} }
#pause { #pause {
width: calc(100% - 40px); width: calc(38% - 40px);
margin: 20px; margin: 20px;
padding: 10px; padding: 6px;
} }
/* ADDED: added to adjust button container when window is resized */ /* ADDED: added to adjust button container when window is resized */
...@@ -378,7 +383,7 @@ body>div>button { ...@@ -378,7 +383,7 @@ body>div>button {
border-width: thin; border-width: thin;
border-color: black; border-color: black;
padding: 5px; padding: 0px;
} }
...@@ -387,14 +392,14 @@ body>div>button { ...@@ -387,14 +392,14 @@ body>div>button {
flex-direction: row; flex-direction: row;
/* justify-content: flex-end; */ /* justify-content: flex-end; */
width: 42%; width: 42%;
padding-right: 3px; padding: 3px;
} }
.inputContainer { .inputContainer {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
width: 56%; width: 100%;
padding-left: 3px; padding-left: 3px;
} }
...@@ -413,9 +418,26 @@ body>div>button { ...@@ -413,9 +418,26 @@ body>div>button {
} }
input[type=text] { input[type=text] {
width: 90%; width: 100%;
} }
select { select {
width: 90%; width: 90%;
} }
#prompt{
backdrop-filter: blur(4px);
z-index: 999;
width: 100%;
height: 100%;
text-align: center;
margin: 0px auto;
position: fixed;
top: 50%;
left: 50%;
border: 1px solid gray;
transform: translate(-50%, -50%);
background-color: #555555a1;
padding: 10px;
display: block;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment