From b008986efcbc4b52a8019b75e662d194accf40f4 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Sat, 2 Feb 2019 19:45:29 +0500 Subject: [PATCH] add workaround to deal with CSP interruption of theme_option.js --- js/theme_option.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/theme_option.js b/js/theme_option.js index 5a00261..bfd5536 100644 --- a/js/theme_option.js +++ b/js/theme_option.js @@ -11,10 +11,11 @@ $(function () { testRightSide(); reOrganizeTemplates(); - $.globalEval(postToElem.toString().replace(/postContext.append\(_templatePostRtBy/, - 'postContext.prependTo(postContext.parent()).append(_templatePostRtBy')); + // indirect eval call in hope to execute code globally + (1, eval)(postToElem.toString().replace(/postContext.append\(twister\.tmpl\.postRtBy/, + 'postContext.prependTo(postContext.parent()).append(twister.tmpl.postRtBy')); - $.globalEval(openModal.toString().replace(/window_scrollY = window\.pageYOffset;/, '') + (1, eval)(openModal.toString().replace(/window_scrollY = window\.pageYOffset;/, '') .replace(/\$\('body'\)\.css\('overflow', 'hidden'\);/, '')); $('.userMenu-home.current a').on('click', function () {