blacklist js fixes
This commit is contained in:
@@ -98,7 +98,7 @@
|
||||
tags.push("rating:" + $post.data("rating"));
|
||||
tags.push("user:" + $post.data("user"));
|
||||
|
||||
return Danbooru.is_subset(tags, blacklist.require) && !Danbooru.intersect(tags, blacklist.exclude).length;
|
||||
return (blacklist.require.length > 0 || blacklist.exclude.length > 0) && Danbooru.is_subset(tags, blacklist.require) && !Danbooru.intersect(tags, blacklist.exclude).length;
|
||||
}
|
||||
|
||||
Danbooru.Blacklist.post_hide = function(post) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
Danbooru.is_subset = function(array, subarray) {
|
||||
var all = true;
|
||||
|
||||
|
||||
$.each(subarray, function(i, val) {
|
||||
if ($.inArray(val, array) === -1) {
|
||||
all = false;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<meta name="current-user-id" content="<%= CurrentUser.id %>">
|
||||
<meta name="user-comment-threshold" content="<%= CurrentUser.comment_threshold %>">
|
||||
<% unless CurrentUser.user.blacklisted_tags.blank? %>
|
||||
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tags.gsub(/\r\n|\r|\n/, ",") %>">
|
||||
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tags.gsub(/(?:\r|\n)+/, ",") %>">
|
||||
<% end %>
|
||||
<% if flash[:notice] =~ /error/ %>
|
||||
<meta name="errors" content="true">
|
||||
|
||||
Reference in New Issue
Block a user