Add isArchived to preParsing. Disable Reveal Spoilers on archived posts.
This commit is contained in:
parent
8046bfa939
commit
c3995a173b
@ -2840,7 +2840,7 @@
|
|||||||
node: function(post) {
|
node: function(post) {
|
||||||
var img;
|
var img;
|
||||||
img = post.img;
|
img = post.img;
|
||||||
if (!(img && /^Spoiler/.test(img.alt)) || post.isInlined && !post.isCrosspost) {
|
if (!(img && /^Spoiler/.test(img.alt)) || post.isInlined && !post.isCrosspost || post.isArchived) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
img.removeAttribute('style');
|
img.removeAttribute('style');
|
||||||
@ -4509,6 +4509,7 @@
|
|||||||
"class": el.className,
|
"class": el.className,
|
||||||
id: el.id.match(/\d+$/)[0],
|
id: el.id.match(/\d+$/)[0],
|
||||||
threadId: g.THREAD_ID || $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0],
|
threadId: g.THREAD_ID || $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0],
|
||||||
|
isArchived: /\barchivedPost\b/.test(parentClass),
|
||||||
isInlined: /\binline\b/.test(parentClass),
|
isInlined: /\binline\b/.test(parentClass),
|
||||||
isCrosspost: /\bcrosspost\b/.test(parentClass),
|
isCrosspost: /\bcrosspost\b/.test(parentClass),
|
||||||
blockquote: el.lastElementChild,
|
blockquote: el.lastElementChild,
|
||||||
|
|||||||
@ -2243,7 +2243,7 @@ RevealSpoilers =
|
|||||||
Main.callbacks.push @node
|
Main.callbacks.push @node
|
||||||
node: (post) ->
|
node: (post) ->
|
||||||
{img} = post
|
{img} = post
|
||||||
if not (img and /^Spoiler/.test img.alt) or post.isInlined and not post.isCrosspost
|
if not (img and /^Spoiler/.test img.alt) or post.isInlined and not post.isCrosspost or post.isArchived
|
||||||
return
|
return
|
||||||
img.removeAttribute 'style'
|
img.removeAttribute 'style'
|
||||||
img.src = "//thumbs.4chan.org#{img.parentNode.pathname.replace /src(\/\d+).+$/, 'thumb$1s.jpg'}"
|
img.src = "//thumbs.4chan.org#{img.parentNode.pathname.replace /src(\/\d+).+$/, 'thumb$1s.jpg'}"
|
||||||
@ -3520,8 +3520,9 @@ Main =
|
|||||||
class: el.className
|
class: el.className
|
||||||
id: el.id.match(/\d+$/)[0]
|
id: el.id.match(/\d+$/)[0]
|
||||||
threadId: g.THREAD_ID or $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0]
|
threadId: g.THREAD_ID or $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0]
|
||||||
isInlined: /\binline\b/.test parentClass
|
isArchived: /\barchivedPost\b/.test parentClass
|
||||||
isCrosspost: /\bcrosspost\b/.test parentClass
|
isInlined: /\binline\b/.test parentClass
|
||||||
|
isCrosspost: /\bcrosspost\b/.test parentClass
|
||||||
blockquote: el.lastElementChild
|
blockquote: el.lastElementChild
|
||||||
quotes: el.getElementsByClassName 'quotelink'
|
quotes: el.getElementsByClassName 'quotelink'
|
||||||
backlinks: el.getElementsByClassName 'backlink'
|
backlinks: el.getElementsByClassName 'backlink'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user