Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,712
Issues
1,712
List
Boards
Labels
Service Desk
Milestones
Merge Requests
87
Merge Requests
87
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
fbb27e38
Commit
fbb27e38
authored
Oct 09, 2015
by
HERBERT Ryan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing mistakes when refactoring builder.js: build_settings
parent
5f24c044
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
browser/js/builder.js
browser/js/builder.js
+31
-27
No files found.
browser/js/builder.js
View file @
fbb27e38
...
...
@@ -19,8 +19,8 @@ Builder.prototype = {
d3
.
select
(
"
#visu-separator
"
)
.
on
(
"
mousedown
"
,
function
()
{
self
.
dragSeparator
()
})
self
.
dragSeparator
()
;
})
;
d3
.
select
(
"
#visu-container
"
)
.
on
(
"
mouseup
"
,
function
()
{
self
.
dropSeparator
()
...
...
@@ -99,34 +99,34 @@ Builder.prototype = {
build_settings
:
function
()
{
var
self
=
this
;
var
normalize_list
=
document
.
getElementById
(
"
normalize_list
"
)
normalize_list
.
innerHTML
=
""
var
normalize_list
=
document
.
getElementById
(
"
normalize_list
"
)
;
normalize_list
.
innerHTML
=
""
;
var
input
=
document
.
createElement
(
"
input
"
)
input
.
type
=
"
radio
"
var
input
=
document
.
createElement
(
"
input
"
)
;
input
.
type
=
"
radio
"
;
input
.
value
=
-
1
;
input
.
name
=
"
normalize_list
"
input
.
id
=
"
reset_norm
"
input
.
name
=
"
normalize_list
"
;
input
.
id
=
"
reset_norm
"
;
input
.
checked
=
true
;
var
div
=
document
.
createElement
(
"
div
"
)
var
div
=
document
.
createElement
(
"
div
"
)
;
div
.
onclick
=
function
()
{
self
.
m
.
compute_normalization
(
-
1
)
this
.
firstChild
.
checked
=
true
self
.
m
.
update
()
}
div
.
className
=
"
buttonSelector
"
div
.
appendChild
(
input
)
div
.
appendChild
(
document
.
createTextNode
(
"
none
"
))
self
.
m
.
compute_normalization
(
-
1
)
;
this
.
firstChild
.
checked
=
true
;
self
.
m
.
update
()
;
}
;
div
.
className
=
"
buttonSelector
"
;
div
.
appendChild
(
input
)
;
div
.
appendChild
(
document
.
createTextNode
(
"
none
"
))
;
normalize_list
.
appendChild
(
div
)
normalize_list
.
appendChild
(
div
)
;
// Regroup Clones and Data into a single array with only critical data
var
divElements
=
[];
for
(
var
i
=
0
;
i
<
self
.
m
.
clones
.
length
;
++
i
)
{
if
(
typeof
self
.
m
.
clone
(
i
).
expected
!=
"
undefined
"
)
{
divElements
.
push
({
id
:
i
id
:
i
,
name
:
self
.
m
.
clone
(
i
).
getName
(),
expected
:
self
.
m
.
clone
(
i
).
expected
});
...
...
@@ -144,10 +144,11 @@ Builder.prototype = {
}
// Create clickable div for each Clone and Data Entry
for
(
int
i
=
0
;
i
<
divElements
.
length
;
++
i
)
{
var
div
=
setupNormalizeDiv
(
divElements
[
i
],
"
buttonSelector
"
);
normalize_list
.
appendChild
(
div
);
}
for
(
var
j
=
0
;
j
<
divElements
.
length
;
++
j
)
{
var
elem
=
self
.
setupNormalizeDiv
(
divElements
[
i
],
"
buttonSelector
"
);
console
.
log
(
elem
);
normalize_list
.
appendChild
(
elem
);
}
},
...
...
@@ -693,9 +694,11 @@ Builder.prototype = {
},
// Build an html input tag
setupInput
:
function
(
name
,
type
,
value
,
id
=
None
)
{
setupInput
:
function
(
name
,
type
,
value
,
id
)
{
var
input
=
document
.
createElement
(
"
input
"
);
if
(
id
!=
None
)
input
.
id
=
id
;
if
(
id
!=
""
)
{
input
.
id
=
id
;
}
input
.
name
=
name
;
input
.
type
=
type
;
input
.
value
=
value
;
...
...
@@ -704,10 +707,11 @@ Builder.prototype = {
// Build a clickable div element that triggers model update
setupNormalizeDiv
:
function
(
elem
,
className
)
{
var
self
=
this
;
var
div
=
document
.
createElement
(
"
div
"
);
var
input
=
setupInput
(
"
normalize_list
"
,
"
radio
"
,
elem
.
id
);
if
(
self
.
m
.
normalization
.
id
==
elem
.
id
)
input
.
checked
=
true
;
var
text
=
document
.
createTextNode
(
elem
.
name
+
"
→
"
+
elem
.
expected
);
var
input
Node
=
this
.
setupInput
(
"
normalize_list
"
,
"
radio
"
,
elem
.
id
,
""
);
if
(
this
.
m
.
normalization
.
id
==
elem
.
id
)
input
.
checked
=
true
;
var
text
Node
=
document
.
createTextNode
(
elem
.
name
+
"
→
"
+
elem
.
expected
);
div
.
onclick
=
function
()
{
self
.
m
.
compute_data_normalization
(
this
.
firstChild
.
value
);
...
...
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