From 4f19466108c084e5ef59df7becd2fc85e85c1524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 2 Oct 2018 10:16:45 +0200 Subject: [PATCH] Manually instantiate jscolor to avoid csp errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/theming/js/settings-admin.js | 4 ++++ apps/theming/templates/settings-admin.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js index afc218b7ff..28f7645eae 100644 --- a/apps/theming/js/settings-admin.js +++ b/apps/theming/js/settings-admin.js @@ -106,6 +106,10 @@ function hideUndoButton(setting, value) { $(document).ready(function () { $('#theming [data-toggle="tooltip"]').tooltip(); + // manually instantiate jscolor to work around new Function call which violates strict CSP + var colorElement = $('#theming-color')[0]; + var jscolor = new window.jscolor(colorElement, {hash: true}); + $('#theming .theme-undo').each(function() { var setting = $(this).data('setting'); var value = $('#theming-'+setting).val(); diff --git a/apps/theming/templates/settings-admin.php b/apps/theming/templates/settings-admin.php index 0cc224abc2..656b23be4f 100644 --- a/apps/theming/templates/settings-admin.php +++ b/apps/theming/templates/settings-admin.php @@ -62,7 +62,7 @@ style('theming', 'settings-admin');