summaryrefslogtreecommitdiff
path: root/elm/Lib
AgeCommit message (Collapse)AuthorFilesLines
2024-03-28!BREAKING! Restructure directory layout for generated & runtime filesYorhel2-7/+7
My testing, deployment and backup scripts were getting more complicated with files from various stages being lumped into a single directory structure, so all generated files (= anything touched by 'make') and runtime files (= anything touched by the web backend or multi) have now been moved into separate directories. These directories are also configurable with $VNDB_GEN and $VNDB_VAR, making it possible to manage multiple instances from a single source checkout. I also got rid of *data/* and *dl/* while I was at it, and moved *static/st/* (that is, the screenshot thumbnails) to */sf.t/*, to be consistent with the newer and more flexible image directory naming scheme. This commit breaks all existing installations and upgrading requires manual action. General upgrade instructions: # BEFORE doing a checkout of this commit make clean # AFTER make mkdir -p var/static var/log mv static/st var/static/sf.t mv static/{sf,ch,cv}{,.orig} var/static/ mv data/conf.pl var/ mv data/log var/ mv data/hibp var/ mv dl var/ util/setup-var.sh Use `git status` find leftover files to clean up or move. Don't forget to update conf.pl and web server configuration to make sure they access the new paths.
2024-01-05Support ISBN codes for releasesYorhel1-17/+0
Fixes https://vndb.org/t950.1680
2023-12-25More CJK blocksYorhel1-1/+1
https://vndb.org/t21372.3
2023-12-24Add extended CJK characters to non-latin script detectionYorhel1-1/+1
Fixes https://vndb.org/t21372.1
2023-12-02DocEdit: Rewrite to JSYorhel1-11/+0
Pointless busywork, because my brain is too mushy to work on useful stuff. :(
2023-10-14DRM: Initial implementationYorhel2-0/+16
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-07-27ReleaseEdit: Delete old Elm implementationYorhel1-130/+0
2023-07-23FixupYorhel1-1/+1
How about I test the code before deploying?
2023-07-23Whitelist Greek and some symbols in non-Latin title checkYorhel1-1/+1
Workaround for https://vndb.org/t8242.1461 - Not anywhere near perfect, but tends to cover most titles. I might adjust the forms later on to turn the romanization requirement into a warning, but for now this'll do.
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/Yorhel2-9/+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-05-11JS: Preparing for writing forms without Elm + minor CSS changesYorhel2-6/+6
2023-04-26SVG: Optimize and merge rss & list iconsYorhel1-3/+1
The idea behind the list icon CSS filters was that they could be adjusted in themes, but (1) that never happened and (2) even with colors embedded in the SVG they can still be adjusted with the same mechanism. In that light, embedding the colors in the SVG is the cleaner solution.
2023-04-25CSS: Unique classes for icons + generated dimensionsYorhel1-3/+3
Unique classes have lower chance of clashing with anything else. Automatically generating the dimensions increases the size of the CSS file a bit, but it simplifies maintenance. The only thing that's still done manually is the selection between the .svg and .png image.
2023-04-25Merge platform icons into an SVG spriteYorhel1-1/+1
Couldn't get fragment identifiers to work satisfyingly, so ended up going back to old-fashioned CSS background-position. Oh well.
2023-04-15CSS: Add font:inherit and color:inherit reset + minor cleanupYorhel1-2/+2
Not that this is any less messy, but hopefully makes it easier to build upon.
2023-04-15CSS: Use <b> as main "standout" elementYorhel5-10/+10
2023-04-15CSS: Stop abusing <b> for grayedout, use <small> insteadYorhel3-20/+20
Which is also kind of an abuse, but at least the semantics are much closer. (Next up: the standout class. Slowly working towards a "font: inherit" and "color: inherit" reset, which'll remove the need for a bunch of ugly workarounds)
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-04-09JS: Minor thingsYorhel1-1/+1
2023-04-08JS: Reorganization to prepare for an Elm->Preact migrationYorhel1-26/+0
This change also increases browser version requirements by quite a bit, though it should still be fair. Pale Moon is an easy "old enough" target to test. This new organization is, in a way, pretty similar to what we had before the switch to Elm, except with more experience I might be able to do this in a more manageable way. I have to admit, I like arrow functions more than I had expected.
2023-03-24Exclude unnecessary hidden DB entries from search cacheYorhel1-1/+1
It was possible to search for deleted producers, but I didn't really see the value in that. Checking for deleted VNs is still important, likewise for tags & traits. This reduces the size of the cache a bit, but more importantly also improves accuracy of the search result counts for other DB entries.
2023-03-09TitlePrefs: Also apply prefs to character namesYorhel1-2/+2
2023-03-09Recognize Greek alphabet as non-LatinYorhel1-1/+1
Might have some false positives as there's prolly a bunch of titles mixing Greek into a Latin alphabet, but that shouldn't be a problem.
2023-02-20Also apply title preferences to staff namesYorhel1-2/+2
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-09-28Order JA and EN first in various language selection dropdownsYorhel1-0/+16
2022-09-27AdvSearch: auto-open field dropdown when adding a new fieldYorhel1-1/+4
I'm pretty sure this was requested by someone, but I can't find the relevant post at the moment.
2022-08-29Elm: Recognize Inuktitut as a non-latin scriptYorhel1-1/+1
Fixes https://vndb.org/t2520.697
2022-08-21UList: Add text input to create new label in label dropdownYorhel1-0/+1
2022-07-30Add duplicate entry check when creating new staff entryYorhel1-1/+1
2022-07-29Display staff original name and primary language flag in autocompleteYorhel1-2/+5
2022-06-19Move & streamline VN release expanding settingsYorhel1-0/+6
Problems with the old implementation were that the setting wasn't an intentional user action, so there were a LOT of preference writes that were reverted a minute or so later. Wasting both server and visitor time. For regular visitors, the localstorage-based approach also caused a reflow if their preferences didn't match the default. Downside of the new implementation is that regular visitors can't change their preference at all anymore, this now requires an account. :/
2022-02-08VN: Add support for multiple titles in different languagesYorhel1-4/+11
This implements the main database model part of custom title languages (https://vndb.org/t12465). Selecting the right title for display is done in SQL through the 'vnt' VIEW, which can be overridden in each session with a TEMPORARY VIEW in order to support user title preferences, but that part has not been implemented yet. I had started out using an sql_vn() function that returned a subquery instead of using a VIEW, but then ran into trouble with the item_info() SQL function. This VIEW approach also happened to simplify much of the code. I did have to get rid of the Discusssions::Lib::sql_boards() function, as Postgres was unable to optimize the subquery inside a UNION inside a subquery for some reason. Haven't run into any other noticeable performance regressions yet. TODO: - Implement actual user title preferences - Add the correct 'lang' HTML attributes everywhere a title is displayed (we do have the information now, though it still isn't trivial) - Add title fetching support to API
2021-10-28Allow and log username changesYorhel1-0/+1
2021-09-26Display icons in ulist label selectorYorhel1-0/+11
But don't display them on the ulist itself yet, since that may be confusing when the widget is added to that listing. Ugh, what a mess.
2021-07-30Add early test implementation of VN length votingYorhel3-1/+10
There's no way to list or aggregate the votes yet, and I'm not fully sure the data model is what it should be. Hence testing.
2021-07-28Elm: Less awkward month displayYorhel1-14/+16
2021-07-28AdvSearch: Add character birthday filterYorhel1-15/+15
Only exact matches for now, and the UI's a bit ugly. w/e it works, ship it.
2021-07-19elm: Recognize Arabic characters as non-latinYorhel1-1/+1
Fixes https://vndb.org/t2520.585
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-06-07A few email delivery related changesYorhel1-10/+0
Make it clear that a valid email is required in order to create an account. The previous wording implied that there was no account activation and people would enter bogus addresses. There (should) not be a need anymore for the "shitty email provider" messages, as I'm routing mails for those destinations through external relays now. I really hate that this is necessary, but such is life. Also fix the wording of the password reset mail - that function hasn't disabled your account for a while now.
2021-04-20Use old-fashioned <img> tags for platform iconsYorhel1-1/+2
I don't like the platforms listing in CSS much, after all, and I've never been a big fan of the <abbr> hacks. Been experimenting with sprite sheets and inline <svg><use..>, but for now I think the simplest solution of just using <img> tags still seems the best. Until I change my mind again and can't resist the allure of throwing all icons in a single nicely compressed file.
2021-04-20Elm: Improve & shorten shittyMailProvider matchingYorhel1-29/+5