Fix some errors from features run on 404 pages.
This commit is contained in:
parent
79dedbcb2b
commit
935596722c
@ -91,7 +91,7 @@ Header =
|
|||||||
@setBarPosition Conf['Bottom Header']
|
@setBarPosition Conf['Bottom Header']
|
||||||
@
|
@
|
||||||
|
|
||||||
$.ready =>
|
Main.ready =>
|
||||||
@footer = footer = $.id 'boardNavDesktopFoot'
|
@footer = footer = $.id 'boardNavDesktopFoot'
|
||||||
if a = $ "a[href*='/#{g.BOARD}/']", footer
|
if a = $ "a[href*='/#{g.BOARD}/']", footer
|
||||||
a.className = 'current'
|
a.className = 'current'
|
||||||
|
|||||||
@ -82,6 +82,7 @@ Index =
|
|||||||
|
|
||||||
@update()
|
@update()
|
||||||
$.asap (-> $('.board > .thread > .postContainer', doc) or d.readyState isnt 'loading'), ->
|
$.asap (-> $('.board > .thread > .postContainer', doc) or d.readyState isnt 'loading'), ->
|
||||||
|
return unless Main.isThisPageLegit()
|
||||||
Index.hat = $ '.board > .thread > img:first-child'
|
Index.hat = $ '.board > .thread > img:first-child'
|
||||||
if Index.hat and Index.nodes
|
if Index.hat and Index.nodes
|
||||||
for threadRoot in Index.nodes
|
for threadRoot in Index.nodes
|
||||||
@ -106,6 +107,7 @@ Index =
|
|||||||
$.before topNavPos, Index.navLinks
|
$.before topNavPos, Index.navLinks
|
||||||
|
|
||||||
$.asap (-> $('.pagelist', doc) or d.readyState isnt 'loading'), ->
|
$.asap (-> $('.pagelist', doc) or d.readyState isnt 'loading'), ->
|
||||||
|
return unless Main.isThisPageLegit()
|
||||||
if pagelist = $('.pagelist')
|
if pagelist = $('.pagelist')
|
||||||
$.replace pagelist, Index.pagelist
|
$.replace pagelist, Index.pagelist
|
||||||
else
|
else
|
||||||
|
|||||||
@ -273,6 +273,10 @@ Main =
|
|||||||
d.title not in ['4chan - Temporarily Offline', '4chan - Error', '504 Gateway Time-out']
|
d.title not in ['4chan - Temporarily Offline', '4chan - Error', '504 Gateway Time-out']
|
||||||
Main.thisPageIsLegit
|
Main.thisPageIsLegit
|
||||||
|
|
||||||
|
ready: (cb) ->
|
||||||
|
$.ready ->
|
||||||
|
cb() if Main.isThisPageLegit()
|
||||||
|
|
||||||
css: """
|
css: """
|
||||||
<%= grunt.file.read('src/General/css/font-awesome.css').replace(/\s+/g, ' ').replace(/\\/g, '\\\\').trim() %>
|
<%= grunt.file.read('src/General/css/font-awesome.css').replace(/\s+/g, ' ').replace(/\\/g, '\\\\').trim() %>
|
||||||
<%= grunt.file.read('src/General/css/style.css').replace(/\s+/g, ' ').trim() %>
|
<%= grunt.file.read('src/General/css/style.css').replace(/\s+/g, ' ').trim() %>
|
||||||
|
|||||||
@ -7,7 +7,7 @@ Banner =
|
|||||||
|
|
||||||
# Let 4chan's JS load the banner if enabled; otherwise, load it ourselves.
|
# Let 4chan's JS load the banner if enabled; otherwise, load it ourselves.
|
||||||
if g.BOARD.ID isnt 'f'
|
if g.BOARD.ID isnt 'f'
|
||||||
$.ready -> $.queueTask Banner.load
|
Main.ready -> $.queueTask Banner.load
|
||||||
|
|
||||||
ready: ->
|
ready: ->
|
||||||
banner = $ ".boardBanner"
|
banner = $ ".boardBanner"
|
||||||
|
|||||||
@ -36,7 +36,7 @@ Fourchan =
|
|||||||
cb: @math
|
cb: @math
|
||||||
|
|
||||||
# Disable 4chan's ID highlighting (replaced by IDHighlight) and reported post hiding.
|
# Disable 4chan's ID highlighting (replaced by IDHighlight) and reported post hiding.
|
||||||
$.ready ->
|
Main.ready ->
|
||||||
$.globalEval '''
|
$.globalEval '''
|
||||||
(function() {
|
(function() {
|
||||||
window.clickable_ids = false;
|
window.clickable_ids = false;
|
||||||
|
|||||||
@ -27,7 +27,7 @@ ThreadUpdater =
|
|||||||
updateLink = $.el 'span',
|
updateLink = $.el 'span',
|
||||||
className: 'brackets-wrap updatelink'
|
className: 'brackets-wrap updatelink'
|
||||||
$.extend updateLink, <%= html('<a href="javascript:;">Update</a>') %>
|
$.extend updateLink, <%= html('<a href="javascript:;">Update</a>') %>
|
||||||
$.ready ->
|
Main.ready ->
|
||||||
$.add $('.navLinksBot'), [$.tn(' '), updateLink]
|
$.add $('.navLinksBot'), [$.tn(' '), updateLink]
|
||||||
$.on updateLink.firstElementChild, 'click', @update
|
$.on updateLink.firstElementChild, 'click', @update
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user