Don't execute on the 'Temporary Offline' page.
This commit is contained in:
parent
8ceb892cfd
commit
e7fbfe8886
File diff suppressed because one or more lines are too long
@ -46,10 +46,8 @@ Header =
|
|||||||
order: 105
|
order: 105
|
||||||
|
|
||||||
$.asap (-> d.body), ->
|
$.asap (-> d.body), ->
|
||||||
if $ 'link[href*="favicon-status.ico"]', d.head
|
if Main.isThisPageLegit()
|
||||||
# 404 error page or similar.
|
$.prepend d.body, Header.headerEl
|
||||||
return
|
|
||||||
$.prepend d.body, Header.headerEl
|
|
||||||
$.asap (-> $.id 'boardNavDesktop'), @setBoardList
|
$.asap (-> $.id 'boardNavDesktop'), @setBoardList
|
||||||
|
|
||||||
setBoardList: ->
|
setBoardList: ->
|
||||||
|
|||||||
@ -361,9 +361,7 @@ Main =
|
|||||||
$.ready Main.initReady
|
$.ready Main.initReady
|
||||||
|
|
||||||
initStyle: ->
|
initStyle: ->
|
||||||
if $ 'link[href*="favicon-status.ico"]', d.head
|
return unless Main.isThisPageLegit()
|
||||||
# 404 error page or similar.
|
|
||||||
return
|
|
||||||
# disable the mobile layout
|
# disable the mobile layout
|
||||||
$('link[href*=mobile]', d.head)?.disabled = true
|
$('link[href*=mobile]', d.head)?.disabled = true
|
||||||
$.addClass doc, $.engine
|
$.addClass doc, $.engine
|
||||||
@ -487,6 +485,12 @@ Main =
|
|||||||
textContent: error
|
textContent: error
|
||||||
[message, error]
|
[message, error]
|
||||||
|
|
||||||
|
isThisPageLegit: ->
|
||||||
|
# 404 error page or similar.
|
||||||
|
unless 'thisPageIsLegit' of Main
|
||||||
|
Main.thisPageIsLegit = !$('link[href*="favicon-status.ico"]', d.head) and d.title isnt '4chan - Temporarily Offline'
|
||||||
|
Main.thisPageIsLegit
|
||||||
|
|
||||||
css: """
|
css: """
|
||||||
<%= grunt.file.read('css/style.css') %>
|
<%= grunt.file.read('css/style.css') %>
|
||||||
<%= grunt.file.read('css/yotsuba.css') %>
|
<%= grunt.file.read('css/yotsuba.css') %>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user