Don't execute on the 'Temporary Offline' page.

This commit is contained in:
Nicolas Stepien 2013-03-01 12:42:28 +01:00
parent 8ceb892cfd
commit e7fbfe8886
3 changed files with 18 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -46,10 +46,8 @@ Header =
order: 105
$.asap (-> d.body), ->
if $ 'link[href*="favicon-status.ico"]', d.head
# 404 error page or similar.
return
$.prepend d.body, Header.headerEl
if Main.isThisPageLegit()
$.prepend d.body, Header.headerEl
$.asap (-> $.id 'boardNavDesktop'), @setBoardList
setBoardList: ->

View File

@ -361,9 +361,7 @@ Main =
$.ready Main.initReady
initStyle: ->
if $ 'link[href*="favicon-status.ico"]', d.head
# 404 error page or similar.
return
return unless Main.isThisPageLegit()
# disable the mobile layout
$('link[href*=mobile]', d.head)?.disabled = true
$.addClass doc, $.engine
@ -487,6 +485,12 @@ Main =
textContent: 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: """
<%= grunt.file.read('css/style.css') %>
<%= grunt.file.read('css/yotsuba.css') %>