summaryrefslogtreecommitdiff
path: root/util/vndb.pl
AgeCommit message (Collapse)AuthorFilesLines
2019-09-25v2rw: Add Elm & db_edit framework + Convert doc page editingYorhel1-2/+36
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)
2019-09-18v2rw: Convert authentication code to VNWeb::AuthYorhel1-53/+33
More churn! Also converted v3 to use VNWeb::Auth, considering the API is pretty much the same. Converted VNWeb::* to use VNDB::Config directly rather than read from tuwf->{}, converted VNWeb::HTML to use VNWeb::Auth, and updated util/vndb.pl with the new code style. I tested as much as I could, but I'm sure I broke something.
2019-09-17v2rw: Initial start on an incremental rewrite; Layout HTML firstYorhel1-1/+1
I copied and modified VN3::DB to VNWeb::DB, but it isn't used yet. Now that I think about it, that module isn't "web" specific at all and should perhaps be in the VNDB:: namespace. Oh well.
2019-09-12Add VNDB::Config module and unified conf.pl config fileYorhel1-25/+14
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...
2017-12-09Add vndb-dev-server.pl, an autoreloading http serverYorhel1-0/+1
2017-12-06Add instructions for running VNDB as standalone web serverYorhel1-0/+8
2016-07-02Util::ValidateTemplates: Fix forgotten import of kv_validateYorhel1-1/+1
2016-07-02Validate release dates + move validation out of vndb.plYorhel1-75/+0
2016-01-23L10N: Remove all remaining traces of the interface translation featureYorhel1-8/+0
...unless I missed something.
2016-01-16L10N: Remove all translationsYorhel1-30/+2
TODO: Intern strings again to simplify the code. The immediate effect of this commit is that starting the util/vndb.pl script and generating the JS file is much faster now and that vndb.pl uses less memory. Translations have already been disabled on the main VNDB for a week now.
2015-10-03formValidate: Add json_(maxitems|unique|sort) options to json templateYorhel1-2/+46
Adds slightly more strict validation and simplifies further processing.
2015-10-03Handle JSON data natively when processing form dataYorhel1-3/+2
No more need for extra json_encode/json_decode calls, and the form_compare() function is more lenient w.r.t. integer/string comparison. This is the improvement I described in commit ed86cfd12b0bed7352e2be525b8e63cb4d6d5448
2015-09-20formValidate(): Let's just allow a '0' id - fix more errorsYorhel1-1/+1
Looks like 0 is actually used often to indicate some special value. Affects basically all 'check all' boxes (had to modify some of those boxes because some used -1, but that wasn't a problem).
2015-09-20Fix handling of empty seiyuu/credits fieldsYorhel1-1/+1
2015-09-20formValidate: Add json template and remove json_validate() functionYorhel1-1/+24
This is less convenient than I had expected, because all the form handling code is designed to work with plain strings rather than any scalar. This means the json data has to be encoded again to get into $frm (not doing this means that, if the form didn't validate, the field won't be filled out correctly). And then decoded for validation, and then encoded again for comparison. I suspect the better solution is to fix the form handling code to handle arbitrary data structures: comparison can be done by deep comparison rather than a simple string compare, and the form generator can auto-encode-to-json if it sees a complex object. Another advantage of this solution is that the comparison function can be less strict with respect to number formatting. In the current scheme you have to be very careful that numbers are not automatically coerced into string format, otherwise the comparison will fail. Either way, that's an idea for the future...
2015-09-20formValidate: Created templates for gtin and editsum fieldsYorhel1-0/+3
2015-09-20Update usage kv_validate() to upcoming TUWF 1.0Yorhel1-6/+3
And added new 'page' and 'id' templates for more strict validation.
2015-07-19Remove the MSIE browser check & warning pageYorhel1-3/+0
It's a relic of the past. IE 6 & 7 are very rarely used nowadays, and people still using it will quickly realize why things don't quite work - they'll be used to it.
2014-09-01Disallow ( and ) in email regexYorhel1-1/+1
2014-07-09Disallow comma in email pattern matchYorhel1-1/+1
2013-05-19Allow * in URL validatorYorhel1-1/+1
Fixes http://vndb.org/t4105
2013-04-17Fix form validation bug on /u*/posts + disallow space in email fieldYorhel1-1/+1
2011-04-30Bugfix: Don't allow unicode numbers as 'int' in formValidateYorhel1-1/+1
Stuff like "168" went through earlier, but couldn't be interpreted by either perl or postgresql.
2011-02-02Log user ID in the TUWF logYorhel1-0/+10
2011-01-27TUWF: Cleanup IE check code using pre_request_handler return valueYorhel1-7/+1
No more ugly hacks in my code thanks to TUWF! (a browser check in itself is already ugly enough for my tastes...)
2011-01-27TUWF: Replaced resHeader('Set-Cookie', ..) with resCookie()Yorhel1-2/+1
Way more convenient. This also fixes several bugs with the previous commit, since the cookie_prefix wasn't used for *all* cookies. Since it is now, the 'l10n' cookie now also respects the configured prefix, which means some people will have to set their default language again. Configuration changes: 'cookie_domain' option has been removed, the 'cookie_defaults' option of TUWF should now be used.
2011-01-25TUWF: Initial convert from YAWF to TUWFYorhel1-7/+21
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-23Store l10n preference in the database for logged-in usersYorhel1-12/+32
2010-11-27Extended IE6 warning message to show up for IE7 as wellYorhel1-3/+3
Because the site never looked good in IE7, and the new filter system doesn't work *at all*. (Doesn't work correctly on IE8 either, but I'll try to fix that)
2010-11-24vndb.pl: Use the Makefile to auto-update static filesYorhel1-42/+7
Rather than trying to figure out what to update in the Perl code, duplicating the logic that's already present in the Makefile. This is only enabled when 'regen_static' is set to true in data/config.pl.
2010-01-26Removed the ?l10n= parameterYorhel1-8/+4
Setting the l10n cookie is now done from a separate url: /setlang This makes the language determination code less complex, and makes sure nobody links to pages that change the UI language without intending to. (I've seen some links floating around with the l10n parameter included, which is... bad)
2010-01-24Automatically generate the skin credits on d7Yorhel1-2/+2
Added a userid field in the skin config files, from which the credits are loaded. Now I don't have to constantly update d7 for every language when something changes in the skin files.
2010-01-24SkinFile: Abstracted access to the skin configuration filesYorhel1-13/+5
And updated skingen.pl and vndb.pl to make use of this abstraction.
2010-01-10L10N: Determine language from Accept-Language headerYorhel1-4/+16
So that people with correctly configured browsers don't have to manually choose their language of choice with the language switcher, and so that most people will have one cookie less. (The 'l10n' cookie is removed if it matches the Accept-Header language -- or the fallback) More info @ http://www.w3.org/International/questions/qa-lang-priorities
2009-10-21JS: Improved dependency checking when determining whether to run jsgen.plYorhel1-1/+7
2009-10-07L10N: Extracted some common Javascript stringsYorhel1-1/+2
2009-10-07JS: Moved script.js to data/ and added jsgen.pl to process itYorhel1-0/+12
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.
2009-08-17L10N: Russian TL for site title and main menuYorhel1-4/+4
Things are looking good so far.
2009-08-17Added language switcher to the main menuYorhel1-2/+4
2009-08-17Started on a framework for interface I18NYorhel1-0/+9
You can ignore the entries in lang.txt, those are simply for testing purposes.
2009-08-05Removed last traces of the shared memory processing queueYorhel1-8/+0
Everything has now finally been converted to use the PgSQL LISTEN/NOTIFY feature. This commit removes the last Tie::ShareLite dependency.
2009-05-27Fixed typo on 404 pageYorhel1-1/+1
2009-01-15Moving style.css to data/Yorhel1-1/+1
2009-01-10Popularity indicator on VN pagesYorhel1-0/+3
2009-01-02Also remove \r from skin names in vndb.plYorhel1-0/+1
2009-01-02Another bugfix with the skin auto-update, when neither style.css nor ↵Yorhel1-3/+3
boxbg.png are generated
2009-01-02Improved the skin reader and updater in vndb.plYorhel1-6/+9
Less error prone, and only updates the skins that need updating and are actually writable.
2008-12-23Read the available skins in memory at vndb.pl startupYorhel1-0/+30
Skins are automatically regenerated if necessary. This, however, requires the vndb.pl process to have write access to the skins, which is most often not the case. To do this, simply do a: chmod 777 static/s/*; chmod 666 static/s/*/{boxbg.png,style.css} (and make sure to repeat that each time a new skin is added)
2008-12-17Added warning for IE6 usersYorhel1-0/+8
2008-12-04Made sure 404 pages actually return a 404 HTTP statusYorhel1-0/+1