Age | Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
This might have broken the screenshot uploader on some crappy browsers,
but it's much cleaner than the old iframe hack. The ability to upload
multiple files in one go is also very convenient.
|
|
|
|
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).
|
|
It can be 0 when creating a new alias as primary name.
|
|
|
|
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.
|
|
As requested at https://vndb.org/t6862.28
|
|
This (only very slightly) simplified further processing of the data. It
does add more validation than was present: Previously it was possible to
send invalid roles (would give a 500) or invalid numeric IDs (would
throw some perl warnings). These issues are now handled earlier on. This
change also puts a maximum length on the notes field, but nobody has
passed the 300 characters so far.
|
|
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.
|
|
|
|
And also fix strip_bb_tags() to be case-insensitive and fix a bug in
converting the query into a tsquery.
|
|
It's not verified and only uglifies the URLs.
|
|
Inspired by wakaranai's implementation at
https://github.com/morkt/vndb/commit/b852c87ad145fdaaa09c79b6378dd819b46f7e87
This version is different in a number of aspects:
- Separate search functions for title search and fulltext post search.
Perhaps not the most convenient option, but the downside of a combined
search is that if the query matches the threads' title, then all of
the posts in that thread will show up in the results. This didn't seem
very useful.
- Sorting is based purely on post date. Rank-based sort is slow without
a separate caching column, and in my opinion not all that useful.
Implementation differences:
- Integrated in the existing DB::Discussions functions, so less code to
maintain and more code reuse.
- No separate caching column for the tsvector, a functional index is
used instead. This is a bit slower (index results need to be
re-checked against the actual messages, hence the slowdown), but has
the advantage of smaller database dumps and less complexity in
updating the cache.
Things to fix or look at:
- Highlighting of the search query in message contents.
- Allow or-style query matching
|
|
From 50 to 200. https://vndb.org/t6892
|
|
- Individual blocks don't leak variables into the parent scope anymore.
Previously some blocks would re-use variables from other blocks,
creating (almost invisible) dependencies between te blocks.
- More consistent code for ulist-change-dropdowns, and all of them have
a ref= argument now.
- Use 'hidden' class instead of style.display wherever that makes sense.
- Remove dead 'advselect' code. Hasn't been used since the addition of
search filters.
- lang_select doesn't rely on the position of the language class in
className anymore (seriously that stuff is fragile...)
|
|
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).
|
|
First part of a Javascript cleanup.
|
|
|
|
|
|
It's not a preference yet and the sexual traits are still visible by
default. I'll fix that later.
|
|
- Remove the obsolete 'use's
- Re-add max-width style when requested
- Fix comparison in displaying media
- Fix sorting on animation column
|
|
The previous code was using experimental perl features (switch /
smartmatch) that weren't really needed, and the information about
individual columns was spread around in multiple functions. This rewrite
makes the code consistent with the rest of VNDB, and has *all* of the
column-specific information in one data structure.
I did not replicate the similar-cell-merging feature, partly because the
code for it is definitely not trivial and partly because it doesn't make
the table look any less cluttered. In fact, I feel that it only makes
the table harder to interpret because it looks messy. This is a matter
opinion, of course, so I might reimplement the feature if people who
actually use this comparison page want to.
Overall, I'm still undecided on whether this comparison page should
exist at all in its current form - it's not very user-friendly and often
looks cluttered. I'm keeping it because it does have some use-cases
where it avoids opening every release page to do a manual comparison,
but I'd love a more friendly-looking alternative.
|
|
|
|
This fixes the unexpected behaviour that changing the spoiler setting on
one page will change it for all pages. All manual spoiler changing
options are temporary now.
|
|
|
|
The name of the profile setting isn't very clear. Not sure what to do
with it.
|
|
|
|
Used /v+/chars, other occurrences just use singular.
|
|
|
|
|
|
First step in removing the use of the Referer header for redirects. The
Referer header is ugly and not always reliable, it's better to encode
the required information in the URL.
|
|
Apparently, imagemagick's Flatten() has some odd corner cases where it
seems to do more than just remove the alpha layer. The current approach
is the one recommended by the official docs:
http://www.imagemagick.org/Usage/masking/#remove
|
|
Same as 2f61c4f6772f852f9e0b9ede6228de4e4dbf71a0
|
|
As suggested at https://vndb.org/t6668.18
I also like how the 'amount' option isn't documented for UnsharpMask().
All documentation says 'gain' instead, but that option throws an error.
|
|
Having a proper and up-to-date list of moderators is an often requested
feature.
|
|
Not entirely sure if this is an improvement, but it's slightly more
consistent with other layouts (combination of user page, release page
and character page), and leaves more room for the credit/cast listings.
|
|
|
|
Broken in commit 887607bb3744c727ec617508c17b2b7df46c2287
|
|
|
|
|
|
|
|
(Quoting mail:)
- character list is sorted by name in cast edit form (managing of the
huge lists like v6458 becomes slightly easier);
- display number of characters voiced on seiyuu page;
- display a notice in staff edit form when primary name could be
changed.
|
|
Ugh I hate merge commits, but for some reason 'git rebase' doesn't allow
empty email addreses, and refuses to rebase my commits. :-(
|
|
The new alias editing interface makes it a lot easier to change the
primary name.
|