Development: Frontend: Adapters - zhaw-timetable/zhawo GitHub Wiki
- IdbAdapter
-
ZHAWo Adapeter
- ZhawoAdapter.exports.getMensaResource(facilityId, date)
- ZhawoAdapter.exports.getAllMensas()
- ZhawoAdapter.exports.getScheduleResource(route, name, startDate, rangeAroundDate)
- ZhawoAdapter.exports.convertSchedule(schedule)
- ZhawoAdapter.exports.resolveOverlaps(schedule)
- ZhawoAdapter.exports.getPossibleNames()
- ZhawoAdapter.exports.getFreeRoomsJson()
- ZhawoAdapter.exports.convertFreeRooms(freeRooms)
- ZhawoAdapter.exports.getVszhawEvents()
- ZhawoAdapter.exports.handleError(err, url)
- getVszhawFeed()
Adapter used to interact with idb
Kind: global class
Async function that opens idb on client. If idb instance does not exist it creates one.
resolves promise once done
Kind: instance method of IdbAdapter
Function that return dbInstance used to make transactions
Kind: instance method of IdbAdapter
| Param | Type |
|---|---|
| dbInstance | * |
| accessMode | string |
Async function that return the saved user from idb
Kind: instance method of IdbAdapter
Async function that return saved theme
Kind: instance method of IdbAdapter
Async function that saves theme to idb
Kind: instance method of IdbAdapter
| Param | Type |
|---|---|
| theme | string |
Async function saves user to idb
Kind: instance method of IdbAdapter
| Param | Type |
|---|---|
| name | string |
| type | string |
Async function that removes saved user from db
Kind: instance method of IdbAdapter
Async function that saves current ViewState to idb
Kind: instance method of IdbAdapter
| Param | Type |
|---|---|
| value | number |
Async function that gets saved ViewState from idb
Kind: instance method of IdbAdapter
Async function that removes saved ViewState from idb
Kind: instance method of IdbAdapter
Contains functions that handle everything ZHAW
Function that make Api call to get Mensa Info for specified mensa
Kind: static method of ZhawoAdapter
| Param | Type |
|---|---|
| facilityId | number |
| date | string |
Function that make api call to get all mensa facilities.
Kind: static method of ZhawoAdapter
Function that gets week schedule for specified user to improve loading time it also loads weeks around specified start date
Kind: static method of ZhawoAdapter
| Param | Type |
|---|---|
| route | string |
| name | string |
| startDate | Date |
| rangeAroundDate | number |
Function to make rendering of multiple events in the same slot possible, also helps with coordinating which schedules to fetch from the api and allows for nice event indicators in Week Navigation and Month
Receives schedule for exactly one week
Kind: static method of ZhawoAdapter
| Param | Type |
|---|---|
| schedule | * |
Function that rebuilds schedule to resolve resolveOverlaps returns new schedule
Kind: static method of ZhawoAdapter
| Param | Type |
|---|---|
| schedule | * |
Function makes api call to get all possible user names.
Kind: static method of ZhawoAdapter
Async Function that makes an api call to get all the Free rooms for the current day. returns array containing all the time slots and the free rooms in said time slot.
Kind: static method of ZhawoAdapter
Function that converts freeRooms Object to an array.
Kind: static method of ZhawoAdapter
| Param | Type |
|---|---|
| freeRooms | * |
Function that makes api call to get next vszhaw event.
Kind: static method of ZhawoAdapter
Function used output errors of api calls
Kind: static method of ZhawoAdapter
| Param | Type |
|---|---|
| err | * |
| url | string |
Function that makes api call to get vszhaw feed
Kind: global function