blacklist js fixes

This commit is contained in:
albert
2013-02-28 13:03:51 -08:00
parent 609357ae9e
commit d089bc8464
3 changed files with 3 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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">