summaryrefslogtreecommitdiff
path: root/util/jsgen.pl
AgeCommit message (Collapse)AuthorFilesLines
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.
2011-02-04jsgen.pl: Fixed bug with referencing to the wrong cookie_defaultsYorhel1-2/+2
2011-01-25TUWF: Initial convert from YAWF to TUWFYorhel1-1/+0
There may still be some bugs present and I've only converted the points where TUWF is incompatible with YAWF. The new TUWF features are not in use yet, I'll do that later on. Note that, in order to run the new code, TUWF must be installed on your system. The configuration for the TransAdmin plugin has also changed. Other than that there shouldn't be any issues.
2010-12-19RFC-01: Code/DB cleanup and renamed some stuff for consistencyYorhel1-2/+1
2010-12-18JS: Fixed bug in jsgen.pl with the generation of age_ratingsYorhel1-1/+1
Should've tested an earlier commit. jsgen.pl wouldn't even run. >_>
2010-12-17Don't allow NULL for rr.minage and use -1 for unknownYorhel1-1/+1
This can be seen as a partial revert of 0a4f97f0186d6941a4cab2e3bd05201f1fed1441. I used to think using NULL for special values is more "correct" in database terms. But in the end I guess I should be aiming for whatever solution is easier. Both are "correct" in a sense anyway.
2010-12-14L10N: Extracted screen resolution strings from the codeYorhel1-3/+6
A somewhat ugly approach, but couldn't think of something better.
2010-12-04JS: Display TL lang in its own language in TL selector dropdownYorhel1-4/+3
This is how it used to be before the JS files were split. I simply forgot to update this code to behave the same.
2010-11-27VN Filter Selector: Added length field filterYorhel1-0/+2
Has been requested quite often, now finally implemented.
2010-11-26Added voiced field release filterYorhel1-0/+1
The release filters are now pretty much complete. Save, perhaps, for some improved styling and grouping in the filter selector; but I'm too lazy for that at the moment.
2010-11-26Added animation field release filterYorhel1-1/+2
Surprisingly enough, the SQL queries are still quite fast even when matching on the animation columns. And thanks to the new filter system, adding this filter was incredibly easy.
2010-11-25JS: Split script.js into a separate file for each languageYorhel1-55/+62
This greatly reduces the size of the Javascript file. The compressed size has been reduced with about 9kB, and is now a total of 14kB for en.js. A nice property of this is that more translations can be added without increasing the JS size. While I was at it, I made jsgen.pl also replace mt() function calls in cases where an exact TL string was requested without any additional arguments and/or formatting codes. This helped reduce the compressed size by about 1kB. My aim is to keep *all* the JS code of VNDB smaller than the jQuery core library, as a general "fuck you" towards users of large and bloated JS libraries. We must keep the VNDB page loading times lower than that of other sites, after all!
2010-11-21Implemented the client side of the new release filter systemYorhel1-2/+28
This isn't entirely functional yet, the server side will need to be rewritten as well. And after that new filters should be added and this system should also be used for VN/producer search. script.js is getting quite large with all those new translation strings, it may be an idea to generate a separate .js file for each language and only load the one being used. I won't have a valid reason to feel bored anytime soon, at least...
2010-11-02Automatically read L10N keys from script.jsYorhel1-46/+44
This makes jsgen.pl a bit easier to maintain, as there's not one reliable source to get the keys from (namely, the JS code itself). Also cleaned up the l10n() function in jsgen.pl to be more readable. I had expected the new .js file to be smaller because this trick may remove some keys that were previously present but unused. Unfortunately it seems the file only grew a bit larger and compression seems to be less effective now. No idea why this happened. :-(
2010-11-02Prefix all cookies with a configurable cookie_prefixYorhel1-0/+1
This replaces the "cookie_auth" setting, and applies to all cookies in use by VNDB.
2009-10-21Wrote producer relation editor interfaceYorhel1-1/+2
Again, mostly copied from the VN relation editor...
2009-10-07Changed language selector into a Javascript dropdownYorhel1-1/+3
2009-10-07L10N: Extracted last bits of JavascriptYorhel1-1/+4
2009-10-07L10N: Extracted VN screenshot uploaderYorhel1-1/+2
2009-10-07L10N: Extracted release media and the media selectorYorhel1-1/+2
2009-10-07L10N: Extracted VN relation editorYorhel1-1/+2
2009-10-07L10N: Extracted strings for and improved release list selector on VN pagesYorhel1-3/+8
2009-10-07L10N: Extracted release list statusesYorhel1-1/+2
Should be converted to enums at some point... integers don't do the trick here.
2009-10-07L10N: Extracted some common Javascript stringsYorhel1-2/+6
2009-10-07L10N/JS: Added small framework for translating the strings in JSYorhel1-1/+55
2009-10-07JS: Moved script.js to data/ and added jsgen.pl to process itYorhel1-0/+24
While this 'processing' is currently limited to minifying the file if JavaScript::Minifier::XS is available, this change would make it a lot easier to make the strings in the JS code translatable.