diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index b41f699e7..b88879f59 100644 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -92,8 +92,7 @@ Filter = # Fields that this filter applies to (for 'general' filters) if key is 'general' if (types = filter.match /(?:^|;)\s*type:([^;]*)/) - types = types[1].split(',').filter (x) -> - x of Config.filter and x isnt 'general' + types = types[1].split(',') else types = ['subject', 'name', 'filename', 'comment'] @@ -181,7 +180,10 @@ Filter = MD5: (post) -> post.file?.MD5 value: (key, post) -> - Filter.valueF[key](post) + if key of Filter.valueF + Filter.valueF[key](post) + else + key.split('+').map((k) -> Filter.valueF[k]?(post) or '').join('\n') addFilter: (type, re, cb) -> $.get type, Conf[type], (item) -> diff --git a/src/General/Settings/Filter-guide.html b/src/General/Settings/Filter-guide.html index 2e47c6b31..3099a15cb 100644 --- a/src/General/Settings/Filter-guide.html +++ b/src/General/Settings/Filter-guide.html @@ -41,7 +41,9 @@
  • Filters in the "General" section apply to multiple fields, by default subject,name,filename,comment.
    The fields can be specified with the type option, separated by commas.
    - For example: type:@{filterTypes};. + For example: type:@{filterTypes};.
    + Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
    + For example: type:filename+filesize+dimensions;.