From a625d1297984db70b3184a6ccb7d57fad9415d60 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 28 Jan 2017 05:43:28 -0800 Subject: [PATCH] Switch to CSS-based Anonymize. More efficient, and works on /f/ index and native catalog. #1111 --- src/Filtering/Anonymize.coffee | 30 ++---------------------------- src/css/burichan.css | 5 +++++ src/css/futaba.css | 5 +++++ src/css/style.css | 19 +++++++++++++++++++ 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/src/Filtering/Anonymize.coffee b/src/Filtering/Anonymize.coffee index 699553842..987b2818a 100644 --- a/src/Filtering/Anonymize.coffee +++ b/src/Filtering/Anonymize.coffee @@ -1,30 +1,4 @@ Anonymize = init: -> - return unless g.VIEW in ['index', 'thread', 'archive'] and Conf['Anonymize'] - - @archive() if g.VIEW is 'archive' - - Callbacks.Post.push - name: 'Anonymize' - cb: @node - - node: -> - return if @info.capcode or @isClone - {name, tripcode, pass, email} = @nodes - if @info.name isnt 'Anonymous' - name.textContent = 'Anonymous' - if tripcode - $.rm tripcode - delete @nodes.tripcode - if pass - $.rm pass - delete @nodes.pass - if email - $.replace email, name - delete @nodes.email - - archive: -> - $.ready -> - name.textContent = 'Anonymous' for name in $$ '.name' - $.rm trip for trip in $$ '.postertrip' - return + return unless Conf['Anonymize'] + $.addClass doc, 'anonymize' diff --git a/src/css/burichan.css b/src/css/burichan.css index f432dabb7..d8f89d666 100644 --- a/src/css/burichan.css +++ b/src/css/burichan.css @@ -55,6 +55,11 @@ color: #D6DAF0; } +/* Anonymize */ +:root.burichan.anonymize .name::before { + font-size: 12pt; +} + /* QR */ .burichan #dump-list::-webkit-scrollbar-thumb { background-color: #D6DAF0; diff --git a/src/css/futaba.css b/src/css/futaba.css index 09ffa7cba..738909f28 100644 --- a/src/css/futaba.css +++ b/src/css/futaba.css @@ -55,6 +55,11 @@ color: #F0E0D6; } +/* Anonymize */ +:root.futaba.anonymize .name::before { + font-size: 12pt; +} + /* QR */ .futaba #dump-list::-webkit-scrollbar-thumb { background-color: #F0E0D6; diff --git a/src/css/style.css b/src/css/style.css index 036029baa..74bd4f8f5 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -1433,6 +1433,25 @@ input[name="Default Volume"] { left: 19px; } +/* Anonymize */ +:root.anonymize .name, +:root.anonymize .post-author:not([class*=capcode]) { + font-size: 0; +} +:root.anonymize .postertrip, +:root.anonymize .n-pu { + display: none; +} +:root.anonymize .name::before, +:root.anonymize .post-author:not([class*=capcode])::before { + content: "Anonymous"; + font-size: 10pt; +} +:root.anonymize .flashListing .name::before, +:root.anonymize .post-last > .post-author:not([class*=capcode])::before { + font-size: 9pt; +} + /* QR */ :root.hide-original-post-form #togglePostFormLink, #qr.autohide:not(.focus):not(:hover):not(:active) > form,