summaryrefslogtreecommitdiff
path: root/elm/Lib/Api.elm
AgeCommit message (Collapse)AuthorFilesLines
2023-10-14DRM: Initial implementationYorhel1-0/+1
Unfinished, primarily for testing. https://vndb.org/t20399.36
2023-09-12User::PassSet: Convert form to JSYorhel1-1/+0
For completeness.
2023-09-12User::PassReset: Convert form to JSYorhel1-1/+0
For some reason people manage to fail the old input validation even on this form.
2023-06-15User::Register: Rewrite form in JS + improve error reportingYorhel1-5/+0
Main reason for this rewrite is that I realized that many mobile browsers don't properly support reportValidity() yet. The new form code still heavily uses the HTML5 validation API, but doesn't rely on reportValidity() as much since it has CSS :invalid fallbacks. And even if that fails, the error messages reported by the server are slightly more useful. Also removed the bot verification question as an experiment, might come back if it turns out to be needed. Also added a silly checkbox to check if people read checkbox labels. Also used <input type="email"> to help mobile browsers select the right keyboard.
2023-06-04UserEdit rewrite part 10: delete the old Elm form \o/Yorhel1-3/+0
elm.min.js.gz shrunk by 9919 bytes. user.min.js.gz is now 9681 bytes. Not a totally fair comparison and those few bytes are completely irrelevant, but it at least shows that I'm not making things more bloated.
2023-05-21JS/CSS: Rewrite login form + experiment with new form code & styleYorhel1-2/+0
Yak shaving at its finest. I was working on an edit form for the new franchises system, but then realized that the form JS and HTML kind of sucked and a completely new form isn't the best way to experiment with a new implementation. I also had some ideas to improve the user edit form, so decided to rewrite that first, but then realized it's better to lay down a smaller foundation before doing the complex stuff. So here we are, a completely useless rewrite of a tiny little login form. But I did improve error messages a bit while I was at it. There's still a bunch of unknowns regarding form implementations: to see if there's a more convenient way to set custom validations; to see if HTML5 validation works well with form tabs; to see if URL fragments can be used to select form tabs; mobile-friendly form layouts (should be easier with this new approach); dropdown search improvements, etc. The user edit form should prove a good testing ground for all of that.
2023-04-09Remove CSRF tokens on elm APIs, rely on CORS insteadYorhel1-1/+0
With a samesite cookie check, to see if that can be relied on.
2023-01-04Elm: Better error messages for some HTTP status codesYorhel1-0/+3
2022-12-03Switch to the HIBP password databaseYorhel1-1/+1
Currently has 851 million password hashes, taking about 8G of space with the current approach. It's simple and fast, so should be worth it. inb4 complains about "why can't I use my password anymore!?"
2022-11-29API2: Implement token-based authentication + GET /authinfoYorhel1-0/+1
+ update filters and APIs to respect the 'listread' permission.
2022-08-21UList: Add text input to create new label in label dropdownYorhel1-0/+1
2021-10-28Allow and log username changesYorhel1-0/+1
2021-07-08Ulist.Widget: Experiment with a VN list management widgetYorhel1-0/+1
Currently only added on VN listings in row view, but the goal is to add this widget to other listings and pages as well. This should make it easy to see whether a VN is on your list and to add/remove/edit your list status. The code is one of the messiest copy-paste jobs I've ever done. I'm totally going to regret having to maintain this crap. But anyway, let's first see how this UI is received.
2021-07-07Image::Upload: Add support for WebP imagesYorhel1-1/+1
Requires imagemagick built with webp support, of course. They're still converted to JPEG, because I don't think the size/compatibility trade-off is worth it.
2021-01-03AdvSearch: Add feature to save/load/delete queriesYorhel1-0/+1
2020-11-28Releases::Edit: Use lazy-loaded autocompletion for resolutions and enginesYorhel1-0/+1
Seems more efficient - no need to fetch and transfer those lists when they won't be needed in the majority of cases.
2020-11-28AdvSearch: Add resolution autocompleteYorhel1-0/+1
Using a lazily loaded static list
2020-09-27v2rw/TagEdit: Rewrite tag edit form to elmYorhel1-0/+1
It's still missing a few mod features, will add those later.
2020-07-07VN::Edit: Add staff editingYorhel1-0/+1
2020-07-01Char::Edit: Abstract & revamp image voting UIYorhel1-1/+0
The image voting is now handled separately from form submission and image IDs are validated when changed. This abstraction is hopefully also usable for the VN form.
2020-06-29VN::Edit: Add length/wikidata/renai/anime fieldsYorhel1-0/+1
Completing the "General info" tab. This makes use of the new anime titles import for validation and autocomplete. It does have a bug, though, as it also autocompletes deleted AniDB entries that happen to have been linked to old VN revisions. Need to find a way to mark those for exclusion.
2020-06-10VNWeb::Elm: Return a special message when the editsum validation failsYorhel1-0/+1
Because, apparently, some browsers ignore the client-side HTML5 validation attributes for textareas and some people will never learn that the edit summary is a required field.
2020-05-14Chars::Edit: Add traits editingYorhel1-0/+1
2020-05-13Chars::Edit: Add image editingYorhel1-1/+24
2020-05-12Chars::Edit: Add instance editingYorhel1-0/+1
2020-03-16imgflag: Initial schema + UI for image flaggingYorhel1-0/+1
Lots of TODO's left to work on, but you have to start somewhere. I've bumped the Docker image version because this change requires TUWF commit 74aad378d49592df4359ea8a9f6f36d4a0013c04 (Elm decoder for structs with more than 8 fields)
2020-02-28v2rw/RelEdit: Add producers relation editingYorhel1-0/+1
Lots of copy-pasting going on here. Meh. Also added a couple of overdue server-side validations.
2020-02-28v2rw/RelEdit: Add visual novel relation editingYorhel1-0/+1
And a few minor styling fixes.
2020-02-23v2rw/RelEdit: Instant autocompletion for the engine fieldYorhel1-1/+0
So much more convenient. \o/
2020-02-23v2rw/RelEdit: Add engine field with autocompletionYorhel1-0/+1
2020-01-28v2rw: Convert the VN tagmod interfaceYorhel1-0/+1
This also changes the voting interface a little bit: - Spoiler options are a bit more concise - Mouse-over a button indicates what it does - The -1 and -2 options are not available anymore - Downvoted tags are hidden by default - Moderators can now vote-and-overrule in a single go
2020-01-05refactor: Combine json_api() & elm_form() + generate Elm function to msg API ↵Yorhel1-3/+4
endpoint The new elm_api() function now creates an API endpoint (like json_api()) and generates a corresponding Elm module to interact with that API (like elm_form()). The API endpoint URL is now derived from the name of the Elm module, so there's no need to think of a separate URL and less prone to making typos when using that URL from Elm. Reduces the boilerplace a bit as well.
2019-12-12v2rw: Discussion board editing & thread creationYorhel1-0/+1
Now with BBCode preview, interactive board search, client-side error reporting and lots of new bugs. This took me far too long, turns out it wasn't such a trivial rewrite.
2019-12-10Elm: Add Redirect response + fix redirect to last post on replyYorhel1-1/+1
Fixes https://vndb.org/t2520/14#334 - I originally had some trouble to do this because `load` doesn't actually reload the page if you're just changing the hash. The `reload` following it handles that now. The Redirect response is just cleanup, there's several places that could benefit form it.
2019-11-10ulist: Add feature to add releases to the listYorhel1-0/+1
2019-10-03Require email confirmation when changing email addressYorhel1-0/+1
This ensures that the email address linked to a user is always valid and actually belong(s|ed) to that user.
2019-10-02v2rw: Convert user preferences formYorhel1-0/+1
And add a small 'formField' function to shrink the Elm form generation code a bit.
2019-10-01v2rw: Convert registration, account activation and password resetYorhel1-0/+5
This is largely copy-paste from v3.
2019-09-30v2rw: Convert login, logout & insecure-password-change formsYorhel1-0/+3
The insecure-password-change flow is now slightly more friendly. The logout functionality has been hardened to use POST and require CSRF.
2019-09-25v2rw: Add Elm & db_edit framework + Convert doc page editingYorhel1-0/+53
Most of this is copied from v3. I did improve on a few aspects: - db_edit() and db_entry() use VNDB::Schema rather than dynamically querying the DB. This has the minor advantage of a faster startup. - The Elm code generator now writes to multiple files, this avoids the namespace pollution seen in v3's Lib.Gen and makes the dependency graph a bit more lean (i.e. faster incremental builds). - The Elm code generator doesn't update the timestamp of files that haven't been modified. This also speeds up incremental builds, the elm compiler can now skip rebuilding unmodified files. - The Elm API response generator code now uses plain functions rather than code references and all possible responses are now defined in Elm.pm. Turns out most API responses were used from more than a single place, so it makes sense to have them centrally defined. The doc page preview function is also much nicer; I'd like to apply this to all BBCode textareas as well. (Elm.pm itself is ugly as hell though. And we will prolly need some HTML form generation functions in Elm to make that part less verbose)