Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
This is based on the API that I described in https://vndb.org/t5564.12
It's mostly bug-compatible with the old bb2html(), main differences:
- <br /> -> <br> for no reason
- Doesn't sporadically add a wrong </div>
- $rmwhitespace now also after [/code]
Most of the test cases were contributed by flan <flan@flande.re>
|
|
Most of these replacements were automated. This ended up being less
work than I had anticipated.
I also fixed a few minor bugs along the way, but probably introduced
more than I fixed.
|
|
With some related edits in other parts of the code, mostly due to
interface changes to htmlRevision() and htmlFormError().
Trivial replacements were automated by a super awesome script.
|
|
|
|
I definitely needed the Tie::IxHash thing for these.
|
|
|
|
|
|
I'd have preferred to stick with XHTML 1.0, but unfortunately browsers
won't allow you to use modern Javascript APIs with an older doctype.
Note that most pages don't actually validate correctly as HTML5, I'm
relying on browsers to be lenient.
In either case, I'd like VNDB to stay valid XML (XHTML5, then), and
luckily that shouldn't be a problem.
|
|
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
|
|
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...
|
|
CamelCase is used for methods, C-style names for functions. I'm just
nitpicking now.
|
|
The intention is to move more JS editing forms to use JSON, but manually
verifying JSON objects is both painful and likely to introduce errors or
vulnerabilities. json_validate() is a bit of a hack, but has the
advantage that its validation syntax is the same as for normal forms,
and it automatically strips whitespace. I intent to give kv_validate()
an upgrade to be more flexible/modular so it can do more custom
normalization. But that's for later.
I've been meaning to rewrite the JS forms anyway together with the large
JS rewrite, but I'm rather lazy. This is one small step in the right
direction anyway.
Note that json_validate() assumes that the JS code will provide
user-friendly messages on bad input, but the staff alias editor doesn't
quite do this yet.
|
|
|
|
|
|
A generic '_unknown' is more easily usable.
|
|
The interface to set a non-integer vote isn't very nice, but at least it
works. Or so I hope.
|
|
|
|
|
|
|
|
|
|
I'll have to optimize the updating of traits_chars as soon as I have
some data to test with.
Also renamed tags.c_vns to c_items, to have it share the same name as
traits.c_items. This makes it a lot easier to re-use code for both tags
and traits, such as what I did with dbTagTree/dbTraitTree -> dbTTTree
and the childtags() and parenttags() functions.
|
|
|
|
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.
|
|
This will correctly handle fetching stuff from the database when
permanent filters are enabled.
This update also removes compatibility with some old VN browse URLs. The
old 'ti' and 'te' (tag include/exclude) query parameters are now
ignored, and searching for a language in the query string (e.g.
"q=English") won't enable the language filter.
|
|
|
|
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.
|
|
Had to fix some bugs here and there and add some new functionality to
the abstractions at some places, but it appears to be working now. There
are still a few TODOs left, I'll get to those in a bit.
|
|
fil_parse() now checks for proper formatting of the string and ignores
key/value pairs that are not the list of allowed keys. This makes it
impossible to provide extra, unintended, arguments to dbReleaseGet(),
such as 'results'.
|
|
It seems a comma has to be escaped in query string values. A ~ doesn't
and thus makes the URIs significantly shorter.
|
|
There's no validation of the filter string yet, and somehow I don't feel
like adding that; it's a lot of code and there's nothing to protect -
the values are inserted using parameters into a SELECT query, the worst
thing that could happen is the user receiving a 500.
Also, I've started using the perl '//=' operator, which was added in
5.10. This removes support for older perls.
|
|
This adds a new column to the vn table: c_search, which holds the
normalized titles for speedy search results using LIKE.
Also split some functions from VNDB::Func that didn't require YAWF into
a VNDBUtil module, so Multi can also make use of them. The normalization
functions are the same for Multi and VNDB, after all.
The API and Multi::IRC still use the old search, these should be updated
as well.
|
|
|
|
The previous version also had a problem with closing tags when a
$maxlength was defined. With $maxlength, not all tags actually open a
tag in HTML, after all.
|
|
Should be converted to enums at some point... integers don't do the
trick here.
|
|
and age()
|
|
You can ignore the entries in lang.txt, those are simply for testing
purposes.
|
|
|
|
<RT> yorhel, in the browse view, can you put the date in italics when
the first complete release date is not "fully qualified" ? e.g. 2008-08
|
|
Conflicts:
lib/VNDB/DB/Discussions.pm
util/updates/update_2.3.sql
|
|
|
|
...I could've also just used a gradient background image, which is
easier to do and looks better... but I hate solutions that require
external resources. >.>
|
|
VNDB::Func::bb2html()
|
|
|
|
|
|
|
|
|
|
|
|
Three-box-layout didn't work very well together with the screenshots
on the homepage and the CSS icon hack needed a to get rid of
a strange top margin.
With this, the following browsers should render all pages correctly:
FF2, FF3 and the latest Opera, Safari and Chrome
|
|
These changes are all pretty much related, so couldn't really do
that in multiple commits.
|