From 52ead496617bf781e0f11909ea7a7b023e9dc95d Mon Sep 17 00:00:00 2001 From: Gavin Wahl Date: Sun, 11 Jan 2015 15:24:25 -0700 Subject: [PATCH 1/2] Remove the use of inline scripts for CSP compatibility --- debug_toolbar/static/debug_toolbar/js/jquery_existing.js | 1 + debug_toolbar/static/debug_toolbar/js/jquery_post.js | 1 + debug_toolbar/static/debug_toolbar/js/jquery_pre.js | 1 + debug_toolbar/templates/debug_toolbar/base.html | 6 +++--- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 debug_toolbar/static/debug_toolbar/js/jquery_existing.js create mode 100644 debug_toolbar/static/debug_toolbar/js/jquery_post.js create mode 100644 debug_toolbar/static/debug_toolbar/js/jquery_pre.js diff --git a/debug_toolbar/static/debug_toolbar/js/jquery_existing.js b/debug_toolbar/static/debug_toolbar/js/jquery_existing.js new file mode 100644 index 000000000..085495a65 --- /dev/null +++ b/debug_toolbar/static/debug_toolbar/js/jquery_existing.js @@ -0,0 +1 @@ +var djdt = {jQuery: jQuery}; diff --git a/debug_toolbar/static/debug_toolbar/js/jquery_post.js b/debug_toolbar/static/debug_toolbar/js/jquery_post.js new file mode 100644 index 000000000..d94e6755a --- /dev/null +++ b/debug_toolbar/static/debug_toolbar/js/jquery_post.js @@ -0,0 +1 @@ +var djdt = {jQuery: jQuery.noConflict(true)}; window.define = _djdt_define_backup; diff --git a/debug_toolbar/static/debug_toolbar/js/jquery_pre.js b/debug_toolbar/static/debug_toolbar/js/jquery_pre.js new file mode 100644 index 000000000..d94199668 --- /dev/null +++ b/debug_toolbar/static/debug_toolbar/js/jquery_pre.js @@ -0,0 +1 @@ +var _djdt_define_backup = window.define; window.define = undefined; diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index c64628350..1c1f4a15b 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -5,11 +5,11 @@ {% if toolbar.config.JQUERY_URL %} - + - + {% else %} - + {% endif %}