diff --git a/4chan_x.user.js b/4chan_x.user.js index d1b18b079..ff58e1446 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -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 @@ \

Name:

\

Tripcode:

\ +

Admin/Mod:

\

E-mail:

\

Subject:

\

Comment:

\ diff --git a/changelog b/changelog index d1600ae15..8e8bf2bff 100644 --- a/changelog +++ b/changelog @@ -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 diff --git a/script.coffee b/script.coffee index 85b928eb4..2326e0175 100644 --- a/script.coffee +++ b/script.coffee @@ -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 =

Name:

Tripcode:

+

Admin/Mod:

E-mail:

Subject:

Comment: