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
8f42e223
Commit
8f42e223
authored
Feb 06, 2023
by
Jorem Magcawas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save form update on next and previous amd change of schema
parent
049513e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
61 deletions
+30
-61
accessFile.js
WebGde/WebContent/src/accessFile/accessFile.js
+0
-7
getFields.js
WebGde/WebContent/src/getFields/getFields.js
+26
-47
highlight.js
WebGde/WebContent/src/highlight/highlight.js
+0
-2
validateSchema.js
WebGde/WebContent/src/validateSchema/validateSchema.js
+4
-5
No files found.
WebGde/WebContent/src/accessFile/accessFile.js
View file @
8f42e223
...
@@ -3,23 +3,16 @@ var File_Path;
...
@@ -3,23 +3,16 @@ var File_Path;
var
gfsFileName
;
var
gfsFileName
;
async
function
accessFile
()
{
async
function
accessFile
()
{
var
button
=
0
;
var
size
=
0
;
var
size
=
0
;
let
file_url
=
[];
const
elStatus
=
document
.
getElementById
(
'status'
);
const
elStatus
=
document
.
getElementById
(
'status'
);
function
status
(
text
)
{
function
status
(
text
)
{
elStatus
.
innerHTML
=
text
;
elStatus
.
innerHTML
=
text
;
}
}
const
progressBar
=
document
.
getElementById
(
'progressBar'
);
const
progressBar
=
document
.
getElementById
(
'progressBar'
);
const
elProgress
=
document
.
getElementById
(
'progress'
);
function
progress
({
loaded
,
total
})
{
function
progress
({
loaded
,
total
})
{
// elProgress.innerHTML = Math.round(loaded * .000001) + " mb of " + Math.round(total * .000001);
// elProgress.innerHTML = Math.round(loaded * .000001) + " mb of " + Math.round(total * .000001);
progressBar
.
value
=
Math
.
round
(
loaded
/
total
*
100
);
progressBar
.
value
=
Math
.
round
(
loaded
/
total
*
100
);
}
}
const
indexedDB
=
const
indexedDB
=
window
.
indexedDB
||
window
.
indexedDB
||
window
.
mozIndexedDB
||
window
.
mozIndexedDB
||
...
...
WebGde/WebContent/src/getFields/getFields.js
View file @
8f42e223
...
@@ -34,8 +34,7 @@ const displayFields = async (parentID) => {
...
@@ -34,8 +34,7 @@ const displayFields = async (parentID) => {
createSection
(
'Section'
,
div
)
createSection
(
'Section'
,
div
)
Object
.
keys
(
schema
).
forEach
(
function
(
key
)
{
/* Object.keys(schema).forEach(function(key) {
console
.
log
(
key
+
": "
+
schema
[
key
]);
//doctypes in schema
let doctypes = schema[key];
let doctypes = schema[key];
const { valid, error } = validateSchema(key)
const { valid, error } = validateSchema(key)
if(!valid){
if(!valid){
...
@@ -51,11 +50,9 @@ const displayFields = async (parentID) => {
...
@@ -51,11 +50,9 @@ const displayFields = async (parentID) => {
}
}
}
}
});
});*/
/*
const { ACCOUNTING_DOCUMENTS } = schema
const
{
ACCOUNTING_DOCUMENTS
}
=
schema
//getDocType = DOC_TYPE1 ;
//getDocType = DOC_TYPE1 ;
...
@@ -72,9 +69,8 @@ const displayFields = async (parentID) => {
...
@@ -72,9 +69,8 @@ const displayFields = async (parentID) => {
const
{
HR_FILES
}
=
schema
const
{
HR_FILES
}
=
schema
const
{
SECTION3
}
=
HR_FILES
const
{
SECTION3
}
=
HR_FILES
div = deconstruct(SECTION3, div, 'SECTION3')
*/
div
=
deconstruct
(
SECTION3
,
div
,
'SECTION3'
)
const
submit
=
document
.
createElement
(
'input'
)
const
submit
=
document
.
createElement
(
'input'
)
submit
.
type
=
'submit'
submit
.
type
=
'submit'
...
@@ -240,6 +236,7 @@ const inputString = (key, validation) => {
...
@@ -240,6 +236,7 @@ const inputString = (key, validation) => {
let
input
=
document
.
createElement
(
'input'
)
let
input
=
document
.
createElement
(
'input'
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'text'
)
input
.
setAttribute
(
'type'
,
'text'
)
input
.
setAttribute
(
'autocomplete'
,
'off'
)
input
.
setAttribute
(
'autocomplete'
,
'off'
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
...
@@ -302,6 +299,7 @@ const inputNumeric = (key, validation) => {
...
@@ -302,6 +299,7 @@ const inputNumeric = (key, validation) => {
const
input
=
document
.
createElement
(
'input'
)
const
input
=
document
.
createElement
(
'input'
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'text'
)
input
.
setAttribute
(
'type'
,
'text'
)
input
.
setAttribute
(
'autocomplete'
,
'off'
)
input
.
setAttribute
(
'autocomplete'
,
'off'
)
input
.
setAttribute
(
'pattern'
,
'[0-9/-]+'
)
input
.
setAttribute
(
'pattern'
,
'[0-9/-]+'
)
...
@@ -332,6 +330,7 @@ const inputDate = (key, validation) => {
...
@@ -332,6 +330,7 @@ const inputDate = (key, validation) => {
const
input
=
document
.
createElement
(
'input'
)
const
input
=
document
.
createElement
(
'input'
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'date'
)
input
.
setAttribute
(
'type'
,
'date'
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
...
@@ -358,6 +357,7 @@ const inputDropdown = (key, validation) => {
...
@@ -358,6 +357,7 @@ const inputDropdown = (key, validation) => {
const
{
mandatory
,
options
}
=
validation
const
{
mandatory
,
options
}
=
validation
const
input
=
document
.
createElement
(
'select'
)
const
input
=
document
.
createElement
(
'select'
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
classList
.
add
(
'dropdown-input'
)
input
.
classList
.
add
(
'dropdown-input'
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
...
@@ -626,22 +626,23 @@ const createSection = (fieldLabel, div) => {
...
@@ -626,22 +626,23 @@ const createSection = (fieldLabel, div) => {
}
}
function
saveForm
(
index
){
function
saveForm
(
index
){
const
form
=
document
.
querySelector
(
"#fields"
);
const
inputs
=
form
.
querySelectorAll
(
"input,textarea"
);
const
values
=
{};
inputs
.
forEach
(
input
=>
{
if
(
input
.
value
!=
''
){
values
[
input
.
name
]
=
input
.
value
;
}
});
let
formValues
=
{
name
:
document
.
getElementById
(
"Name"
).
value
,
subject
:
document
.
getElementById
(
"Subject"
).
value
,
docNo
:
document
.
getElementById
(
"Document_No"
).
value
,
date
:
document
.
getElementById
(
"Date"
).
value
,
accountNo
:
document
.
getElementById
(
"Account_No"
).
value
,
empNo
:
document
.
getElementById
(
"Employee_No"
).
value
,
}
index
--
;
index
--
;
var
formArray
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'formArray'
));
var
formArray
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'formArray'
));
//formArray.push(formValues);
//formArray.push(formValues);
if
(
typeof
formArray
[
index
]
!==
'undefined'
)
{
if
(
typeof
formArray
[
index
]
!==
'undefined'
)
{
formArray
.
splice
(
index
,
1
,
formV
alues
)
formArray
.
splice
(
index
,
1
,
v
alues
)
}
else
{
}
else
{
formArray
.
splice
(
index
,
0
,
formV
alues
)
formArray
.
splice
(
index
,
0
,
v
alues
)
}
}
sessionStorage
.
setItem
(
'formArray'
,
JSON
.
stringify
(
formArray
));
sessionStorage
.
setItem
(
'formArray'
,
JSON
.
stringify
(
formArray
));
...
@@ -656,36 +657,13 @@ function populateForm(index){
...
@@ -656,36 +657,13 @@ function populateForm(index){
var
formArray
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'formArray'
));
var
formArray
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'formArray'
));
var
name
=
document
.
getElementById
(
"Name"
);
if
(
formArray
[
index
]
!=
null
)
{
var
subject
=
document
.
getElementById
(
"Subject"
);
var
currForm
=
formArray
[
index
];
var
docNo
=
document
.
getElementById
(
"Document_No"
);
for
(
let
field
in
currForm
)
{
var
date
=
document
.
getElementById
(
"Date"
);
document
.
getElementById
(
field
).
value
=
currForm
[
field
];
var
accountNo
=
document
.
getElementById
(
"Account_No"
);
}
var
empNo
=
document
.
getElementById
(
"Employee_No"
);
if
(
formArray
[
index
].
name
!=
null
)
{
name
.
value
=
formArray
[
index
].
name
;
}
if
(
formArray
[
index
].
subject
!=
null
)
{
subject
.
value
=
formArray
[
index
].
subject
;
}
if
(
formArray
[
index
].
docNo
!=
null
)
{
docNo
.
value
=
formArray
[
index
].
docNo
;
}
if
(
formArray
[
index
].
date
!=
null
)
{
date
.
value
=
formArray
[
index
].
date
;
}
if
(
formArray
[
index
].
accountNo
!=
null
)
{
accountNo
.
value
=
formArray
[
index
].
accountNo
;
}
if
(
formArray
[
index
].
empNo
!=
null
)
{
empNo
.
value
=
formArray
[
index
].
empNo
;
}
}
}
}
\ No newline at end of file
WebGde/WebContent/src/highlight/highlight.js
View file @
8f42e223
...
@@ -182,8 +182,6 @@ function initHighlight() {
...
@@ -182,8 +182,6 @@ function initHighlight() {
//waits until TIFF image is loaded, since its size is based on the displayed TIFF image
//waits until TIFF image is loaded, since its size is based on the displayed TIFF image
const
observer
=
new
MutationObserver
(
function
(
mutations
,
mutationInstance
)
{
const
observer
=
new
MutationObserver
(
function
(
mutations
,
mutationInstance
)
{
console
.
log
(
sessionStorage
.
getItem
(
"TiffViewer_current"
));
var
TIFFimg
=
document
.
getElementById
(
sessionStorage
.
getItem
(
"TiffViewer_current"
));
var
TIFFimg
=
document
.
getElementById
(
sessionStorage
.
getItem
(
"TiffViewer_current"
));
if
(
TIFFimg
!=
null
)
{
if
(
TIFFimg
!=
null
)
{
//waits until width and height has been assigned
//waits until width and height has been assigned
...
...
WebGde/WebContent/src/validateSchema/validateSchema.js
View file @
8f42e223
const
validateSchema
=
(
doctype
)
=>
{
const
validateSchema
=
()
=>
{
const
validate
=
schema
[
doctype
]
const
{
ACCOUNTING_DOCUMENTS
}
=
schema
if
(
!
validate
)
return
{
valid
:
false
,
error
:
'SECTION is missing!'
}
if
(
!
ACCOUNTING_DOCUMENTS
)
return
{
valid
:
false
,
error
:
'SECTION is missing!'
}
return
{
valid
:
true
}
return
{
valid
:
true
}
}
}
\ No newline at end of file
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