evazion
bfed323988
deviantart: fix page_url for when api data is unavailable.
...
The api data is unavailable when we can't scrape the uuid, either
because the work is deleted or because the work is actually a sta.sh
upload and we weren't given the sta.sh page in the referer url.
2018-09-10 19:26:53 -05:00
evazion
c9300cc54e
sta.sh: add tests + docs.
2018-09-10 19:26:53 -05:00
evazion and lllusion3469
7d5d098636
Fix #3877 : Add sta.sh strategy.
...
Co-authored-by: lllusion3469 <31420484+lllusion3469@users.noreply.github.com >
2018-09-10 19:26:47 -05:00
evazion
10358d4211
Fix #3881 : It has been reviewed by X moderators.“ message.
2018-09-10 17:39:49 -05:00
evazion
cb2d85d925
twitter: fix profile_url for twitter.com/i/web/status/:id urls.
...
Fix profile_url returning nil for https://twitter.com/i/web/status/943446161586733056 .
2018-09-09 19:48:34 -05:00
evazion
0d7b7e6e85
twitter tests: fix dead tweet.
2018-09-09 14:10:43 -05:00
evazion
b924c2bb9c
nijie: fix artist url normalization.
2018-09-09 13:17:52 -05:00
evazion
99a5e885e0
artist_url.rb: remove legacy artist url normalization code.
...
* `legacy_normalize` came from c6012535 , which is no longer a problem.
* `normalize_for_search` is only used for "[mass edit]" links
in artist entries. These links are a shortcut for performing a
`-artist_name source:<artist_url> -> artist_name` mass edit to tag
untagged artists, but this won't work for most sites these days.
2018-09-07 12:55:51 -05:00
evazion
8e7dd9e97f
artist_url.rb: remove unnecessary deviantart profile url normalization.
...
This is now handled in the source strategy.
2018-09-07 12:26:50 -05:00
evazion
a67edb8783
deviantart: fix artist finder for artist names with underscores.
...
Fix the artist finder for urls like this:
https://orig00.deviantart.net/4274/f/2010/230/8/a/pkmn_king_and_queen_by_mikoto_chan.jpg
that don't contain a deviantart id but do contain the artist name.
2018-09-07 12:23:48 -05:00
evazion
610391205f
deviantart: fix artist finder for profile urls missing the 'www'.
...
Fix the artist finder to work when the profile url in the artist entry
is missing the 'www'. Example:
https://deviantart.com/noizave
https://www.deviantart.com/noizave
2018-09-07 11:36:48 -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
evazion
950fcdb7b2
uploads: add new source:<url> dupe check ( fix #3873 )
...
* On the /uploads/new page, instead of just showing a "This post has
probably already been uploaded" message, show the actual thumbnails of
posts having the same source as what the user is trying to upload.
* Move the iqdb results section up top, beside the related posts section.
2018-09-06 20:43:20 -05:00
evazion
07c0695ac1
uploads: remove "this post was probably already uploaded" dupe check.
...
Also makes it so that using the bookmarklet always triggers async upload
preprocessing. Before it was only triggered when the source passed a
dupe check, but that check was inaccurate (#3873 ).
2018-09-06 20:43:04 -05:00
evazion
06cf32160b
user.rb: memoize upload limit methods.
...
These methods get called multiple times when rendering UserPresenter#upload_limit
on the upload page. This caused repeated COUNT(*) queries.
2018-09-06 20:31:51 -05:00
evazion
7ecf6f1ba2
Fix link colors inside dialogs, autocomplete.
...
ref: f9f0da054 , https://github.com/r888888888/danbooru/issues/3791#issuecomment-410378703 .
2018-09-05 23:48:51 -05:00
evazion
aee1906761
Fix #3738 : Artist URL search should be case-insensitive for domains.
2018-09-05 19:14:24 -05:00
evazion
c2cf6a5441
Fix #3871 : Autocomplete can return duplicate tags.
2018-09-05 18:56:30 -05:00
evazion
6c457c86ac
nav menu: fix 'Forum' link not getting '.current' class.
...
Fixes the '.current' class not being set on the 'Forum' link when
viewing the /forum_topics page. As a result, the link wasn't bolded and
didn't have the background set.
2018-09-04 18:15:21 -05:00
evazion
5c457fbe51
pixiv: remove obsolete edgesuite.net rewrite rule.
...
This CDN hasn't been seen for several years.
ref: https://danbooru.donmai.us/forum_topics/10766
2018-09-04 18:15:21 -05:00
evazion
4bbe09762d
pixiv: remove dead methods (#is_manga?, #page_count, #page).
2018-09-04 18:15:21 -05:00
evazion
3bed5f3cf9
Fix #3867 : Add namespaces to all Javascript events.
2018-09-04 12:26:18 -05:00
evazion
c03af7f563
posts.js: remove dead search dropdown code.
2018-09-04 12:26:18 -05:00
evazion
1bfe763182
related tags: remove dead #artist-tags-container code.
...
Dead since 78900c4d3 .
2018-09-03 19:13:09 -05:00
evazion
e37844303d
deviantart: take artist name from url when unavailable from API.
...
In some cases we can't get the artist name from the API, either because
we can't do the API call because the url doesn't contain a deviation id,
or because the work is deleted:
* http://fc08.deviantart.net/files/f/2007/120/c/9/cool_like_me_by_47ness.jpg (work: http://fav.me/dwcohb )
* https://pre00.deviantart.net/423b/th/pre/i/2017/281/e/0/mindflayer_girl01_by_nickbeja-dbpxdt8.png (work: http://fav.me/dbpxd58 )
Switch to taking the artist name from the url (when present) to deal
with these cases. Fixes the artist finder and the artist url normalizer
to work in this situation.
2018-09-03 18:27:01 -05:00
evazion
8f87fb90d9
deviantart: handle urls without deviation ids ( fix #3864 )
...
Some older URL formats don't contain the deviation id:
* http://fc08.deviantart.net/files/f/2007/120/c/9/Cool_Like_Me_by_47ness.jpg
* http://pre06.deviantart.net/8497/th/pre/f/2009/173/c/c/cc9686111dcffffffb5fcfaf0cf069fb.jpg
In these cases we can't make the API call. Fix failures due to not being
able to do API calls in this situation.
Also fix canonical_url to use the image_url when it contains the
deviation id, or the page_url when it doesn't.
Finally, fix page_url to use the url from the API instead of the raw url
given by the user, so that it's in a consistent form for canonical_url.
2018-09-03 18:26:45 -05:00
evazion
316acead16
deviantart: fix error when uploading image belonging to deleted work.
2018-09-02 23:09:40 -05:00
evazion
2d1b1311d6
deviantart: fix sample urls not being rewritten to full size urls.
2018-09-02 23:09:29 -05:00
evazion
807c3dd5f4
deviantart: remove obsolete image sample rewrite rules.
...
Remove rewrite rules for these types of sample urls:
* http://th00.deviantart.net/fs71/PRE/f/2014/065/3/b/goruto_by_xyelkiltrox-d797tit.png
* http://th04.deviantart.net/fs70/300W/f/2009/364/4/d/Alphes_Mimic___Rika_by_Juriesute.png
These URLs aren't served to users any more, and just stripping out "PRE"
or "200H" isn't sufficient to get the full size image. In general, an
api call is required to find the full size image url.
2018-09-02 14:49:58 -05:00
evazion
b9ed676bfb
deviantart: handle origin-orig.deviantart.net urls.
2018-09-02 13:57:15 -05:00
evazion
6fc2d17886
Post#normalized_source: normalize da urls to new format ( #3771 )
2018-09-02 11:19:15 -05:00
evazion
d693f01dde
Fix #3859 : Related tag and find artist don't run when fetch data fails.
...
Fixes an exception in the artist finder caused by searching for a nil profile_url.
2018-09-01 11:48:42 -05:00
evazion
d6235d6f9e
nijie: add canonical url tests.
2018-08-31 23:23:15 -05:00
evazion
bc7ead5396
Fix #3857 : Add searching mod actions by message.
...
Also allow searching user feedbacks and bulk update requests.
2018-08-31 19:59:51 -05:00
evazion
0eff095a3e
Refactor searching text attributes.
...
* Allow using ApplicationRecord#attribute_matches to search text attributes,
and standardize models on using this instead of duplicating code.
* Remove restrictions that limited wildcard searches to Builders only in various places.
2018-08-31 19:50:46 -05:00
evazion
736c22c3ce
pixiv: fix fetch source data failing on fanbox images.
...
ref: https://danbooru.donmai.us/forum_posts/150000
2018-08-31 00:21:03 -05:00
evazion
c689a161f6
pixiv: fix failure when normalizing pixiv stacc artist urls ( #3856 ).
2018-08-30 19:24:44 -05:00
evazion
a68d12bd45
autocomplete: fix case sensitivity ( #3854 ).
...
ref: https://github.com/r888888888/danbooru/issues/3854#issuecomment-417366253 :
2018-08-30 17:38:29 -05:00
evazion
6c94047556
Sources::Strategies::Twitter#profile_url: fix case when url is a profile url.
2018-08-29 19:29:16 -05:00
evazion
a1044dbc19
twitter: fix handling of direct image urls without a referer url.
2018-08-29 17:14:57 -05:00
evazion
cd11ae6008
upload page: fix fetch source data when not using bookmarklet.
...
* #upload_referer_url no longer exists, just using #ref works.
* #upload_source defaults to params[:url], so using it instead of #url still works.
ref: https://github.com/r888888888/danbooru/issues/3850#issuecomment-417116385
2018-08-29 16:54:03 -05:00
evazion
bf19ea3bd1
twitter: fix typo in ASSET regex ( #3850 ).
2018-08-29 15:09:36 -05:00
evazion
a8ae4d3f36
Fix #3849 : Forum Button in the topbar has broken css
2018-08-29 14:29:15 -05:00
evazion
4f5cb0ba70
Post#has_artist_tag: fix "artist tag is required" triggering incorrectly.
...
Fixes the "Artist tag is required" upload warning to only trigger when
the source is from a first-party site.
2018-08-28 18:14:21 -05:00
evazion
604bfb0923
Fix #3846 : Subscribed forum posts link to invalid URL in email updates.
...
Test: http://localhost/rails/mailers/user_mailer/forum_notice
2018-08-27 22:04:37 -05:00
evazion
47e26419d3
nav menu: add html ids to secondary nav menu links ( #3844 ).
2018-08-27 20:57:59 -05:00
evazion
4e1d76da81
html: add controller & action attributes to <body> tag ( #3844 ).
2018-08-26 16:02:06 -05:00
evazion
b98bc26397
nav menu: add html ids to main menu nav links ( #3844 ).
2018-08-26 13:12:41 -05:00
evazion
8ccc238791
nav menu: remove duplicate "More »" link.
...
Remove a second hidden "More »" link from the nav menu. This was
leftover code first added in f2f524b87 and later reverted in 68161f7b8 .
2018-08-26 13:11:26 -05:00
evazion
6ff70c5002
mod actions: separate account upgrades from promotions ( fix #3841 )
2018-08-26 11:12:04 -05:00
evazion
3dafca9aec
Fix #3842 : Mods can demote other mods or admins.
2018-08-25 13:52:50 -05:00
evazion
0bb787d987
Post.pending_or_flagged: fix ambiguous column reference.
...
Fixes an ambiguous column reference error when searching for
`status:unmoderated` on the comments page:
https://danbooru.donmai.us/comments?group_by=comment&search[post_tags_match]=status:unmoderated
Also removes the `id in (...)` subquery checking whether flagged posts
have a flag from the last week; this is always true.
2018-08-25 11:26:00 -05:00
evazion
e33d6f9e84
Post#is_approvable?: fix 'Approve' link appearing on approver's own uploads.
...
Fixes the 'Approve' link in the modqueue and in the quickmod bar being
shown as available on the approver's own flagged uploads, even though
they can't actually approve these posts.
2018-08-25 11:12:37 -05:00
evazion
847237980b
Fix #3469 : Rejecting post shouldn't hide pending/flagged notices
...
Just reload the page entirely instead of trying to update it in place.
2018-08-25 00:39:08 -05:00
evazion
f9a39c9fbe
Fix #3840 : "Q" moves cursor to beginning of search bar.
2018-08-24 20:31:37 -05:00
evazion
e10df5bdf7
Fix #3839 : Allow prepopulating upload form with url params.
2018-08-24 17:39:26 -05:00
evazion
2cdd022c37
Fix #3837 : Remove expired bans.
2018-08-24 16:49:34 -05:00
evazion
05ad112831
Fix #3835 : Related tags update vulnerability.
...
Also fixes deprecated call to `render :text`.
2018-08-24 12:16:23 -05:00
evazion
8833374294
Fix calling reportbooru when it isn't fully configured ( #3834 ).
2018-08-24 11:23:19 -05:00
evazion
cf5c458020
danbooru_default_config.rb: document enable_post_search_counts ( #3834 ).
2018-08-24 11:21:54 -05:00
evazion
83cca4a382
PostDisapproval: fix duplicate initialize_attributes definition.
2018-08-23 15:24:57 -05:00
evazion
85ae2cda0d
optimization: prefer relation.none over relation.where("false")
...
Using `relation.none` instead of `relation.where("false")` avoids an sql query.
2018-08-23 15:21:51 -05:00
evazion
4f02c7f70a
search: add status:modqueue, status:unmoderated metatags.
...
* status:modqueue = ~status:pending ~status:flagged
* status:unmoderated = status:modqueue -user:self -approver:self -disapproval:any
2018-08-23 14:48:39 -05:00
evazion
89c4fe150a
search: add disapproval:<any|none|disinterest|poor_quality|breaks_rules> metatag.
2018-08-23 14:08:02 -05:00
evazion
db23e06a4f
comments.js: remove unused import.
2018-08-22 20:29:51 -05:00
evazion
a6162246f4
Fix #3830 : JS Upload ignores set Max-Filesize bigger than 265 MB.
2018-08-22 20:24:52 -05:00
evazion
8890baaf42
Fix #3821 : Blacklist and mod queue.
2018-08-22 18:14:13 -05:00
evazion
083c537abf
Fix #3769 : Favgroup search negation doesn't work as expected.
2018-08-22 17:33:23 -05:00
evazion
9a0f37e359
Fix #3715 : Provide any/none modifiers for pixiv: metatag
2018-08-22 00:25:38 -05:00
evazion
8cc393183e
Fix #3754 : Include unbans in Mod Actions.
2018-08-22 00:08:33 -05:00
evazion
d6eecb5466
blacklists: truncate display of long blacklist rules.
2018-08-21 23:33:33 -05:00
evazion
6ccf4ed9c0
blacklists: refactor blacklist html+css.
...
* Consolidate blacklist css in one file.
* blacklist box: fix tag colors not dimming on hover.
* blacklist box: allow middle clicking on tags to open in new tab.
* /wiki_pages: move blacklist controls to top of tag sidebar.
* /wiki_pages: fix missing "disable all" / "re-enable all" buttons.
2018-08-21 23:33:08 -05:00
evazion
d26d450c09
Fix #3709 : Provide OR capability for blacklist items.
2018-08-21 23:31:25 -05:00
evazion
03a97d2962
Post#normalized_source: add toranoana.jp normalization.
2018-08-21 00:07:58 -05:00
evazion
3af82de596
Partial fix for #3719 : Certain commentaries not parsed correctly
2018-08-20 23:18:26 -05:00
evazion
33506839c4
Post#normalized_source: fix gelbooru source normalization.
...
Didn't handle https or md5-based subdirs:
https://gelbooru.com//images/57/a3/57a3676a63e5cf4ab05463a3a9a953bb.jpg
^ ^^^^^
2018-08-20 15:02:08 -05:00
evazion
e4286632f5
Fix #3826 : Upload error: Could not parse output from FFProbe
2018-08-19 18:22:49 -05:00
evazion
c504ad555d
Fix #3822 : Move favorites (while deleting) fails if user has also favorited destination
2018-08-19 00:54:17 -05:00
evazion
eaef616a01
Fixup tests for 03cf4c917.
2018-08-19 00:42:06 -05:00
evazion
3419193341
Post#normalized_source: fix twipple.jp normalization.
2018-08-19 00:33:31 -05:00
evazion
03cf4c917e
Post#normalized_source: prefer https links where supported.
2018-08-19 00:31:07 -05:00
evazion
4eead40f4d
Fix #3823 : Add Photozou source normalization.
2018-08-18 23:23:48 -05:00
evazion
3ae913a707
html: convert html comments to erb comments.
...
Avoid emitting useless comments in the html.
2018-08-17 18:55:21 -05:00
evazion
3f7b1e0b13
html: fix invalid </meta>, </link>, </input> closing tags.
2018-08-17 18:41:48 -05:00
evazion
f85b34cd9f
shortcuts.js: simplify scroll up/down hotkeys.
2018-08-17 16:25:47 -05:00
evazion
e9d6a0fda6
utility.js: remove dead Utility.without function.
2018-08-17 16:25:47 -05:00
evazion
21895ef0aa
utility.js: simplify $.fn.selectEnd().
...
Remove createTextRange fallback; setSelectionRange is supported by all modern browsers.
https://caniuse.com/#feat=input-selection
2018-08-17 16:25:47 -05:00
evazion
dfffabd662
utility.js: replace Utility.scroll_to with Element.scrollIntoView.
...
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
https://caniuse.com/#feat=scrollintoview
2018-08-17 16:25:47 -05:00
evazion
ad056e69d5
utility.js: simplify even/odd table row striping.
2018-08-17 16:25:36 -05:00
evazion
eef8b9c323
posts/show: fix flash message when faving/unfaving posts.
...
Bug: if you faved a post, then opened another page in a separate tab,
then the "You have favorited this post" flash message would appear in
the separate tab.
Fixes regression in bcaee199 .
2018-08-15 20:14:51 -05:00
evazion
ec0646c234
posts/show: don't scroll page when opening edit dialog.
...
Don't scroll up the page when opening the tag edit dialog via shift+e.
Fixes regression in #3812 .
2018-08-15 18:56:52 -05:00
evazion
56beed8a23
dtext: fix flicker in [expand] elements.
2018-08-14 16:04:13 -05:00
evazion
0b6e89c908
dtext: fix flickering dtext preview div.
2018-08-14 16:04:08 -05:00
evazion
e57eb87632
forum_topics/show: fix flickering forum post edit forms.
2018-08-14 16:04:08 -05:00
evazion
7aa2a41798
blacklists: fix flickering of inline blacklists.
2018-08-14 16:04:08 -05:00
evazion
33ed762e91
posts/show: eliminate unused <meta> tags.
2018-08-14 16:04:08 -05:00
evazion
766d68c4ee
posts/show: fix flickering post unvote link.
2018-08-14 16:04:08 -05:00
evazion
7174c24ac8
posts/show: fix flickering recommended tab.
2018-08-14 16:04:08 -05:00
evazion
73fc7cab7f
posts/show: fix flickering tabs in artist commentary box.
2018-08-14 16:04:08 -05:00
evazion
0c49b162f0
posts/show: fix flickering favlist show/hide buttons.
2018-08-14 16:03:16 -05:00