Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEBGDE-Components
web-ui
Commits
ad245dd3
Commit
ad245dd3
authored
May 24, 2023
by
Daniel Bawag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added modifications for beta 2
parent
101fd51b
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
279 additions
and
50 deletions
+279
-50
index.html
WebGde/WebContent/index.html
+3
-2
getElement.js
WebGde/WebContent/src/BPO/getElement.js
+1
-1
rejectElement.js
WebGde/WebContent/src/BPO/rejectElement.js
+1
-1
returnElement.js
WebGde/WebContent/src/BPO/returnElement.js
+5
-1
accessFile.js
WebGde/WebContent/src/accessFile/accessFile.js
+63
-6
captureMetrics.js
WebGde/WebContent/src/captureMetrics/captureMetrics.js
+3
-0
getFields.js
WebGde/WebContent/src/getFields/getFields.js
+38
-9
pdfv.js
WebGde/WebContent/src/pdfviewer/pdfv.js
+0
-11
HR Speed Test schema.json
...de/WebContent/src/sample_schema/HR Speed Test schema.json
+103
-0
submit.js
WebGde/WebContent/src/submit/submit.js
+23
-1
tiffViewer.js
WebGde/WebContent/src/tiffViewer/tiffViewer.js
+0
-18
validateInput.js
WebGde/WebContent/src/validateInput/validateInput.js
+38
-0
style.css
WebGde/WebContent/style.css
+1
-0
No files found.
WebGde/WebContent/index.html
View file @
ad245dd3
...
...
@@ -274,7 +274,7 @@ const rejectIcon = document.createElement("img");
}
);
document
.
addEventListener
(
"keydown"
,
(
e
)
=>
{
/*
document.addEventListener("keydown", (e) => {
if (e.ctrlKey && e.keyCode === 123) {
const fieldForm = document.getElementById("fields");
fieldForm.querySelector('input[type="submit"]').click();
...
...
@@ -283,10 +283,11 @@ const rejectIcon = document.createElement("img");
document.addEventListener("keydown", (e) => {
if (e.ctrlKey && e.keyCode === 122) {
localStorage.setItem("prev", "1");
const fieldForm = document.getElementById("fields");
fieldForm.querySelector('input[type="submit"]').click()
}
})
})
*/
document
.
addEventListener
(
"keydown"
,
(
e
)
=>
{
if
(
e
.
shiftKey
&&
e
.
key
===
"Enter"
)
{
...
...
WebGde/WebContent/src/BPO/getElement.js
View file @
ad245dd3
...
...
@@ -288,7 +288,7 @@ async function completeToNextNode(elementId) {
// let json = await response.json();
// return json.elements;
localStorage.clear();
Current_page = 0
;
//localStorage.sfIndex = 1
;
await initGetElement();
init();
} else {
...
...
WebGde/WebContent/src/BPO/rejectElement.js
View file @
ad245dd3
...
...
@@ -48,7 +48,7 @@ async function rejectElement() {
sessionStorage
.
removeItem
(
"doctype"
);
isCanvasNotCreated
=
true
;
localStorage
.
clear
();
Current_page
=
0
;
//localStorage.sfIndex = 1;
await
initGetElement
();
init
();
alert
(
"Element Rejected"
);
...
...
WebGde/WebContent/src/BPO/returnElement.js
View file @
ad245dd3
...
...
@@ -40,7 +40,7 @@ async function returnElementBPO(elementId) {
sessionStorage
.
removeItem
(
"doctype"
);
isCanvasNotCreated
=
true
;
localStorage
.
clear
();
Current_page
=
0
;
//localStorage.sfIndex = 1;
await
loadWaitingElement
();
init
();
alert
(
'Element Returned'
);
...
...
@@ -190,10 +190,14 @@ function createReturnWindow() {
returnElementBPO
(
sessionStorage
.
getItem
(
"element_id"
));
var
fileName
=
sessionStorage
.
getItem
(
"file_Name"
);
if
(
fileName
!==
null
&&
fileName
!==
undefined
){
if
(
document
.
getElementById
(
"controlsContainer"
)
!==
null
)
{
document
.
getElementById
(
"controlsContainer"
).
outerHTML
=
""
;
}
}
else
{
if
(
document
.
getElementById
(
"TiffViewer_ButtonContainer"
)
!==
null
)
{
document
.
getElementById
(
"TiffViewer_ButtonContainer"
).
outerHTML
=
""
;
}
}
overlay
.
remove
();
}
...
...
WebGde/WebContent/src/accessFile/accessFile.js
View file @
ad245dd3
...
...
@@ -75,7 +75,7 @@ async function accessFile() {
var
ctrlTiff
=
document
.
getElementById
(
"TiffViewer_ButtonContainer"
);
var
ctrlImg
=
document
.
getElementById
(
"controlsContainerImg"
);
if
(
ctrlTiff
)
{
ctrl
Img
.
outerHTML
=
""
;
ctrl
Tiff
.
outerHTML
=
""
;
}
if
(
ctrlImg
)
{
ctrlImg
.
outerHTML
=
""
;
...
...
@@ -267,6 +267,8 @@ async function accessFile() {
count
.
onsuccess
=
async
function
()
{
if
(
count
.
result
==
0
&&
(
localStorage
.
length
)
==
0
)
{
checkSfIndex
(
true
);
store
.
put
({
id
:
count
.
result
+
1
,
address
:
blob
,
...
...
@@ -286,7 +288,7 @@ async function accessFile() {
var
ctrlTiff
=
document
.
getElementById
(
"TiffViewer_ButtonContainer"
);
var
ctrlImg
=
document
.
getElementById
(
"controlsContainerImg"
);
if
(
ctrlTiff
)
{
ctrl
Img
.
outerHTML
=
""
;
ctrl
Tiff
.
outerHTML
=
""
;
}
if
(
ctrlImg
)
{
ctrlImg
.
outerHTML
=
""
;
...
...
@@ -343,6 +345,7 @@ async function accessFile() {
localStorage
.
setItem
(
"submit"
,
"0"
);
localStorage
.
setItem
(
"display_counter"
,
2
);
localStorage
.
setItem
(
"sfIndex"
,
1
);
checkSfIndex
();
size
=
size
+
total
;
}
else
if
(
totalImages
!=
(
parseInt
(
localStorage
.
getItem
(
"sfIndex"
)))
&&
img
==
null
&&
count
.
result
>=
2
&&
(
localStorage
.
length
)
>=
2
&&
localStorage
.
getItem
(
"submit"
)
==
1
)
{
//if only one file left
...
...
@@ -364,6 +367,7 @@ async function accessFile() {
}
else
{
document
.
getElementById
(
'next'
).
setAttribute
(
'disabled'
,
'true'
);
localStorage
.
setItem
(
"sfIndex"
,
parseInt
(
localStorage
.
getItem
(
"sfIndex"
))
+
1
);
checkSfIndex
();
localStorage
.
setItem
(
"display_counter"
,
parseInt
(
localStorage
.
getItem
(
"display_counter"
))
+
1
);
/*var formArray = JSON.parse(sessionStorage.getItem('formArray'));
if (typeof formArray[parseInt(localStorage.getItem("sfIndex")) - 1] !== 'undefined') {
...
...
@@ -377,13 +381,13 @@ async function accessFile() {
}
else
if
(
img
==
null
&&
count
.
result
>=
2
&&
(
localStorage
.
length
)
>=
2
&&
localStorage
.
getItem
(
"submit"
)
==
1
)
{
//no files left
// alert("No Files Left");
if
(
IS_RETRIEVE_FROM_GFS
!=
'Y'
)
{
const
json
=
{
/*
const json = {
"start_time": formatDate(global_start_time),
"end_time": formatDate(global_end_time),
"metrics_dir": METRIC_FILES + "/" + metrics_file_name
}
}
*/
localStorage
.
setItem
(
"complete"
,
"1"
);
saveTime
(
json
);
//
saveTime(json);
store
.
clear
();
// disableForm();
// promptNoFilesLeft();
...
...
@@ -415,6 +419,7 @@ async function accessFile() {
});
localStorage
.
setItem
(
"display_counter"
,
parseInt
(
localStorage
.
getItem
(
"display_counter"
))
+
1
);
//update how many have been fetched
localStorage
.
setItem
(
"sfIndex"
,
parseInt
(
localStorage
.
getItem
(
"sfIndex"
))
+
1
);
checkSfIndex
();
//var file = new File([blob], filename + ".TIFF", {type: "img"}); //uplaod to uploadimgfolder //scanned images
/*var formArray = JSON.parse(sessionStorage.getItem('formArray'));
...
...
@@ -501,6 +506,7 @@ async function accessFile() {
if (localStorage.getItem("
prev
") == 1) {
localStorage.setItem("
display_counter
", parseInt(localStorage.getItem("
display_counter
")) - 2);
localStorage.setItem("
sfIndex
", parseInt(localStorage.getItem("
sfIndex
")) - 1);
checkSfIndex();
count = parseInt(localStorage.getItem("
display_counter
"));
} else {
count = parseInt(localStorage.getItem("
display_counter
"));
...
...
@@ -677,6 +683,7 @@ function postServiceText(url, myObject, funcSuccess, funcFail) {
function refreshImage() {
checkSfIndex();
var size = 0;
const elStatus = document.getElementById('
status
');
...
...
@@ -714,7 +721,7 @@ function refreshImage() {
disableForm();
promptNoFilesLeft();
} else {
const idQuery =
count.result == 2 ? store.get(parseInt(localStorage.getItem("display_counter")) - 1) : store.get(parseInt(localStorage.getItem("display_counter"))
);
const idQuery =
localStorage.getItem("display_counter") == 1 ? store.get(1): store.get(parseInt(localStorage.getItem("display_counter")) - 1
);
idQuery.onsuccess = function() {
url = URL.createObjectURL(idQuery.result.address);
...
...
@@ -852,3 +859,52 @@ function promptNoFilesLeft() {
function getGfsFileName(contentDisposition) {
return contentDisposition.split("filename=")[1].replaceAll('
"', '');
}
function checkSfIndex(first) {
if(first == true) {
localStorage.sfIndex = 1;
}
let ofTotal = JSON.parse(sessionStorage.getItem("
dir_files
")).length;
document.getElementById("
totalPageValue
").innerHTML = localStorage.sfIndex + ' of ' + ofTotal;
if(localStorage.sfIndex == 1) {
document.getElementById("
prevDiv
").style.visibility = "
hidden
";
document.removeEventListener("
keydown
", (e) => {
if (e.ctrlKey && e.keyCode === 122) {
localStorage.setItem("
prev
", "
1
");
const fieldForm = document.getElementById("
fields
");
fieldForm.querySelector('input[type="
submit
"]').click()
}
})
} else {
document.getElementById("
prevDiv
").style.visibility = "
visible
";
document.addEventListener("
keydown
", (e) => {
if (e.ctrlKey && e.keyCode === 122) {
localStorage.setItem("
prev
", "
1
");
const fieldForm = document.getElementById("
fields
");
fieldForm.querySelector('input[type="
submit
"]').click()
}
})
}
if(localStorage.sfIndex == JSON.parse(sessionStorage.dir_files).length) {
document.getElementById("
nextDiv
").style.visibility = "
hidden
";
document.removeEventListener("
keydown
", (e) => {
if (e.ctrlKey && e.keyCode === 123) {
const fieldForm = document.getElementById("
fields
");
fieldForm.querySelector('input[type="
submit
"]').click();
}
})
} else {
document.getElementById("
nextDiv
").style.visibility = "
visible
";
document.addEventListener("
keydown
", (e) => {
if (e.ctrlKey && e.keyCode === 123) {
const fieldForm = document.getElementById("
fields
");
fieldForm.querySelector('input[type="
submit
"]').click();
}
})
}
if(first == true) {
localStorage.removeItem("
sfIndex
");
}
}
\ No newline at end of file
WebGde/WebContent/src/captureMetrics/captureMetrics.js
View file @
ad245dd3
...
...
@@ -281,7 +281,10 @@ function enableForm() {
}
const
formatDate
=
(
date
)
=>
{
if
(
typeof
date
==
"string"
)
{
return
date
.
replace
(
","
,
""
);
}
return
date
;
}
function
saveTime
(
json
)
{
...
...
WebGde/WebContent/src/getFields/getFields.js
View file @
ad245dd3
...
...
@@ -17,6 +17,7 @@
* @returns
*/
let
getDocType
;
let
popUp
=
null
;
const
displayFields
=
async
(
parentID
)
=>
{
try
{
document
.
getElementById
(
"userNameValue"
).
innerHTML
=
`User:
${
sessionStorage
.
getItem
(
"user_id"
)}
`
;
...
...
@@ -354,11 +355,11 @@ const noValidation = (key) => {
* @returns
* created input field element
*/
const
inputString
=
(
key
,
validation
)
=>
{
const
inputString
=
(
key
,
validation
,
source
)
=>
{
try
{
const
{
mandatory
,
fieldLength
fieldLength
,
}
=
validation
let
input
=
document
.
createElement
(
'input'
)
...
...
@@ -366,6 +367,7 @@ const inputString = (key, validation) => {
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'text'
)
input
.
setAttribute
(
'autocomplete'
,
'off'
)
input
.
addEventListener
(
'focusin'
,
()
=>
{
checkSource
(
source
);})
input
.
addEventListener
(
'focusout'
,
handleInput
)
if
(
fieldLength
>=
31
&&
fieldLength
<=
60
)
{
...
...
@@ -374,6 +376,7 @@ const inputString = (key, validation) => {
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'cols'
,
30
)
input
.
addEventListener
(
'focusin'
,
()
=>
{
checkSource
(
source
);})
input
.
addEventListener
(
'focusout'
,
handleInput
)
}
else
if
(
fieldLength
>=
61
&&
fieldLength
<=
90
)
{
input
=
document
.
createElement
(
'TEXTAREA'
)
...
...
@@ -381,6 +384,7 @@ const inputString = (key, validation) => {
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'cols'
,
30
)
input
.
addEventListener
(
'focusin'
,
()
=>
{
checkSource
(
source
);})
input
.
addEventListener
(
'focusout'
,
handleInput
)
}
else
if
(
fieldLength
>=
91
&&
fieldLength
<=
120
)
{
input
=
document
.
createElement
(
'TEXTAREA'
)
...
...
@@ -388,6 +392,7 @@ const inputString = (key, validation) => {
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'cols'
,
30
)
input
.
addEventListener
(
'focusin'
,
()
=>
{
checkSource
(
source
);})
input
.
addEventListener
(
'focusout'
,
handleInput
)
}
else
if
(
fieldLength
>=
120
)
{
input
=
document
.
createElement
(
'TEXTAREA'
)
...
...
@@ -395,6 +400,7 @@ const inputString = (key, validation) => {
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'cols'
,
30
)
input
.
addEventListener
(
'focusin'
,
()
=>
{
checkSource
(
source
);})
input
.
addEventListener
(
'focusout'
,
handleInput
)
}
...
...
@@ -417,7 +423,7 @@ const inputString = (key, validation) => {
* @returns
* created input field element
*/
const
inputNumeric
=
(
key
,
validation
)
=>
{
const
inputNumeric
=
(
key
,
validation
,
source
)
=>
{
try
{
const
{
mandatory
,
...
...
@@ -430,6 +436,7 @@ const inputNumeric = (key, validation) => {
input
.
setAttribute
(
'type'
,
'text'
)
input
.
setAttribute
(
'autocomplete'
,
'off'
)
input
.
setAttribute
(
'pattern'
,
'[0-9/-]+'
)
input
.
addEventListener
(
'focusin'
,
()
=>
{
checkSource
(
source
);})
input
.
addEventListener
(
'focusout'
,
handleInput
)
fieldLength
?
input
.
setAttribute
(
'maxLength'
,
`
${
fieldLength
}
`
)
:
null
...
...
@@ -451,7 +458,7 @@ const inputNumeric = (key, validation) => {
* @returns
* created input field element
*/
const
inputDate
=
(
key
,
validation
)
=>
{
const
inputDate
=
(
key
,
validation
,
source
)
=>
{
try
{
const
{
mandatory
,
...
...
@@ -462,6 +469,7 @@ const inputDate = (key, validation) => {
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'date'
)
input
.
addEventListener
(
'focusin'
,
()
=>
{
checkSource
(
source
);})
input
.
addEventListener
(
'focusout'
,
handleInput
)
mandatory
?
input
.
setAttribute
(
'required'
,
'true'
)
:
null
...
...
@@ -482,7 +490,7 @@ const inputDate = (key, validation) => {
* @returns
* created input field element
*/
const
inputDropdown
=
(
key
,
validation
)
=>
{
const
inputDropdown
=
(
key
,
validation
,
source
)
=>
{
try
{
const
{
mandatory
,
...
...
@@ -492,6 +500,7 @@ const inputDropdown = (key, validation) => {
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
classList
.
add
(
'dropdown-input'
)
input
.
addEventListener
(
'focusin'
,
()
=>
{
checkSource
(
source
);})
input
.
addEventListener
(
'focusout'
,
handleInput
)
input
.
addEventListener
(
'keydown'
,
function
(
event
)
{
...
...
@@ -622,6 +631,7 @@ const deconstruct = (section, div, classAttribute) => {
fieldLabel
}
=
section
[
key
]
const
validation
=
getValidation
(
key
)
const
source
=
getSource
(
key
);
const
newField
=
document
.
createElement
(
'div'
)
// will contain input field and label
newField
.
setAttribute
(
'class'
,
'fieldContainer '
+
classAttribute
)
...
...
@@ -645,18 +655,18 @@ const deconstruct = (section, div, classAttribute) => {
switch
(
fieldLabel
&&
validation
&&
validation
.
collection
)
{
case
'alphanumeric'
:
case
'alphabet'
:
input
=
inputString
(
key
,
validation
)
input
=
inputString
(
key
,
validation
,
source
)
break
case
'specific'
:
case
'dropdown'
:
input
=
inputDropdown
(
key
,
validation
)
input
=
inputDropdown
(
key
,
validation
,
source
)
break
case
'numeric'
:
input
=
inputNumeric
(
key
,
validation
)
input
=
inputNumeric
(
key
,
validation
,
source
)
break
case
'date'
:
case
'datepicker'
:
input
=
inputDate
(
key
,
validation
)
input
=
inputDate
(
key
,
validation
,
source
)
break
default
:
input
=
noValidation
()
...
...
@@ -898,3 +908,21 @@ async function populateFields() {
sessionStorage
.
setItem
(
'fields'
,
JSON
.
stringify
(
fields
));
displayFields
(
"fields"
);
}
function
checkSource
(
source
)
{
if
(
typeof
source
!==
"undefined"
)
{
if
(
source
===
"s"
)
{
if
(
popUp
!==
null
)
{
if
(
popUp
.
closed
)
{
popUp
=
null
;
}
}
if
(
popUp
===
null
)
{
let
params
=
`scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=0,height=0,left=-1000,top=-1000`
;
popUp
=
open
(
'/'
,
'test'
,
params
);
}
}
}
return
null
;
}
\ No newline at end of file
WebGde/WebContent/src/pdfviewer/pdfv.js
View file @
ad245dd3
let
current_pdf
=
0
;
var
displayPdf
=
function
(
doc
)
{
//Create all Elements
const
container
=
document
.
createElement
(
'div'
);
...
...
@@ -337,15 +335,6 @@ var displayPdf = function(doc) {
});
}
let
ofTotal
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"dir_files"
)).
length
;
if
(
localStorage
.
getItem
(
"prev"
)
==
1
)
{
current_pdf
=
current_pdf
-
1
;
}
else
{
current_pdf
=
current_pdf
+
1
;
}
document
.
getElementById
(
"totalPageValue"
).
innerHTML
=
current_pdf
+
' of '
+
ofTotal
;
// Render the first page
renderPage
(
currentPage
);
// Render highlight on the pdf canvas
...
...
WebGde/WebContent/src/sample_schema/HR Speed Test schema.json
View file @
ad245dd3
...
...
@@ -48,9 +48,112 @@
"collection"
:
"datepicker"
,
"mandatory"
:
false
}
},
"Gender"
:
{
"fieldLabel"
:
"Gender"
,
"aka"
:
"field27"
,
"source"
:
"s"
,
"validation"
:
{
"fieldLength"
:
10
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
,
"validvalues"
:
[
"Male"
,
"Female"
]
}
}
},
"SECTION2"
:
{
"Name"
:
{
"fieldLabel"
:
"Name"
,
"aka"
:
"field3"
,
"validation"
:
{
"fieldLength"
:
100
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
}
},
"Account_No"
:
{
"fieldLabel"
:
"Account No"
,
"aka"
:
"field4"
,
"validation"
:
{
"fieldLength"
:
30
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
false
}
},
"Date"
:
{
"fieldLabel"
:
"Date"
,
"aka"
:
"field2"
,
"validation"
:
{
"fieldLength"
:
20
,
"collection"
:
"datepicker"
,
"mandatory"
:
false
}
}
},
"SECTION3"
:
{
"Name"
:
{
"fieldLabel"
:
"Name"
,
"aka"
:
"field10"
,
"validation"
:
{
"fieldLength"
:
100
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
}
},
"Subject"
:
{
"fieldLabel"
:
"Subject"
,
"aka"
:
"field12"
,
"validation"
:
{
"fieldLength"
:
200
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
true
}
},
"Employee_No"
:
{
"fieldLabel"
:
"Employee No"
,
"aka"
:
"field11"
,
"validation"
:
{
"fieldLength"
:
30
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
false
}
},
"Date"
:
{
"fieldLabel"
:
"Date"
,
"aka"
:
"field9"
,
"validation"
:
{
"fieldLength"
:
20
,
"collection"
:
"datepicker"
,
"mandatory"
:
false
}
}
}
},
"BANK APPLICATION FORMS"
:
{
...
...
WebGde/WebContent/src/submit/submit.js
View file @
ad245dd3
...
...
@@ -4,7 +4,8 @@ const submitForm = (e) => {
let
eoe_ts
=
new
Date
().
toLocaleString
();
const
Form
=
Settings
.
SrcElement
(
e
);
const
{
elements
}
=
Form
let
error
=
false
let
error
=
false
;
let
errorMsg
=
null
;
let
doctype
;
let
section
;
...
...
@@ -26,6 +27,12 @@ const submitForm = (e) => {
continue
;
}
var
{
isValidValue
,
errMsg
}
=
checkValidValues
(
id
,
value
);
if
(
typeof
errMsg
!==
"undefined"
)
{
errorMsg
=
errMsg
;
}
// Update display of input field if input is not valid
if
(
!
valid
)
{
error
=
true
...
...
@@ -36,8 +43,19 @@ const submitForm = (e) => {
const
newEvent
=
new
Event
(
'focusout'
)
field
.
dispatchEvent
(
newEvent
)
}
if
(
!
isValidValue
)
{
error
=
true
const
field
=
document
.
getElementById
(
id
);
field
.
classList
.
remove
(
'input-valid'
);
field
.
classList
.
add
(
'input-invalid'
);
field
.
select
();
}
}
// Update display of dropdown field if input is not valid
const
dropdowns
=
$
(
'.dropdown-input'
).
select2
();
for
(
let
dropdown
of
dropdowns
)
{
...
...
@@ -46,7 +64,11 @@ const submitForm = (e) => {
}
if
(
error
)
{
if
(
errorMsg
!==
null
)
{
alert
(
errorMsg
);
}
else
{
alert
(
'Invalid or Missing data on highlighted fields!'
)
}
return
false
}
else
{
...
...
WebGde/WebContent/src/tiffViewer/tiffViewer.js
View file @
ad245dd3
...
...
@@ -51,8 +51,6 @@ var span = document.getElementsByClassName("TiffModalClose")[0];
// }
// });
let
Current_page
=
0
;
//XHR to Load Test TIFF Image
function
loadDoc
(
url
,
cFunction
,
filename
)
{
Tiff
.
initialize
({
...
...
@@ -119,15 +117,6 @@ function TIFFViewer(xhr, TiffViewerImageName) {
let TiffViewer_pages = 0; //page count
let TiffViewer_current = 1; // TiffViewer_current page number
sessionStorage.setItem("TiffViewer_current", filenameWithoutExt + TiffViewer_current);
if (localStorage.getItem("prev") == 1) {
Current_page = Current_page - 1;
} else {
console.log(Current_page + " | " + localStorage.getItem("display_counter"));
if(localStorage.getItem("submit") == 1 || Current_page == 0) {
Current_page = Current_page + 1;
}
}
//declaration of HTML Contents
const TiffViewer_detailcont = document.createElement("div");
...
...
@@ -260,13 +249,6 @@ function TIFFViewer(xhr, TiffViewerImageName) {
const zoom = document.createElement("div");
zoom.classList.add("viewerSizeLabel");
let ofTotal = JSON.parse(sessionStorage.getItem("dir_files")).length;
document.getElementById("totalPageValue").innerHTML = Current_page + '
of
' + ofTotal;
//append all content declarations to modal
let multiTiffDiv = document.createElement("div");
...
...
WebGde/WebContent/src/validateInput/validateInput.js
View file @
ad245dd3
...
...
@@ -221,3 +221,40 @@ const validateSpecific = (validation, value) => {
throw
err
}
}
const
checkValidValues
=
(
fieldID
,
value
)
=>
{
try
{
const
validation
=
getValidation
(
fieldID
);
if
(
!
validation
)
return
{
isValidValue
:
false
,
errMsg
:
[
`FieldName: '
${
fieldID
}
' not in schema`
]
};
if
(
typeof
validation
.
validvalues
!==
"undefined"
)
{
let
validValues
=
validation
.
validvalues
;
const
result
=
validValues
.
findIndex
(
item
=>
value
.
toUpperCase
()
===
item
.
toUpperCase
());
if
(
result
!==
-
1
)
{
return
{
isValidValue
:
true
};
}
else
{
return
{
isValidValue
:
false
,
errMsg
:
[
`'
${
value
}
' is not a valid value. Choose between
${
validValues
}
`
]
};
}
}
return
{
isValidValue
:
true
};
}
catch
(
err
)
{
return
{
isValidValue
:
false
,
errMsg
:
[
err
]}
}
}
const
getSource
=
(
fieldID
)
=>
{
// const { SECTION } = schema
let
section
=
schema
[
sessionStorage
.
getItem
(
"currentDoctype"
).
replaceAll
(
"_"
,
" "
)][
sessionStorage
.
getItem
(
"currentSection"
).
replaceAll
(
"_"
,
" "
)];
try
{
if
(
Object
.
keys
(
section
).
includes
(
fieldID
))
return
section
[
fieldID
].
source
;
return
null
;
}
catch
(
err
)
{
return
null
}
}
\ No newline at end of file
WebGde/WebContent/style.css
View file @
ad245dd3
...
...
@@ -351,6 +351,7 @@ img.tiffViewerIcons {
#counter
{
height
:
11px
;
/* font-size: 22px;
padding: 10px;
position: absolute;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment