Commit Graph

267 Commits

Author SHA1 Message Date
evazion
980a4b82b9 notes: adjust line-height for new fonts.
`line-height: normal;` produces large gaps between lines when using
non-default font families or font sizes. `line-height: 1.25;` reduces
these gaps.
2019-11-26 01:27:41 -06:00
evazion
b43008a506 notes: add multiple new fonts (#4212).
Add the following fonts:

* Comic (Comic Relief)
* Slab Sans (Anton)
* Slab Serif (Rokkitt)
* Formal Serif (Lora)
* Formal Cursive (Petit Formal Script)
* Print (Kalam)
* Hand (Indie Flower)
* Narrow (Archivo Narrow)
* Blackletter (Unifraktur Maguntia)

Add the following font aliases:

* Comic Sans MS is aliased to Comic Relief.
* Arial Narrow is aliased to Archivo Narrow.
* Rockwell is aliased to Rokkitt.
* Impact is aliased to Anton.
2019-11-26 01:27:41 -06:00
evazion
761cbc47c1 notes: fix word breaks inside links.
https://danbooru.donmai.us/forum_topics/9127?page=286#forum_post_161140
2019-11-25 02:52:40 -06:00
evazion
320ff01e07 login: remove 'remember' checkbox; make session cookies permanent.
Remove the "Remember" checkbox from the login page. Make session cookies
permanent instead. Phase out legacy `user_name` and `password_hash` cookies.

Previously a user's session cookies would be cleared whenever they
closed their browser window, which would log them out of the site. To
work around this, when the "Remember" box was checked on the login page
(which it was by default), the user's name and password hash (!) would
be stored in separate permanent cookies, which would be used to
automatically log the user back in when their session cookies were
cleared. We can avoid all of this just by making the session cookies
themselves permanent.
2019-11-17 17:50:23 -06:00
evazion
72f17fd1de Fix #3534: Remove Janitor Trials. 2019-11-17 02:10:24 -06:00
evazion
fedb525305 notes: add fallback font for comic sans (#4212). 2019-11-16 22:43:16 -06:00
evazion
378559ff47 autocomplete: make number of results configurable (partly).
Add `Danbooru.Autocomplete.MAX_RESULTS` param that controls the number
of results returned by autocomplete.

This does not work with tag autocomplete for Builders. Builder
autocomplete still needs to be refactored and unified with Member
autocomplete.

Also fix a bug in the /saved_searches/labels endpoint where the limit
param wasn't respected.
2019-11-13 01:47:41 -06:00
evazion
89c5ac73af autocomplete: switch to async/await. 2019-11-13 01:47:41 -06:00
evazion
2d1eabbe5f autocomplete: factor out clearing of menu bindings. 2019-11-13 01:47:37 -06:00
evazion
f9881e5414 autocomplete: add saved search label autocomplete in more places. 2019-11-12 20:24:24 -06:00
evazion
9cf5b1f01c dtext: add dtext cheatsheet popup. 2019-11-10 14:48:17 -06:00
evazion
19549e2c12 css: fix overlong parent/child preview boxes on post show page.
Bug: if a post had a large number of child posts, the child post preview
box would expand beyond the width of the screen.

Setting `min-width: 0` makes the flexbox column shrink instead of
expand.
2019-11-05 20:58:07 -06:00
evazion
90fef76121 artists: reorganize index page.
* Make other names searchable.
* Add post count and update timestamp.
* Add edit / delete / undelete links.
2019-11-04 16:45:19 -06:00
evazion
75ca53a9a1 autocomplete: fix underscore-to-space conversion in usernames.
Didn't handle names with multiple underscores correctly.
2019-11-04 15:45:07 -06:00
evazion
3a908f84bb wiki pages: use names instead of ids in urls.
Switching to using wiki names in URLs instead of IDs:

* https://danbooru.donami.us/wiki_pages/vocaloid
* https://danbooru.donami.us/wiki_pages/hatsune_miku

ID numbers can still be used, but they redirect to the name instead:

* https://danbooru.donami.us/wiki_pages/11 (redirects to /wiki_pages/touhou).

Numeric tags are prefixed with '~' to distinguish them from IDs:

* https://danbooru.donami.us/wiki_pages/2019 (the wiki with id 2019)
* https://danbooru.donami.us/wiki_pages/~2019 (the wiki for the tag named 2019)

The tag names 'new' and 'search' are disallowed to prevent conflicts
with existing routes:

* https://danbooru.donami.us/wiki_pages/new
* https://danbooru.donami.us/wiki_pages/search
2019-10-31 19:04:18 -05:00
evazion
91fd5e1bff js: add "ctrl+enter to submit form" shortcut.
Press Ctrl+Enter inside any text box to submit the form.
2019-10-31 00:27:43 -05:00
evazion
9cfb753c1b post tooltips: fix null deref when tooltips are disabled.
Fix an exception that is triggered by mousing out of a thumbnail when
tooltips are disabled. Caused by trying to access `qtip.cache` when
`qtip` is null.
2019-10-30 23:43:52 -05:00
evazion
4f858384bb dark mode: make header elements brighter. 2019-10-28 21:57:49 -05:00
evazion
f54885b72e css: update dtext external link icon selector.
DText was changed so that the .dtext-external-link class is now applied to all external links.
Previously it applied only to named links (ex: "google":[http://www.google.com]), not bare
links (ex: http://www.google.com).
2019-10-23 21:33:15 -05:00
evazion
5abbab644d font awesome: switch from svg+js to webfonts.
https://fontawesome.com/how-to-use/on-the-web/other-topics/performance

The default version of Font Awesome uses Javascript to replace <i> tags
with dynamically generated SVG elements. This adds a lot of weight to
the Javascript bundle (at least 1MB+), even when using subsetting to
load only the icons we actually use. The web font version is less
featureful than the JS version, but much lighter weight.
2019-10-22 16:20:53 -05:00
evazion
103742eb6c Fix #4058: FontAwesome CDN is slow/blocking.
Switch to the free self-hosted version of FontAwesome. We're not using
any Pro icons, so the Pro version isn't necessary.
2019-10-22 12:02:26 -05:00
evazion
e9a3ed563c dtext: fix tag colors bleeding through [spoiler] tags.
https://danbooru.donmai.us/forum_topics/9127?page=283#forum_post_160443
2019-10-18 07:56:55 -05:00
evazion
649c10ecf8 Fix #4194: Add CSS IDs to the uploads page. 2019-10-17 01:03:13 -05:00
evazion
d2c6d6d17b iqdb: hide low similarity results behind "show" link. 2019-10-16 23:53:09 -05:00
evazion
57de1d8ef3 /uploads: raise iqdb similarity threshold to 50%. 2019-10-15 01:12:08 -05:00
evazion
0059597f1e /uploads: fix manually clicking 'Similar' button.
Manually clicking Similar called `/iqdb_queries` instead of
`/iqdb_queries.js`, which caused it to update the page incorrectly.
2019-10-15 00:49:31 -05:00
evazion
f7116ad1c4 post previews: fix thumbnail width/height outside post index.
Normally thumbnails have a fixed size of 154x154, but that's not always
desirable outside of the posts index because it creates empty gaps
around thumbnails.
2019-10-14 21:16:04 -05:00
evazion
fa37b1edcd iqdb: lower similarity cutoff, return more results (fix #4190).
* Change cutoffs on upload page to max 5 results, min. 20% similarity.
* Change cutoffs on standalone /iqdb_queries page to max 20 results, min. 0% similarity.
* /iqdb_queries.json: add `limit` and `similarity` params to change default cutoffs.
2019-10-14 21:16:04 -05:00
evazion
ca54e2d67b iqdb: simplify ajax call.
Also add support for .xml responses to /iqdb_queries.
2019-10-14 21:16:04 -05:00
evazion
ccf32aa7a4 posts: remove 'Similar' button from post edit form.
Remove the 'Similar' button next to the source field in the post edit
form. Removed for multiple reasons:

* It doesn't make sense to have to open the edit form to do a reverse
  image search.

* The 'Similar' button tries to redownload the file from the source,
  which has various problems: the source might have been deleted, it
  might have been changed or revised, it might be a format that iqdb
  can't handle (ugoira/webm/mp4), or it might otherwise not match the
  the actual post.

* The 'Find similar' button already exists in the sidebar and it does
  the right thing by using the preview image from Danbooru, which
  avoids all the above issues.
2019-10-14 21:16:04 -05:00
evazion
18e8b13aeb css: fix long usernames in comments not word wrapping.
Ex: https://danbooru.donmai.us/posts/4206#comment_1954688.
2019-10-14 21:16:04 -05:00
evazion
8bffe8dba1 Fix #4189: long source: link not wrapping on tag changes report, and underscores shown as spaces
* Use underscores instead of spaces for tags in inline tag lists (upload
  tags report, tooltips, modqueue, comments page).

* Allow long tags to word wrap. Fixes long sources not wrapping in the
  uploads tag report. Also fixes very long tags that don't have
  underscores not wrapping in the sidebar (ex: kuouzumiaiginsusutakeizumonokamimeichoujin_mika).
2019-10-13 18:53:46 -05:00
evazion
20f28910da /posts: word wrap long sources in sidebar.
* Don't truncate long sources in the sidebar on the post show page. Word
  wrap them instead.
* Word wrap long external links in general (mainly links in dtext).
* Turn sources into links on modqueue page.
2019-10-13 18:53:46 -05:00
evazion
ee6f7a1d7e /posts: increase width of sidebar.
Also fix search box to stretch to full width of sidebar.
2019-10-13 18:53:46 -05:00
evazion
33f2725ae7 Fix #4112: Colorize tags in DText.
DText is processed in three phases: a preprocessing phase, the regular
parsing phases, and a postprocessing phase.

In the preprocessing phase we extract all the wiki links from all the
dtext messages on the page (more precisely, we do this in forum threads
and on comment pages, because these are the main places with lots of
dtext). This is so we can lookup all the tags and wiki pages in one
query, which is necessary because in the worst case (in certain forum
threads and in certain list_of_* wiki pages) there can be hundreds of
tags per page.

In the postprocessing phase we fixup the html generated by the ragel
parser to add CSS classes to wiki links. We do this in a postprocessing
step because it's easier than doing it in the ragel parser itself.
2019-10-11 18:45:55 -05:00
evazion
930e904594 mobile: reduce swipe gesture sensitivity.
Address complaints that gestures are too sensitive and interfere with
scrolling.
2019-10-07 23:20:16 -05:00
evazion
eb80d4f36e mobile: disable "swipe left to go back" gesture on post show page.
The swipe left gesture interfered with scrolling left and right, using
using pinch to zoom, and with copy and pasting text. This gesture wasn't
really necessary anyway, since the back button can always be used to go
back instead.
2019-10-07 23:17:13 -05:00
evazion
e6c53a9e9a Fix #4187: Meh vote color not working. 2019-10-07 12:52:33 -05:00
evazion
c9b2891f80 post tooltips: remove speech bubble tips. 2019-10-06 18:05:13 -05:00
evazion
d723195838 post tooltips: remove gap beneath thumbnail on post #xxx tooltips.
Set the thumbnail height to auto instead of 154px so that there's not a
big empty gap beneath thumbnails that aren't 150px high.

This requires setting dimensions on the <img> tag itself so that the
image height is known before loading, otherwise the tooltip will be
mispositioned after the image loads in.

We set the min-width and min-height instead of the <img> width and
height properties because our calculated dimensions are sometimes
off-by-one compared to the actual dimensions. I'm not sure how libvips
calculates the thumbnail dimensions, but this avoids forcing a slightly
wrong aspect ratio, which produces ugly resizing artifacts.
2019-10-06 18:05:13 -05:00
evazion
8e4e274dae Fix #4186: Add tooltips to post #xxx links. 2019-10-06 18:05:13 -05:00
evazion
d69e95a539 Fix #4180: Tooltip requests can be spammed.
* Cancel pending ajax requests when mousing out of the thumbnail.
  Prevents multiple requests from piling up if the user moves in and out
  of the thumbnail before the first request completes. This normally
  isn't possible except during slowbooru.

* Show an error message if the ajax request fails unexpectedly.
2019-10-06 02:54:27 -05:00
evazion
ce33cd8b02 Fix #4185: Embedded translation notes aren't being styled. 2019-10-06 01:26:08 -05:00
evazion
188602abcc css: fix long blacklists not truncating in sidebar.
* https://danbooru.donmai.us/forum_topics/9127?page=281#forum_post_160147
* https://css-tricks.com/flexbox-truncated-text
2019-10-03 21:51:33 -05:00
evazion
d64236813a js: replace <meta> tags with <body> data attributes.
Refactor things to store information about the current user as data
attributes on the <body> tag rather than as <meta> tags. These <meta>
tags are now deprecated and will be eventually removed.

* Store all of the current user's API attributes as data attributes on
  the <body> tag.

* Add `CurrentUser.data` for getting data from the <body> tag, and
  use it instead of `Utility.meta`.

* Add `CurrentUser.update` for updating the current user's settings.

* Fix a bug with the user named "Anonymous" not being able to edit notes.
2019-10-02 15:59:22 -05:00
evazion
b492b5de9c modqueue: improve layout on mobile.
* Switch layout from float to flexbox.
* Collapse to one column layout on mobile (thumbnails above post info).
* Wordbreak overly long sources.
2019-10-02 01:52:24 -05:00
evazion
d9f154094f css: switch mod dashboard, keyboard shortcuts pages to flexbox.
* Switch /static/keyboard_shortcuts from float-based layout to flexbox.
* Switch /moderator/dashboard from float-based layout to flexbox.
* Remove various .clearfix, `clear: both` rules.
* Remove dead .quick-mod rule.
2019-10-02 01:52:24 -05:00
evazion
b9c869f3e4 css: fix stylelint issues. 2019-10-02 01:52:24 -05:00
evazion
1291505546 Fix blacklists not working on /comments page.
This rule:

    .post-preview.blacklisted-active, #image-container.blacklisted-active, #c-comments .post.blacklisted-active {
      display: none;
    }

was being overridden by this rule:

    div#c-comments div#a-index div.post, div#c-comments div#a-show div.post {
      display: flex;
    }
2019-10-01 00:36:47 -05:00
evazion
dade1e67b0 /post_versions: add search form, tweak layout.
* Add search form above table.
* Move thumbnail to left of table when viewing history of single post.
* Remove unrelated links from subnav menu.
* Fix bugs with changed_tags search.
2019-09-30 02:51:13 -05:00