Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open
Commits
6c2ee6b4
Commit
6c2ee6b4
authored
Mar 16, 2014
by
Renfred Harper
Browse files
Fix front-end to match new API
parent
6564a989
Changes
2
Hide whitespace changes
Inline
Side-by-side
whats-open/static/js/grid.js
View file @
6c2ee6b4
...
...
@@ -70,8 +70,8 @@ function update_grid(facilities) {
// Special schedules take effect after 5am on their start day
// to prevent collisions with the previous night's schedule,
// and they end at 5am the day after their end date.
special_start
=
Date
.
parse
(
special
.
start
+
'
05:00:00
'
);
special_end
=
Date
.
parse
(
special
.
end
+
'
05:00:00
'
);
special_start
=
Date
.
parse
(
special
.
vaild_
start
+
'
05:00:00
'
);
special_end
=
Date
.
parse
(
special
.
valid_
end
+
'
05:00:00
'
);
special_end
.
setDate
(
special_end
.
getDate
()
+
1
);
if
(
now
>=
special_start
&&
now
<=
special_end
)
{
schedule
=
special
;
...
...
@@ -139,9 +139,9 @@ function update_grid(facilities) {
}
$
.
ajax
({
url
:
'
/a
jax/schedule/
'
,
url
:
'
/a
pi/facilities/.json
'
,
}).
done
(
function
(
data
)
{
facilities
=
data
.
data
;
facilities
=
data
;
update_grid
(
facilities
);
construct_grid
(
facilities
);
// Every second, check and see if it is necessary to update the grid.
...
...
whats-open/static/js/typeAhead.js
View file @
6c2ee6b4
$
.
ajax
({
url
:
'
/a
jax/schedule/
'
,
url
:
'
/a
pi/facilities/.json
'
,
}).
done
(
function
(
data
)
{
//collecting list of facility names from server data
var
rest_names
=
[];
for
(
var
i
=
0
;
i
<
data
.
data
.
length
;
i
++
)
{
rest_names
.
push
(
data
.
data
[
i
].
name
);
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
rest_names
.
push
(
data
[
i
].
name
);
};
// For doumentation on jQuery's autocomplete: (api.jqueryui.com/autocomplete)
$
(
"
#searchBar
"
).
autocomplete
({
...
...
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