Commit graph

10 commits

Author SHA1 Message Date
Wolvan
74a0910d11 Fix NaN on result refresh
With 0 total votes, the results page would show NaN after the first
refresh. Don't divide by 0, children.
2022-01-12 21:14:44 +01:00
Wolvan
cfa150cc42 Move API and document it
The API has been moved to a /api path to distinguish it from the form
submission path and make it clear it is a callable API.
The API also has been rudimentarily documented.
2022-01-12 21:11:09 +01:00
Wolvan
cb0ec9dfa1 Add non-JS way of adding options
A new button has been added (which gets automatically removed by JS)
that lets a user add a new option.
Also, an XSS exploit has been fixed.
2022-01-11 21:00:44 +01:00
Wolvan
23445f7509 Fix options not appearing
The options only appeared when at least 2 letters were typed into the
input field as the event triggered before a value was set into the input
field. Using `keyup` instead of `keydown` delays the event after a
letter has been typed into it.
2022-01-10 21:47:35 +01:00
Wolvan
7887fa360b Fix votes from breaking server side rendering 2022-01-08 16:12:51 +01:00
Wolvan
927d2666e9 Satisfy tests to npm i doesn't fail 2022-01-06 21:28:32 +01:00
Wolvan
e9aaedb494 Implement auto update
Every 5 seconds the system attempts to fetch the most recent vote state
of the poll and display it to the user.
2022-01-06 20:44:29 +01:00
Wolvan
dca2cc3eeb Create results page
The page displays the amount of votes, percentage and bars for quick
visual comparison, as well as a pie chart created with google charts.
2022-01-06 19:52:53 +01:00
Wolvan
edff19fb5b Create voting page
This page displays all options that have been set on creation. Thanks to
`textFit` the texts in the title and options automatically get sized
correctly. The create poll button has also been renamed to submit-button
to make it more universal on other pages.
2022-01-04 22:25:05 +01:00
Wolvan
c00ea29b4f Implement Form Expansion
If more than 3 options are written down, additional inputs will load in
to allow more options. The maximum cap of options currently is set to
255 but can be configured in Config.ts.
Likewise, the input length can also be controlled from there.
2022-01-01 14:36:25 +01:00