Add Country filtering.

This commit is contained in:
Nicolas Stepien 2012-07-02 09:55:25 +02:00
parent 572e717152
commit d5c825c683
3 changed files with 19 additions and 0 deletions

View File

@ -151,6 +151,7 @@
email: ['# Filter any e-mails that are not `sage` on /a/ and /jp/:', '#/^(?!sage$)/;boards:a,jp'].join('\n'),
subject: ['# Filter Generals on /v/:', '#/general/i;boards:v;op:only'].join('\n'),
comment: ['# Filter Stallman copypasta on /g/:', '#/what you\'re refer+ing to as linux/i;boards:g'].join('\n'),
country: [''].join('\n'),
filename: [''].join('\n'),
dimensions: ['# Highlight potential wallpapers:', '#/1920x1080/;op:yes;highlight;top:no;boards:w,wg'].join('\n'),
filesize: [''].join('\n'),
@ -701,6 +702,13 @@
}
return text.join('');
},
country: function(post) {
var flag;
if (flag = $('.countryFlag', post.el)) {
return flag.title.replace('Country: ', '');
}
return false;
},
filename: function(post) {
var file, fileInfo;
fileInfo = post.fileInfo;
@ -2322,6 +2330,7 @@
<option value=email>E-mail</option>\
<option value=subject>Subject</option>\
<option value=comment>Comment</option>\
<option value=country>Country</option>\
<option value=filename>Filename</option>\
<option value=dimensions>Image dimensions</option>\
<option value=filesize>Filesize</option>\

View File

@ -1,4 +1,6 @@
master
- Mayhem
Add Country filtering.
2.33.7
- Mayhem

View File

@ -86,6 +86,9 @@ Config =
'# Filter Stallman copypasta on /g/:'
'#/what you\'re refer+ing to as linux/i;boards:g'
].join '\n'
country: [
''
].join '\n'
filename: [
''
].join '\n'
@ -552,6 +555,10 @@ Filter =
for i in [0...nodes.snapshotLength]
text.push if data = nodes.snapshotItem(i).data then data else '\n'
text.join ''
country: (post) ->
if flag = $ '.countryFlag', post.el
return flag.title.replace 'Country: ', ''
false
filename: (post) ->
{fileInfo} = post
if fileInfo and file = $ '.fileText > span', fileInfo
@ -1778,6 +1785,7 @@ Options =
<option value=email>E-mail</option>
<option value=subject>Subject</option>
<option value=comment>Comment</option>
<option value=country>Country</option>
<option value=filename>Filename</option>
<option value=dimensions>Image dimensions</option>
<option value=filesize>Filesize</option>