path: root/elm/Lib
AgeCommit message (Collapse)AuthorFilesLines
2020-06-17Elm: Recognize Hangul as a non-latin languageYorhel1-1/+1
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-06-09ReleaseEdit: Experiment with a few warnings for title & original fieldsYorhel1-0/+16
To warn against a few more common mistakes.
2020-05-28Drop ReleaseExtLinks.elm in favor of pure CSS solutionYorhel1-1/+1
It's the only Elm module used on VN pages for not-logged-in visitors, so doing this in CSS makes it possible to not load an Elm bundle on those pages (when I get to splitting up the JS files). This solution also simplifies code reuse with the producer pages, but a v2rw migration of that page would have taken care of that as well.
2020-05-14Chars::Edit: Add traits editingYorhel2-8/+29
2020-05-13Chars::Edit: Add image editingYorhel2-1/+32
2020-05-12Chars::Edit: Add instance editingYorhel2-0/+20
2020-05-12Char::Edit: Initial rewrite of the character edit form, general info firstYorhel1-3/+3
2020-04-24Merge branch 'v2rw/vnpage'Yorhel1-4/+13
2020-04-24v2rw/VN::Page: Make the release extlink dropdown open on hoverYorhel1-4/+13
i.e. revert to the old behavior. I do prefer this behavior and it was easier to implement than I had expected.
2020-04-17JS: Obtain urlStatic from the DOM rather than embedding it in the JS fileYorhel2-0/+9
This way I don't have to rebuild the JS file for each deploy - the generated JS is now the same for dev and prod. (uglifyjs & zoplfi aren't fast)
2020-04-06Release::Edit: Consider GTIN code as a string for validation/editingYorhel1-6/+2
Problem is that the 'uint' validation does not allow leading zeros, which are very valid as part of GTIN codes, thus resulting in an error when validating a normalized GTIN code.
2020-03-16Merge branch 'imgflag'Yorhel1-0/+1
While it's a bit early to put this feature online already, it is rather annoying to work on a different branch when if involves a somewhat large change in the database schema. It'll be much easier to continue development and testing on the master branch. Most of the changes that will follow won't affect the DB or the rest of the site much, so if this update succeeds I don't expect any trouble.
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-03-14Lib.Autocomplete: Disable browser-based autocompletionYorhel1-1/+2
2020-03-09Lib.Extlinks: Automatically add URL after pasting it into the formYorhel1-9/+13
2020-03-07Lib.ExtLinks: Ignore whitespace around URLsYorhel1-1/+1
2020-03-03Lib.ExtLinks: Don't hide site list + add expandable list of supported URL ↵Yorhel1-5/+23
2020-03-03Lib.ExtLinks: Fix "edit" button to show "add" when adding a new linkYorhel1-1/+1
2020-02-28Elm/form styling: Use buttons instead of links for "remove" actionYorhel1-1/+1
2020-02-28v2rw/RelEdit: Add producers relation editingYorhel2-0/+16
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 editingYorhel3-1/+17
And a few minor styling fixes.
2020-02-27v2rw/RelEdit: Add external links editorYorhel1-0/+108
Seems to be working pretty well. It's not as discoverable as the old form, but it's much easier to work with (just paste the URL), it provides better feedback and looks a lot less messy. The code is also nicely DRY. It has some complexity, but less than what I had anticipated. Adding new links or allowing multiple links for a single site should be much easier now. This is the edit form I was referring to back in 06bacb61526f3945520dd344821d2aa7b85a5f43
2020-02-23v2rw/RelEdit: Instant autocompletion for the engine fieldYorhel2-32/+27
So much more convenient. \o/
2020-02-23v2rw/RelEdit: Add engine field with autocompletionYorhel2-9/+26
2020-02-23v2rw/RelEdit: Add all the "simple" fields + restructure form a littleYorhel1-0/+25
Hopefully this structure is more logical.
2020-02-21v2rw/WIP: Incremental rewrite of the release edit formYorhel2-2/+24
The new form does change a few things to the UI, so I'll keep the old form around for a while so that people have something to fallback to when it doesn't work (like, right now). I'm also doing this rewrite in multiple commits as it's a pretty large change.
2020-02-13Lib.Autocomplete: Don't try to autocomplete whitespaceYorhel1-1/+1
2020-01-28v2rw: Convert the VN tagmod interfaceYorhel4-0/+38
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 ↵Yorhel3-28/+30
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.
2020-01-03ulist: Display platform icons in releases listingYorhel1-0/+3
2020-01-02ulist: Automatically unset other progress labels when changing progress labelYorhel1-0/+5
2019-12-12v2rw: Discussion board editing & thread creationYorhel3-0/+227
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 - 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-12-06Add link to d9#3 to quick reply box + allow customizing TextPreview headerYorhel2-18/+18
2019-12-05v2rw: Convert thread reply form to ElmYorhel1-1/+1
So we can apply the new preview functionality. I got rid of the "Go advanced" button, because there's really nothing advanced about it.
2019-12-01v2rw: Convert thread display + poll votingYorhel1-4/+4
I did not reimplement the 'poll_recast' and 'poll_preview' settings, these actions are now always permitted. Updated CSS a little bit to highlight the linked post and fix the double border at the bottom. The nice thing about the sql_visible_threads() function I wrote earlier is that is can also be used for access control on a single thread. More code re-use. \o/
2019-11-28Use plain links for JS-ified linkradio inputs + fix focus of non-JS linkradiosYorhel1-0/+6
Kind of backwards to use input elements to display a link when they're backed by Javascript anyway. This also avoids the need to create a unique id for each linkradio element.
2019-11-27Elm: Use fieldset to disable the form while loadingYorhel1-0/+8
I wasn't able to do this while the .maintabs used floats.
2019-11-10ulist: Add feature to add releases to the listYorhel1-0/+1
2019-11-10ulist: Generalize Elm dropdown + add release status change & removalYorhel1-0/+59
Found a cleaner way to recognize outside-of-dropdown clicks, so that gets rid of the weird and unreliable message timing workarounds. TODO: - Dynamically updating that releases summary thing (1/1 blah) - Adding releases - Add "linkradio" styling for plain <a> tags? These hidden checkboxes are silly for stuff that requires JS anyway.
2019-11-10ulist: Proper release date formatting in release listYorhel1-0/+68
2019-11-10ulist: Add (nonfunctional) releases + options UI; More consistent namingYorhel2-0/+15
2019-11-10Reorganize JS and Elm instantiation + more efficient ulist loadingYorhel2-1/+14
The order in which .js files are concatenated is (and always has been) important, so rather than relying on name order I've changed that to an explicit $JS_FILES list in the Makefile. Less convenient, but at least we have more freedom regarding .js file naming and organization now. Rather than encoding the Elm flags as JSON in 'data-' attributes, I've added a system for global page variables (pagevars) where the Elm flags are now stored separately from their HTML tags. This has the advantage of more efficient encoding (no more &quot;s), faster parsing (just a single JSON.parse()), and easier/more efficient modification of the Elm arguments from JS. The pagevars provide a unified way of passing other variables to JS as well, which I've used to deduplicate the list of labels on the new ulist page. That shaves off a good 40 KiB on the page size for a typical listing. Whether all of this actually improves the page loading time, I don't really know. Most of the slowness in Firefox seems to come from simply instantiating many <input time="date"> objects.
2019-11-10ulist: Inline assigning labels to VNsYorhel1-0/+4
I'm really unhappy with the workarounds to deal with the global onClick subscription doing the right thing, but I wasn't able to find a good alternative.
2019-11-10ulist: Inline editable votesYorhel2-4/+17
2019-11-10ulist: Add data model for new lists + Perl/Elm for label managementYorhel1-0/+6
Very much experimental. I'm not sure this is even the right model.
2019-10-21Elm: Add text preview framework + BBCode preview in formsYorhel2-9/+99
2019-10-16Fix editing of staff entries without WikidataYorhel1-3/+5
And I can't say the wikidata field is all that intuitive to edit. Need to look at it later...
2019-10-16v2rw: Convert staff adding/editing formYorhel2-9/+67
This is the first major editing form to be converted, so I'm expecting a little breakage. A good chunk of this code has been copied from v3. In terms of the UI there has been a small change: aliases that are still referenced do not have the 'remove' link and instead have a flag that shows that they are still referenced. This ought to be a bit friendlier than throwing an error message after the user has submitted the form. Some other things I'd like to improve in this form: - BBCode preview - Pasting in external links and letting the form figure out the Pixiv ID, etc. - Or perhaps even: Integrate AniDB/Wikidata search/autocompletion.