From 48022bb31ba84396d9e4e3e0f57540371515a4f9 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 25 Jul 2019 17:49:24 -0700 Subject: [PATCH] Remove last uses of $.globalEval. --- src/General/Header.coffee | 3 ++- src/Miscellaneous/Fourchan.coffee | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 366b1c6d2..054d5ba8c 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -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 diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 186576ec4..ec46de04e 100644 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -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