Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
d9246688
Commit
d9246688
authored
May 14, 2018
by
Rob Stupay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quotes and arrays for expand and submit
parent
1db74cb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
multiParamManager.js
src/multiParamManager.js
+4
-10
No files found.
src/multiParamManager.js
View file @
d9246688
...
...
@@ -59,13 +59,10 @@ class MultiParamManager {
makeMultiVal
()
{
var
inputString
=
this
.
basicInputField
.
value
var
inputJSON
=
JSON
.
parse
(
'['
+
inputString
+
']'
)
console
.
log
(
'inputJSON is '
+
inputJSON
)
var
multiInputs
=
this
.
multiFields
.
querySelectorAll
(
'input'
)
console
.
log
(
'ml length '
+
multiInputs
.
length
)
for
(
var
k
=
0
;
k
<
multiInputs
.
length
;
k
++
)
{
if
(
inputJSON
[
k
])
{
multiInputs
[
k
].
value
=
inputJSON
[
k
]
console
.
log
(
'inputJSON number '
+
k
+
' is '
+
inputJSON
[
k
])
multiInputs
[
k
].
value
=
JSON
.
stringify
(
inputJSON
[
k
])
}
}
}
...
...
@@ -108,14 +105,11 @@ class MultiParamManager {
var
valArray
=
this
.
multiFields
.
querySelectorAll
(
'input'
)
var
ret
=
''
for
(
var
k
=
0
;
k
<
valArray
.
length
;
k
++
)
{
var
el
=
valArray
[
k
]
let
el
=
valArray
[
k
].
value
if
(
ret
!==
''
)
ret
+=
','
// start with the beginning of a line or with a comma or with a space and a comma
// then match on a a-zA-Z or a [] or a {} but not a ""
// el.value = el.value.replace(/(^|,\s+|,)(^[a-zA-Z^a-zA-Z]+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted string - that starts with a letter
ret
+=
el
.
value
el
=
el
.
replace
(
/
(
^|,
\s
+|,
)(\w
+|
)(\s
+,|,|$
)
/g
,
'$1"$2"$3'
)
// replace non quoted string or number by quoted string
ret
+=
el
}
console
.
log
(
'ret is '
+
ret
)
this
.
clickCallBack
(
this
.
funABI
.
inputs
,
ret
)
this
.
emptyInputs
()
}
...
...
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