Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eDisplay
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Green Science
eDisplay
Commits
96c7b7ca
Commit
96c7b7ca
authored
5 years ago
by
Lillian Gray
Browse files
Options
Downloads
Patches
Plain Diff
Replace parseInts() with mapping #9
parent
7370f09a
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/main.js
+1
-9
1 addition, 9 deletions
js/main.js
with
1 addition
and
9 deletions
js/main.js
+
1
−
9
View file @
96c7b7ca
...
...
@@ -269,7 +269,7 @@ function parsePermalink(){
var
argsArray
=
args
.
split
(
"
+
"
)
var
startTemp
=
parseDate
(
argsArray
[
0
])
var
endTemp
=
parseDate
(
argsArray
[
1
])
var
whichArgs
=
parseInts
(
argsArray
[
2
].
split
(
""
))
var
whichArgs
=
argsArray
[
2
].
split
(
""
)
.
map
(
x
=>
parseInt
(
x
)
)
for
(
i
=
0
;
i
<
buildings
.
length
;
i
++
){
if
(
whichArgs
.
includes
(
i
)){
buildings
[
i
].
enabled
=
false
...
...
@@ -292,14 +292,6 @@ function parseDate(urlArg){
return
new
Date
(
parseInt
(
dateArr
[
0
]),
parseInt
(
dateArr
[
1
])
-
1
,
parseInt
(
dateArr
[
2
]))
}
//takes the string of integers from a permalink and returns them as an array of integers
function
parseInts
(
strArray
){
var
a
=
new
Array
()
for
(
i
=
0
;
i
<
strArray
.
length
;
i
++
)
a
.
push
(
parseInt
(
strArray
[
i
]))
return
a
}
//generates a permalink and copies it, called in index.html when the Get Permalink button is clicked
function
genPermalink
(){
//month is zero-indexed
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment