fix -favgroup: for tag scripts, add -fav:
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
} else if (command === "[reset]") {
|
} else if (command === "[reset]") {
|
||||||
return [];
|
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)});
|
return Danbooru.reject(tags, function(x) {return x === command.substr(1, 100)});
|
||||||
} else {
|
} else {
|
||||||
tags.push(command);
|
tags.push(command);
|
||||||
|
|||||||
@@ -629,7 +629,7 @@ class Post < ActiveRecord::Base
|
|||||||
|
|
||||||
def filter_metatags(tags)
|
def filter_metatags(tags)
|
||||||
@pre_metatags, tags = tags.partition {|x| x =~ /\A(?:rating|parent|-parent):/i}
|
@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
|
apply_pre_metatags
|
||||||
return tags
|
return tags
|
||||||
end
|
end
|
||||||
@@ -665,6 +665,9 @@ class Post < ActiveRecord::Base
|
|||||||
when /^fav:(.+)$/i
|
when /^fav:(.+)$/i
|
||||||
add_favorite!(CurrentUser.user)
|
add_favorite!(CurrentUser.user)
|
||||||
|
|
||||||
|
when /^-fav:(.+)$/i
|
||||||
|
remove_favorite!(CurrentUser.user)
|
||||||
|
|
||||||
when /^child:(.+)$/i
|
when /^child:(.+)$/i
|
||||||
child = Post.find($1)
|
child = Post.find($1)
|
||||||
child.parent_id = id
|
child.parent_id = id
|
||||||
|
|||||||
Reference in New Issue
Block a user