fix -favgroup: for tag scripts, add -fav:

This commit is contained in:
Toks
2015-06-30 09:47:20 -04:00
parent 1d9596d7f2
commit bb879cc4fd
2 changed files with 5 additions and 2 deletions

View File

@@ -34,7 +34,7 @@
}
} else if (command === "[reset]") {
return [];
} else if (command[0] === "-" && !command.match(/^(?:-pool|-parent):/i)) {
} else if (command[0] === "-" && !command.match(/^(?:-pool|-parent|-fav|-favgroup):/i)) {
return Danbooru.reject(tags, function(x) {return x === command.substr(1, 100)});
} else {
tags.push(command);

View File

@@ -629,7 +629,7 @@ class Post < ActiveRecord::Base
def filter_metatags(tags)
@pre_metatags, tags = tags.partition {|x| x =~ /\A(?:rating|parent|-parent):/i}
@post_metatags, tags = tags.partition {|x| x =~ /\A(?:-pool|pool|newpool|fav|child|-favgroup|favgroup):/i}
@post_metatags, tags = tags.partition {|x| x =~ /\A(?:-pool|pool|newpool|fav|-fav|child|-favgroup|favgroup):/i}
apply_pre_metatags
return tags
end
@@ -665,6 +665,9 @@ class Post < ActiveRecord::Base
when /^fav:(.+)$/i
add_favorite!(CurrentUser.user)
when /^-fav:(.+)$/i
remove_favorite!(CurrentUser.user)
when /^child:(.+)$/i
child = Post.find($1)
child.parent_id = id