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
55e0429a
Commit
55e0429a
authored
Sep 15, 2023
by
Leonard Ambros II
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-WG-390' into 'development'
pamerge See merge request
!59
parents
4e62f742
23600d0c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
21 deletions
+34
-21
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+24
-13
XML_Saver.js
...e/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
+7
-5
submit.js
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
+3
-3
No files found.
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
55e0429a
...
...
@@ -478,9 +478,13 @@ const inputChecklist = (key, validation) => {
var
checkbox
=
document
.
createElement
(
'input'
);
checkbox
.
type
=
'checkbox'
;
checkbox
.
name
=
'checkboxChoices'
;
checkbox
.
name
=
`checkboxChoices_
${
key
}
`
;
checkbox
.
classList
.
add
(
"checkboxOption"
);
checkbox
.
value
=
item
;
if
(
index
==
0
)
checkbox
.
setAttribute
(
'id'
,
`
${
key
}
`
);
if
(
index
==
0
)
{
checkbox
.
classList
.
add
(
"checkboxFirst"
);
checkbox
.
setAttribute
(
'id'
,
`
${
key
}
`
);
}
div
.
appendChild
(
checkbox
);
var
label
=
document
.
createTextNode
(
item
);
...
...
@@ -495,9 +499,10 @@ const inputChecklist = (key, validation) => {
dependentDiv
.
classList
.
add
(
'checkbox'
);
var
dependentCheckbox
=
document
.
createElement
(
'input'
);
dependentCheckbox
.
type
=
'checkbox'
;
dependentCheckbox
.
name
=
'checkboxChoices'
;
dependentCheckbox
.
name
=
`checkboxChoices_
${
key
}
`
;
dependentCheckbox
.
classList
.
add
(
"checkboxOption"
);
dependentCheckbox
.
id
=
'checkDP'
;
dependentCheckbox
.
value
=
''
;
// Set the value here based on the input text
dependentCheckbox
.
value
=
'
other
'
;
// Set the value here based on the input text
dependentDiv
.
appendChild
(
dependentCheckbox
);
var
dependentLabel
=
document
.
createTextNode
(
'other'
);
...
...
@@ -507,13 +512,14 @@ const inputChecklist = (key, validation) => {
// Initially hide the input text box
var
inputTextBox
=
document
.
createElement
(
'input'
);
inputTextBox
.
type
=
'text'
;
inputTextBox
.
id
=
'dependentTB'
;
inputTextBox
.
id
=
`dependentTB_
${
key
}
`
;
inputTextBox
.
classList
.
add
(
'checkboxOther'
);
inputTextBox
.
style
.
display
=
'none'
;
inputTextBox
.
style
.
padding
=
'0px'
;
dropdownContent
.
appendChild
(
inputTextBox
);
// Add event listener to the "other" checkbox
d
ependentCheckbox
.
addEventListener
(
'change'
,
function
()
{
d
ropdownContent
.
addEventListener
(
'change'
,
function
()
{
if
(
dependentCheckbox
.
checked
)
{
inputTextBox
.
style
.
display
=
'inline-block'
;
}
else
{
...
...
@@ -565,10 +571,13 @@ const inputRadiolist = (key, validation) => {
var
radio
=
document
.
createElement
(
'input'
);
radio
.
type
=
'radio'
;
radio
.
name
=
'radioChoices'
;
radio
.
name
=
`radioChoices_
${
key
}
`
;
radio
.
classList
.
add
(
"radioOption"
);
radio
.
value
=
item
;
if
(
index
==
0
)
radio
.
setAttribute
(
'id'
,
`
${
key
}
`
);
if
(
index
==
0
)
{
radio
.
classList
.
add
(
'radioFirst'
);
radio
.
setAttribute
(
'id'
,
`
${
key
}
`
);
}
var
label
=
document
.
createTextNode
(
item
);
radioDiv
.
appendChild
(
radio
);
radioDiv
.
appendChild
(
label
);
...
...
@@ -581,8 +590,9 @@ const inputRadiolist = (key, validation) => {
dependentDiv
.
classList
.
add
(
'radio-like-checkbox'
);
var
dependentRadio
=
document
.
createElement
(
'input'
);
dependentRadio
.
type
=
'radio'
;
dependentRadio
.
name
=
'radioChoices'
;
dependentRadio
.
value
=
''
;
dependentRadio
.
name
=
`radioChoices_
${
key
}
`
;
dependentRadio
.
classList
.
add
(
"radioOption"
);
dependentRadio
.
value
=
'other'
;
dependentDiv
.
appendChild
(
dependentRadio
);
var
dependentLabel
=
document
.
createTextNode
(
'other'
);
...
...
@@ -591,13 +601,14 @@ const inputRadiolist = (key, validation) => {
var
inputTextBox
=
document
.
createElement
(
'input'
);
inputTextBox
.
type
=
'text'
;
inputTextBox
.
id
=
'dependentTB'
;
inputTextBox
.
id
=
`dependentTB_
${
key
}
`
;
inputTextBox
.
classList
.
add
(
'radioOther'
);
inputTextBox
.
style
.
display
=
'none'
;
inputTextBox
.
style
.
padding
=
'0px'
;
dropdownContent
.
appendChild
(
inputTextBox
);
// Add event listener to the "other" radio button
d
ependentRadio
.
addEventListener
(
'change'
,
function
()
{
d
ropdownContent
.
addEventListener
(
'change'
,
function
()
{
if
(
dependentRadio
.
checked
)
{
inputTextBox
.
style
.
display
=
'inline-block'
;
}
else
{
...
...
WebGde/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
View file @
55e0429a
...
...
@@ -21,7 +21,7 @@ export async function WriteForm(e,metrics,doctype,section) {
let
fid
=
Nodes
[
i
].
id
;
if
(
fid
==
'DocType'
||
fid
==
'Section'
||
fid
==
''
||
fid
==
"submitButton"
)
continue
// Skip the textbox in checklist and radiolist
if
(
fid
==
'dependentTB'
)
continue
;
if
(
Nodes
[
i
].
classList
.
contains
(
'radioOther'
)
||
Nodes
[
i
].
classList
.
contains
(
'checkboxOther'
)
)
continue
;
// Skip elements of type "button", "submit", and files
if
(
Nodes
[
i
].
type
===
'button'
||
Nodes
[
i
].
type
===
'submit'
||
fid
==
''
||
Nodes
[
i
].
name
===
'hidden_file_content'
)
continue
;
...
...
@@ -33,8 +33,9 @@ export async function WriteForm(e,metrics,doctype,section) {
continue
;
}
// If the first radio button was found
if
(
fid
==
'Radio_List'
)
{
const
radioButtons
=
document
.
getElementsByName
(
'radioChoices'
);
if
(
Nodes
[
i
].
classList
.
contains
(
'radioFirst'
))
{
var
key
=
fid
;
const
radioButtons
=
document
.
getElementsByName
(
`radioChoices_
${
key
}
`
);
let
selectedValue
;
//check if the value is checked to find the selected value
radioButtons
.
forEach
(
radio
=>
{
...
...
@@ -50,8 +51,9 @@ export async function WriteForm(e,metrics,doctype,section) {
}
// If the first checkbox was found
if
(
fid
==
'Checkbox_List'
)
{
const
checkboxButtons
=
document
.
getElementsByName
(
'checkboxChoices'
);
if
(
Nodes
[
i
].
classList
.
contains
(
'checkboxFirst'
))
{
var
key
=
fid
;
const
checkboxButtons
=
document
.
getElementsByName
(
`checkboxChoices_
${
key
}
`
);
let
selectedValue
=
''
;
let
isFirstChecked
=
true
;
// Variable to track the first checked checkbox
//check each checkbox if it is checked to find the values.
...
...
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
View file @
55e0429a
...
...
@@ -22,7 +22,7 @@ export const submitForm = async (e) => {
const
{
id
,
value
,
type
,
name
}
=
element
// Skip submit, buttons, and files
if
(
id
===
'dependentTB'
)
continue
;
if
(
element
.
classList
.
contains
(
'radioOther'
)
||
element
.
classList
.
contains
(
'checkboxOther'
)
)
continue
;
if
(
element
.
classList
.
contains
(
'geotag'
)
||
element
.
classList
.
contains
(
'altitude'
)
||
element
.
classList
.
contains
(
'direction'
))
{
continue
;
}
...
...
@@ -30,8 +30,8 @@ export const submitForm = async (e) => {
if
(
type
===
'submit'
)
continue
if
(
type
===
'file'
)
continue
if
(
type
===
'hidden'
)
continue
if
(
id
===
'Radio_List'
||
name
==
'radioChoices'
)
continue
if
(
id
===
'Checkbox_List'
||
name
==
'checkboxChoices'
)
continue
if
(
id
===
'Radio_List'
||
element
.
classList
.
contains
(
'radioOption'
)
)
continue
if
(
id
===
'Checkbox_List'
||
element
.
classList
.
contains
(
"checkboxOption"
)
)
continue
if
(
id
===
'DocType'
)
{
doctype
=
element
.
options
[
element
.
selectedIndex
].
text
;
...
...
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