summaryrefslogtreecommitdiff
path: root/site/index.html (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-04-12site: use errormsg function for general survey errorsstuebinm1-9/+10
the previous commit introduced handling error messages using a "setErrormsg" function. This is now also used for the general error messages which may show up at the bottom of surveys. However, since js and async things are weird, the code there is still a long repetitive mess which can't really be cut down further.
2021-04-12site: show hint for unselected radio buttonsstuebinm1-8/+30
In surveys containing radio buttons, there will now be a nice little hint directly beneath them if none were selected when attempting to submit (in addition to the relatively nondescript "not all required questions were filled in"-hint at the bottom of the form)
2021-04-12site: fix locale detectionstuebinm1-1/+1
(it mistakenly set the locale to undefined before)
2021-04-08site: attempt to guess default languagestuebinm1-2/+4
(from the browser's preferences set via navigator.language and navigator.languages)
2021-04-08add translation logic, locales for en and destuebinm1-14/+17
This adds a basic "replace fixed keys"-approach to translating the UI of surveys. So far this works great, but for complex things it may fail for some languages — for now I'll just try to take care not to add any output that puts things in the middle of sentences, which I think should work for a simple survey thing. The default language is still english, which is important as the language is declared withing a survey config — i.e. if loading it fails, it cannot be applied, and the "enter passphrase" dialog can also not change based on locales. This could possibly be fixed by adding an unencrypted "header" to the encrypted configs, but for now I'm not sure if that makes a lot of sense — it may be easier to just guess based on the browser's settings, and otherwise fall back to some specified default language. The "thanks for your answers"-page also has no translation so far.
2021-04-08site: implement accessibility hints of WAVEstuebinm1-17/+25
This implements some accessibility guidelines, as hinted at by WAVE [1]: - labels for textareas - fieldsets for multiple-choice answers One thing that's still missing is a set language, which I guess will be best implemented together with an actual language switcher. [1] https://wave.webaim.org/
2021-04-08site: better html attributesstuebinm1-1/+1
(i.e. defined charset & a main tag)
2021-04-08site: better error messagesstuebinm1-34/+43
this includes styling error messages red, and displaying error messages in case not all answers were answered as required (for now, this just means that not selecting any option in radio buttons is disallowed in general, as so far there are no corresponding config fields).
2021-04-07site: better error messagesstuebinm1-14/+27
this includes deduplicating some code, and attempts at error messages for files which could not be parsed as json but aren't actually valid age-encrypted files (there doesn't seem to be some easy way to validate that these files are valid age files without knowing the key).
2021-04-07site: add visual feedback on survey submissionstuebinm1-2/+19
After a submission, the survey will now either redirect to a "thanks for your answers!"-site (if the POST request had status 200) or else display some kind of error message.
2021-04-05site: add headers for survey POST requeststuebinm1-2/+8
2021-04-05load survey from (and submit result to) path given as fragmentstuebinm1-18/+30
syntax: http(s)://domain.tld/path/to/file/index.html#[upload url] The upload url may be relative to the site's position, or absolute. Survey results will be POSTed to [upload path]/upload.