Switch to CSS-based Anonymize. More efficient, and works on /f/ index and native catalog. #1111

This commit is contained in:
ccd0 2017-01-28 05:43:28 -08:00
parent b1fe9efa82
commit a625d12979
4 changed files with 31 additions and 28 deletions

View File

@ -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'

View File

@ -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;

View File

@ -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;

View File

@ -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,