Members
payload :Object
Payload for scrapping postani-student.hr
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
Mjesto |
string | |
lista |
Array | |
page |
number | |
podrucje |
string | |
polje |
string | |
posebnaKvota |
string | |
search |
string | |
searchVisokaUcilista |
string | |
usporedba |
Boolean |
Methods
add_default_options(selectUcilista, selectSastavnice)
Add default options to the select elements.
Parameters:
| Name | Type | Description |
|---|---|---|
selectUcilista |
HTMLSelectElement | The select element for ucilista |
selectSastavnice |
HTMLSelectElement | The select element for sastavnice ucilista |
add_options(selectUcilista, selectSastavnice, ucilista, vrsta)
Add options, filter by vrsta (-1 is all), to the Ucilista and Sastavnice select elements.
Parameters:
| Name | Type | Description |
|---|---|---|
selectUcilista |
HTMLSelectElement | The select element for ucilista. |
selectSastavnice |
HTMLSelectElement | The select element for sastavnice. |
ucilista |
object | An json object containing all of the ucilista, their ids, names, and the same info for all of their sastavnice |
vrsta |
number | Vrsta ucilista, -1 is the default (all options), look at the first select element in scrape.html for other options and their values. |
clear_options(selectUcilista, selectSastavnice)
Clears options from select elements for ucilista and sastavnice.
Parameters:
| Name | Type | Description |
|---|---|---|
selectUcilista |
HTMLSelectElement | Select element for ucilista. |
selectSastavnice |
HTMLSelectElement | Select element for sastavnice. |
displayMethod(method, action)
Displays the selected method.
Parameters:
| Name | Type | Description |
|---|---|---|
method |
string | The chosen method |
action |
string | The chosen action |
emailLogin(action)
Handles login with email method.
Parameters:
| Name | Type | Description |
|---|---|---|
action |
string | Chosen email login action. |
filter_by_vrsta(vrsta, ucilista) → {object}
Filters the ucilista object by vrsta ucilista.
Parameters:
| Name | Type | Description |
|---|---|---|
vrsta |
number | vrsta ucilista |
ucilista |
object | An object containing ucilista and their vrsta alongside other info. |
Returns:
- ucilista filtered by vrsta
- Type
- object
googleLogin()
Handle google login with redirect (iOS compatible).
init_buttons()
Initialize all buttons with their event handlers.
init_methods_form()
Attaches an event listener to all buttons in the methods form.
loading_screen()
Starts the loading screen.
(async) main() → {void}
Application Entry Point
This is the main entry function that initializes and runs the entire aplication.
It serves as the starting point for all aplication logic.
Returns:
- Type
- void
make_payload_lista(ucilista) → {Array}
Function that makes the lista of all the sastavnica ids that
should go into the payload.
Parameters:
| Name | Type | Description |
|---|---|---|
ucilista |
* | an object containing all of their ids, vrsta and names, as well as their sastavnica alongside their ids and names |
Returns:
- an array of the (filtered) ids that go into the payloads lista
- Type
- Array
next_page()
Updates the payload to select the next page, that is next batch of programs.
populate_programi(data)
Popuplates the programi table with scraped programi data for a single page.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
* | the (`response.data.d) object from the response to the axios post request. |
prepare_email_signin()
Prepares the email signin form.
prepare_email_signup()
Prepares the email signup form.
(async) scrapePrograms()
Scrape programs data from postani-student.hr using axios.
signIn(email, password)
Sign in user using firebase sdk.
Parameters:
| Name | Type | Description |
|---|---|---|
email |
string | |
password |
string |
signUp(email, password)
create firebase user with firebase sdk
Parameters:
| Name | Type | Description |
|---|---|---|
email |
string | |
password |
string |
signinListener(event)
Read email and password and then sign in user.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
event | yeah idk |
signupListener(event)
Read email and password and then signup user.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
event |
stop_loading_screen()
hides the loading text when everything is loaded and displays the methods container
test_handler(test_index)
Describes the each test with it's own index.
Parameters:
| Name | Type | Description |
|---|---|---|
test_index |
Number | index of a test |
update_firebase_profile(username, photoURL, user, firstName, lastName, email)
Update firebase profile.
Parameters:
| Name | Type | Description |
|---|---|---|
username |
string | User's desired username |
photoURL |
string | User's desired photo URL |
user |
user | firebase user object |
firstName |
string | User's first name |
lastName |
string | User's last name |
email |
string | User's email |
vrstaFilter(ucilista)
Filters options according to vrsta selected.
Parameters:
| Name | Type | Description |
|---|---|---|
ucilista |
object | Ucilista information object. |