summaryrefslogtreecommitdiff
path: root/util/jsgen.pl
AgeCommit message (Collapse)AuthorFilesLines
2023-12-02StaffEdit: Use ExtLinks editing componentYorhel1-9/+15
Abstract it out of the Release edit form (easy, I had written it with re-use in mind) and fix it to support NULLable fields.
2023-11-09VN/Graph: CSS styling + scroll + improved relation filtersYorhel1-0/+1
2023-10-14DRM: Initial implementationYorhel1-0/+1
Unfinished, primarily for testing. https://vndb.org/t20399.36
2023-09-17Producer::Edit: Convert form to JSYorhel1-0/+2
This one got priority because many people appear to be stumbling on the URL validation bug in this form. Staff edit form is still affected by it, but that's less commonly a problem. New form also doesn't pre-fill a language anymore and instead requires the user to input one manually. Fixes a problem with non-JP producer entries having JP selected by default.
2023-07-29JS/forms: Get rid of the HTML5 validity APIYorhel1-2/+2
Main problems I ran into: - Not all browsers (especially true for mobile browsers) support reportValidity(), so we need custom reporting anyway. - Some browsers (or addons, dunno) completely ignore form validation and pretend everything is valid; those users will not have a very good experience. - setCustomValidity() only works on 'willValidate' form elements, which means we need additional custom reporting for errors that do not apply to such elements. - 'minlength' doesn't work at all when the input's value is set by JS. - Getting reportValidity() to work with FormTabs was extremely awkward. Sad, because the idea of offloading form validation and reporting to the browser is actually a pretty useful idea. Anyway, this custom implementation should be more robust. Also provides much better feedback on invalid usernames.
2023-07-26ReleaseEdit: Add database relations + notesYorhel1-0/+1
This completes the form, but I rushed it a bit so there's bound to be some issues left.
2023-07-26ReleaseEdit: Add external linksYorhel1-7/+16
2023-07-24ReleaseEdit: Complete the format section + fix vnode reuse bugYorhel1-0/+1
2023-07-24ReleaseEdit: Platform + Media; JS: bunch of more tooling & infraYorhel1-0/+2
I'm not sold on the validity API at all.
2023-07-24ReleaseEdit: Add release status fieldsYorhel1-0/+1
2023-06-02UserEdit rewrite part 7: All display preferences + multiselection dropdownYorhel1-0/+14
Multiselection thingy was easier than I expected, but the UI doesn't feel quite right somehow. :/
2023-06-01Types/JS: Move language properties into VNDB::Types + improve lang sorting ↵Yorhel1-1/+1
in dropdown selector
2023-06-01UserEdit rewrite part 6: Title preferences + more dropdown select thingy ↵Yorhel1-1/+8
tweaking
2023-05-21JS/CSS: Rewrite login form + experiment with new form code & styleYorhel1-0/+24
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.
2021-01-20v2rw: Rewrite done, time to clean up old v2 codeYorhel1-62/+0
Yay! There are no more request handlers in the VNDB::* namespace and no more Javascript in data/js/. This cleans up a lot of old legacy code that wasn't fun to maintain.
2021-01-17Use SASS for CSS + static asset reoganizationYorhel1-1/+1
Had been planning to use a more powerful preprocessor for CSS for a while, so that I can also reorganize and clean up the CSS a bit. The cleanup will come later, this is the first step to reorganize the build system a bit and remove skingen.pl. I moved all generated static assets to static/g/ (for _g_enerated), including icons.png and js files. This simplifies management of static/f/ and static/s/, which are fully in git. Skins are now defined as sass files in css/skins/ with their images in static/s/ using plain directory structure.
2020-06-15Releases: Allow custom resolutions to be enteredYorhel1-19/+0
The resolution field now works much like the engine field.
2019-11-02Add character cup size field + conversion + filterYorhel1-0/+1
2019-10-13Sort languages by name rather than tagYorhel1-1/+1
https://vndb.org/t950.634
2019-09-12Add VNDB::Config module and unified conf.pl config fileYorhel1-5/+3
This gets rid of global.pl, config.pl and config3.pl and uses the cleaner config3.pl format for the config file. The config is easily accessible from anywhere by importing the new VNDB::Config module; The global $VNDB::S,O,M,ROOT variables have been removed. Sorry for all the churn...
2019-09-12VNDB::Types: Convert medium & resolutionYorhel1-7/+7
2019-09-12VNDB::Types: Convert age_rating and release_typeYorhel1-2/+2
2019-09-12VNDB::Types: Convert animated & voicedYorhel1-2/+2
2019-09-11VNDB::Types: Convert vn_lengths, anime_types and tag_categoriesYorhel1-1/+1
2019-09-11VNDB::Types: Convert char_roles, blood_types and gendersYorhel1-3/+3
2019-09-11VNDB::Types: Convert (wishlist|rlist|vnlist)_statusYorhel1-1/+1
I did create a function to export arrays, but ended up exporting them as hashes. That ought to simplify a conversion to an enum type. Which will likely never happen because I'd rather switch to dynamic user-defined statuses, but that's quite a step further...
2019-09-11VNDB::Types: Convert platforms into %PLATFORMYorhel1-1/+1
2019-09-11VNDB::Types: Convert languages into %LANGUAGEYorhel1-1/+1
2019-09-11VNDB::Types: Convert staff_roles into %CREDIT_TYPEYorhel1-1/+4
Part one in converting data/global.pl lists into a separate VNDB::Types module. This is basically what I had started with VN3::Types, but it looks like a gradual rewrite/cleanup may be more successful. At least it'll be more useful on the short term.
2019-09-09JS/Build: Move minification and compression to "make prod"Yorhel1-29/+3
Similar to previous commit.
2018-10-02DB: Convert resolution into an enumYorhel1-2/+2
Been wanting to do this for a long time - using an integer index into an array that changes once in a while is way too fragile. Doubly so when said indices are also used in filters and URLs that can't be updated every time a new resolution is added.
2016-02-12JS: Fix char_roles bug + CSS: Minor tweaks to main VN info layoutYorhel1-1/+1
2016-01-17L10N: Intern all Javascript strings and rename main JS fileYorhel1-100/+4
This has been mostly automated.
2016-01-17L10N: Intern blood_types/genders/(char|staff)_roles/discussion_boardsYorhel1-4/+4
I definitely needed the Tie::IxHash thing for these.
2016-01-17Use Tie::IxHash for some global.pl listsYorhel1-3/+3
This removes the reliance on sort() to provide meaningful ordering (the keys aren't always good for ordering) and removes the 'order' hack used for (vn|prod)_relations.
2016-01-17L10N: Intern tag_cats/voiced/animated/*_statusYorhel1-3/+3
2016-01-16L10N: Intern languages/platforms/resolutions/media/ptype/rtype/vnlengthYorhel1-11/+8
2016-01-10Use atomic replace when writing .gz assetsYorhel1-1/+4
2016-01-10Support zopfli/zopflipng for all static asset generatorsYorhel1-0/+2
Compresses a little better. I reduced the number of iterations required to find the optimal image size in spritegen.pl, but generating the icons.png is *incredibly slow* when combining zopflipng with the 'slow' option. It's possible to parallelize the calculation and use multiple cores to speed it up, but that seems overkill. Some icons.png compression stats: METHOD SIZE RUNTIME default 18103 <1sec slow 17941 few secs pngcrush 15385 <1sec pngcrush+slow 15148 few mins zopflipng 14986 few secs zopflipng+slow 14898 ~1 hour
2015-08-17jsgen: Support external command for JS compression (like uglifyjs)Yorhel1-7/+30
Tends to compress a bit better than JavaScript::Minifier::JS. But is also a lot slower, so not really useful when devving. Stats for en.js: raw gzip uglifyjs 68199 19446 JS::Minifier::XS 79862 21624 Uncompressed 107662 28663 On an unrelated note, I like how jQuery boasts about being "Only 32kB minified and gzipped.". That's quite a bit more than all of VNDB's Javascript combined. For a damn library.
2015-08-17js: Add L10N strings to all relevant varsYorhel1-8/+8
This simplifies the JS code in some places and removes a whole number of L10N strings from the "l10n_str" var, thus shrinking the JS size a bit (uncompressed about 1500 bytes, in fact. 500 bytes after gzip).
2015-08-15js: Let jsgen.pl preprocess L10N strings + add L10N strings to some varsYorhel1-18/+48
This simplifies the JS version of mt() a bit and makes the whole internationalization framework a bit more robust. I also changed the VARS.{rlist_status,age_ratings,languages,platforms,char_roles} arrays to include the L10N string. This simplifies the JS code and reduces the JS size. There's a few more of such lists that can be transformed in the same way, I'll get to that later.
2015-08-15js: Wrap included files in anonymous functionYorhel1-1/+1
This removes the need to indent all files and add the anonymous function manually, and it also provides clean and consistent semantics. I already rewrote the library-like files earlier on to add their public interfaces to the window object, so everything should keep working after this change. It's still possible that some files use use a function from another non-library file. Those will break, but I'm sure such cases will be found soon enough, if they exist.
2015-08-10js: Move generated variables into global VARS structureYorhel1-46/+44
This removes one source of namespace polution, and makes it more clear which code is using the variables.
2015-08-10Split script.js into multiple smaller filesYorhel1-3/+13
First part of a Javascript cleanup.
2014-12-22Initial implementation of a staff/seiyuu databasemorkt1-0/+1
2011-10-24Added 'role' filter to character browserYorhel1-0/+1
2011-08-30Changed size/weight character filters to javascript slidersQCyph1-5/+0
2011-08-27Added filters to character browse page and trait pageQCyph1-0/+7
2011-03-14chardb: Added Char<->VN linking edit interfaceYorhel1-0/+1
Still somewhat quircky, but it works.