diff --git a/src/main/Main.coffee b/src/main/Main.coffee index b4791171a..529918c48 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -244,9 +244,9 @@ Main = $.rm Main.bgColorStyle else # Determine proper background color for dialogs if 4chan is using a special stylesheet. - div = $.el 'div', - className: 'reply' - div.style.cssText = 'position: absolute; visibility: hidden;' + div = Site.bgColoredEl() + div.style.position = 'absolute'; + div.style.visibility = 'hidden'; $.add d.body, div bgColor = window.getComputedStyle(div).backgroundColor $.rm div diff --git a/src/site/SW.tinyboard.coffee b/src/site/SW.tinyboard.coffee index ea0f24231..6abb12a38 100644 --- a/src/site/SW.tinyboard.coffee +++ b/src/site/SW.tinyboard.coffee @@ -45,6 +45,9 @@ SW.tinyboard = $ /// + bgColoredEl: -> + $.el 'div', className: 'post reply' + parseNodes: (post, nodes) -> # Add vichan's span.poster_id around the ID if not already present. return if nodes.uniqueID diff --git a/src/site/SW.yotsuba.coffee b/src/site/SW.yotsuba.coffee index ca029b6ab..bf90d30fa 100644 --- a/src/site/SW.yotsuba.coffee +++ b/src/site/SW.yotsuba.coffee @@ -52,6 +52,9 @@ SW.yotsuba = $ /// + bgColoredEl: -> + $.el 'div', className: 'reply' + isThisPageLegit: -> # not 404 error page or similar. location.hostname is 'boards.4chan.org' and