Remove last uses of $.globalEval.

This commit is contained in:
ccd0 2019-07-25 17:49:24 -07:00
parent 25dd9d5985
commit 48022bb31b
2 changed files with 7 additions and 7 deletions

View File

@ -103,7 +103,8 @@ Header =
$('#navtopright', footer).id = 'navbotright'
$('#settingsWindowLink', footer).id = 'settingsWindowLinkBot'
$.before absbot, footer
$.globalEval 'window.cloneTopNav = function() {};'
$.global ->
window.cloneTopNav = ->
if (Header.bottomBoardList = $ g.SITE.selectors.boardListBottom)
for a in $$ 'a', Header.bottomBoardList
a.className = 'current' if a.hostname is location.hostname and a.pathname.split('/')[1] is g.BOARD.ID

View File

@ -12,17 +12,16 @@ Fourchan =
unless $.hasClass pre, 'prettyprinted'
pre.innerHTML = e.detail.html
$.addClass pre, 'prettyprinted'
$.globalEval '''
window.addEventListener('prettyprint', function(e) {
$.global ->
window.addEventListener('prettyprint', (e) ->
window.dispatchEvent(new CustomEvent('prettyprint:cb', {
detail: {
ID: e.detail.ID,
i: e.detail.i,
html: prettyPrintOne(e.detail.html)
html: window.prettyPrintOne(e.detail.html)
}
}));
}, false);
'''
}))
, false)
Callbacks.Post.push
name: 'Parse [code] tags'
cb: Fourchan.code