Commit Graph

54 Commits

Author SHA1 Message Date
evazion
d072ef98ba css: don't use monospace font for textareas.
This changes the font in text input boxes (including the tag edit box)
from monospace to Verdana.
2020-08-16 15:17:40 -05:00
evazion
317cfe19b4 flags: only show current flag on flagged posts.
* Only show the current pending flag on flagged posts. Don't show old flags.

* Don't show both the "This post was flagged for review" and the "This
  post was flagged and is pending" notices.
2020-08-16 14:31:47 -05:00
evazion
7eb9f0b75e appeals: only show current appeal on appealed posts.
* Only show the current pending appeal in the "This post was appealed"
  notice. Don't show old appeals.

* Don't show both the "This post was deleted" and the "This post was
  appealed" notice on appealed posts. Only show the "This post was
  appealed" notice.

* Show "no reason" if no appeal reason was given.
2020-08-16 14:31:47 -05:00
evazion
3d3b5262cc uploads: don't show translated commentary in tag edit dialog. 2020-08-12 11:02:11 -05:00
evazion
3a17b5a13e flags/appeals: replace is_resolved flag with statuses.
Replace references to the `is_resolved` field with the `status` field.
Post flags were marked as resolved when a post was approved (but not
when the post was deleted because it went unapproved). The status field
supercedes the resolved field.
2020-08-07 19:24:57 -05:00
evazion
ef9bc37d9e posts: show ratings in tag edit dialog box.
* Show the rating buttons in the tag edit dialog box.
* Fix the tag counter not showing up in the tag edit dialog box on the
  uploads page.
2020-08-05 12:28:24 -05:00
evazion
6b7cd7b972 posts: update tag counter icons. 2020-08-02 18:33:47 -05:00
evazion
3fe18c57d0 posts: always show "resized to X%" notice on mobile.
Always show the "Resized to X% of original" notice when viewing a sample
image on mobile.
2020-07-31 15:09:56 -05:00
evazion
2cbce9a525 notes: rewrite notes Javascript to object-oriented style.
Rewrite the notes Javascript from a procedural style to an
object-oriented style.

Before the notes Javascript had a lot of problems:

* There was hidden state everywhere, both locally and globally. We had
  state in global variables, in <meta> tags, in DOM data-* attributes
  (on multiple elements), and in jQuery .data() properties (which are
  different from data-* attributes, because they aren't visible in the
  DOM).

* Local state was hard to reason about. There was lots of direct DOM
  manipulation in random places. Functions had to constantly pass around
  note ids and look up elements in the DOM to get the state. State was
  invisible because it was stored as jQuery .data() properties. It was
  hard to follow where state was stored, how it was initialized, and how
  it changed.

* Global state was also a mess. There were a lot of global flags and
  variables only used in specific situations. Almost all of this state was
  unnecessary. Global state also prevented us from doing things like
  loading or unloading posts dynamically, or showing multiple posts with
  notes on the same page.

* There was a lot of duplication of code, especially for placing notes,
  and for loading or saving new notes versus saved notes.

Now the code is organized in an object-oriented fashion:

* The Note class represents a single note. A post has a list of notes,
  and each note object has a Note.Box and a Note.Body. Together these
  objects encapsulate the note's state.

* Notes have methods for doing things like placing note boxes, or showing
  and hiding note bodies, or creating, saving, or deleting notes. This
  makes the JS API cleaner.

* Global state is kept to a minimum.

This is one big patch because it was too hard to make these changes
incrementally. There are a couple minor bugfixes, but the actual
behavior of notes should remain unchanged.

Bugfixes:

* It was possible to enter translation mode, start dragging a new note,
  then press N to leave translation mode while still dragging the note.
  If you did this, then you would be stuck in translation mode and you
  couldn't stop dragging the note.

* Placement of new notes is now pixel-perfect. Before when placing a
  note, the note would shift by 1-2 pixels.

* Previewing an empty note didn't show the "Click to edit" message.

Other noteworthy changes:

* Most global state has been eliminated. There were a lot of flags and
  variables stored as global variables on `Danbooru.Note`. Most of these
  turned out to be either unnecessary or even unused.

* Notes now have an explicit minimum size of 10x10 pixels. Before this
  limit was hardcoded and undocumented.

* A lot of the note placement and note creation code has been simplified.

* `Note.add()` and `Note.create()` have been refactored into `new Note()`.
  Before `Note.add` was used to load an existing note, while `Note.create`
  was used to create a new note. These did the same thing, but had
  slightly different behavior.

* `Note.Box.scale()` and `Note.box.update_data_attributes` have been
  refactored into `Note.Box.place_note()`. Contrary to their names,
  these functions were actually both used to place notes.
2020-07-28 22:06:35 -05:00
evazion
3a3d456bd2 html: standardize font sizes and heading tags.
Standardize font sizes and heading tags (<h1>-<h6>) to be more
consistent across the site.

Changes:

* Introduce font size CSS variables and start replacing hardcoded font
  sizes with standard sizes.
* Change header tags to use only one <h1> per page. One <h1> per page is
  recommended for SEO purposes. Usually this is for the page title, like
  in forum threads or wiki pages.
* Standardize on <h2> for section headers in sidebars and <h3> for
  smaller subsection headers. Don't use <h4>-<h6>.
* In DText, make h1-h4 headers all the same size. Standard wiki style is
  to ignore h1-h3 and start at h4.
* In DText, make h4-h6 the same size as the h1-h3 tags outside of DText.
* In the tag list, change the <h1> and <h2> tag category headers to <h3>.
* Make usernames in comments and forum posts smaller. Also change the
  <h4> tag for the commenter name to <div class="author-name">.
* Make the tag list, paginator, and nav menu smaller on mobile.
* Change h1#app-name-header to a#app-name-header.
2020-07-23 17:34:17 -05:00
evazion
35824c9e45 posts: remove AddThis widget.
AddThis apparently pulls in a script from z.moatads.com now. Fuck that.
2020-04-23 13:38:24 -05:00
evazion
dda47f15b0 Merge pull request #4350 from BrokenEagle/fix-relationship-previews
Fix relationship preview alt text overflowing
2020-04-04 02:34:03 -05:00
evazion
1af6850c7c posts: add "view original" sidebar option.
* Add a "View original" sidebar option.
* Rename the "View large" sidebar option to "View smaller".
* Remove the "Loading..." message when switching image sizes.
* Fix the V hotkey not working after using it once.
* Change #image-resize-link to .image-view-original link (note that
  there are two of these links now, one in the notice bar and one in the
  sidebar).
* Add a `data-post-current-image-size` attribute on the <body> element
  and use it to control visibility of links and notices.
2020-03-26 22:03:47 -05:00
evazion
87a51129b8 posts: add back "resize to window" link.
* Add back "Resize to window" link.
* Add Z shortcut for resize to window link (mnemonic: Z for zoom image).
* Resize images to screen width by default on both desktop and mobile.
* Make it so that notes are nested directly inside the .image-container
  element with the image, instead of inside a separate .note-container
  element. This means .image-container and .note-container are now the
  same element. This is so that the size of the .note-container is
  driven by the size of the image, which ensures that notes are
  automatically resized as the image is resized.
2020-03-26 21:55:59 -05:00
evazion
1126147dee posts: change #image-container, #note-container to classes.
Change #image-container and #note-container from IDs to classes. This is
necessary so that we can use one container element for both the image
container and the note container. This may break custom CSS and
userscripts.
2020-03-26 18:17:13 -05:00
BrokenEagle
85611ec379 Fix relationship preview alt text overflowing 2020-03-21 06:40:21 +00:00
BrokenEagle
e844a06e61 Convert notes to use percentages instead of exact coordinates
- This allows for the note boxes to be easily resized
-- Now resizing the note container resizes all of the note boxes
-- The z-index and position values had to be adjusted for this
--- So that the note/preview boxes were still visible
--- So that the image was selectable with right clicks
- All of the inner box styles have been moved to the outer box
-- Now the inner box is only a container for the note body
- The always resize image option has been removed from user settings
-- The value still exists on the model for future rename/reuse
- The max width is set at 100% for responsive mode to fit the screen
2020-03-04 00:35:42 +00:00
evazion
463b1b734e Add curated posts page.
Add a curated posts page at /explore/posts/curated. Curated posts are
the most favorited posts by contributor-level users (users with
unlimited upload permissions).

Also add an order:curated tag using for use in regular searches.
2020-02-23 17:52:38 -06:00
evazion
ab325c5d2b favgroups: convert post_ids from string to array. 2020-01-17 00:19:20 -06:00
evazion
ee212f8ebb css: fix references to data-user attributes on <body> tag.
Fixup for 5e03c3d84.
2020-01-05 16:41:42 -06:00
evazion
5791f4e805 recommendations: show favcount beneath recommended posts.
* Add favorite count beneath recommended posts. Clicking the favcount
  loads more recommended posts like that post.
* Increase number of recommendations shown on post show page.
2019-12-02 03:08:01 -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
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
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
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
6ef1a1c0b8 css: fix dead space around thumbnails in tables. 2019-09-28 17:50:10 -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
77d2260576 css: clean up <ul> css.
* Remove `list-style-type: none` rules (this is the default).
* Add `list-bulleted` and `list-inline` utility classes.
* Wrap terms of service and user deletion pages in dtext `.prose` class
  so we don't have to redefine basic list styles on these pages.
2019-09-23 19:10:40 -05:00
evazion
e98db8a5b8 css: refactor notice box css.
* Remove .ui-corner-all, .ui-state-highlight, .ui-state-error classes
  from notice boxes.
* Use .notice, .notice-info, .notice-error classes instead.
* Replace <p> elements in notices with <div>'s so that we don't have to
  work around the `margin-bottom: 1em` from <p> elements.
* Replace <h1> elements in notices with <h2>.
* Standardize info notices to use the same shade of light yellow in the
  light theme.
2019-09-22 15:09:45 -05:00
evazion
6b2e6fa3f4 css: fix width of #tags input in search box.
Fix the #tags input not shrinking to fit inside the sidebar.

9720e4cfa9 (r35160195)
2019-09-22 02:58:09 -05:00
evazion
56c7727dd2 css: fix margin between commentary box and search navbar on posts.
* Fix commentary box not having a gap between it and the search navbar
  when the search navbar is beneath the post (the default setting).
* Reduce border radius of commentary box.
2019-09-19 15:01:05 -05:00
evazion
9720e4cfa9 css: fix positioning of search button in tag search box.
Fixes the search button wrapping to the next line in Firefox. Also fixes
the search box to be full width with no gap between the search box and
the search button.
2019-09-19 14:20:47 -05:00
evazion
b24ce0922a css: fix spacing in flag/appeal notices. 2019-09-18 03:30:57 -05:00
evazion
7461372e07 css: standardize body text colors.
* Standardize on one shade of grey for all grey text.
* Use very dark grey instead of black for body text.
2019-09-17 00:28:41 -05:00
evazion
9c96557be8 css: standardize post notice css.
* Standardize post notice background colors.
* Replace .ui-state-highlight and .ui-corner-all classes with .post-notice.
* Rename post notice classes (e.g. .notice-parent -> .post-notice-parent).
* Remove hover effect from sequential search navbar.
2019-09-17 00:28:41 -05:00
evazion
c325bfa199 css: factor out colors from main css (#4158). 2019-09-17 00:28:41 -05:00
Albert Yi
6c332057ac add blur->sharpen animation for loading expanded images on posts 2019-01-23 16:56:00 -08:00
Albert Yi
035a0026cd fixes #4050 2019-01-22 15:14:10 -08:00
Albert Yi
8ac530a909 fixes #4006: Bring back the "edit tags" button to the sidebar
fixes #4011: Comment input field under posts is too big, goes slightly beyond view boundaries
fixes #4010: Incorrect dynamic tag counts
2018-12-12 11:44:25 -08:00
Albert Yi
3893926048 add dynamic tag counts on upload form 2018-12-10 17:51:28 -08:00
Albert Yi
542641e3e2 refactor pool nav html 2018-11-01 17:42:49 -07:00
Albert Yi
21a08d17a4 tweak styles for fav button 2018-10-24 10:02:50 -07:00
Albert Yi
c0ab54b889 css tweaks 2018-10-23 18:30:35 -07:00
evazion
bbb233b93f css: remove unused or redundant rules. 2018-09-14 13:31:59 -05:00
evazion
a5ef97a608 css: remove obsolete/unused mixins. 2018-09-14 00:34:34 -05:00
evazion
056fe365f2 Render "Fetch source data" box html server-side.
Instead of calling /sources.json and rendering the "Fetch source data"
box client-side in Javascript, call /sources.js so we can render the
html server-side.
2018-09-08 15:42:16 -05:00
evazion
22c27f8910 post previews: fix css for captioned post previews.
Captioned post previews (previews with the pool name, similarity, or
size beneath) need to have `height: auto` set, otherwise they'll default
to `height: 154px` (just enough for the image) and the caption won't be visible.
2018-09-06 20:44:47 -05:00