fix -favgroup: for tag scripts, add -fav:
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user