Commit Graph

249 Commits

Author SHA1 Message Date
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
evazion
4d45141c4e js: standardize width of dialog boxes.
Increase width of artist commentary dialog, saved search dialog, and
favgroups dialog to 700px (the width that most other dialog boxes use).
2019-09-30 00:58:34 -05:00
evazion
5b2675b831 css: clean up responsive css.
* Reduce size of buttons, form inputs, site menu items, paginator, and
  sidebar text.
* Remove various dead rules (nonexistent selectors, rules overriden by
  other rules, rules that were otherwise redundant or did nothing).
* Increase page margin size.
* Fix notes being mispositioned (caused by `#image { margin-top: 5px }` rule).
2019-09-30 00:58:34 -05:00
evazion
5818c367fd css: add .mobile-only, .desktop-only classes. 2019-09-30 00:58:34 -05:00
evazion
cf97235aa6 css: reduce spacing between comments on mobile. 2019-09-30 00:58:34 -05:00
evazion
fc3441606e forum posts, comments: make timestamps into permalinks.
Make the timestamp beneath the username on forum posts into a permalink
that links to the post in full context of the thread. For comments, make
the timestamp link to the comment in full context of the post.

* Make the timestamp in forum posts link to /forum_posts/123.
* Make the timestamp in comments link to /posts/456#comment_123.
* Make /forum_posts/123 redirect to /forum_topics/456#forum_post_123.
* Make /comments/123 redirect to /posts/456#comment_123.
* Remove the "ID: ###" and "Permalink" fields from forum posts.
2019-09-29 15:57:15 -05:00
evazion
f34489af02 css: factor out shared forum post / comment css. 2019-09-29 14:09:47 -05:00
evazion
5dfc14ba07 css: switch sidebar layout from float to flexbox. 2019-09-28 23:45:47 -05:00
evazion
f7d7ed4b23 css: generalize anchor :target highlighting.
Generalize :target css so that it works on other things besides forum
posts (e.g. wiki pages, /post_versions#post-version-123).
2019-09-28 17:50:10 -05:00
evazion
6ef1a1c0b8 css: fix dead space around thumbnails in tables. 2019-09-28 17:50:10 -05:00
evazion
d29bbbbd71 Fix #4178: add ability to mass undo tag edits.
Adds checkboxes to the /post_versions index allowing you to select and
undo multiple versions at once.
2019-09-27 21:02:32 -05:00
evazion
97e0c16af6 /tags: add history, related, similar links. 2019-09-26 22:14:29 -05:00
evazion
3341223b40 css: adjust comment / forum post layout on mobile.
* Remove borders around comments.
* Remove background behind commenter name / timestamp.
* Put timestamp on same line as commenter name.
2019-09-26 02:03:13 -05:00
evazion
bca35d93bd css: fix comment layout on mobile.
Display comments and forum posts the same way on mobile.
2019-09-26 01:35:24 -05:00
evazion
cb6f467764 css: unify comment and forum post css.
Unify comments and forum posts to have the same CSS and HTML structure.
Fixes various minor spacing and styling inconsistencies.
2019-09-26 01:35:14 -05:00
evazion
37eb6d0a4d css: switch comments and forum posts to flexbox. 2019-09-26 01:35:14 -05:00
evazion
b8744cd2c4 pool tooltips: don't grey out tooltips until hovered. 2019-09-25 22:18:04 -05:00
evazion
eff6480699 user name changes: require confirmation of new name. 2019-09-25 22:16:06 -05:00
evazion
8d1874d309 css: clean up various unnecessary css. 2019-09-25 18:32:49 -05:00