forked from Schemetrical/UBCScheduler
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprefix.js
More file actions
31 lines (29 loc) · 728 Bytes
/
prefix.js
File metadata and controls
31 lines (29 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
let LocalTime = JSJoda.LocalTime;
let Weekday = {
None: 0, // 0 *
Monday: 1 << 0, // 1
Tuesday: 1 << 1, // 2
Wednesday: 1 << 2, // 4
Thursday: 1 << 3, // 8
Friday: 1 << 4, // 16
};
const concat = (x, y) =>
x.concat(y)
const flatMap = (f, xs) =>
xs.map(f).reduce(concat, [])
Array.prototype.flatMap = function (f) { // why does this not exist by default idk
return flatMap(f, this)
}
let defaultOptions = {
visiblePages: 1,
first: "⇤",
last: "⇥",
prev: "←",
next: "→",
startPage: 1,
page: '{{page}} of {{total_pages}}',
onPageClick: function (event, page) {
currPage = page
loadTimetable(filteredSchedules[page - 1])
}
}