Age | Commit message (Collapse) | Author | Files | Lines |
|
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)
|
|
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.
|
|
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.
|
|
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...
|
|
|
|
|
|
|
|
|
|
...unless I missed something.
|
|
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.
|
|
Adds slightly more strict validation and simplifies further processing.
|
|
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
|
|
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).
|
|
|
|
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...
|
|
|
|
And added new 'page' and 'id' templates for more strict validation.
|
|
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.
|
|
|
|
|
|
Fixes http://vndb.org/t4105
|
|
|
|
Stuff like "168" went through earlier, but couldn't be interpreted by
either perl or postgresql.
|
|
|
|
No more ugly hacks in my code thanks to TUWF!
(a browser check in itself is already ugly enough for my tastes...)
|
|
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.
|
|
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.
|
|
|
|
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)
|
|
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.
|
|
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)
|
|
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.
|
|
And updated skingen.pl and vndb.pl to make use of this abstraction.
|
|
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
|
|
|
|
|
|
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.
|
|
Things are looking good so far.
|
|
|
|
You can ignore the entries in lang.txt, those are simply for testing
purposes.
|
|
Everything has now finally been converted to use the PgSQL LISTEN/NOTIFY
feature. This commit removes the last Tie::ShareLite dependency.
|
|
|
|
|
|
|
|
|
|
boxbg.png are generated
|
|
Less error prone, and only updates the skins that need updating and
are actually writable.
|
|
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)
|
|
|
|
|