Admin/mod filter. Close #290.

This commit is contained in:
Nicolas Stepien 2012-02-27 02:52:30 +01:00
parent f7d17467b8
commit bf54dff77b
3 changed files with 23 additions and 1 deletions

View File

@ -139,6 +139,7 @@
filter: {
name: ['# Filter any namefags:', '#/^(?!Anonymous$)/'].join('\n'),
tripcode: ['# Filter any tripfags', '#/^!/'].join('\n'),
mod: ['# Set a custom class for mods:', '#/Mod$/;highlight:mod;op:yes', '# Set a custom class for moot:', '#/Admin$/;highlight:moot;op:yes'].join('\n'),
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'),
@ -625,6 +626,13 @@
if (trip = $('.postertrip', root)) return trip.textContent;
return false;
},
mod: function(root, isOP) {
var mod;
if (mod = (isOP ? $('.commentpostername', root) : $('.commentpostername ~ .commentpostername', root))) {
return mod.textContent;
}
return false;
},
email: function(root) {
var mail;
if (mail = $('.linkmail', root)) return mail.href;
@ -2132,6 +2140,7 @@
</ul>\
<p>Name:<br><textarea name=name></textarea></p>\
<p>Tripcode:<br><textarea name=tripcode></textarea></p>\
<p>Admin/Mod:<br><textarea name=mod></textarea></p>\
<p>E-mail:<br><textarea name=email></textarea></p>\
<p>Subject:<br><textarea name=subject></textarea></p>\
<p>Comment:<br><textarea name=comment></textarea></p>\

View File

@ -1,5 +1,5 @@
master
-ahodesuka
- ahodesuka
Reply/Thread File Info Formatting:
- Link: %l, %L (Original file names are shown inside threads).
- Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default).
@ -8,6 +8,8 @@ master
- noface
Update imagelimit for mlp.
Fix stubs if poster has unique ID.
- Mayhem
You can now filter or highlight admin/mod posts.
2.27.1
- Mayhem

View File

@ -62,6 +62,12 @@ config =
'# Filter any tripfags'
'#/^!/'
].join '\n'
mod: [
'# Set a custom class for mods:'
'#/Mod$/;highlight:mod;op:yes'
'# Set a custom class for moot:'
'#/Admin$/;highlight:moot;op:yes'
].join '\n'
email: [
'# Filter any e-mails that are not `sage` on /a/ and /jp/:'
'#/^(?!sage$)/;boards:a,jp'
@ -540,6 +546,10 @@ filter =
if trip = $ '.postertrip', root
return trip.textContent
false
mod: (root, isOP) ->
if mod = (if isOP then $ '.commentpostername', root else $ '.commentpostername ~ .commentpostername', root)
return mod.textContent
false
email: (root) ->
if mail = $ '.linkmail', root
return mail.href
@ -1731,6 +1741,7 @@ options =
</ul>
<p>Name:<br><textarea name=name></textarea></p>
<p>Tripcode:<br><textarea name=tripcode></textarea></p>
<p>Admin/Mod:<br><textarea name=mod></textarea></p>
<p>E-mail:<br><textarea name=email></textarea></p>
<p>Subject:<br><textarea name=subject></textarea></p>
<p>Comment:<br><textarea name=comment></textarea></p>